f
This commit is contained in:
		| @@ -210,9 +210,9 @@ public class WoPackagingBoxSubstrateController { | ||||
|     @PostMapping("insertSubstrateManual") | ||||
|     @ApiOperation("手动装箱") | ||||
|     @LogOperation("手动装箱") | ||||
|     public Result insertSubstrateManual(@RequestBody ChangePackingBoxDTO dto){ | ||||
|     public Result insertSubstrateManual(@RequestBody ChangePackingBoxDTO[] dtos){ | ||||
|  | ||||
|         woPackagingBoxSubstrateService.insertSubstrateManual(dto); | ||||
|         woPackagingBoxSubstrateService.insertSubstrateManual(dtos); | ||||
|  | ||||
|         return new Result(); | ||||
|     } | ||||
|   | ||||
| @@ -32,7 +32,7 @@ public interface WoPackagingBoxSubstrateServiceBiz extends CrudService<WoPackagi | ||||
|  | ||||
|     void replaceSubstrate(ChangePackingBoxDTO[] dtos); | ||||
|  | ||||
|     void insertSubstrateManual(ChangePackingBoxDTO dto); | ||||
|     void insertSubstrateManual(ChangePackingBoxDTO[] dtos); | ||||
|  | ||||
|     WoPackagingBoxSubstrate getBySubId(String subId); | ||||
|     int updatePackagingBoxIdByWoSubstrateId(String packagingBoxId,String woSubstrateId); | ||||
|   | ||||
| @@ -3,6 +3,8 @@ package com.cnbm.packing.service.impl; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | ||||
| import com.cnbm.admin.base.BaseSupport; | ||||
| import com.cnbm.admin.base.BaseSupport; | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| @@ -14,6 +16,7 @@ import com.cnbm.packing.entity.WoPowerLevel; | ||||
| import com.cnbm.packing.mapper.ChangePackagingBoxHistoryMapper; | ||||
| import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| @@ -30,6 +33,9 @@ import java.util.Map; | ||||
| @Service | ||||
| public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<ChangePackagingBoxHistoryMapper, ChangePackagingBoxHistory, ChangePackagingBoxHistoryDTO> implements ChangePackagingBoxHistoryServiceBiz { | ||||
|  | ||||
|     @Autowired | ||||
|     private BaseSupport baseSupport; | ||||
|  | ||||
|     @Override | ||||
|     public QueryWrapper<ChangePackagingBoxHistory> getWrapper(Map<String, Object> params){ | ||||
|         LocalDateTime startTime = (LocalDateTime) params.get("startTime"); | ||||
| @@ -65,6 +71,7 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<Cha | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(ChangePackagingBoxHistoryDTO dto) { | ||||
|         ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class); | ||||
|         baseSupport.setCommonField(entity); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
| @@ -72,6 +79,7 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<Cha | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(ChangePackagingBoxHistoryDTO dto) { | ||||
|         ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class); | ||||
|         baseSupport.setUpdateCommonField(entity); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | ||||
| import com.cnbm.admin.base.BaseSupport; | ||||
| import com.cnbm.admin.utils.CodeGeneratorHelper; | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| @@ -31,6 +32,8 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper, | ||||
|  | ||||
|     @Autowired | ||||
|     private PrintModelMapper mapper; | ||||
|     @Autowired | ||||
|     private BaseSupport baseSupport; | ||||
|      | ||||
|     @Override | ||||
|     public QueryWrapper<PrintModel> getWrapper(Map<String, Object> params){ | ||||
| @@ -69,6 +72,7 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper, | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(PrintModelDTO dto) { | ||||
|         PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class); | ||||
|         baseSupport.setCommonField(entity); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
| @@ -76,6 +80,7 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper, | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(PrintModelDTO dto) { | ||||
|         PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class); | ||||
|         baseSupport.setUpdateCommonField(entity); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | ||||
| import com.cnbm.admin.base.BaseSupport; | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| @@ -34,6 +35,8 @@ public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompens | ||||
|  | ||||
|     @Autowired | ||||
|     private WoCompensationPowerMapper mapper; | ||||
|     @Autowired | ||||
|     private BaseSupport baseSupport; | ||||
|      | ||||
|     @Override | ||||
|     public QueryWrapper<WoCompensationPower> getWrapper(Map<String, Object> params){ | ||||
| @@ -66,6 +69,7 @@ public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompens | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(WoCompensationPowerDTO dto) { | ||||
|         WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class); | ||||
|         baseSupport.setCommonField(entity); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
| @@ -73,6 +77,7 @@ public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompens | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(WoCompensationPowerDTO dto) { | ||||
|         WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class); | ||||
|         baseSupport.setUpdateCommonField(entity); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | ||||
| import com.cnbm.admin.base.BaseSupport; | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| @@ -36,6 +37,9 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox | ||||
|     private WoPackagingBoxMapper mapper; | ||||
|     @Autowired | ||||
|     private WoPackagingBoxSubstrateMapper substrateMapper; | ||||
|     @Autowired | ||||
|     private BaseSupport baseSupport; | ||||
|  | ||||
|     @Override | ||||
|     public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){ | ||||
|  | ||||
| @@ -83,6 +87,7 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox | ||||
|     public IdVo add(WoPackagingBoxDTO dto) { | ||||
|         WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class); | ||||
|         insert(entity); | ||||
|         baseSupport.setCommonField(entity); | ||||
|         return IdVo.builder().id(entity.getId()).build(); | ||||
|     } | ||||
|  | ||||
| @@ -90,6 +95,7 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(WoPackagingBoxDTO dto) { | ||||
|         WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class); | ||||
|         baseSupport.setUpdateCommonField(entity); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.cnbm.admin.base.BaseSupport; | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| @@ -41,6 +42,8 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|     private ChangePackagingBoxHistoryServiceBiz changePackagingBoxHistoryService; | ||||
|     @Autowired | ||||
|     private WoPackagingBoxSubstrateMapper mapper; | ||||
|     @Autowired | ||||
|     private BaseSupport baseSupport; | ||||
|  | ||||
|     @Override | ||||
|     public QueryWrapper<WoPackagingBoxSubstrate> getWrapper(Map<String, Object> params){ | ||||
| @@ -75,6 +78,7 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(WoPackagingBoxSubstrateDTO dto) { | ||||
|         WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class); | ||||
|         baseSupport.setCommonField(entity); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
| @@ -82,6 +86,7 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(WoPackagingBoxSubstrateDTO dto) { | ||||
|         WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class); | ||||
|         baseSupport.setUpdateCommonField(entity); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
| @@ -103,6 +108,7 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|         changePackagingBoxHistory.setSourceSlot(entity.getSlot()); | ||||
|         changePackagingBoxHistory.setLeaveTime(LocalDateTime.now()); | ||||
|         changePackagingBoxHistory.setType(2); | ||||
|         baseSupport.setCommonField(changePackagingBoxHistory); | ||||
|         changePackagingBoxHistoryService.insert(changePackagingBoxHistory); | ||||
|         //模组从该包装箱中移出,该模组变为未绑定BoxID的模组 | ||||
|         UpdateWrapper<WoPackagingBoxSubstrate> wrapper = new UpdateWrapper<>(); | ||||
| @@ -126,10 +132,12 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|         changePackagingBoxHistory.setTargetSlot(dto.getSlot()); | ||||
|         changePackagingBoxHistory.setInputTime(LocalDateTime.now()); | ||||
|         changePackagingBoxHistory.setType(1); | ||||
|         baseSupport.setCommonField(changePackagingBoxHistory); | ||||
|         changePackagingBoxHistoryService.insert(changePackagingBoxHistory); | ||||
|         //更新 | ||||
|         entity.setPackagingBoxId(dto.getPackagingBoxId()); | ||||
|         entity.setSlot(dto.getSlot()); | ||||
|         baseSupport.setUpdateCommonField(entity); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
| @@ -146,34 +154,38 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|             changePackagingBoxHistory.setTargetBoxNo(dto.getPackagingBoxId()); | ||||
|             changePackagingBoxHistory.setTargetSlot(dto.getSlot()); | ||||
|             changePackagingBoxHistory.setType(3); | ||||
|             baseSupport.setCommonField(changePackagingBoxHistory); | ||||
|             changePackagingBoxHistoryService.insert(changePackagingBoxHistory); | ||||
|             //更新 | ||||
|             entity.setPackagingBoxId(dto.getPackagingBoxId()); | ||||
|             entity.setSlot(dto.getSlot()); | ||||
|             baseSupport.setUpdateCommonField(entity); | ||||
|             updateById(entity); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void insertSubstrateManual(ChangePackingBoxDTO dto) { | ||||
|  | ||||
|         QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>(); | ||||
|         wrapper.eq(StringUtils.isNotBlank(dto.getWoSubstrateId()),WoPackagingBoxSubstrate.WO_SUBSTRATE_ID,dto.getWoSubstrateId()); | ||||
|         if(mapper.selectCount(wrapper)>0 && StringUtils.isNotBlank(dto.getWoSubstrateId())) { | ||||
|             WoPackagingBoxSubstrate substrate = mapper.selectList(wrapper).get(0); | ||||
|             substrate.setPackagingBoxId(dto.getPackagingBoxId()); | ||||
|             updateById(substrate); | ||||
|         } | ||||
|         else{ | ||||
|             //模组ID有时为空,用户会输入”无码“ | ||||
|             if(dto.getWoSubstrateId()==null) { | ||||
|                 dto.setWoSubstrateId("无码"); | ||||
|     public void insertSubstrateManual(ChangePackingBoxDTO[] dtos) { | ||||
|         for(ChangePackingBoxDTO dto : dtos) { | ||||
|             QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>(); | ||||
|             wrapper.eq(StringUtils.isNotBlank(dto.getWoSubstrateId()), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, dto.getWoSubstrateId()); | ||||
|             if (mapper.selectCount(wrapper) > 0 && StringUtils.isNotBlank(dto.getWoSubstrateId())) { | ||||
|                 WoPackagingBoxSubstrate substrate = mapper.selectList(wrapper).get(0); | ||||
|                 substrate.setPackagingBoxId(dto.getPackagingBoxId()); | ||||
|                 baseSupport.setUpdateCommonField(substrate); | ||||
|                 updateById(substrate); | ||||
|             } else { | ||||
|                 //模组ID有时为空,用户会输入”无码“ | ||||
|                 if (dto.getWoSubstrateId() == null) { | ||||
|                     dto.setWoSubstrateId("无码"); | ||||
|                 } | ||||
|                 //效验数据 | ||||
|                 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); | ||||
|                 WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class); | ||||
|                 baseSupport.setCommonField(entity); | ||||
|                 insert(entity); | ||||
|             } | ||||
|             //效验数据 | ||||
|             ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); | ||||
|             WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class); | ||||
|             insert(entity); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | ||||
| import com.cnbm.admin.base.BaseSupport; | ||||
| import com.cnbm.admin.enums.WhetherEnum; | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| @@ -42,6 +43,8 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|  | ||||
|     @Autowired | ||||
|     private WoPackagingPrintHistoryMapper mapper; | ||||
|     @Autowired | ||||
|     private BaseSupport baseSupport; | ||||
|  | ||||
|     @Autowired | ||||
|     private WoPackagingBoxServiceBiz woPackagingBoxServiceBiz; | ||||
| @@ -78,6 +81,7 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(WoPackagingPrintHistoryDTO dto) { | ||||
|         WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class); | ||||
|         baseSupport.setCommonField(entity); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
| @@ -85,6 +89,7 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(WoPackagingPrintHistoryDTO dto) { | ||||
|         WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class); | ||||
|         baseSupport.setUpdateCommonField(entity); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
| @@ -112,6 +117,7 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|         BeanUtils.copyProperties(woPackagingBox, woPackagingPrintHistory); | ||||
|         woPackagingPrintHistory.setId(null); | ||||
|         woPackagingPrintHistory.setPrintTime(LocalDateTime.now()); | ||||
|         baseSupport.setCommonField(woPackagingPrintHistory); | ||||
|         insert(woPackagingPrintHistory); | ||||
|         //更新包装箱表中打印状态和时间 | ||||
|         woPackagingBox.setPrintTime(woPackagingPrintHistory.getPrintTime()); | ||||
| @@ -122,6 +128,7 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac | ||||
|         else{ | ||||
|             woPackagingBox.setPrintCount(woPackagingBox.getPrintCount()+1); | ||||
|         } | ||||
|         baseSupport.setUpdateCommonField(woPackagingBox); | ||||
|         woPackagingBoxServiceBiz.update(woPackagingBox); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; | ||||
| import com.cnbm.admin.base.BaseSupport; | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| @@ -31,6 +32,8 @@ public class WoPowerLevelServiceBizImpl extends CrudServiceImpl<WoPowerLevelMapp | ||||
|  | ||||
|     @Autowired | ||||
|     private WoPowerLevelMapper mapper; | ||||
|     @Autowired | ||||
|     private BaseSupport baseSupport; | ||||
|  | ||||
|     @Override | ||||
|     public QueryWrapper<WoPowerLevel> getWrapper(Map<String, Object> params){ | ||||
| @@ -64,6 +67,7 @@ public class WoPowerLevelServiceBizImpl extends CrudServiceImpl<WoPowerLevelMapp | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(WoPowerLevelDTO dto) { | ||||
|         WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class); | ||||
|         baseSupport.setCommonField(entity); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
| @@ -71,6 +75,7 @@ public class WoPowerLevelServiceBizImpl extends CrudServiceImpl<WoPowerLevelMapp | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(WoPowerLevelDTO dto) { | ||||
|         WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class); | ||||
|         baseSupport.setUpdateCommonField(entity); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user