Showing
5 changed files
with
50 additions
and
13 deletions
| ... | ... | @@ -180,7 +180,8 @@ public class OrderChangeRecordServiceImpl extends BaseMpServiceImpl<OrderChangeR |
| 180 | 180 | purchaseOrderLineService.create(orderLineVo); |
| 181 | 181 | } |
| 182 | 182 | // 缓存订货单物料行数据 |
| 183 | - redisHandler.set(vo.getOrderId() + "_order_line_info", JsonUtil.toJsonString(orderLineVoList)); | |
| 183 | + List<PurchaseOrderLine> orderLineList = purchaseOrderLineService.listByOrderIds(Collections.singletonList(data.getOrderId())); | |
| 184 | + redisHandler.set(vo.getOrderId() + "_order_line_info", JsonUtil.toJsonString(orderLineList)); | |
| 184 | 185 | // 更新订货单变更状态 |
| 185 | 186 | purchaseOrderInfoService.updateSpecChangeStatus(vo.getOrderId(), OrderSpecChangeStatus.IN_PROGRESS.getCode()); |
| 186 | 187 | // 发起流程 |
| ... | ... | @@ -230,8 +231,6 @@ public class OrderChangeRecordServiceImpl extends BaseMpServiceImpl<OrderChangeR |
| 230 | 231 | for (UpdatePurchaseOrderLineVo updatePurchaseOrderLineVo : lineVoList) { |
| 231 | 232 | purchaseOrderLineService.update(updatePurchaseOrderLineVo); |
| 232 | 233 | } |
| 233 | - // 更新订货单物料行缓存数据 | |
| 234 | - redisHandler.set(vo.getOrderId() + "_order_line_info", JsonUtil.toJsonString(lineVoList)); | |
| 235 | 234 | // 重新发起流程 |
| 236 | 235 | Boolean output = data.getOutput(); |
| 237 | 236 | if (BooleanUtils.isTrue(output)) { | ... | ... |
| ... | ... | @@ -3,7 +3,7 @@ package com.lframework.xingyun.sc.impl.shipments; |
| 3 | 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 5 | 5 | import com.github.pagehelper.PageInfo; |
| 6 | -import com.lframework.xingyun.sc.entity.PurchaseOrderInfo; | |
| 6 | +import com.lframework.starter.web.core.components.security.SecurityUtil; | |
| 7 | 7 | import com.lframework.xingyun.sc.entity.ShipmentsPlanDetail; |
| 8 | 8 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; |
| 9 | 9 | import com.lframework.starter.web.core.utils.PageResultUtil; |
| ... | ... | @@ -23,7 +23,6 @@ import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanDetailVo; |
| 23 | 23 | import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; |
| 24 | 24 | import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanDetailVo; |
| 25 | 25 | import org.apache.commons.collections4.CollectionUtils; |
| 26 | -import org.springframework.data.redis.core.RedisHash; | |
| 27 | 26 | import org.springframework.stereotype.Service; |
| 28 | 27 | import org.springframework.transaction.annotation.Transactional; |
| 29 | 28 | |
| ... | ... | @@ -70,6 +69,8 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP |
| 70 | 69 | if (CollectionUtils.isEmpty(orderIds)) { |
| 71 | 70 | throw new DefaultClientException("订货单ID不能为空!"); |
| 72 | 71 | } |
| 72 | + // 当前人员id | |
| 73 | + String userId = SecurityUtil.getCurrentUser().getId(); | |
| 73 | 74 | List<ShipmentsPlanDetail> detailList = new ArrayList<>(); |
| 74 | 75 | for (String orderId : orderIds) { |
| 75 | 76 | ShipmentsPlanDetail data = new ShipmentsPlanDetail(); |
| ... | ... | @@ -77,10 +78,12 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP |
| 77 | 78 | data.setPlanId(vo.getPlanId()); |
| 78 | 79 | data.setOrderId(orderId); |
| 79 | 80 | data.setShipmentsDate(vo.getShipmentDate()); |
| 81 | + data.setCreateById(userId); | |
| 82 | + data.setUpdateById(userId); | |
| 80 | 83 | |
| 81 | 84 | detailList.add(data); |
| 82 | 85 | } |
| 83 | - | |
| 86 | + getBaseMapper().batchAdd(detailList); | |
| 84 | 87 | } |
| 85 | 88 | |
| 86 | 89 | @OpLog(type = OtherOpLogType.class, name = "修改发货计划明细,ID:{}", params = {"#id"}) | ... | ... |
| ... | ... | @@ -22,4 +22,11 @@ public interface ShipmentsPlanDetailMapper extends BaseMapper<ShipmentsPlanDetai |
| 22 | 22 | * @return List<ShipmentsPlanDetail> |
| 23 | 23 | */ |
| 24 | 24 | List<ShipmentsPlanDetail> query(@Param("vo") QueryShipmentsPlanDetailVo vo); |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 批量新增 | |
| 28 | + * | |
| 29 | + * @param dataList 数据实体 | |
| 30 | + */ | |
| 31 | + void batchAdd(List<ShipmentsPlanDetail> dataList); | |
| 25 | 32 | } | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/shipments/plan/QueryShipmentsPlanDetailVo.java
| ... | ... | @@ -25,12 +25,5 @@ public class QueryShipmentsPlanDetailVo extends PageVo implements BaseVo, Serial |
| 25 | 25 | */ |
| 26 | 26 | @ApiModelProperty("发货日期") |
| 27 | 27 | @TypeMismatch(message = "发货日期格式有误!") |
| 28 | - private LocalDate shipmentsDate; | |
| 29 | - | |
| 30 | - /** | |
| 31 | - * 发货日期 | |
| 32 | - */ | |
| 33 | - @ApiModelProperty("发货日期") | |
| 34 | - @TypeMismatch(message = "发货日期格式有误!") | |
| 35 | 28 | private List<LocalDate> shipmentsDateList; |
| 36 | 29 | } | ... | ... |
| ... | ... | @@ -74,4 +74,39 @@ |
| 74 | 74 | </if> |
| 75 | 75 | </where> |
| 76 | 76 | </select> |
| 77 | + | |
| 78 | + <insert id="batchAdd"> | |
| 79 | + INSERT INTO shipments_plan_detail ( | |
| 80 | + id, | |
| 81 | + plan_id, | |
| 82 | + order_id, | |
| 83 | + parent_id, | |
| 84 | + status, | |
| 85 | + shipments_date, | |
| 86 | + shipments_time, | |
| 87 | + can_shipments, | |
| 88 | + del_flag, | |
| 89 | + create_by_id, | |
| 90 | + update_by_id, | |
| 91 | + create_time, | |
| 92 | + update_time | |
| 93 | + ) VALUES | |
| 94 | + <foreach collection="list" item="item" separator=","> | |
| 95 | + ( | |
| 96 | + #{item.id}, | |
| 97 | + #{item.planId}, | |
| 98 | + #{item.orderId}, | |
| 99 | + #{item.parentId}, | |
| 100 | + #{item.status}, | |
| 101 | + #{item.shipmentsDate}, | |
| 102 | + #{item.shipmentsTime}, | |
| 103 | + #{item.canShipments}, | |
| 104 | + #{item.delFlag}, | |
| 105 | + #{item.createById}, | |
| 106 | + #{item.updateById}, | |
| 107 | + #{item.createTime}, | |
| 108 | + #{item.updateTime} | |
| 109 | + ) | |
| 110 | + </foreach> | |
| 111 | + </insert> | |
| 77 | 112 | </mapper> | ... | ... |