Commit 4163adedad809f2a8efeccd4647f3e92411c7ba6

Authored by yeqianyong
1 parent beffe621

楚江ERP-发货单相关接口调试

... ... @@ -6,6 +6,9 @@ import com.lframework.starter.common.constants.StringPool;
6 6 import com.lframework.starter.web.core.bo.BaseBo;
7 7 import java.time.LocalDate;
8 8 import java.time.LocalDateTime;
  9 +import java.util.List;
  10 +
  11 +import com.lframework.xingyun.sc.entity.ShipmentsPlanDetail;
9 12 import io.swagger.annotations.ApiModelProperty;
10 13
11 14 import lombok.Data;
... ... @@ -99,6 +102,12 @@ public class GetShipmentsOrderInfoBo extends BaseBo<ShipmentsOrderInfo> {
99 102 private String status;
100 103
101 104 /**
  105 + * 发货明细数据
  106 + */
  107 + @ApiModelProperty("发货明细数据")
  108 + private List<ShipmentsPlanDetail> detailList;
  109 +
  110 + /**
102 111 * 创建人ID
103 112 */
104 113 @ApiModelProperty("创建人ID")
... ...
... ... @@ -378,12 +378,12 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe
378 378 roleCodeList.add("scktjy");
379 379 // 运作科主管
380 380 roleCodeList.add("yzkzg");
  381 + // 市场科主管
  382 + roleCodeList.add("sckzg");
381 383 // 获取厂房信息
382 384 Workshop workshop = workshopService.findById(plan.getWorkshopId());
383 385 String workshopName = workshop.getName();
384 386 if ("一分厂".equals(workshopName)) {
385   - // 市场科主管
386   - roleCodeList.add("yfcsckzg");
387 387 // 经营办主管
388 388 roleCodeList.add("yfcjybzg");
389 389 // 生产经理
... ... @@ -391,8 +391,6 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe
391 391 // 品质经理
392 392 roleCodeList.add("yfcpzjl");
393 393 } else if ("二分厂".equals(workshopName)) {
394   - // 市场科主管
395   - roleCodeList.add("efcsckzg");
396 394 // 经营办主管
397 395 roleCodeList.add("efcjybzg");
398 396 // 生产经理
... ... @@ -400,8 +398,6 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe
400 398 // 品质经理
401 399 roleCodeList.add("efcpzjl");
402 400 } else if ("三分厂".equals(workshopName)) {
403   - // 市场科主管
404   - roleCodeList.add("sfcsckzg");
405 401 // 经营办主管
406 402 roleCodeList.add("sfcjybzg");
407 403 // 生产经理
... ... @@ -409,8 +405,6 @@ public class CustomerDevelopPlanServiceImpl extends BaseMpServiceImpl<CustomerDe
409 405 // 品质经理
410 406 roleCodeList.add("sfcpzjl");
411 407 } else if ("四分厂".equals(workshopName) || "紫铜厂".equals(workshopName)) {
412   - // 市场科主管
413   - roleCodeList.add("ztcsckzg");
414 408 // 经营办主管
415 409 roleCodeList.add("ztcjybzg");
416 410 // 生产经理
... ...
... ... @@ -407,22 +407,24 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr
407 407 , (v1, v2) -> v2));
408 408 }
409 409 for (PurchaseOrderInfo orderInfo : orderInfoList) {
410   - String status = orderInfo.getStatus();
411   - if ("ISSUED".equals(status)) {
  410 + DraftRequestCarTicket draftTicket = draftTicketMap.get(orderInfo.getId());
  411 + if (draftTicket == null) {
412 412 // 生成草稿要车单
413 413 CreateDraftRequestCarTicketVo createVo = packDraftRequestCarTicket(orderInfo, plan.getTomoPreShipDate());
414 414 draftRequestCarTicketService.create(createVo);
415   - } else {
  415 + break;
  416 + }
  417 + if ("PASS".equals(draftTicket.getStatus())) {
416 418 // 生成要车计划
417 419 CreateCarRequestPlanVo planCreateVo = new CreateCarRequestPlanVo();
418 420 planCreateVo.setRequestCarDate(LocalDate.now());
419 421 planCreateVo.setWorkshopId(orderInfo.getWorkshopId());
420 422 String requestCarPlanId = carRequestPlanService.create(planCreateVo);
421 423 // 生成要车单
422   - DraftRequestCarTicket draftTicket = draftTicketMap.get(orderInfo.getId());
423   - CreateRequestCarTicketVo ticketCreateVo = packRequestCarTicket(orderInfo, requestCarPlanId, draftTicket == null
424   - ? null : draftTicket.getId(), plan.getTomoPreShipDate());
  424 + CreateRequestCarTicketVo ticketCreateVo = packRequestCarTicket(orderInfo, requestCarPlanId, draftTicket.getId(), plan.getTomoPreShipDate());
425 425 requestCarTicketService.create(ticketCreateVo);
  426 + } else {
  427 + throw new DefaultClientException("请先补充草稿要车单数据!");
426 428 }
427 429 }
428 430 }
... ...
... ... @@ -14,6 +14,12 @@ public class QueryShipmentsOrderInfoVo extends PageVo implements BaseVo, Seriali
14 14 private static final long serialVersionUID = 1L;
15 15
16 16 /**
  17 + * 购货单位名称
  18 + */
  19 + @ApiModelProperty("购货单位名称")
  20 + private String customerName;
  21 +
  22 + /**
17 23 * 厂房ID
18 24 */
19 25 @ApiModelProperty("厂房ID")
... ... @@ -24,7 +30,8 @@ public class QueryShipmentsOrderInfoVo extends PageVo implements BaseVo, Seriali
24 30 */
25 31 @ApiModelProperty("发货日期")
26 32 @TypeMismatch(message = "发货日期格式有误!")
27   - private LocalDate shipmentsDate;
  33 + private LocalDate shipmentsDateStart;
  34 + private LocalDate shipmentsDateEnd;
