Showing
6 changed files
with
26 additions
and
3 deletions
| ... | ... | @@ -641,6 +641,9 @@ create table if not exists shipments_plan ( |
| 641 | 641 | update_time datetime default now() comment '更新时间' |
| 642 | 642 | ); |
| 643 | 643 | |
| 644 | +ALTER TABLE `shipments_plan` | |
| 645 | + ADD COLUMN `business_office_auditor` varchar(32) DEFAULT NULL COMMENT '经营办审核人(发货计划提交人)'; | |
| 646 | + | |
| 644 | 647 | -- 发货明细 |
| 645 | 648 | drop table if exists `shipments_plan_detail`; |
| 646 | 649 | create table if not exists `shipments_plan_detail` ( | ... | ... |
| ... | ... | @@ -249,6 +249,7 @@ public class ShipmentsOrderInfoController extends DefaultBaseController { |
| 249 | 249 | @Scheduled(cron = "0 8 0 * * ?") |
| 250 | 250 | public InvokeResult<Void> dataHandler() { |
| 251 | 251 | // 只处理今日应该发货但状态仍是未发货的数据,避免已签收/已发货的数据被重复处理 |
| 252 | + log.info("=========定时任务开始执行========"); | |
| 252 | 253 | List<ShipmentsOrderInfo> shipmentsOrderInfoList = shipmentsOrderInfoService.queryUnShipmentsByShipmentDate(LocalDate.now()); |
| 253 | 254 | if (CollectionUtils.isNotEmpty(shipmentsOrderInfoList)) { |
| 254 | 255 | for (ShipmentsOrderInfo orderInfo : shipmentsOrderInfoList) { | ... | ... |
| ... | ... | @@ -58,6 +58,11 @@ public class ShipmentsPlan extends BaseEntity implements BaseDto { |
| 58 | 58 | private Boolean autoGenerate; |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | + * 经营办审核人(发货计划提交人) | |
| 62 | + */ | |
| 63 | + private String businessOfficeAuditor; | |
| 64 | + | |
| 65 | + /** | |
| 61 | 66 | * 创建人ID |
| 62 | 67 | */ |
| 63 | 68 | @TableField(fill = FieldFill.INSERT) | ... | ... |
| ... | ... | @@ -116,6 +116,10 @@ public class ShipmentsPlanServiceImpl extends BaseMpServiceImpl<ShipmentsPlanMap |
| 116 | 116 | LambdaUpdateWrapper<ShipmentsPlan> updateWrapper = Wrappers.lambdaUpdate(ShipmentsPlan.class) |
| 117 | 117 | .set(ShipmentsPlan::getStatus, vo.getStatus()) |
| 118 | 118 | .eq(ShipmentsPlan::getId, vo.getId()); |
| 119 | + // 状态为审核中(CHECKING)时,记录当前提交人作为经营办审核人 | |
| 120 | + if ("CHECKING".equals(vo.getStatus())) { | |
| 121 | + updateWrapper.set(ShipmentsPlan::getBusinessOfficeAuditor, SecurityUtil.getCurrentUser().getId()); | |
| 122 | + } | |
| 119 | 123 | |
| 120 | 124 | getBaseMapper().update(updateWrapper); |
| 121 | 125 | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/shipments/car/CarRequestPlanServiceImpl.java
| ... | ... | @@ -20,6 +20,7 @@ import com.lframework.starter.common.utils.Assert; |
| 20 | 20 | import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; |
| 21 | 21 | import com.lframework.xingyun.sc.entity.*; |
| 22 | 22 | import com.lframework.xingyun.sc.mappers.CarRequestPlanMapper; |
| 23 | +import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService; | |
| 23 | 24 | import com.lframework.xingyun.sc.service.shipments.car.CarRequestPlanService; |
| 24 | 25 | import com.lframework.xingyun.sc.service.shipments.car.DraftRequestCarTicketService; |
| 25 | 26 | import com.lframework.xingyun.sc.service.shipments.car.RequestCarTicketService; |
| ... | ... | @@ -44,6 +45,8 @@ public class CarRequestPlanServiceImpl extends BaseMpServiceImpl<CarRequestPlanM |
| 44 | 45 | private RequestCarTicketService requestCarTicketService; |
| 45 | 46 | @Resource |
| 46 | 47 | private DraftRequestCarTicketService draftRequestCarTicketService; |
| 48 | + @Resource | |
| 49 | + private ShipmentsPlanService shipmentsPlanService; | |
| 47 | 50 | |
| 48 | 51 | @Override |
| 49 | 52 | public PageResult<CarRequestPlan> query(Integer pageIndex, Integer pageSize, QueryCarRequestPlanVo vo) { |
| ... | ... | @@ -157,6 +160,11 @@ public class CarRequestPlanServiceImpl extends BaseMpServiceImpl<CarRequestPlanM |
| 157 | 160 | List<DraftRequestCarTicket> draftTickets = draftRequestCarTicketService.listByOrderId(orderIds); |
| 158 | 161 | Map<String, DraftRequestCarTicket> draftTicketMap = draftTickets.stream().collect(Collectors.toMap(DraftRequestCarTicket::getPurchaseOrderId, Function.identity() |
| 159 | 162 | , (v1, v2) -> v2)); |
| 163 | + // 获取发货计划,取经营办审核人(发货计划提交人) | |
| 164 | + ShipmentsPlan shipmentsPlan = null; | |
| 165 | + if (StringUtil.isNotBlank(shipmentsOrderInfo.getPlanId())) { | |
| 166 | + shipmentsPlan = shipmentsPlanService.findById(shipmentsOrderInfo.getPlanId()); | |
| 167 | + } | |
| 160 | 168 | for (PurchaseOrderInfo orderInfo : orderInfoList) { |
| 161 | 169 | // 生成要车计划 |
| 162 | 170 | LocalDate requestCarDate = shipmentsOrderInfo.getShipmentsDate(); |
| ... | ... | @@ -185,8 +193,8 @@ public class CarRequestPlanServiceImpl extends BaseMpServiceImpl<CarRequestPlanM |
| 185 | 193 | ticketVo.setShipmentsOrderId(shipmentsOrderInfo.getId()); |
| 186 | 194 | // 外办审核人(草稿要车单审核人) |
| 187 | 195 | ticketVo.setExternalAuditor(draftTicket.getExternalAuditor()); |
| 188 | - // 经营办审核人(发货计划提交人) | |
| 189 | - ticketVo.setBusinessOfficeAuditor(SecurityUtil.getCurrentUser().getId()); | |
| 196 | + // 经营办审核人(发货计划提交人,取自发货计划) | |
| 197 | + ticketVo.setBusinessOfficeAuditor(shipmentsPlan != null ? shipmentsPlan.getBusinessOfficeAuditor() : null); | |
| 190 | 198 | ticketVo.setDestination(draftTicket.getDestination()); |
| 191 | 199 | ticketVo.setConsignee(draftTicket.getConsignee()); |
| 192 | 200 | ticketVo.setPhone(draftTicket.getPhone()); | ... | ... |
| ... | ... | @@ -10,6 +10,7 @@ |
| 10 | 10 | <result column="tomo_pre_ship_date" property="tomoPreShipDate"/> |
| 11 | 11 | <result column="af_tomo_pre_ship_date" property="afTomoPreShipDate"/> |
| 12 | 12 | <result column="auto_generate" property="autoGenerate"/> |
| 13 | + <result column="business_office_auditor" property="businessOfficeAuditor"/> | |
| 13 | 14 | <result column="create_by_id" property="createById"/> |
| 14 | 15 | <result column="update_by_id" property="updateById"/> |
| 15 | 16 | <result column="create_time" property="createTime"/> |
| ... | ... | @@ -25,6 +26,7 @@ |
| 25 | 26 | tb.tomo_pre_ship_date, |
| 26 | 27 | tb.af_tomo_pre_ship_date, |
| 27 | 28 | tb.auto_generate, |
| 29 | + tb.business_office_auditor, | |
| 28 | 30 | tb.create_by_id, |
| 29 | 31 | tb.update_by_id, |
| 30 | 32 | tb.create_time, |
| ... | ... | @@ -58,7 +60,7 @@ |
| 58 | 60 | ORDER BY tb.create_time DESC |
| 59 | 61 | </select> |
| 60 | 62 | |
| 61 | - <select id="getById" resultType="com.lframework.xingyun.sc.entity.ShipmentsPlan"> | |
| 63 | + <select id="getById" resultMap="ShipmentsPlan"> | |
| 62 | 64 | <include refid="ShipmentsPlan_sql"/> |
| 63 | 65 | <where> |
| 64 | 66 | AND tb.id = #{id} | ... | ... |