定数包代码提交
							parent
							
								
									7480c8edbe
								
							
						
					
					
						commit
						883084f4c5
					
				| @ -0,0 +1,139 @@ | ||||
| package com.glxp.api.controller.inout; | ||||
| 
 | ||||
| import com.github.pagehelper.PageInfo; | ||||
| import com.glxp.api.common.enums.ResultEnum; | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.common.util.ResultVOUtils; | ||||
| import com.glxp.api.entity.inout.IoDestinyProcessDetailEntity; | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.req.inout.IodestinyProcessRequest; | ||||
| import com.glxp.api.res.PageSimpleResponse; | ||||
| import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||
| import com.glxp.api.res.inout.IoCodeRelResponse; | ||||
| import com.glxp.api.res.inout.IodestinyProcessResponse; | ||||
| import com.glxp.api.service.basic.BasicDestinyRelService; | ||||
| import com.glxp.api.service.inout.IoDestinyProcessCodeService; | ||||
| import com.glxp.api.service.inout.IoDestinyProcessDetailService; | ||||
| import com.glxp.api.service.inout.IoDestinyProcessService; | ||||
| import org.springframework.validation.BindingResult; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @RestController | ||||
| public class IoDestinyProcessController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private BasicDestinyRelService basicDestinyRelService; | ||||
|     @Resource | ||||
|     private IoDestinyProcessDetailService ioDestinyProcessDetailService; | ||||
|     @Resource | ||||
|     private IoDestinyProcessCodeService ioDestinyProcessCodeService; | ||||
|     @Resource | ||||
|     private IoDestinyProcessService ioDestinyProcessService; | ||||
| 
 | ||||
| 
 | ||||
