Showing
5 changed files
with
50 additions
and
13 deletions
| @@ -180,7 +180,8 @@ public class OrderChangeRecordServiceImpl extends BaseMpServiceImpl<OrderChangeR | @@ -180,7 +180,8 @@ public class OrderChangeRecordServiceImpl extends BaseMpServiceImpl<OrderChangeR | ||
| 180 | purchaseOrderLineService.create(orderLineVo); | 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 | purchaseOrderInfoService.updateSpecChangeStatus(vo.getOrderId(), OrderSpecChangeStatus.IN_PROGRESS.getCode()); | 186 | purchaseOrderInfoService.updateSpecChangeStatus(vo.getOrderId(), OrderSpecChangeStatus.IN_PROGRESS.getCode()); |
| 186 | // 发起流程 | 187 | // 发起流程 |
| @@ -230,8 +231,6 @@ public class OrderChangeRecordServiceImpl extends BaseMpServiceImpl<OrderChangeR | @@ -230,8 +231,6 @@ public class OrderChangeRecordServiceImpl extends BaseMpServiceImpl<OrderChangeR | ||
| 230 | for (UpdatePurchaseOrderLineVo updatePurchaseOrderLineVo : lineVoList) { | 231 | for (UpdatePurchaseOrderLineVo updatePurchaseOrderLineVo : lineVoList) { |
| 231 | purchaseOrderLineService.update(updatePurchaseOrderLineVo); | 232 | purchaseOrderLineService.update(updatePurchaseOrderLineVo); |
| 232 | } | 233 | } |
| 233 | - // 更新订货单物料行缓存数据 | ||
| 234 | - redisHandler.set(vo.getOrderId() + "_order_line_info", JsonUtil.toJsonString(lineVoList)); | ||
| 235 | // 重新发起流程 | 234 | // 重新发起流程 |
| 236 | Boolean output = data.getOutput(); | 235 | Boolean output = data.getOutput(); |
| 237 | if (BooleanUtils.isTrue(output)) { | 236 | if (BooleanUtils.isTrue(output)) { |
| @@ -3,7 +3,7 @@ package com.lframework.xingyun.sc.impl.shipments; | @@ -3,7 +3,7 @@ package com.lframework.xingyun.sc.impl.shipments; | ||
| 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 5 | import com.github.pagehelper.PageInfo; | 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 | import com.lframework.xingyun.sc.entity.ShipmentsPlanDetail; | 7 | import com.lframework.xingyun.sc.entity.ShipmentsPlanDetail; |
| 8 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; | 8 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; |
| 9 | import com.lframework.starter.web.core.utils.PageResultUtil; | 9 | import com.lframework.starter.web.core.utils.PageResultUtil; |
| @@ -23,7 +23,6 @@ import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanDetailVo; | @@ -23,7 +23,6 @@ import com.lframework.xingyun.sc.vo.shipments.plan.CreateShipmentsPlanDetailVo; | ||
| 23 | import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; | 23 | import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; |
| 24 | import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanDetailVo; | 24 | import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanDetailVo; |
| 25 | import org.apache.commons.collections4.CollectionUtils; | 25 | import org.apache.commons.collections4.CollectionUtils; |
| 26 | -import org.springframework.data.redis.core.RedisHash; | ||
| 27 | import org.springframework.stereotype.Service; | 26 | import org.springframework.stereotype.Service; |
| 28 | import org.springframework.transaction.annotation.Transactional; | 27 | import org.springframework.transaction.annotation.Transactional; |
| 29 | 28 | ||
| @@ -70,6 +69,8 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | @@ -70,6 +69,8 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | ||
| 70 | if (CollectionUtils.isEmpty(orderIds)) { | 69 | if (CollectionUtils.isEmpty(orderIds)) { |
| 71 | throw new DefaultClientException("订货单ID不能为空!"); | 70 | throw new DefaultClientException("订货单ID不能为空!"); |
| 72 | } | 71 | } |
| 72 | + // 当前人员id | ||
| 73 | + String userId = SecurityUtil.getCurrentUser().getId(); | ||
| 73 | List<ShipmentsPlanDetail> detailList = new ArrayList<>(); | 74 | List<ShipmentsPlanDetail> detailList = new ArrayList<>(); |
| 74 | for (String orderId : orderIds) { | 75 | for (String orderId : orderIds) { |
| 75 | ShipmentsPlanDetail data = new ShipmentsPlanDetail(); | 76 | ShipmentsPlanDetail data = new ShipmentsPlanDetail(); |
| @@ -77,10 +78,12 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | @@ -77,10 +78,12 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP | ||
| 77 | data.setPlanId(vo.getPlanId()); | 78 | data.setPlanId(vo.getPlanId()); |
| 78 | data.setOrderId(orderId); | 79 | data.setOrderId(orderId); |
| 79 | data.setShipmentsDate(vo.getShipmentDate()); | 80 | data.setShipmentsDate(vo.getShipmentDate()); |
| 81 | + data.setCreateById(userId); | ||
| 82 | + data.setUpdateById(userId); | ||
| 80 | 83 | ||
| 81 | detailList.add(data); | 84 | detailList.add(data); |
| 82 | } | 85 | } |
| 83 | - | 86 | + getBaseMapper().batchAdd(detailList); |
| 84 | } | 87 | } |
| 85 | 88 | ||
| 86 | @OpLog(type = OtherOpLogType.class, name = "修改发货计划明细,ID:{}", params = {"#id"}) | 89 | @OpLog(type = OtherOpLogType.class, name = "修改发货计划明细,ID:{}", params = {"#id"}) |
| @@ -22,4 +22,11 @@ public interface ShipmentsPlanDetailMapper extends BaseMapper<ShipmentsPlanDetai | @@ -22,4 +22,11 @@ public interface ShipmentsPlanDetailMapper extends BaseMapper<ShipmentsPlanDetai | ||
| 22 | * @return List<ShipmentsPlanDetail> | 22 | * @return List<ShipmentsPlanDetail> |
| 23 | */ | 23 | */ |
| 24 | List<ShipmentsPlanDetail> query(@Param("vo") QueryShipmentsPlanDetailVo vo); | 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,12 +25,5 @@ public class QueryShipmentsPlanDetailVo extends PageVo implements BaseVo, Serial | ||
| 25 | */ | 25 | */ |
| 26 | @ApiModelProperty("发货日期") | 26 | @ApiModelProperty("发货日期") |
| 27 | @TypeMismatch(message = "发货日期格式有误!") | 27 | @TypeMismatch(message = "发货日期格式有误!") |
| 28 | - private LocalDate shipmentsDate; | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 发货日期 | ||
| 32 | - */ | ||
| 33 | - @ApiModelProperty("发货日期") | ||
| 34 | - @TypeMismatch(message = "发货日期格式有误!") | ||
| 35 | private List<LocalDate> shipmentsDateList; | 28 | private List<LocalDate> shipmentsDateList; |
| 36 | } | 29 | } |
| @@ -74,4 +74,39 @@ | @@ -74,4 +74,39 @@ | ||
| 74 | </if> | 74 | </if> |
| 75 | </where> | 75 | </where> |
| 76 | </select> | 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 | </mapper> | 112 | </mapper> |