28 35
29 36 /**
30 37 * 办事处ID
... ... @@ -33,6 +40,12 @@ public class QueryShipmentsOrderInfoVo extends PageVo implements BaseVo, Seriali
33 40 private String deptId;
34 41
35 42 /**
  43 + * 办事处名称
  44 + */
  45 + @ApiModelProperty("办事处名称")
  46 + private String deptName;
  47 +
  48 + /**
36 49 * 状态
37 50 */
38 51 @ApiModelProperty("状态")
... ...
... ... @@ -27,6 +27,7 @@
27 27 <result column="status" property="status"/>
28 28 <result column="examine_status" property="examineStatus"/>
29 29 <result column="revoke_status" property="revokeStatus"/>
  30 + <result column="spec_change_status" property="specChangeStatus"/>
30 31 <result column="production_process" property="productionProcess"/>
31 32 <result column="dept_id" property="deptId"/>
32 33 <result column="dept_name" property="deptName"/>
... ... @@ -73,6 +74,7 @@
73 74 tb.status,
74 75 tb.examine_status,
75 76 tb.revoke_status,
  77 + tb.spec_change_status,
76 78 tb.production_process,
77 79 tb.dept_id,
78 80 sd.name AS dept_name,
... ...
... ... @@ -50,8 +50,11 @@
50 50 <if test="vo.workshopId != null and vo.workshopId != ''">
51 51 AND tb.workshop_id = #{vo.workshopId}
52 52 </if>
53   - <if test="vo.shipmentsDate != null">
54   - AND tb.shipments_date = #{vo.shipmentsDate}
  53 + <if test="vo.shipmentsDateStart != null">
  54 + AND tb.shipments_date >= #{vo.shipmentsDateStart}
  55 + </if>
  56 + <if test="vo.shipmentsDateEnd != null">
  57 + AND tb.shipments_date &lt;= #{vo.shipmentsDateEnd}
55 58 </if>
56 59 <if test="vo.deptId != null and vo.deptId != ''">
57 60 AND tb.dept_id = #{vo.deptId}
... ... @@ -59,6 +62,9 @@
59 62 <if test="vo.status != null and vo.status != ''">
60 63 AND tb.status = #{vo.status}
61 64 </if>
  65 + <if test="vo.customerName != null and vo.customerName != ''">
  66 + AND c.name like concat('%', #{vo.customerName}, '%')
  67 + </if>
62 68 </where>
63 69 </select>
64 70
... ...
... ... @@ -138,7 +138,10 @@
138 138 from tbl_purchase_order_line ol
139 139 inner join purchase_order_info o on ol.purchase_order_id = o.id
140 140 left join base_data_customer c on o.ordering_unit = c.id
141   - where ol.delivery_date >= #{vo.shipmentDate}
  141 + where ol.delivery_date >= #{vo.shipmentDate} and ol.del_flag = false
  142 + and o.type = 'PRODUCTION' and o.examine_status = 'PASS' and o.status not in ('SHIPPED', 'DELIVERED')
  143 + and (o.revoke_status != 'UNDOING' or o.revoke_status is null)
  144 + and (o.spec_change_status != 'IN_PROGRESS' or o.spec_change_status is null)
142 145 <if test="vo.orderSpecIds != null and vo.orderSpecIds.size() > 0">
143 146 and ol.id not in
144 147 <foreach collection="vo.orderSpecIds" open="(" separator="," close=")" item="item">
... ... @@ -201,6 +204,7 @@
201 204 pd.*,
202 205 c.id as customer_id
203 206 from shipments_plan_detail pd
  207 + inner join shipments_plan p on pd.plan_id = p.id and pd.shipments_date = p.tomo_pre_ship_date
204 208 left join purchase_order_info o on pd.order_id = o.id
205 209 left join base_data_customer c on o.ordering_unit = c.id
206 210 where pd.del_flag = false
... ...