|     @PostMapping("/udiwms/basic/destiny/model/addDestinyDelect") | ||||
|     public BaseResponse addDestinyDelect(@RequestBody FilterUdiRelRequest filterUdiRelRequest, BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
|         ioDestinyProcessDetailService.insertProcessDetail(filterUdiRelRequest); | ||||
| 
 | ||||
|         return ResultVOUtils.success(); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/udiwms/basic/destiny/model/filterDestinyProcessDelect") | ||||
|     public BaseResponse filterDestinyProcessDelect(FilterUdiRelRequest filterUdiRelRequest, BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
|         List<UdiRelevanceResponse> udiRelevanceResponseList = ioDestinyProcessDetailService.filterProcessDetail(filterUdiRelRequest); | ||||
| 
 | ||||
|         return ResultVOUtils.success(udiRelevanceResponseList); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/udiwms/basic/destiny/model/filterDestinyProcess") | ||||
|     public BaseResponse filterDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest, BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
|         List<IodestinyProcessResponse> iodestinyProcessResponseList = ioDestinyProcessDetailService.filterDestinyProcess(iodestinyProcessRequest); | ||||
|         PageInfo<IodestinyProcessResponse> pageInfo; | ||||
|         pageInfo = new PageInfo<>(iodestinyProcessResponseList); | ||||
|         PageSimpleResponse<IodestinyProcessResponse> pageSimpleResponse = new PageSimpleResponse<>(); | ||||
|         pageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||
|         pageSimpleResponse.setList(iodestinyProcessResponseList); | ||||
| 
 | ||||
|         return ResultVOUtils.success(pageSimpleResponse); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/udiwms/basic/destiny/model/checkDestinyProcess") | ||||
|     public BaseResponse checkDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest, BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
|         BaseResponse baseResponse = ioDestinyProcessDetailService.checkDestinyProcess(iodestinyProcessRequest); | ||||
| 
 | ||||
| 
 | ||||
|         return baseResponse; | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/udiwms/basic/destiny/model/filterDestinyProcessCode") | ||||
|     public BaseResponse filterDestinyProcessCode(IodestinyProcessRequest iodestinyProcessRequest, BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
|         List<IodestinyProcessResponse> iodestinyProcessResponseList = ioDestinyProcessCodeService.filterDestinyProcessCode(iodestinyProcessRequest); | ||||
|         PageInfo<IodestinyProcessResponse> pageInfo; | ||||
|         pageInfo = new PageInfo<>(iodestinyProcessResponseList); | ||||
|         PageSimpleResponse<IodestinyProcessResponse> pageSimpleResponse = new PageSimpleResponse<>(); | ||||
|         pageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||
|         pageSimpleResponse.setList(iodestinyProcessResponseList); | ||||
| 
 | ||||
|         return ResultVOUtils.success(pageSimpleResponse); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/udiwms/basic/destiny/model/addDestinyProcess") | ||||
|     public BaseResponse addDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest, BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
|         List<IoDestinyProcessDetailEntity> ioDestinyProcessDetailEntityList= ioDestinyProcessDetailService.addDestinyProcess(iodestinyProcessRequest); | ||||
| 
 | ||||
|         for (IoDestinyProcessDetailEntity ioDestinyProcessDetailEntity : ioDestinyProcessDetailEntityList) { | ||||
|             if(ioDestinyProcessDetailEntity.getCount()-ioDestinyProcessDetailEntity.getReCount()>0){ | ||||
|                 return ResultVOUtils.error(999,"该单还未完全扫码校验!"); | ||||
|             } | ||||
|         } | ||||
|          //更新状态
 | ||||
|         ioDestinyProcessService.uploadDestinyProcess(iodestinyProcessRequest); | ||||
| 
 | ||||
|         return ResultVOUtils.success(); | ||||
|     } | ||||
| 
 | ||||
|     @GetMapping("/udiwms/basic/destiny/model/delectDestinyProcess") | ||||
|     public BaseResponse delectDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest, BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
| 
 | ||||
|         //更新状态
 | ||||
|         ioDestinyProcessService.delectDestinyProcess(iodestinyProcessRequest); | ||||
| 
 | ||||
|         return ResultVOUtils.success(); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -1,9 +1,23 @@ | ||||
| package com.glxp.api.dao.inout; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
| import com.glxp.api.dao.BaseMapperPlus; | ||||
| import com.glxp.api.entity.inout.IoCodeTempEntity; | ||||
| import com.glxp.api.entity.inout.IoDestinyProcessDetailEntity; | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.req.inout.IodestinyProcessRequest; | ||||
| import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||
| import com.glxp.api.res.inout.IodestinyProcessResponse; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Mapper | ||||
| public interface IoDestinyProcessDetailMapper extends BaseMapper<IoDestinyProcessDetailEntity> { | ||||
| public interface IoDestinyProcessDetailMapper extends BaseMapperPlus<IoDestinyProcessDetailMapper, IoDestinyProcessDetailEntity, IoDestinyProcessDetailEntity> { | ||||
| 
 | ||||
|     List<UdiRelevanceResponse> filterDestinyProducts(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|     List<IodestinyProcessResponse> filterDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest); | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,15 @@ | ||||
| package com.glxp.api.req.inout; | ||||
| 
 | ||||
| import com.glxp.api.util.page.ListPageRequest; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| @Data | ||||
| public class IodestinyProcessRequest extends ListPageRequest { | ||||
| 
 | ||||
|     private String billNo; | ||||
| 
 | ||||
|     private String invCode; | ||||
| 
 | ||||
|     private String code; | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,101 @@ | ||||
| package com.glxp.api.res.inout; | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.annotation.IdType; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.glxp.api.util.page.ListPageRequest; | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.math.BigDecimal; | ||||
| import java.util.Date; | ||||
| 
 | ||||
| @Data | ||||
| public class IodestinyProcessResponse { | ||||
| 
 | ||||
| 
 | ||||
|     private Long id; | ||||
| 
 | ||||
|     private String destinyId; | ||||
| 
 | ||||
|     private String destinyNo; | ||||
| 
 | ||||
|     private String billNo; | ||||
| 
 | ||||
|     private Date billDate; | ||||
| 
 | ||||
|     private String invCode; | ||||
| 
 | ||||
|     private String remark; | ||||
| 
 | ||||
|     private Date createTime; | ||||
| 
 | ||||
|     private Date updateTime; | ||||
| 
 | ||||
|     private String createUser; | ||||
| 
 | ||||
|     private String updateUser; | ||||
| 
 | ||||
|     private Integer status; | ||||
| 
 | ||||
|     private String invName; | ||||
| 
 | ||||
|     private String updateName; | ||||
|     private String createName; | ||||
|     private String code; | ||||
| 
 | ||||
|     private String serialNo; | ||||
|     private String productDate; | ||||
|     private String expireDate; | ||||
|     private BigDecimal price; | ||||
|     private String batchNo; | ||||
|     private int count; | ||||
|     private int reCount; | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|     //产品
 | ||||
|     private String originUuid; | ||||
|     private String nameCode; | ||||
|     private String deviceRecordKey; | ||||
|     private String packRatio; | ||||
|     private String packLevel; | ||||
|     private String packUnit; | ||||
|     private Integer bhxjsl; | ||||
|     private Integer bhzxxsbzsl; | ||||
|     private Integer zxxsbzbhsydysl; | ||||
|     private String bhxjcpbm; | ||||
|     private String bzcj; | ||||
|     private String cpmctymc; | ||||
|     private String cplb; | ||||
|     private String flbm; | ||||
|     private String ggxh; | ||||
|     private String qxlb; | ||||
|     private String tyshxydm; | ||||
|     private String ylqxzcrbarmc; | ||||
|     private String zczbhhzbapzbh; | ||||
|     private String ylqxzcrbarywmc; | ||||
|     private String sydycpbs; | ||||
|     private String sjcpbm; | ||||
|     private Integer versionNumber; | ||||
|     private Integer diType; | ||||
|     private String ybbm; | ||||
|     private String sptm; | ||||
|     private String manufactory; | ||||
|     private String measname; | ||||
|     private Integer productType; | ||||
|     private String scbssfbhph; | ||||
|     private String scbssfbhxlh; | ||||
|     private String scbssfbhscrq; | ||||
|     private String scbssfbhsxrq; | ||||
|     private String cpms; | ||||
|     private Boolean allowNoBatch; | ||||
|     private Boolean allowNoExpire; | ||||
|     private Boolean allowNoProduct; | ||||
|     private Boolean allowNoSerial; | ||||
|     private String spmc; | ||||
|     private String cplx; | ||||
|     private String hchzsb; | ||||
|     private String cpdls; | ||||
| 
 | ||||
| } | ||||
| @ -1,8 +1,24 @@ | ||||
| package com.glxp.api.service.inout; | ||||
| 
 | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.entity.inout.IoDestinyProcessDetailEntity; | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.req.inout.IodestinyProcessRequest; | ||||
| import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||
| import com.glxp.api.res.inout.IodestinyProcessResponse; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| public interface IoDestinyProcessDetailService{ | ||||
| 
 | ||||
|      Boolean insertProcessDetail(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|      List<IoDestinyProcessDetailEntity> addDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest); | ||||
| 
 | ||||
|      List<UdiRelevanceResponse> filterProcessDetail(FilterUdiRelRequest filterUdiRelRequest); | ||||
| 
 | ||||
|      List<IodestinyProcessResponse> filterDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest); | ||||
| 
 | ||||
|      BaseResponse checkDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest); | ||||
| } | ||||
|  | ||||
| @ -1,6 +1,14 @@ | ||||
| package com.glxp.api.service.inout; | ||||
| 
 | ||||
| 
 | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.req.inout.IodestinyProcessRequest; | ||||
| 
 | ||||
| public interface IoDestinyProcessService{ | ||||
| 
 | ||||
|     Boolean uploadDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest); | ||||
| 
 | ||||
|     Boolean delectDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest); | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,8 +1,28 @@ | ||||
| package com.glxp.api.service.inout.impl; | ||||
| 
 | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.dao.inout.IoDestinyProcessCodeMapper; | ||||
| import com.glxp.api.req.inout.IodestinyProcessRequest; | ||||
| import com.glxp.api.res.inout.IodestinyProcessResponse; | ||||
| import org.springframework.stereotype.Service; | ||||
| import com.glxp.api.service.inout.IoDestinyProcessCodeService; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| public class IoDestinyProcessCodeServiceImpl  implements IoDestinyProcessCodeService { | ||||
| 
 | ||||
|     @Resource | ||||
|     IoDestinyProcessCodeMapper ioDestinyProcessCodeMapper; | ||||
| 
 | ||||
|     @Override | ||||
|     public List<IodestinyProcessResponse> filterDestinyProcessCode(IodestinyProcessRequest iodestinyProcessRequest) { | ||||
| 
 | ||||
|         if (iodestinyProcessRequest.getPage() != null) { | ||||
|             int offset = (iodestinyProcessRequest.getPage() - 1) * iodestinyProcessRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, iodestinyProcessRequest.getLimit()); | ||||
|         } | ||||
|         return ioDestinyProcessCodeMapper.filterDestinyProcessCode(iodestinyProcessRequest); | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1,11 +1,221 @@ | ||||
| package com.glxp.api.service.inout.impl; | ||||
| 
 | ||||
| import cn.hutool.core.util.IdUtil; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.common.util.ResultVOUtils; | ||||
| import com.glxp.api.dao.inout.IoDestinyProcessCodeMapper; | ||||
| import com.glxp.api.dao.inout.IoDestinyProcessMapper; | ||||
| import com.glxp.api.entity.auth.AuthAdmin; | ||||
| import com.glxp.api.entity.basic.UdiEntity; | ||||
| import com.glxp.api.entity.inout.IoDestinyProcessCodeEntity; | ||||
| import com.glxp.api.entity.inout.IoDestinyProcessEntity; | ||||
| import com.glxp.api.req.basic.FilterUdiRelRequest; | ||||
| import com.glxp.api.req.inout.IodestinyProcessRequest; | ||||
| import com.glxp.api.res.basic.UdiRelevanceResponse; | ||||
| import com.glxp.api.res.inout.IodestinyProcessResponse; | ||||
| import com.glxp.api.service.auth.CustomerService; | ||||
| import com.glxp.api.service.basic.BasicDestinyRelService; | ||||
| import com.glxp.api.service.basic.UdiRelevanceService; | ||||
| import com.glxp.api.service.inout.IoDestinyProcessService; | ||||
| import com.glxp.api.util.udi.FilterUdiUtils; | ||||
| import com.glxp.api.util.udi.UdiCalCountUtil; | ||||
| import org.springframework.stereotype.Service; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.glxp.api.dao.inout.IoDestinyProcessDetailMapper; | ||||
| import com.glxp.api.entity.inout.IoDestinyProcessDetailEntity; | ||||
| import com.glxp.api.service.inout.IoDestinyProcessDetailService; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.awt.geom.QuadCurve2D; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Collections; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| public class IoDestinyProcessDetailServiceImpl implements IoDestinyProcessDetailService{ | ||||
| public class IoDestinyProcessDetailServiceImpl implements IoDestinyProcessDetailService { | ||||
| 
 | ||||
| 
 | ||||
|     @Resource | ||||
|     private BasicDestinyRelService basicDestinyRelService; | ||||
|     @Resource | ||||
|     private IoDestinyProcessDetailMapper ioDestinyProcessDetailMapper; | ||||
|     @Resource | ||||
|     private IoDestinyProcessCodeMapper ioDestinyProcessCodeMapper; | ||||
| 
 | ||||
|     @Resource | ||||
|     CustomerService customerService; | ||||
|     @Resource | ||||
|     IoDestinyProcessMapper ioDestinyProcessMapper; | ||||
|     @Resource | ||||
|     UdiRelevanceService udiRelevanceService; | ||||
|     @Resource | ||||
|     UdiCalCountUtil udiCalCountUtil; | ||||
| 
 | ||||
| 
 | ||||
|     @Override | ||||
|     public Boolean insertProcessDetail(FilterUdiRelRequest filterUdiRelRequest) { | ||||
|         //删除原数据
 | ||||
|         QueryWrapper<IoDestinyProcessDetailEntity> ew=new QueryWrapper<>(); | ||||
|         ew.eq("orderIdFk",filterUdiRelRequest.getBillNo()); | ||||
|         long count= ioDestinyProcessDetailMapper.delete(ew); | ||||
| 
 | ||||
|         QueryWrapper<IoDestinyProcessCodeEntity> ew1=new QueryWrapper<>(); | ||||
|         ew1.eq("orderIdFk",filterUdiRelRequest.getBillNo()); | ||||
|         ioDestinyProcessCodeMapper.delete(ew1); | ||||
|         filterUdiRelRequest.setDestinyId(filterUdiRelRequest.getDestinyId()); | ||||
|         filterUdiRelRequest.setDiType(1); | ||||
|         List<UdiRelevanceResponse> thrProductsEntities = basicDestinyRelService.filterDestinyProducts(filterUdiRelRequest); | ||||
| 
 | ||||
|         AuthAdmin authAdmin= customerService.getUserBean(); | ||||
|         IoDestinyProcessEntity ioDestinyProcessEntity=new IoDestinyProcessEntity(); | ||||
|         // 插入主表
 | ||||
|         if(count>0){ | ||||
|             QueryWrapper<IoDestinyProcessEntity> ew2=new QueryWrapper<>(); | ||||
|             ew2.eq("billNo",filterUdiRelRequest.getBillNo()); | ||||
|             ioDestinyProcessEntity=ioDestinyProcessMapper.selectOne(ew2); | ||||
|             ioDestinyProcessEntity.setCreateTime(new Date()); | ||||
|             ioDestinyProcessEntity.setUpdateTime(new Date()); | ||||
|             ioDestinyProcessEntity.setCreateUser(authAdmin.getId() + ""); | ||||
|             ioDestinyProcessEntity.setUpdateUser(authAdmin.getId() + ""); | ||||
|             ioDestinyProcessEntity.setInvCode(filterUdiRelRequest.getInvCode()); | ||||
|             ioDestinyProcessEntity.setRemark(filterUdiRelRequest.getRemark()); | ||||
|             ioDestinyProcessMapper.updateById(ioDestinyProcessEntity); | ||||
|         }else{ | ||||
|             ioDestinyProcessEntity.setId(IdUtil.getSnowflakeNextId()); | ||||
|             ioDestinyProcessEntity.setDestinyNo(filterUdiRelRequest.getDestinyNo()); | ||||
|             ioDestinyProcessEntity.setDestinyId(filterUdiRelRequest.getDestinyId()); | ||||
|             ioDestinyProcessEntity.setBillNo(filterUdiRelRequest.getBillNo()); | ||||
|             ioDestinyProcessEntity.setBillDate(filterUdiRelRequest.getBillDate()); | ||||
|             ioDestinyProcessEntity.setRemark(filterUdiRelRequest.getRemark()); | ||||
|             ioDestinyProcessEntity.setInvCode(filterUdiRelRequest.getInvCode()); | ||||
|             ioDestinyProcessEntity.setCreateTime(new Date()); | ||||
|             ioDestinyProcessEntity.setUpdateTime(new Date()); | ||||
|             ioDestinyProcessEntity.setCreateUser(authAdmin.getId() + ""); | ||||
|             ioDestinyProcessEntity.setUpdateUser(authAdmin.getId() + ""); | ||||
|             ioDestinyProcessEntity.setStatus(0); | ||||
|             ioDestinyProcessMapper.insert(ioDestinyProcessEntity); | ||||
|         } | ||||
| 
 | ||||
|         // 插入详情表
 | ||||
|         List<IoDestinyProcessDetailEntity> ioDestinyProcessDetailEntityList=new ArrayList<>(); | ||||
|         for (UdiRelevanceResponse thrProductsEntity : thrProductsEntities) { | ||||
|             IoDestinyProcessDetailEntity ioDestinyProcessDetailEntity=new IoDestinyProcessDetailEntity(); | ||||
|             ioDestinyProcessDetailEntity.setId(IdUtil.getSnowflakeNextId()); | ||||
|             ioDestinyProcessDetailEntity.setCount(thrProductsEntity.getCount()); | ||||
|             ioDestinyProcessDetailEntity.setRelId(thrProductsEntity.getId()); | ||||
|             ioDestinyProcessDetailEntity.setReCount(0); | ||||
|             ioDestinyProcessDetailEntity.setUpdateTime(new Date()); | ||||
|             ioDestinyProcessDetailEntity.setOrderIdFk(ioDestinyProcessEntity.getBillNo()); | ||||
|             ioDestinyProcessDetailEntityList.add(ioDestinyProcessDetailEntity); | ||||
|             thrProductsEntity.setReCount(0); | ||||
|         } | ||||
|         ioDestinyProcessDetailMapper.insertBatch(ioDestinyProcessDetailEntityList); | ||||
| 
 | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<IoDestinyProcessDetailEntity> addDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest) { | ||||
| 
 | ||||
|         QueryWrapper<IoDestinyProcessDetailEntity> ew=new QueryWrapper<>(); | ||||
|         ew.eq("orderIdFk",iodestinyProcessRequest.getBillNo()); | ||||
|         List<IoDestinyProcessDetailEntity> ioDestinyProcessDetailEntity=ioDestinyProcessDetailMapper.selectList(ew); | ||||
|         return ioDestinyProcessDetailEntity; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<UdiRelevanceResponse> filterProcessDetail(FilterUdiRelRequest filterUdiRelRequest) { | ||||
|         //查询详情
 | ||||
|         List<UdiRelevanceResponse> thrProductsEntities = ioDestinyProcessDetailMapper.filterDestinyProducts(filterUdiRelRequest); | ||||
|         return thrProductsEntities; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<IodestinyProcessResponse> filterDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest) { | ||||
| 
 | ||||
|         if (iodestinyProcessRequest.getPage() != null) { | ||||
|             int offset = (iodestinyProcessRequest.getPage() - 1) * iodestinyProcessRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, iodestinyProcessRequest.getLimit()); | ||||
|         } | ||||
|         return ioDestinyProcessDetailMapper.filterDestinyProcess(iodestinyProcessRequest); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public BaseResponse checkDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest) { | ||||
| 
 | ||||
|         UdiEntity udiEntity = FilterUdiUtils.getUdi(iodestinyProcessRequest.getCode()); | ||||
|         UdiRelevanceResponse checkUdi = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); | ||||
|         if (checkUdi ==null){ | ||||
|             return ResultVOUtils.error(500, "耗材字典不存在此产品!"); | ||||
|         } | ||||
|         QueryWrapper<IoDestinyProcessDetailEntity> ew=new QueryWrapper<>(); | ||||
|         ew.eq("orderIdFk",iodestinyProcessRequest.getBillNo()); | ||||
|         ew.eq("relId",checkUdi.getRelId()); | ||||
|         IoDestinyProcessDetailEntity ioDestinyProcessDetailEntity=ioDestinyProcessDetailMapper.selectOne(ew); | ||||
|         if(ioDestinyProcessDetailEntity == null){ | ||||
|             return ResultVOUtils.error(500, "定数包不存在此产品!"); | ||||
|         } | ||||
|         if(ioDestinyProcessDetailEntity.getCount()-ioDestinyProcessDetailEntity.getReCount()<=0){ | ||||
|             return ResultVOUtils.error(500, "该产品已足够!"); | ||||
|         } | ||||
|         int count = udiCalCountUtil.getActCount(udiEntity.getUdi()); | ||||
|         ioDestinyProcessDetailEntity.setReCount(ioDestinyProcessDetailEntity.getReCount()+count); | ||||
|         ioDestinyProcessDetailMapper.updateById(ioDestinyProcessDetailEntity); | ||||
|         //判断有没有序列号
 | ||||
|         //有
 | ||||
|         if (udiEntity.getSerialNo()!=null){ | ||||
|             //插入详细表
 | ||||
|             IoDestinyProcessCodeEntity ioDestinyProcessCodeEntity=new IoDestinyProcessCodeEntity(); | ||||
|             ioDestinyProcessCodeEntity.setCode(iodestinyProcessRequest.getCode()); | ||||
|             ioDestinyProcessCodeEntity.setId(IdUtil.getSnowflakeNextId()); | ||||
|             ioDestinyProcessCodeEntity.setOrderIdFk(iodestinyProcessRequest.getBillNo()); | ||||
|             ioDestinyProcessCodeEntity.setBindRlFk(checkUdi.getRelId() + ""); | ||||
|             ioDestinyProcessCodeEntity.setUuidFk(checkUdi.getUuid()); | ||||
|             ioDestinyProcessCodeEntity.setNameCode(checkUdi.getNameCode()); | ||||
|             ioDestinyProcessCodeEntity.setCount(1); | ||||
|             ioDestinyProcessCodeEntity.setReCount(count); | ||||
|             ioDestinyProcessCodeEntity.setProductDate(udiEntity.getProduceDate()); | ||||
|             ioDestinyProcessCodeEntity.setExpireDate(udiEntity.getExpireDate()); | ||||
|             ioDestinyProcessCodeEntity.setBatchNo(udiEntity.getBatchNo()); | ||||
|             ioDestinyProcessCodeEntity.setPrice(checkUdi.getPrice()); | ||||
|             ioDestinyProcessCodeEntity.setSerialNo(udiEntity.getSerialNo()); | ||||
|             ioDestinyProcessCodeEntity.setUpdateTime(new Date()); | ||||
|             ioDestinyProcessCodeMapper.insert(ioDestinyProcessCodeEntity); | ||||
|         }else{ | ||||
|            //无批次号的时候判断是不是第一次是第一次就插入不是第一此就更新
 | ||||
|             QueryWrapper<IoDestinyProcessCodeEntity> ew1=new QueryWrapper<>(); | ||||
|             ew1.eq("code",iodestinyProcessRequest.getCode()); | ||||
|             ew1.eq("orderIdFk",iodestinyProcessRequest.getBillNo()); | ||||
|             ew1.last("limit 1"); | ||||
|             IoDestinyProcessCodeEntity ioDestinyProcessCodeEntity=ioDestinyProcessCodeMapper.selectOne(ew1); | ||||
|             if(ioDestinyProcessCodeEntity==null){ | ||||
|                 //插入详细表
 | ||||
|                 ioDestinyProcessCodeEntity=new IoDestinyProcessCodeEntity(); | ||||
|                 ioDestinyProcessCodeEntity.setCode(iodestinyProcessRequest.getCode()); | ||||
|                 ioDestinyProcessCodeEntity.setId(IdUtil.getSnowflakeNextId()); | ||||
|                 ioDestinyProcessCodeEntity.setOrderIdFk(iodestinyProcessRequest.getBillNo()); | ||||
|                 ioDestinyProcessCodeEntity.setBindRlFk(checkUdi.getRelId() + ""); | ||||
|                 ioDestinyProcessCodeEntity.setUuidFk(checkUdi.getUuid()); | ||||
|                 ioDestinyProcessCodeEntity.setNameCode(checkUdi.getNameCode()); | ||||
|                 ioDestinyProcessCodeEntity.setCount(1); | ||||
|                 ioDestinyProcessCodeEntity.setReCount(count); | ||||
|                 ioDestinyProcessCodeEntity.setProductDate(udiEntity.getProduceDate()); | ||||
|                 ioDestinyProcessCodeEntity.setExpireDate(udiEntity.getExpireDate()); | ||||
|                 ioDestinyProcessCodeEntity.setBatchNo(udiEntity.getBatchNo()); | ||||
|                 ioDestinyProcessCodeEntity.setPrice(checkUdi.getPrice()); | ||||
|                 ioDestinyProcessCodeEntity.setSerialNo(udiEntity.getSerialNo()); | ||||
|                 ioDestinyProcessCodeEntity.setUpdateTime(new Date()); | ||||
|                 ioDestinyProcessCodeMapper.insert(ioDestinyProcessCodeEntity); | ||||
|                 return ResultVOUtils.success(); | ||||
|             } | ||||
|             ioDestinyProcessCodeEntity.setCount(ioDestinyProcessCodeEntity.getReCount()+1); | ||||
|             ioDestinyProcessCodeEntity.setReCount(ioDestinyProcessCodeEntity.getReCount()+count); | ||||
|             ioDestinyProcessCodeMapper.updateById(ioDestinyProcessCodeEntity); | ||||
| 
 | ||||
|         } | ||||
|         return ResultVOUtils.success(); | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1,10 +1,55 @@ | ||||
| package com.glxp.api.service.inout.impl; | ||||
| 
 | ||||
| 
 | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||||
| import com.glxp.api.dao.inout.IoDestinyProcessCodeMapper; | ||||
| import com.glxp.api.dao.inout.IoDestinyProcessDetailMapper; | ||||
| import com.glxp.api.dao.inout.IoDestinyProcessMapper; | ||||
| import com.glxp.api.entity.inout.IoDestinyProcessCodeEntity; | ||||
| import com.glxp.api.entity.inout.IoDestinyProcessDetailEntity; | ||||
| import com.glxp.api.entity.inout.IoDestinyProcessEntity; | ||||
| import com.glxp.api.req.inout.IodestinyProcessRequest; | ||||
| import com.glxp.api.service.inout.IoDestinyProcessService; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| 
 | ||||
| @Service | ||||
| public class IoDestinyProcessServiceImpl implements IoDestinyProcessService { | ||||
|     @Resource | ||||
|     IoDestinyProcessMapper ioDestinyProcessMapper; | ||||
|     @Resource | ||||
|     private IoDestinyProcessDetailMapper ioDestinyProcessDetailMapper; | ||||
|     @Resource | ||||
|     private IoDestinyProcessCodeMapper ioDestinyProcessCodeMapper; | ||||
| 
 | ||||
|     @Override | ||||
|     public Boolean uploadDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest) { | ||||
| 
 | ||||
|         QueryWrapper<IoDestinyProcessEntity> ew = new QueryWrapper<>(); | ||||
|         ew.eq("billNo", iodestinyProcessRequest.getBillNo()); | ||||
|         IoDestinyProcessEntity ioDestinyProcessEntity = ioDestinyProcessMapper.selectOne(ew); | ||||
|         ioDestinyProcessEntity.setStatus(2); | ||||
|         ioDestinyProcessMapper.updateById(ioDestinyProcessEntity); | ||||
|         return null; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public Boolean delectDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest) { | ||||
| 
 | ||||
| 
 | ||||
|         QueryWrapper<IoDestinyProcessDetailEntity> ew=new QueryWrapper<>(); | ||||
|         ew.eq("orderIdFk",iodestinyProcessRequest.getBillNo()); | ||||
|         long count= ioDestinyProcessDetailMapper.delete(ew); | ||||
| 
 | ||||
|         QueryWrapper<IoDestinyProcessCodeEntity> ew1=new QueryWrapper<>(); | ||||
|         ew1.eq("orderIdFk",iodestinyProcessRequest.getBillNo()); | ||||
|         ioDestinyProcessCodeMapper.delete(ew1); | ||||
| 
 | ||||
|         QueryWrapper<IoDestinyProcessEntity> ew3 = new QueryWrapper<>(); | ||||
|         ew3.eq("billNo", iodestinyProcessRequest.getBillNo()); | ||||
|         ioDestinyProcessMapper.delete(ew3); | ||||
| 
 | ||||
|         return null; | ||||
|     } | ||||
| } | ||||
|  | ||||
					Loading…
					
					
				
		Reference in New Issue