包装
This commit is contained in:
		| @@ -0,0 +1,29 @@ | ||||
| package com.cnbm.packing.service; | ||||
|  | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.CrudService; | ||||
| import com.cnbm.packing.dto.ChangePackagingBoxHistoryDTO; | ||||
| import com.cnbm.packing.dto.ChangePackagingBoxHistoryDTO; | ||||
| import com.cnbm.packing.entity.ChangePackagingBoxHistory; | ||||
|  | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 包装箱拆合箱历史表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since  2023-02-16 | ||||
|  */ | ||||
| public interface ChangePackagingBoxHistoryServiceBiz extends CrudService<ChangePackagingBoxHistory, ChangePackagingBoxHistoryDTO> { | ||||
|  | ||||
|     PageData<ChangePackagingBoxHistoryDTO> page (Map<String, Object> params); | ||||
|  | ||||
|     ChangePackagingBoxHistoryDTO get(Long id); | ||||
|  | ||||
|     void save(ChangePackagingBoxHistoryDTO dto); | ||||
|  | ||||
|     void update(ChangePackagingBoxHistoryDTO dto); | ||||
|  | ||||
|     void delete(Long[] ids); | ||||
|      | ||||
| } | ||||
| @@ -0,0 +1,34 @@ | ||||
| package com.cnbm.packing.service; | ||||
|  | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.CrudService; | ||||
| import com.cnbm.packing.dto.PrintModelDTO; | ||||
| import com.cnbm.packing.dto.PrintModelDTO; | ||||
| import com.cnbm.packing.entity.PrintModel; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 打印标签模板表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since  2023-02-15 | ||||
|  */ | ||||
| public interface PrintModelServiceBiz extends CrudService<PrintModel, PrintModelDTO> { | ||||
|  | ||||
|  | ||||
|     PageData<PrintModelDTO> page (Map<String, Object> params); | ||||
|  | ||||
|     PrintModelDTO get(Long id); | ||||
|  | ||||
|     void save(PrintModelDTO dto); | ||||
|  | ||||
|     void update(PrintModelDTO dto); | ||||
|  | ||||
|     void delete(Long[] ids); | ||||
|  | ||||
|     List<PrintModelDTO> list(); | ||||
|  | ||||
|     String getCode(); | ||||
| } | ||||
| @@ -0,0 +1,31 @@ | ||||
| package com.cnbm.packing.service; | ||||
|  | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.CrudService; | ||||
| import com.cnbm.packing.dto.WoCompensationPowerDTO; | ||||
| import com.cnbm.packing.entity.WoCompensationPower; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 基板补偿功率 表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since  2023-02-20 | ||||
|  */ | ||||
| public interface WoCompensationPowerServiceBiz extends CrudService<WoCompensationPower, WoCompensationPowerDTO> { | ||||
|  | ||||
|     PageData<WoCompensationPowerDTO> page (Map<String, Object> params); | ||||
|  | ||||
|     WoCompensationPowerDTO get(Long id); | ||||
|  | ||||
|     void save(WoCompensationPowerDTO dto); | ||||
|  | ||||
|     void update(WoCompensationPowerDTO dto); | ||||
|  | ||||
|     void delete(Long[] ids); | ||||
|  | ||||
|     List<WoCompensationPowerDTO> list(); | ||||
|      | ||||
| } | ||||
| @@ -0,0 +1,32 @@ | ||||
| package com.cnbm.packing.service; | ||||
|  | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.CrudService; | ||||
| import com.cnbm.packing.dto.WoPackagingBoxDTO; | ||||
| import com.cnbm.packing.dto.WoPackagingBoxDTO; | ||||
| import com.cnbm.packing.entity.WoPackagingBox; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 包装箱表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since  2023-02-15 | ||||
|  */ | ||||
| public interface WoPackagingBoxServiceBiz extends CrudService<WoPackagingBox, WoPackagingBoxDTO> { | ||||
|  | ||||
|     PageData<WoPackagingBoxDTO> page (Map<String, Object> params); | ||||
|  | ||||
|     WoPackagingBoxDTO get(Long id); | ||||
|  | ||||
|     void save(WoPackagingBoxDTO dto); | ||||
|  | ||||
|     void update(WoPackagingBoxDTO dto); | ||||
|  | ||||
|     void delete(Long[] ids); | ||||
|  | ||||
|     List<WoPackagingBoxDTO> list(); | ||||
|      | ||||
| } | ||||
| @@ -0,0 +1,36 @@ | ||||
| package com.cnbm.packing.service; | ||||
|  | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.CrudService; | ||||
| import com.cnbm.packing.dto.WoPackagingBoxSubstrateDTO; | ||||
| import com.cnbm.packing.entity.WoPackagingBoxSubstrate; | ||||
|  | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 包装箱基板关联表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since  2023-02-16 | ||||
|  */ | ||||
| public interface WoPackagingBoxSubstrateServiceBiz extends CrudService<WoPackagingBoxSubstrate, WoPackagingBoxSubstrateDTO> { | ||||
|  | ||||
|     PageData<WoPackagingBoxSubstrateDTO> page (Map<String, Object> params); | ||||
|  | ||||
|     WoPackagingBoxSubstrateDTO get(Long id); | ||||
|  | ||||
|     void save(WoPackagingBoxSubstrateDTO dto); | ||||
|  | ||||
|     void update(WoPackagingBoxSubstrateDTO dto); | ||||
|  | ||||
|     void delete(Long[] ids); | ||||
|  | ||||
|     void removeSubstrate(Long id); | ||||
|  | ||||
|     void insertSubstrate(WoPackagingBoxSubstrateDTO dto); | ||||
|  | ||||
|     void replaceSubstrate(WoPackagingBoxSubstrateDTO[] dtos); | ||||
|  | ||||
|     void batchInsert(WoPackagingBoxSubstrateDTO[] lists); | ||||
|      | ||||
| } | ||||
| @@ -0,0 +1,31 @@ | ||||
| package com.cnbm.packing.service; | ||||
|  | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.CrudService; | ||||
| import com.cnbm.packing.dto.WoPackagingPrintHistoryDTO; | ||||
| import com.cnbm.packing.entity.WoPackagingPrintHistory; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 包装箱打印历史表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since  2023-02-15 | ||||
|  */ | ||||
| public interface WoPackagingPrintHistoryServiceBiz extends CrudService<WoPackagingPrintHistory, WoPackagingPrintHistoryDTO> { | ||||
|  | ||||
|     PageData<WoPackagingPrintHistoryDTO> page (Map<String, Object> params); | ||||
|  | ||||
|     WoPackagingPrintHistoryDTO get(Long id); | ||||
|  | ||||
|     void save(WoPackagingPrintHistoryDTO dto); | ||||
|  | ||||
|     void update(WoPackagingPrintHistoryDTO dto); | ||||
|  | ||||
|     void delete(Long[] ids); | ||||
|  | ||||
|     List<WoPackagingPrintHistoryDTO> list(); | ||||
|      | ||||
| } | ||||
| @@ -0,0 +1,31 @@ | ||||
| package com.cnbm.packing.service; | ||||
|  | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.CrudService; | ||||
| import com.cnbm.packing.dto.WoPowerLevelDTO; | ||||
| import com.cnbm.packing.entity.WoPowerLevel; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 功率等级 表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since  2023-02-15 | ||||
|  */ | ||||
| public interface WoPowerLevelServiceBiz extends CrudService<WoPowerLevel, WoPowerLevelDTO> { | ||||
|  | ||||
|     PageData<WoPowerLevelDTO> page (Map<String, Object> params); | ||||
|  | ||||
|     WoPowerLevelDTO get(Long id); | ||||
|  | ||||
|     void save(WoPowerLevelDTO dto); | ||||
|  | ||||
|     void update(WoPowerLevelDTO dto); | ||||
|  | ||||
|     void delete(Long[] ids); | ||||
|  | ||||
|     List<WoPowerLevelDTO> list(); | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,85 @@ | ||||
| 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.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| import com.cnbm.packing.dto.ChangePackagingBoxHistoryDTO; | ||||
| import com.cnbm.packing.dto.ChangePackagingBoxHistoryDTO; | ||||
| import com.cnbm.packing.entity.ChangePackagingBoxHistory; | ||||
| import com.cnbm.packing.entity.ChangePackagingBoxHistory; | ||||
| 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.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.time.LocalDateTime; | ||||
| import java.util.Arrays; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 包装箱拆合箱历史表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since 2023-02-16 | ||||
|  */ | ||||
| @Service | ||||
| public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<ChangePackagingBoxHistoryMapper, ChangePackagingBoxHistory, ChangePackagingBoxHistoryDTO> implements ChangePackagingBoxHistoryServiceBiz { | ||||
|  | ||||
|     @Override | ||||
|     public QueryWrapper<ChangePackagingBoxHistory> getWrapper(Map<String, Object> params){ | ||||
|         LocalDateTime startTime = (LocalDateTime) params.get("startTime"); | ||||
|         LocalDateTime endTime = (LocalDateTime) params.get("endTime"); | ||||
|  | ||||
|         QueryWrapper<ChangePackagingBoxHistory> wrapper = new QueryWrapper<>(); | ||||
|         wrapper.between(startTime!=null && endTime!=null,ChangePackagingBoxHistory.INPUT_TIME, startTime, endTime); | ||||
|         wrapper.between(startTime!=null && endTime!=null,ChangePackagingBoxHistory.LEAVE_TIME, startTime, endTime); | ||||
|         if(params.get("type")!=null) { | ||||
|             Integer type = Integer.parseInt( params.get("type").toString()); | ||||
|             wrapper.eq(ObjectUtils.isNotNull(type), ChangePackagingBoxHistory.TYPE, type); | ||||
|         } | ||||
|  | ||||
|         return wrapper; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageData<ChangePackagingBoxHistoryDTO> page (Map<String, Object> params){ | ||||
|         IPage<ChangePackagingBoxHistory> page = baseDao.selectPage( | ||||
|                 getPage(params, ChangePackagingBoxHistory.CREATE_TIME, true), | ||||
|                 getWrapper(params) | ||||
|         ); | ||||
|         return getPageData(page, ChangePackagingBoxHistoryDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public ChangePackagingBoxHistoryDTO get(Long id) { | ||||
|         ChangePackagingBoxHistory entity = baseDao.selectById(id); | ||||
|         return ConvertUtils.sourceToTarget(entity, ChangePackagingBoxHistoryDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(ChangePackagingBoxHistoryDTO dto) { | ||||
|         ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(ChangePackagingBoxHistoryDTO dto) { | ||||
|         ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void delete(Long[] ids) { | ||||
|         //删除 | ||||
|         deleteBatchIds(Arrays.asList(ids)); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,95 @@ | ||||
| package com.cnbm.packing.service.impl; | ||||
|  | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.cnbm.admin.utils.CodeGeneratorHelper; | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| import com.cnbm.packing.dto.PrintModelDTO; | ||||
| import com.cnbm.packing.entity.PrintModel; | ||||
| import com.cnbm.packing.mapper.PrintModelMapper; | ||||
| import com.cnbm.packing.service.PrintModelServiceBiz; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.util.Arrays; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 打印标签模板表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since 2023-02-15 | ||||
|  */ | ||||
| @Service | ||||
| public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper, PrintModel, PrintModelDTO> implements PrintModelServiceBiz { | ||||
|  | ||||
|     @Autowired | ||||
|     private PrintModelMapper mapper; | ||||
|      | ||||
|     @Override | ||||
|     public QueryWrapper<PrintModel> getWrapper(Map<String, Object> params){ | ||||
|         String name = (String)params.get("name"); | ||||
|  | ||||
|         QueryWrapper<PrintModel> wrapper = new QueryWrapper<>(); | ||||
|         wrapper.like(StringUtils.isNotBlank(name), PrintModel.NAME, name); | ||||
|  | ||||
|         return wrapper; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageData<PrintModelDTO> page (Map<String, Object> params){ | ||||
|         IPage<PrintModel> page = baseDao.selectPage( | ||||
|                 getPage(params, PrintModel.ID, true), | ||||
|                 getWrapper(params) | ||||
|         ); | ||||
|         return getPageData(page, PrintModelDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PrintModelDTO get(Long id) { | ||||
|         PrintModel entity = baseDao.selectById(id); | ||||
|         return ConvertUtils.sourceToTarget(entity, PrintModelDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(PrintModelDTO dto) { | ||||
|         PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(PrintModelDTO dto) { | ||||
|         PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void delete(Long[] ids) { | ||||
|         //删除 | ||||
|         deleteBatchIds(Arrays.asList(ids)); | ||||
|     } | ||||
|  | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public List<PrintModelDTO> list() { | ||||
|         List<PrintModelDTO> list = mapper.list(); | ||||
|         return list; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public String getCode() { | ||||
|         return CodeGeneratorHelper.getPrintModelCode(); | ||||
|     } | ||||
|  | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,90 @@ | ||||
| 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.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| import com.cnbm.packing.dto.WoCompensationPowerDTO; | ||||
| import com.cnbm.packing.entity.WoCompensationPower; | ||||
| import com.cnbm.packing.entity.WoPowerLevel; | ||||
| import com.cnbm.packing.mapper.WoCompensationPowerMapper; | ||||
| import com.cnbm.packing.service.WoCompensationPowerServiceBiz; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.util.Arrays; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 基板补偿功率 表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since 2023-02-20 | ||||
|  */ | ||||
| @Service | ||||
| public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompensationPowerMapper, WoCompensationPower, WoCompensationPowerDTO> implements WoCompensationPowerServiceBiz { | ||||
|  | ||||
|     @Autowired | ||||
|     private WoCompensationPowerMapper mapper; | ||||
|      | ||||
|     @Override | ||||
|     public QueryWrapper<WoCompensationPower> getWrapper(Map<String, Object> params){ | ||||
|  | ||||
|         QueryWrapper<WoCompensationPower> wrapper = new QueryWrapper<>(); | ||||
|         if(params.get("lineBody")!=null) { | ||||
|             Integer lineBody = Integer.parseInt(params.get("lineBody").toString()); | ||||
|             wrapper.eq(ObjectUtils.isNotNull(lineBody), WoCompensationPower.LINE_BODY, lineBody); | ||||
|         } | ||||
|  | ||||
|         return wrapper; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageData<WoCompensationPowerDTO> page (Map<String, Object> params){ | ||||
|         IPage<WoCompensationPower> page = baseDao.selectPage( | ||||
|                 getPage(params, WoCompensationPower.ID, true), | ||||
|                 getWrapper(params) | ||||
|         ); | ||||
|         return getPageData(page, WoCompensationPowerDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public WoCompensationPowerDTO get(Long id) { | ||||
|         WoCompensationPower entity = baseDao.selectById(id); | ||||
|         return ConvertUtils.sourceToTarget(entity, WoCompensationPowerDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(WoCompensationPowerDTO dto) { | ||||
|         WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(WoCompensationPowerDTO dto) { | ||||
|         WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void delete(Long[] ids) { | ||||
|         //删除 | ||||
|         deleteBatchIds(Arrays.asList(ids)); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public List<WoCompensationPowerDTO> list() { | ||||
|         List<WoCompensationPowerDTO> list = mapper.list(); | ||||
|         return list; | ||||
|     } | ||||
|      | ||||
| } | ||||
| @@ -0,0 +1,113 @@ | ||||
| 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.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| import com.cnbm.packing.dto.WoPackagingBoxDTO; | ||||
| import com.cnbm.packing.dto.WoPackagingBoxDTO; | ||||
| import com.cnbm.packing.dto.WoPowerLevelDTO; | ||||
| import com.cnbm.packing.entity.WoPackagingBox; | ||||
| import com.cnbm.packing.entity.WoPackagingBox; | ||||
| import com.cnbm.packing.entity.WoPowerLevel; | ||||
| import com.cnbm.packing.mapper.WoPackagingBoxMapper; | ||||
| import com.cnbm.packing.mapper.WoPackagingBoxMapper; | ||||
| import com.cnbm.packing.service.WoPackagingBoxServiceBiz; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.time.LocalDateTime; | ||||
| import java.util.Arrays; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 包装箱表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since 2023-02-15 | ||||
|  */ | ||||
| @Service | ||||
| public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBoxMapper, WoPackagingBox, WoPackagingBoxDTO> implements WoPackagingBoxServiceBiz { | ||||
|  | ||||
|     @Autowired | ||||
|     private WoPackagingBoxMapper mapper; | ||||
|      | ||||
|     @Override | ||||
|     public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){ | ||||
|  | ||||
|         LocalDateTime startTime = (LocalDateTime) params.get("startTime"); | ||||
|         LocalDateTime endTime = (LocalDateTime) params.get("endTime"); | ||||
|         String boxNo = (String) params.get("boxNo"); | ||||
|  | ||||
|         QueryWrapper<WoPackagingBox> wrapper = new QueryWrapper<>(); | ||||
|         wrapper.between(startTime!=null && endTime!=null,WoPackagingBox.PACKAGING_TIME, startTime, endTime); | ||||
|         wrapper.like(StringUtils.isNotBlank(boxNo), WoPackagingBox.BOX_NO, boxNo); | ||||
|         if(params.get("lineBody")!=null) { | ||||
|             Integer lineBody = Integer.parseInt(params.get("lineBody").toString()); | ||||
|             wrapper.eq(ObjectUtils.isNotNull(lineBody), WoPackagingBox.LINE_BODY, lineBody); | ||||
|         } | ||||
|         if(params.get("lineBody")!=null) { | ||||
|             Integer printStatus = Integer.parseInt(params.get("printStatus").toString()); | ||||
|             wrapper.eq(ObjectUtils.isNotNull(printStatus), WoPackagingBox.PRINT_STATUS, printStatus); | ||||
|         } | ||||
|         if(params.get("lineBody")!=null) { | ||||
|             Integer model = Integer.parseInt(params.get("model").toString()); | ||||
|             wrapper.eq(ObjectUtils.isNotNull(model), WoPackagingBox.MODEL, model); | ||||
|         } | ||||
|  | ||||
|         return wrapper; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageData<WoPackagingBoxDTO> page (Map<String, Object> params){ | ||||
|  | ||||
|         IPage<WoPackagingBox> page = baseDao.selectPage( | ||||
|                 getPage(params, WoPackagingBox.CREATE_TIME, false), | ||||
|                 getWrapper(params) | ||||
|         ); | ||||
|         return getPageData(page, WoPackagingBoxDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public WoPackagingBoxDTO get(Long id) { | ||||
|         WoPackagingBox entity = baseDao.selectById(id); | ||||
|         return ConvertUtils.sourceToTarget(entity, WoPackagingBoxDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(WoPackagingBoxDTO dto) { | ||||
|         WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(WoPackagingBoxDTO dto) { | ||||
|         WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void delete(Long[] ids) { | ||||
|         //删除 | ||||
|         deleteBatchIds(Arrays.asList(ids)); | ||||
|     } | ||||
|  | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public List<WoPackagingBoxDTO> list() { | ||||
|         List<WoPackagingBoxDTO> list = mapper.list(); | ||||
|         return list; | ||||
|     } | ||||
|  | ||||
|      | ||||
| } | ||||
| @@ -0,0 +1,165 @@ | ||||
| package com.cnbm.packing.service.impl; | ||||
|  | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | ||||
| import com.cnbm.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| import com.cnbm.common.validator.ValidatorUtils; | ||||
| import com.cnbm.common.validator.group.AddGroup; | ||||
| import com.cnbm.common.validator.group.DefaultGroup; | ||||
| import com.cnbm.packing.dto.WoPackagingBoxSubstrateDTO; | ||||
| import com.cnbm.packing.entity.ChangePackagingBoxHistory; | ||||
| import com.cnbm.packing.entity.WoPackagingBoxSubstrate; | ||||
| import com.cnbm.packing.mapper.WoPackagingBoxMapper; | ||||
| import com.cnbm.packing.mapper.WoPackagingBoxSubstrateMapper; | ||||
| import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz; | ||||
| import com.cnbm.packing.service.WoPackagingBoxSubstrateServiceBiz; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import javax.annotation.Resource; | ||||
| import java.time.LocalDateTime; | ||||
| import java.util.Arrays; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 包装箱基板关联表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since 2023-02-16 | ||||
|  */ | ||||
| @Service | ||||
| public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPackagingBoxSubstrateMapper, WoPackagingBoxSubstrate, WoPackagingBoxSubstrateDTO> implements WoPackagingBoxSubstrateServiceBiz { | ||||
|  | ||||
|     @Autowired | ||||
|     private ChangePackagingBoxHistoryServiceBiz changePackagingBoxHistoryService; | ||||
|      | ||||
|     @Resource | ||||
|     private WoPackagingBoxMapper woPackagingBoxMapper; | ||||
|  | ||||
|     @Resource | ||||
|     private WoPackagingBoxSubstrateMapper woPackagingBoxSubstrateMapper; | ||||
|  | ||||
|     @Override | ||||
|     public QueryWrapper<WoPackagingBoxSubstrate> getWrapper(Map<String, Object> params){ | ||||
|         String packagingBoxId = (String) params.get("packagingBoxId"); | ||||
|         String woSubstrateId = (String)params.get("woSubstrateId"); | ||||
|  | ||||
|         QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>(); | ||||
|         wrapper.like(StringUtils.isNotBlank(packagingBoxId), WoPackagingBoxSubstrate.PACKAGING_BOX_ID, packagingBoxId); | ||||
|         wrapper.like(StringUtils.isNotBlank(woSubstrateId), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, woSubstrateId); | ||||
|  | ||||
|         return wrapper; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageData<WoPackagingBoxSubstrateDTO> page (Map<String, Object> params){ | ||||
|         IPage<WoPackagingBoxSubstrate> page = baseDao.selectPage( | ||||
|                 getPage(params, WoPackagingBoxSubstrate.SLOT, true), | ||||
|                 getWrapper(params) | ||||
|         ); | ||||
|         return getPageData(page, WoPackagingBoxSubstrateDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public WoPackagingBoxSubstrateDTO get(Long id) { | ||||
|         WoPackagingBoxSubstrate entity = baseDao.selectById(id); | ||||
|         return ConvertUtils.sourceToTarget(entity, WoPackagingBoxSubstrateDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(WoPackagingBoxSubstrateDTO dto) { | ||||
|         WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(WoPackagingBoxSubstrateDTO dto) { | ||||
|         WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void delete(Long[] ids) { | ||||
|         //删除 | ||||
|         deleteBatchIds(Arrays.asList(ids)); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void removeSubstrate(Long id) { | ||||
|         WoPackagingBoxSubstrate entity = baseDao.selectById(id); | ||||
|         //移箱写入包装箱拆合箱历史表 | ||||
|         ChangePackagingBoxHistory changePackagingBoxHistory = new ChangePackagingBoxHistory(); | ||||
|         changePackagingBoxHistory.setSubstrateId(entity.getWoSubstrateId()); | ||||
|         changePackagingBoxHistory.setSourceBoxNo(entity.getPackagingBoxId()); | ||||
|         changePackagingBoxHistory.setSourceSlot(entity.getSlot()); | ||||
|         changePackagingBoxHistory.setLeaveTime(LocalDateTime.now()); | ||||
|         changePackagingBoxHistory.setType(2); | ||||
|         changePackagingBoxHistoryService.insert(changePackagingBoxHistory); | ||||
|         //模组从该包装箱中移出,该模组变为未绑定BoxID的模组 | ||||
|         entity.setPackagingBoxId(null); | ||||
|         entity.setSlot(null); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void insertSubstrate(WoPackagingBoxSubstrateDTO dto) { | ||||
|         WoPackagingBoxSubstrate entity = baseDao.selectById(dto.getId()); | ||||
|         //合箱写入包装箱拆合箱历史表 | ||||
|         ChangePackagingBoxHistory changePackagingBoxHistory = new ChangePackagingBoxHistory(); | ||||
|         changePackagingBoxHistory.setSubstrateId(dto.getWoSubstrateId()); | ||||
|         changePackagingBoxHistory.setTargetBoxNo(dto.getPackagingBoxId()); | ||||
|         changePackagingBoxHistory.setTargetSlot(dto.getSlot()); | ||||
|         changePackagingBoxHistory.setInputTime(LocalDateTime.now()); | ||||
|         changePackagingBoxHistory.setType(1); | ||||
|         changePackagingBoxHistoryService.insert(changePackagingBoxHistory); | ||||
|         //更新 | ||||
|         entity.setPackagingBoxId(dto.getPackagingBoxId()); | ||||
|         entity.setSlot(dto.getSlot()); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void replaceSubstrate(WoPackagingBoxSubstrateDTO[] dtos) { | ||||
|         for(WoPackagingBoxSubstrateDTO dto : dtos){ | ||||
|             WoPackagingBoxSubstrate entity = baseDao.selectById(dto.getId()); | ||||
|             //换箱写入包装箱拆合箱历史表 | ||||
|             ChangePackagingBoxHistory changePackagingBoxHistory = new ChangePackagingBoxHistory(); | ||||
|             changePackagingBoxHistory.setSubstrateId(dto.getWoSubstrateId()); | ||||
|             changePackagingBoxHistory.setTargetBoxNo(entity.getPackagingBoxId()); | ||||
|             changePackagingBoxHistory.setTargetSlot(entity.getSlot()); | ||||
|             changePackagingBoxHistory.setTargetBoxNo(dto.getPackagingBoxId()); | ||||
|             changePackagingBoxHistory.setTargetSlot(dto.getSlot()); | ||||
|             changePackagingBoxHistory.setType(3); | ||||
|             changePackagingBoxHistoryService.insert(changePackagingBoxHistory); | ||||
|             //更新 | ||||
|             entity.setPackagingBoxId(dto.getPackagingBoxId()); | ||||
|             entity.setSlot(dto.getSlot()); | ||||
|             updateById(entity); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void batchInsert(WoPackagingBoxSubstrateDTO[] lists) { | ||||
|         for(WoPackagingBoxSubstrateDTO dto:lists){ | ||||
|             if(dto.getWoSubstrateId()==null){ | ||||
|                 dto.setWoSubstrateId("无码"); | ||||
|             } | ||||
|             //效验数据 | ||||
|             ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); | ||||
|             WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class); | ||||
|             insert(entity); | ||||
|         } | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,96 @@ | ||||
| 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.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| import com.cnbm.packing.dto.WoPackagingPrintHistoryDTO; | ||||
| import com.cnbm.packing.dto.WoPackagingPrintHistoryDTO; | ||||
| import com.cnbm.packing.entity.WoPackagingBox; | ||||
| import com.cnbm.packing.entity.WoPackagingPrintHistory; | ||||
| import com.cnbm.packing.entity.WoPackagingPrintHistory; | ||||
| import com.cnbm.packing.mapper.WoPackagingPrintHistoryMapper; | ||||
| import com.cnbm.packing.mapper.WoPackagingPrintHistoryMapper; | ||||
| import com.cnbm.packing.service.WoPackagingPrintHistoryServiceBiz; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.time.LocalDateTime; | ||||
| import java.util.Arrays; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 包装箱打印历史表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since 2023-02-15 | ||||
|  */ | ||||
| @Service | ||||
| public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPackagingPrintHistoryMapper, WoPackagingPrintHistory, WoPackagingPrintHistoryDTO> implements WoPackagingPrintHistoryServiceBiz { | ||||
|  | ||||
|     @Autowired | ||||
|     private WoPackagingPrintHistoryMapper mapper; | ||||
|  | ||||
|     @Override | ||||
|     public QueryWrapper<WoPackagingPrintHistory> getWrapper(Map<String, Object> params){ | ||||
|         LocalDateTime startTime = (LocalDateTime) params.get("startTime"); | ||||
|         LocalDateTime endTime = (LocalDateTime) params.get("endTime"); | ||||
|         String boxNo = (String) params.get("boxNo"); | ||||
|  | ||||
|         QueryWrapper<WoPackagingPrintHistory> wrapper = new QueryWrapper<>(); | ||||
|         wrapper.between(startTime!=null && endTime!=null, WoPackagingPrintHistory.PRINT_TIME, startTime, endTime); | ||||
|         wrapper.like(StringUtils.isNotBlank(boxNo), WoPackagingPrintHistory.BOX_NO, boxNo); | ||||
|  | ||||
|         return wrapper; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageData<WoPackagingPrintHistoryDTO> page (Map<String, Object> params){ | ||||
|         IPage<WoPackagingPrintHistory> page = baseDao.selectPage( | ||||
|                 getPage(params, WoPackagingPrintHistory.PRINT_TIME, false), | ||||
|                 getWrapper(params) | ||||
|         ); | ||||
|         return getPageData(page, WoPackagingPrintHistoryDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public WoPackagingPrintHistoryDTO get(Long id) { | ||||
|         WoPackagingPrintHistory entity = baseDao.selectById(id); | ||||
|         return ConvertUtils.sourceToTarget(entity, WoPackagingPrintHistoryDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(WoPackagingPrintHistoryDTO dto) { | ||||
|         WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(WoPackagingPrintHistoryDTO dto) { | ||||
|         WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void delete(Long[] ids) { | ||||
|         //删除 | ||||
|         deleteBatchIds(Arrays.asList(ids)); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public List<WoPackagingPrintHistoryDTO> list() { | ||||
|         List<WoPackagingPrintHistoryDTO> list = mapper.list(); | ||||
|         return list; | ||||
|     } | ||||
|  | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,90 @@ | ||||
| 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.common.page.PageData; | ||||
| import com.cnbm.common.service.impl.CrudServiceImpl; | ||||
| import com.cnbm.common.utils.ConvertUtils; | ||||
| import com.cnbm.packing.dto.WoPowerLevelDTO; | ||||
| import com.cnbm.packing.entity.WoPowerLevel; | ||||
| import com.cnbm.packing.mapper.WoPowerLevelMapper; | ||||
| import com.cnbm.packing.service.WoPowerLevelServiceBiz; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.util.Arrays; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 功率等级 表 | ||||
|  * | ||||
|  * @author codeGenerator | ||||
|  * @since 2023-02-15 | ||||
|  */ | ||||
| @Service | ||||
| public class WoPowerLevelServiceBizImpl extends CrudServiceImpl<WoPowerLevelMapper, WoPowerLevel, WoPowerLevelDTO> implements WoPowerLevelServiceBiz { | ||||
|  | ||||
|     @Autowired | ||||
|     private WoPowerLevelMapper mapper; | ||||
|  | ||||
|     @Override | ||||
|     public QueryWrapper<WoPowerLevel> getWrapper(Map<String, Object> params){ | ||||
|  | ||||
|         QueryWrapper<WoPowerLevel> wrapper = new QueryWrapper<>(); | ||||
|         if(params.get("lineBody")!=null) { | ||||
|             Integer lineBody = Integer.parseInt(params.get("lineBody").toString()); | ||||
|             wrapper.eq(ObjectUtils.isNotNull(lineBody), WoPowerLevel.LINE_BODY, lineBody); | ||||
|         } | ||||
|  | ||||
|  | ||||
|         return wrapper; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageData<WoPowerLevelDTO> page (Map<String, Object> params){ | ||||
|         IPage<WoPowerLevel> page = baseDao.selectPage( | ||||
|                 getPage(params, WoPowerLevel.ID, true), | ||||
|                 getWrapper(params) | ||||
|         ); | ||||
|         return getPageData(page, WoPowerLevelDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public WoPowerLevelDTO get(Long id) { | ||||
|         WoPowerLevel entity = baseDao.selectById(id); | ||||
|         return ConvertUtils.sourceToTarget(entity, WoPowerLevelDTO.class); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void save(WoPowerLevelDTO dto) { | ||||
|         WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class); | ||||
|         insert(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void update(WoPowerLevelDTO dto) { | ||||
|         WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class); | ||||
|         updateById(entity); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public void delete(Long[] ids) { | ||||
|         //删除 | ||||
|         deleteBatchIds(Arrays.asList(ids)); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public List<WoPowerLevelDTO> list() { | ||||
|         List<WoPowerLevelDTO> list = mapper.list(); | ||||
|         return list; | ||||
|     } | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user