Commit f0f42258e466eabd6bffdc4d321c94dda2091a62

Authored by 房远帅
1 parent 18ce7ffa

采购:业务员报价看板-成交/中止;成交数据

... ... @@ -7,6 +7,8 @@ import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
7 7 import com.lframework.starter.web.core.components.resp.PageResult;
8 8 import com.lframework.starter.web.core.controller.DefaultBaseController;
9 9 import com.lframework.xingyun.sc.procurement.entity.SalesmanQuotation;
  10 +import com.lframework.xingyun.sc.procurement.entity.SalesmanQuotationLine;
  11 +import com.lframework.xingyun.sc.procurement.service.quotation.SalesmanQuotationLineService;
10 12 import com.lframework.xingyun.sc.procurement.service.quotation.SalesmanQuotationService;
11 13 import com.lframework.xingyun.sc.procurement.vo.quotation.CreateSalesmanQuotationVo;
12 14 import com.lframework.xingyun.sc.procurement.vo.quotation.QuerySalesmanQuotationVo;
... ... @@ -25,6 +27,9 @@ import org.springframework.web.bind.annotation.RequestBody;
25 27 import org.springframework.web.bind.annotation.RequestMapping;
26 28 import org.springframework.web.bind.annotation.RestController;
27 29
  30 +import java.time.LocalDate;
  31 +import java.util.List;
  32 +
28 33 /**
29 34 * 业务员报价 Controller
30 35 */
... ... @@ -39,6 +44,8 @@ public class SalesmanQuotationController extends DefaultBaseController {
39 44 */
40 45 @Resource
41 46 private SalesmanQuotationService salesmanQuotationService;
  47 + @Resource
  48 + private SalesmanQuotationLineService salesmanQuotationLineService;
42 49
43 50 @ApiOperation("生成编号")
44 51 @GetMapping("/generateCode")
... ... @@ -117,4 +124,26 @@ public class SalesmanQuotationController extends DefaultBaseController {
117 124 salesmanQuotationService.cancel(id);
118 125 return InvokeResultBuilder.success();
119 126 }
  127 +
  128 + /**
  129 + * 成交/终止
  130 + */
  131 + @ApiOperation("成交/终止")
  132 + @PostMapping("/updateStatus")
  133 + public InvokeResult<Void> updateStatus(@NotBlank(message = "id不能为空!") String id,
  134 + @NotBlank(message = "状态不能为空!") String status) {
  135 + salesmanQuotationService.updateStatus(id, status);
  136 + return InvokeResultBuilder.success();
  137 + }
  138 +
  139 + /**
  140 + * 已成交报价明细
  141 + */
  142 + @ApiOperation("已成交报价明细")
  143 + @GetMapping("/concluded")
  144 + public InvokeResult<List<SalesmanQuotationLine>> concluded() {
  145 + LocalDate today = LocalDate.now();
  146 + List<SalesmanQuotationLine> salesmanQuotationLineList = salesmanQuotationLineService.queryCurrentDayList(today, "DEAL_CLOSED");
  147 + return InvokeResultBuilder.success(salesmanQuotationLineList);
  148 + }
120 149 }
... ...
... ... @@ -48,8 +48,8 @@ public class SalesmanQuotationLineServiceImpl
48 48 * @return 业务员报价明细列表
49 49 */
50 50 @Override
51   - public List<SalesmanQuotationLine> queryCurrentDayList(LocalDate day) {
52   - return getBaseMapper().queryCurrentDayList(day);
  51 + public List<SalesmanQuotationLine> queryCurrentDayList(LocalDate day, String status) {
  52 + return getBaseMapper().queryCurrentDayList(day, status);
53 53 }
54 54
55 55 /**
... ...
... ... @@ -317,6 +317,25 @@ public class SalesmanQuotationServiceImpl
317 317 }
318 318 }
319 319
  320 + /**
  321 + * 成交/中止
  322 + *
  323 + * @param id 主键ID
  324 + * @param status 状态
  325 + */
  326 + @Override
  327 + public void updateStatus(String id, String status) {
  328 + if (StringUtils.isBlank(id) || StringUtils.isBlank(status)) {
  329 + throw new DefaultClientException("业务员报价ID、状态不能为空!");
  330 + }
  331 + Wrapper<SalesmanQuotation> wrapper = Wrappers.lambdaUpdate(SalesmanQuotation.class)
  332 + .set(SalesmanQuotation::getStatus, status)
  333 + .eq(SalesmanQuotation::getId, id);
  334 + getBaseMapper().update(wrapper);
  335 +
  336 + publishChangedEvent(id, "UPDATE");
  337 + }
  338 +
320 339
321 340 /**
322 341 * 构建新增实体
... ...
... ... @@ -26,5 +26,5 @@ public interface SalesmanQuotationLineMapper extends BaseMapper<SalesmanQuotatio
26 26 * @param day 日期
27 27 * @return 业务员报价明细表列表
28 28 */
29   - List<SalesmanQuotationLine> queryCurrentDayList(@Param("day") LocalDate day);
  29 + List<SalesmanQuotationLine> queryCurrentDayList(@Param("day") LocalDate day, @Param("status") String status);
30 30 }
... ...
... ... @@ -27,7 +27,7 @@ public interface SalesmanQuotationLineService extends BaseMpService<SalesmanQuot
27 27 * @param day 日期
28 28 * @return 业务员报价明细列表
29 29 */
30   - List<SalesmanQuotationLine> queryCurrentDayList(LocalDate day);
  30 + List<SalesmanQuotationLine> queryCurrentDayList(LocalDate day, String status);
31 31
32 32 /**
33 33 * 根据ID查询
... ...
... ... @@ -68,6 +68,14 @@ public interface SalesmanQuotationService extends BaseMpService<SalesmanQuotatio
68 68 void updateApprovalStatus(String id, String approvalStatus);
69 69
70 70 /**
  71 + * 更新状态
  72 + *
  73 + * @param id 主键ID
  74 + * @param status 状态
  75 + */
  76 + void updateStatus(String id, String status);
  77 +
  78 + /**
71 79 * 生成编号
72 80 *
73 81 * @return 编号
... ...
... ... @@ -89,7 +89,7 @@ public class SalesmanQuotationLineRealtimePushService {
89 89 */
90 90 private QuotationLineRealtimeMessage buildCurrentDayMessage(String eventType) {
91 91 LocalDate today = LocalDate.now();
92   - List<SalesmanQuotationLine> records = salesmanQuotationLineService.queryCurrentDayList(today);
  92 + List<SalesmanQuotationLine> records = salesmanQuotationLineService.queryCurrentDayList(today,"QUOTED");
93 93
94 94 QuotationLineRealtimeMessage message = new QuotationLineRealtimeMessage();
95 95 message.setMessageType("FULL_SYNC");
... ...
... ... @@ -86,7 +86,12 @@
86 86
87 87 <select id="queryCurrentDayList" resultMap="SalesmanQuotationLine">
88 88 <include refid="SalesmanQuotationLineSql1"/>
89   - WHERE DATE(sq.create_time) = #{day} and sq.status='QUOTED'
  89 + <where>
  90 + DATE(sq.create_time) = #{day}
  91 + <if test="status != null and status != ''">
  92 + AND sq.status = #{status}
  93 + </if>
  94 + </where>
90 95 ORDER BY tb.create_time DESC, tb.quotation_id DESC
91 96 </select>
92 97 </mapper>
... ...