代码备份
							parent
							
								
									ef237c7479
								
							
						
					
					
						commit
						93399fadc9
					
				| @ -0,0 +1,171 @@ | ||||
| package com.glxp.api.admin.controller.inventory; | ||||
| 
 | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import com.github.pagehelper.PageInfo; | ||||
| import com.glxp.api.admin.annotation.AuthRuleAnnotation; | ||||
| import com.glxp.api.admin.constant.Constant; | ||||
| import com.glxp.api.admin.constant.ConstantStatus; | ||||
| import com.glxp.api.admin.constant.ConstantType; | ||||
| import com.glxp.api.admin.entity.info.CompanyEntity; | ||||
| import com.glxp.api.admin.entity.inventory.InvProductDetailEntity; | ||||
| import com.glxp.api.admin.entity.inventory.InvProductEntity; | ||||
| import com.glxp.api.admin.req.inout.DeleteRequest; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvProductRequest; | ||||
| import com.glxp.api.admin.res.PageSimpleResponse; | ||||
| import com.glxp.api.admin.res.inventory.InvProductDetailResponse; | ||||
| import com.glxp.api.admin.res.inventory.InvProductPageRespnonse; | ||||
| import com.glxp.api.admin.res.inventory.InvProductResponse; | ||||
| import com.glxp.api.admin.res.inventory.InvProductStatResponse; | ||||
| import com.glxp.api.admin.service.info.CompanyService; | ||||
| import com.glxp.api.admin.service.inventory.InvPreInProductDetailService; | ||||
| import com.glxp.api.admin.service.inventory.InvPreInProductService; | ||||
| import com.glxp.api.common.enums.ResultEnum; | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.common.util.ResultVOUtils; | ||||
| import org.springframework.beans.BeanUtils; | ||||
| 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 InvPreInProductsController { | ||||
| 
 | ||||
| 
 | ||||
|     @Resource | ||||
|     InvPreInProductService invProductService; | ||||
|     @Resource | ||||
|     InvPreInProductDetailService invProductDetailService; | ||||
|     @Resource | ||||
|     private CompanyService companyService; | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @GetMapping("spms/prein/inv/products/filter") | ||||
|     public BaseResponse filterInvProduct(FilterInvProductRequest filterInvProductRequest) { | ||||
|         boolean showSup = false; | ||||
| //        if (Constant.SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) {
 | ||||
| //            filterInvProductRequest.setCustomerId(null);
 | ||||
| //            showSup = true;
 | ||||
| //        } else {
 | ||||
| //            CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId()));
 | ||||
| //            filterInvProductRequest.setSupId(companyEntity.getUnitIdFk());
 | ||||
| //            filterInvProductRequest.setCustomerId(null);
 | ||||
| //        }
 | ||||
|         List<InvProductResponse> invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest); | ||||
|         PageInfo<InvProductResponse> pageInfo; | ||||
|         pageInfo = new PageInfo<>(invProductResponses); | ||||
|         InvProductPageRespnonse<InvProductResponse> pageSimpleResponse = new InvProductPageRespnonse<>(); | ||||
|         pageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||
|         pageSimpleResponse.setList(invProductResponses); | ||||
|         pageSimpleResponse.setShowSup(showSup); | ||||
|         return ResultVOUtils.success(pageSimpleResponse); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @GetMapping("spms/prein/inv/products/isExist") | ||||
|     public BaseResponse isExistInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { | ||||
|         List<InvProductDetailEntity> invProductResponses = invProductDetailService.filterInvProduct(filterInvProductDetailRequest); | ||||
|         if (CollUtil.isNotEmpty(invProductResponses)) { | ||||
|             return ResultVOUtils.success("success"); | ||||
|         } | ||||
|         return ResultVOUtils.error(501, "库存不存在此产品"); | ||||
|     } | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @GetMapping("spms/prein/inv/products/getAllCode") | ||||
|     public BaseResponse getAllCodees(FilterInvProductDetailRequest filterInvProductDetailRequest) { | ||||
|         List<String> invProductResponses = invProductDetailService.findAllCode(filterInvProductDetailRequest); | ||||
|         if (CollUtil.isNotEmpty(invProductResponses)) { | ||||
|             return ResultVOUtils.success(invProductResponses); | ||||
|         } | ||||
|         return ResultVOUtils.error(501, "未入库"); | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @GetMapping("spms/prein/inv/products/filterDetail") | ||||
|     public BaseResponse filterInvProductDetail(FilterInvProductDetailRequest filterInvProductRequest) { | ||||
|         if (Constant.SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) { | ||||
|             filterInvProductRequest.setCustomerId(null); | ||||
|         } | ||||
|         List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest); | ||||
|         PageInfo<InvProductDetailEntity> pageInfo; | ||||
|         pageInfo = new PageInfo<>(invProductDetailEntities); | ||||
|         List<InvProductDetailResponse> invProductDetailResponses = new ArrayList<>(); | ||||
|         if (invProductDetailEntities.size() > 0) { | ||||
|             for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) { | ||||
|                 InvProductDetailResponse invProductDetailResponse = new InvProductDetailResponse(); | ||||
|                 BeanUtils.copyProperties(invProductDetailEntity, invProductDetailResponse); | ||||
|                 if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { | ||||
|                     invProductDetailResponse.setMainActionStr("出库"); | ||||
|                     invProductDetailResponse.setOutCount(invProductDetailEntity.getCount()); | ||||
|                 } else { | ||||
|                     invProductDetailResponse.setMainActionStr("入库"); | ||||
|                     invProductDetailResponse.setInCount(invProductDetailEntity.getCount()); | ||||
|                 } | ||||
|                 invProductDetailResponses.add(invProductDetailResponse); | ||||
|             } | ||||
|         } | ||||
|         PageSimpleResponse<InvProductDetailResponse> pageSimpleResponse = new PageSimpleResponse<>(); | ||||
|         pageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||
|         pageSimpleResponse.setList(invProductDetailResponses); | ||||
|         return ResultVOUtils.success(pageSimpleResponse); | ||||
|     } | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @PostMapping("spms/prein/inv/products/delete") | ||||
|     public BaseResponse deleteInvProduct(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
|         String id = deleteRequest.getId(); | ||||
|         InvProductEntity invProductEntity = invProductService.selectById(id); | ||||
|         if (invProductEntity != null) { | ||||
|             invProductService.deleteById(id); | ||||
|             FilterInvProductDetailRequest detailRequest = new FilterInvProductDetailRequest(); | ||||
|             detailRequest.setSupId(invProductEntity.getSupId()); | ||||
|             detailRequest.setBatchNo(invProductEntity.getBatchNo()); | ||||
|             detailRequest.setProductIdFk(invProductEntity.getRelIdFk()); | ||||
|             invProductDetailService.deleteByProductId(detailRequest); | ||||
|             return ResultVOUtils.success("删除成功"); | ||||
|         } else { | ||||
|             return ResultVOUtils.error(500, "删除失败!"); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @GetMapping("spms/prein/inv/products/stat") | ||||
|     public BaseResponse statInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { | ||||
| 
 | ||||
|         InvProductStatResponse invProductStatResponse = new InvProductStatResponse(); | ||||
|         //统计预入库数量
 | ||||
|         FilterInvProductDetailRequest temp1 = new FilterInvProductDetailRequest(); | ||||
|         BeanUtils.copyProperties(filterInvProductDetailRequest, temp1); | ||||
|         temp1.setPurchaseType(ConstantStatus.PRUCHASE_ADVANCE); | ||||
|         invProductStatResponse.setAdvanceCount(invProductDetailService.statCount(temp1)); | ||||
|         //统计普通采购数量
 | ||||
|         FilterInvProductDetailRequest temp2 = new FilterInvProductDetailRequest(); | ||||
|         BeanUtils.copyProperties(filterInvProductDetailRequest, temp2); | ||||
|         temp2.setPurchaseType(ConstantStatus.PRUCHASE_COMMON); | ||||
|         invProductStatResponse.setCommonCount(invProductDetailService.statCount(temp2)); | ||||
|         //统计入库数量
 | ||||
|         FilterInvProductDetailRequest temp3 = new FilterInvProductDetailRequest(); | ||||
|         BeanUtils.copyProperties(filterInvProductDetailRequest, temp3); | ||||
|         temp3.setMainAction(ConstantType.TYPE_PUT); | ||||
|         invProductStatResponse.setInCount(invProductDetailService.statCount(temp3)); | ||||
|         //统计出库数量
 | ||||
|         FilterInvProductDetailRequest temp4 = new FilterInvProductDetailRequest(); | ||||
|         BeanUtils.copyProperties(filterInvProductDetailRequest, temp4); | ||||
|         temp4.setMainAction(ConstantType.TYPE_OUT); | ||||
|         invProductStatResponse.setOutCount(invProductDetailService.statCount(temp4)); | ||||
|         return ResultVOUtils.success(invProductStatResponse); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,86 @@ | ||||
| package com.glxp.api.admin.controller.thrsys; | ||||
| //领用单
 | ||||
| 
 | ||||
| import com.glxp.api.admin.annotation.AuthRuleAnnotation; | ||||
| import com.glxp.api.admin.entity.business.StockOrderDetailEntity; | ||||
| import com.glxp.api.admin.entity.thrsys.ThrOrderDetailEntity; | ||||
| import com.glxp.api.admin.entity.thrsys.ThrOrderEntity; | ||||
| import com.glxp.api.admin.req.business.StockOrderPostRequest; | ||||
| import com.glxp.api.admin.service.auth.CustomerService; | ||||
| import com.glxp.api.admin.service.thrsys.ThrOrderDetailService; | ||||
| import com.glxp.api.admin.service.thrsys.ThrOrderService; | ||||
| import com.glxp.api.admin.util.DateUtil; | ||||
| import com.glxp.api.common.enums.ResultEnum; | ||||
| import com.glxp.api.common.res.BaseResponse; | ||||
| import com.glxp.api.common.util.ResultVOUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.beans.BeanUtils; | ||||
| import org.springframework.validation.BindingResult; | ||||
| 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.Date; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @RestController | ||||
| public class ThrOrderReceiveController { | ||||
| 
 | ||||
|     @Resource | ||||
|     private ThrOrderService thrOrderService; | ||||
|     @Resource | ||||
|     private ThrOrderDetailService thrOrderDetailService; | ||||
|     @Resource | ||||
|     CustomerService customerService; | ||||
| 
 | ||||
|     @AuthRuleAnnotation("") | ||||
|     @PostMapping("/udiwms/thrsys/order/insertWeb") | ||||
|     public BaseResponse insertWeb(@RequestBody StockOrderPostRequest stockOrderPostRequest, BindingResult bindingResult) { | ||||
| 
 | ||||
|         if (bindingResult.hasErrors()) { | ||||
|             return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); | ||||
|         } | ||||
|         Integer userId = customerService.getUserId(); | ||||
|         ThrOrderEntity stockOrderEntity = new ThrOrderEntity(); | ||||
| //        Integer id = Integer.parseInt(CustomUtil.getId());
 | ||||
|         BeanUtils.copyProperties(stockOrderPostRequest, stockOrderEntity); | ||||
|         stockOrderEntity.setCreateUser(userId + ""); | ||||
|         stockOrderEntity.setType(1);//领用单据
 | ||||
|         stockOrderEntity.setUpdateTime(new Date()); | ||||
|         stockOrderEntity.setBilldate(DateUtil.formatDate(new Date())); | ||||
| //        stockOrderEntity.setId(id);
 | ||||
|         ThrOrderEntity temp = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk()); | ||||
|         if (temp != null) { | ||||
|             stockOrderEntity.setId(temp.getId()); | ||||
|         } | ||||
|         thrOrderService.insertThrOrder(stockOrderEntity); | ||||
|         stockOrderEntity = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk()); | ||||
| 
 | ||||
|         if (stockOrderPostRequest.getSubErpOrders() != null) { | ||||
|             List<StockOrderDetailEntity> stockOrderDetailEntityList = stockOrderPostRequest.getSubErpOrders(); | ||||
|             for (StockOrderDetailEntity stockOrderDetailEntity : stockOrderDetailEntityList) { | ||||
| 
 | ||||
|                 ThrOrderDetailEntity thrOrderDetailEntity = new ThrOrderDetailEntity(); | ||||
|                 BeanUtils.copyProperties(stockOrderDetailEntity, thrOrderDetailEntity); | ||||
|                 thrOrderDetailEntity.setOrderIdFk( | ||||
|                         StringUtils.isBlank(stockOrderDetailEntity.getOrderIdFk()) ? | ||||
|                                 stockOrderEntity.getId() + "" : stockOrderDetailEntity.getOrderIdFk()); | ||||
| 
 | ||||
|                 if (StringUtils.isBlank(stockOrderDetailEntity.getId())) { | ||||
|                     thrOrderDetailEntity.setReCount( | ||||
|                             stockOrderDetailEntity.getReCount()); | ||||
|                     thrOrderDetailEntity.setCount( | ||||
|                             stockOrderDetailEntity.getCount()); | ||||
| 
 | ||||
|                     thrOrderDetailService.insertThrOrderDetail(thrOrderDetailEntity); | ||||
| 
 | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             return ResultVOUtils.success("成功"); | ||||
|         } | ||||
|         return ResultVOUtils.success("成功"); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,31 @@ | ||||
| package com.glxp.api.admin.dao.inventory; | ||||
| 
 | ||||
| import com.glxp.api.admin.entity.inventory.InvProductEntity; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvProductRequest; | ||||
| import com.glxp.api.admin.res.inventory.InvProductResponse; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Mapper | ||||
| public interface InvPreInProductDao { | ||||
| 
 | ||||
|     List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest); | ||||
| 
 | ||||
|     List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest); | ||||
| 
 | ||||
|     boolean insertInvProduct(InvProductEntity invProductEntity); | ||||
| 
 | ||||
|     boolean updateInvProduct(InvProductEntity invProductEntity); | ||||
| 
 | ||||
|     InvProductEntity selectByUuid(@Param("relIdFk") String relIdFk, @Param("batchNo") String batchNo, | ||||
|                                   @Param("supId") String supId, @Param("invStorageCode") String invStorageCode, | ||||
|                                   @Param("invWarehouseCode") String invWarehouseCode); | ||||
| 
 | ||||
|     InvProductEntity selectById(@Param("id") String id); | ||||
| 
 | ||||
|     InvProductEntity selectExit(@Param("relIdFk") String id); | ||||
| 
 | ||||
|     boolean deleteById(@Param("id") String id); | ||||
| } | ||||
| @ -0,0 +1,31 @@ | ||||
| package com.glxp.api.admin.dao.inventory; | ||||
| 
 | ||||
| import com.glxp.api.admin.entity.inventory.InvProductDetailEntity; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest; | ||||
| import com.glxp.api.admin.res.inventory.InvProductDetailJoinResponse; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Mapper | ||||
| public interface InvPreInProductDetailDao { | ||||
| 
 | ||||
|     List<InvProductDetailEntity> filterInvProductDetail(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||
| 
 | ||||
|     List<InvProductDetailJoinResponse> filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||
| 
 | ||||
|     boolean insertInvProductDetail(InvProductDetailEntity invProductDetailEntity); | ||||
| 
 | ||||
|     boolean insertInvProductDetails(@Param("invProductDetailEntitys") List<InvProductDetailEntity> invProductDetailEntitys); | ||||
| 
 | ||||
|     boolean updateInvProductDetail(InvProductDetailEntity invProductDetailEntity); | ||||
| 
 | ||||
|     boolean deleteById(@Param("id") String id); | ||||
| 
 | ||||
|     boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||
| 
 | ||||
|     int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||
| 
 | ||||
|     List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||
| } | ||||
| @ -0,0 +1,29 @@ | ||||
| package com.glxp.api.admin.res.info; | ||||
| 
 | ||||
| import lombok.Data; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Data | ||||
| public class SyncDataSetResponse { | ||||
|     private Integer id; | ||||
|     private boolean typeBus; | ||||
|     private boolean typeScan; | ||||
|     private boolean typeThird; | ||||
|     private boolean basicProducts; | ||||
|     private boolean basicCorp; | ||||
|     private boolean basicInv; | ||||
|     private boolean basicThirdProducts; | ||||
|     private boolean basicThirdCorp; | ||||
|     private boolean basicThirdInv; | ||||
|     private boolean basicThirdBusOrder; | ||||
|     private boolean dbDiProducts; | ||||
|     private boolean downstreamEnable; | ||||
|     private boolean orderScanFinish; | ||||
|     private boolean orderUnReceive; | ||||
|     private boolean orderUnCheck; | ||||
|     private List<String> busTypes; | ||||
|     private Integer syncTime; | ||||
|     private Integer syncDonwloadTime;       //定时下载时间
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,30 @@ | ||||
| package com.glxp.api.admin.service.inventory; | ||||
| 
 | ||||
| 
 | ||||
| import com.glxp.api.admin.entity.inventory.InvProductDetailEntity; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest; | ||||
| import com.glxp.api.admin.res.inventory.InvProductDetailJoinResponse; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| public interface InvPreInProductDetailService { | ||||
| 
 | ||||
|     List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||
| 
 | ||||
|     List<InvProductDetailJoinResponse> filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||
| 
 | ||||
|     boolean insertInvProduct(InvProductDetailEntity invProductDetailEntity); | ||||
| 
 | ||||
|     boolean insertInvProducts(List<InvProductDetailEntity> invProductDetailEntitys); | ||||
| 
 | ||||
|     boolean updateInvProduct(InvProductDetailEntity invProductDetailEntity); | ||||
| 
 | ||||
|     boolean deleteById(String id); | ||||
| 
 | ||||
|     boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||
| 
 | ||||
|     int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||
| 
 | ||||
| 
 | ||||
|     List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||
| } | ||||
| @ -0,0 +1,26 @@ | ||||
| package com.glxp.api.admin.service.inventory; | ||||
| 
 | ||||
| import com.glxp.api.admin.entity.inventory.InvProductEntity; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvProductRequest; | ||||
| import com.glxp.api.admin.res.inventory.InvProductResponse; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| public interface InvPreInProductService { | ||||
| 
 | ||||
|     List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest); | ||||
| 
 | ||||
|     List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest); | ||||
| 
 | ||||
|     InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode); | ||||
| 
 | ||||
|     InvProductEntity selectExit(String id); | ||||
| 
 | ||||
|     InvProductEntity selectById(String id); | ||||
| 
 | ||||
|     boolean insertInvProduct(InvProductEntity invProductEntity); | ||||
| 
 | ||||
|     boolean updateInvProduct(InvProductEntity invProductEntity); | ||||
| 
 | ||||
|     boolean deleteById(String id); | ||||
| } | ||||
| @ -0,0 +1,81 @@ | ||||
| package com.glxp.api.admin.service.inventory.impl; | ||||
| 
 | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.admin.dao.inventory.InvPreInProductDetailDao; | ||||
| import com.glxp.api.admin.entity.inventory.InvProductDetailEntity; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest; | ||||
| import com.glxp.api.admin.res.inventory.InvProductDetailJoinResponse; | ||||
| import com.glxp.api.admin.service.inventory.InvPreInProductDetailService; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailService { | ||||
| 
 | ||||
|     @Resource | ||||
|     InvPreInProductDetailDao invPreInProductDetailDao; | ||||
| 
 | ||||
|     @Override | ||||
|     public List<InvProductDetailEntity> filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { | ||||
|         if (filterInvProductDetailRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (filterInvProductDetailRequest.getPage() != null) { | ||||
|             int offset = (filterInvProductDetailRequest.getPage() - 1) * filterInvProductDetailRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterInvProductDetailRequest.getLimit()); | ||||
|         } | ||||
|         List<InvProductDetailEntity> data = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<InvProductDetailJoinResponse> filterJoinInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { | ||||
|         if (filterInvProductDetailRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (filterInvProductDetailRequest.getPage() != null) { | ||||
|             int offset = (filterInvProductDetailRequest.getPage() - 1) * filterInvProductDetailRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterInvProductDetailRequest.getLimit()); | ||||
|         } | ||||
|         List<InvProductDetailJoinResponse> data = invPreInProductDetailDao.filterJoinInvProduct(filterInvProductDetailRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean insertInvProduct(InvProductDetailEntity invProductDetailEntity) { | ||||
|         return invPreInProductDetailDao.insertInvProductDetail(invProductDetailEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean insertInvProducts(List<InvProductDetailEntity> invProductDetailEntitys) { | ||||
|         return invPreInProductDetailDao.insertInvProductDetails(invProductDetailEntitys); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean updateInvProduct(InvProductDetailEntity invProductDetailEntity) { | ||||
|         return invPreInProductDetailDao.updateInvProductDetail(invProductDetailEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteById(String id) { | ||||
|         return invPreInProductDetailDao.deleteById(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteByProductId(FilterInvProductDetailRequest filterInvProductDetailRequest) { | ||||
|         return invPreInProductDetailDao.deleteByProductId(filterInvProductDetailRequest); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public int statCount(FilterInvProductDetailRequest filterInvProductDetailRequest) { | ||||
|         return invPreInProductDetailDao.statCount(filterInvProductDetailRequest); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<String> findAllCode(FilterInvProductDetailRequest filterInvProductDetailRequest) { | ||||
|         return invPreInProductDetailDao.findAllCode(filterInvProductDetailRequest); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,77 @@ | ||||
| package com.glxp.api.admin.service.inventory.impl; | ||||
| 
 | ||||
| import com.github.pagehelper.PageHelper; | ||||
| import com.glxp.api.admin.dao.inventory.InvPreInProductDao; | ||||
| import com.glxp.api.admin.entity.inventory.InvProductEntity; | ||||
| import com.glxp.api.admin.req.inventory.FilterInvProductRequest; | ||||
| import com.glxp.api.admin.res.inventory.InvProductResponse; | ||||
| import com.glxp.api.admin.service.inventory.InvPreInProductService; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import javax.annotation.Resource; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| 
 | ||||
| @Service | ||||
| public class InvPreInProductServiceImpl implements InvPreInProductService { | ||||
| 
 | ||||
|     @Resource | ||||
|     InvPreInProductDao invPreInProductDao; | ||||
| 
 | ||||
|     @Override | ||||
|     public List<InvProductEntity> filterInvProduct(FilterInvProductRequest filterInvProductRequest) { | ||||
|         if (filterInvProductRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (filterInvProductRequest.getPage() != null) { | ||||
|             int offset = (filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterInvProductRequest.getLimit()); | ||||
|         } | ||||
|         List<InvProductEntity> data = invPreInProductDao.filterInvProduct(filterInvProductRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public List<InvProductResponse> filterJoinInvProduct(FilterInvProductRequest filterInvProductRequest) { | ||||
|         if (filterInvProductRequest == null) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         if (filterInvProductRequest.getPage() != null) { | ||||
|             int offset = (filterInvProductRequest.getPage() - 1) * filterInvProductRequest.getLimit(); | ||||
|             PageHelper.offsetPage(offset, filterInvProductRequest.getLimit()); | ||||
|         } | ||||
|         List<InvProductResponse> data = invPreInProductDao.filterJoinInvProduct(filterInvProductRequest); | ||||
|         return data; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public InvProductEntity selectByUuid(String uuid, String batchNo, String supId, String invStorageCode, String invWarehouseCode) { | ||||
|         return invPreInProductDao.selectByUuid(uuid, batchNo, supId, invStorageCode, invWarehouseCode); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public InvProductEntity selectExit(String id) { | ||||
|         return invPreInProductDao.selectExit(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public InvProductEntity selectById(String id) { | ||||
|         return invPreInProductDao.selectById(id); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean insertInvProduct(InvProductEntity invProductEntity) { | ||||
|         return invPreInProductDao.insertInvProduct(invProductEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean updateInvProduct(InvProductEntity invProductEntity) { | ||||
|         return invPreInProductDao.updateInvProduct(invProductEntity); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean deleteById(String id) { | ||||
|         return invPreInProductDao.deleteById(id); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,231 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" ?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | ||||
| 
 | ||||
| <mapper namespace="com.glxp.api.admin.dao.inventory.InvPreInProductDao"> | ||||
| 
 | ||||
|     <select id="filterInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest" | ||||
|             resultType="com.glxp.api.admin.entity.inventory.InvProductEntity"> | ||||
|         SELECT * FROM inv_prein_product | ||||
|         <where> | ||||
|             <if test="productsName != '' and productsName != null"> | ||||
|                 AND productsName = #{productsName} | ||||
|             </if> | ||||
|             <if test="nameCode != '' and nameCode != null"> | ||||
|                 AND nameCode = #{nameCode} | ||||
|             </if> | ||||
|             <if test="relIdFk != '' and relIdFk != null"> | ||||
|                 AND relIdFk = #{relIdFk} | ||||
|             </if> | ||||
|             <if test="ggxh != '' and ggxh != null"> | ||||
|                 AND ggxh = #{ggxh} | ||||
|             </if> | ||||
|             <if test="batchNo != '' and batchNo != null"> | ||||
|                 AND batchNo = #{batchNo} | ||||
|             </if> | ||||
|             <if test="productionDate != '' and productionDate != null"> | ||||
|                 AND productionDate = #{productionDate} | ||||
|             </if> | ||||
|             <if test="expireDate != '' and expireDate != null"> | ||||
|                 AND expireDate = #{expireDate} | ||||
|             </if> | ||||
|             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null"> | ||||
|                 AND ylqxzcrbarmc = #{ylqxzcrbarmc} | ||||
|             </if> | ||||
|             <if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null"> | ||||
|                 AND zczbhhzbapzbh = #{zczbhhzbapzbh} | ||||
|             </if> | ||||
|             <if test="customerId != '' and customerId != null"> | ||||
|                 AND customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="supId != '' and supId != null"> | ||||
|                 AND supId = #{supId} | ||||
|             </if> | ||||
|             <if test="unitFk != '' and unitFk != null"> | ||||
|                 AND unitFk = #{unitFk} | ||||
|             </if> | ||||
|             <if test="invStorageCode != '' and invStorageCode != null"> | ||||
|                 AND invStorageCode = #{invStorageCode} | ||||
|             </if> | ||||
|             <if test="invWarehouseCode != '' and invWarehouseCode != null"> | ||||
|                 AND invWarehouseCode = #{invWarehouseCode} | ||||
|             </if> | ||||
|             <if test="invCodes != null and invCodes.size > 0"> | ||||
|                 AND invStorageCode IN | ||||
|                 <foreach collection="invCodes" item="id" index="index" open="(" close=")" separator=","> | ||||
|                     #{id} | ||||
|                 </foreach> | ||||
|             </if> | ||||
|         </where> | ||||
|         <if test="groupType != '' and groupType != null"> | ||||
|             GROUP BY #{groupType} | ||||
|         </if> | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="selectById" parameterType="Map" | ||||
|             resultType="com.glxp.api.admin.entity.inventory.InvProductEntity"> | ||||
|         SELECT * | ||||
|         FROM inv_prein_product | ||||
|         WHERE id = #{id} | ||||
| 
 | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <select id="selectByUuid" parameterType="Map" | ||||
|             resultType="com.glxp.api.admin.entity.inventory.InvProductEntity"> | ||||
|         SELECT * | ||||
|         FROM inv_prein_product | ||||
| 
 | ||||
|         <where> | ||||
|             relIdFk = #{relIdFk} | ||||
|             and invStorageCode = #{invStorageCode} | ||||
|             <if test="supId != '' and supId != null"> | ||||
|                 AND supId = #{supId} | ||||
|             </if> | ||||
|             <if test="supId == null"> | ||||
|                 AND supId is NULL | ||||
|             </if> | ||||
|             <if test="invWarehouseCode != '' and invWarehouseCode != null"> | ||||
|                 AND invWarehouseCode = #{invWarehouseCode} | ||||
|             </if> | ||||
|             <if test="invWarehouseCode == null"> | ||||
|                 AND invWarehouseCode is NULL | ||||
|             </if> | ||||
|         </where> | ||||
| 
 | ||||
|     </select> | ||||
|     <select id="selectExit" parameterType="Map" | ||||
|             resultType="com.glxp.api.admin.entity.inventory.InvProductEntity"> | ||||
|         SELECT * | ||||
|         FROM inv_prein_product | ||||
|         <where> | ||||
|             relIdFk = #{relIdFk} | ||||
|         </where> | ||||
|         limit 1 | ||||
|     </select> | ||||
|     <!--   and supId = #{supId}--> | ||||
|     <select id="filterJoinInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductRequest" | ||||
|             resultType="com.glxp.api.admin.res.inventory.InvProductResponse"> | ||||
|         SELECT | ||||
|         inv_prein_product.id, | ||||
|         basic_products.cpmctymc,basic_products.nameCode,inv_prein_product.relIdFk,basic_products.ggxh, | ||||
|         inv_prein_product.batchNo | ||||
|         ,inv_prein_product.productionDate,inv_prein_product.expireDate, | ||||
|         basic_products.ylqxzcrbarmc,basic_products.zczbhhzbapzbh, | ||||
|         inv_prein_product.inCount,inv_prein_product.outCount | ||||
|         ,inv_prein_product.reCount,inv_prein_product.customerId, | ||||
|         basic_corp.name companyName,inv_prein_product.supId,inv_prein_product.unitFk ,inv_warehouse.name | ||||
|         invStorageName,inv_prein_product.invStorageCode | ||||
|         FROM inv_prein_product | ||||
|         inner join basic_udirel on inv_prein_product.relIdFk = basic_udirel.id | ||||
|         inner join basic_products on basic_udirel.uuid = basic_products.uuid | ||||
|         left join basic_corp on inv_prein_product.supId=basic_corp.erpId | ||||
|         left join inv_warehouse on inv_warehouse.code=inv_prein_product.invStorageCode | ||||
|         <where> | ||||
|             basic_products.diType=1 | ||||
|             <if test="cpmctymc != '' and cpmctymc != null"> | ||||
|                 AND basic_products.cpmctymc = #{cpmctymc} | ||||
|             </if> | ||||
|             <if test="nameCode != '' and nameCode != null"> | ||||
|                 AND basic_products.nameCode = #{nameCode} | ||||
|             </if> | ||||
|             <if test="relIdFk != '' and relIdFk != null"> | ||||
|                 AND inv_prein_product.relIdFk = #{relIdFk} | ||||
|             </if> | ||||
|             <if test="invStorageCode != '' and invStorageCode != null"> | ||||
|                 AND invStorageCode = #{invStorageCode} | ||||
|             </if> | ||||
|             <if test="invWarehouseCode != '' and invWarehouseCode != null"> | ||||
|                 AND invWarehouseCode = #{invWarehouseCode} | ||||
|             </if> | ||||
| 
 | ||||
|             <if test="ggxh != '' and ggxh != null"> | ||||
|                 AND basic_products.ggxh = #{ggxh} | ||||
|             </if> | ||||
|             <if test="batchNo != '' and batchNo != null"> | ||||
|                 AND inv_prein_product.batchNo = #{batchNo} | ||||
|             </if> | ||||
|             <if test="productionDate != '' and productionDate != null"> | ||||
|                 AND inv_prein_product.productionDate = #{productionDate} | ||||
|             </if> | ||||
|             <if test="expireDate != '' and expireDate != null"> | ||||
|                 AND inv_prein_product.expireDate = #{expireDate} | ||||
|             </if> | ||||
|             <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null"> | ||||
|                 AND basic_products.ylqxzcrbarmc = #{ylqxzcrbarmc} | ||||
|             </if> | ||||
|             <if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null"> | ||||
|                 AND basic_products.zczbhhzbapzbh = #{zczbhhzbapzbh} | ||||
|             </if> | ||||
|             <if test="customerId != '' and customerId != null"> | ||||
|                 AND inv_prein_product.customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="supId != '' and supId != null"> | ||||
|                 AND supId = #{supId} | ||||
|             </if> | ||||
|             <if test="unitFk != '' and unitFk != null"> | ||||
|                 AND unitFk = #{unitFk} | ||||
|             </if> | ||||
|             <if test="invStorageCode != '' and invStorageCode != null"> | ||||
|                 AND invStorageCode = #{invStorageCode} | ||||
|             </if> | ||||
|             <if test="invWarehouseCode != '' and invWarehouseCode != null"> | ||||
|                 AND invWarehouseCode = #{invWarehouseCode} | ||||
|             </if> | ||||
|             <if test="invCodes != null and invCodes.size > 0"> | ||||
|                 AND invStorageCode IN | ||||
|                 <foreach collection="invCodes" item="id" index="index" open="(" close=")" separator=","> | ||||
|                     #{id} | ||||
|                 </foreach> | ||||
|             </if> | ||||
|         </where> | ||||
|         <if test="groupType != '' and groupType != null"> | ||||
|             GROUP BY #{groupType} | ||||
|         </if> | ||||
| 
 | ||||
|     </select> | ||||
|     <insert id="insertInvProduct" keyProperty="id" | ||||
|             parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity"> | ||||
|         insert INTO inv_prein_product | ||||
|         (productsName, nameCode, relIdFk, ggxh, batchNo, | ||||
|          productionDate, expireDate, ylqxzcrbarmc, zczbhhzbapzbh, | ||||
|          inCount, outCount, reCount, customerId, supId, unitFk, invStorageCode, invWarehouseCode) | ||||
|         values (#{productsName}, #{nameCode}, | ||||
|                 #{relIdFk}, #{ggxh}, #{batchNo}, | ||||
|                 #{productionDate}, #{expireDate}, | ||||
|                 #{ylqxzcrbarmc}, #{zczbhhzbapzbh}, | ||||
|                 #{inCount}, #{outCount}, #{reCount}, #{customerId}, #{supId}, #{unitFk} | ||||
|                    , #{invStorageCode}, #{invWarehouseCode}) | ||||
|     </insert> | ||||
| 
 | ||||
| 
 | ||||
|     <delete id="deleteById" parameterType="Map"> | ||||
|         DELETE | ||||
|         FROM inv_prein_product | ||||
|         WHERE id = #{id} | ||||
|     </delete> | ||||
| 
 | ||||
|     <update id="updateInvProduct" parameterType="com.glxp.api.admin.entity.inventory.InvProductEntity"> | ||||
|         UPDATE inv_prein_product | ||||
|         <trim prefix="set" suffixOverrides=","> | ||||
|             <if test="productsName != null">productsName=#{productsName},</if> | ||||
|             <if test="nameCode != null">nameCode=#{nameCode},</if> | ||||
|             <if test="relIdFk != null">relIdFk=#{relIdFk},</if> | ||||
|             <if test="ggxh != null">ggxh=#{ggxh},</if> | ||||
|             <if test="batchNo != null">batchNo=#{batchNo},</if> | ||||
|             <if test="productionDate != null">productionDate=#{productionDate},</if> | ||||
|             <if test="expireDate != null">expireDate=#{expireDate},</if> | ||||
|             <if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if> | ||||
|             <if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if> | ||||
|             <if test="inCount != null">inCount=#{inCount},</if> | ||||
|             <if test="outCount != null">outCount=#{outCount},</if> | ||||
|             <if test="reCount != null">reCount=#{reCount},</if> | ||||
|             <if test="customerId != null">customerId=#{customerId},</if> | ||||
|             <if test="supId != null">supId=#{supId},</if> | ||||
|             <if test="unitFk != null">unitFk=#{unitFk},</if> | ||||
|             <if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if> | ||||
|             <if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if> | ||||
|         </trim> | ||||
|         WHERE id = #{id} | ||||
|     </update> | ||||
| 
 | ||||
| </mapper> | ||||
| @ -0,0 +1,273 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" ?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | ||||
| 
 | ||||
| <mapper namespace="com.glxp.api.admin.dao.inventory.InvPreInProductDetailDao"> | ||||
| 
 | ||||
|     <select id="filterInvProductDetail" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest" | ||||
|             resultType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity"> | ||||
|         SELECT * FROM inv_prein_product_detail | ||||
|         <where> | ||||
|             <if test="productIdFk != '' and productIdFk != null"> | ||||
|                 AND productIdFk = #{productIdFk} | ||||
|             </if> | ||||
|             <if test="customerId != '' and customerId != null"> | ||||
|                 AND customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="mainAction != '' and mainAction != null"> | ||||
|                 AND mainAction = #{mainAction} | ||||
|             </if> | ||||
|             <if test="action != '' and action != null"> | ||||
|                 AND action = #{action} | ||||
|             </if> | ||||
|             <if test="count != '' and count != null"> | ||||
|                 AND count = #{count} | ||||
|             </if> | ||||
| 
 | ||||
|             <if test="purchaseType != null"> | ||||
|                 AND purchaseType = #{purchaseType} | ||||
|             </if> | ||||
| 
 | ||||
|             <if test="batchNo != '' and batchNo != null"> | ||||
|                 AND batchNo = #{batchNo} | ||||
|             </if> | ||||
|             <if test="unitFk != '' and unitFk != null"> | ||||
|                 AND unitFk = #{unitFk} | ||||
|             </if> | ||||
|             <if test="supId != '' and supId != null"> | ||||
|                 AND supId = #{supId} | ||||
|             </if> | ||||
|             <if test="code != '' and code != null"> | ||||
|                 AND code = #{code} | ||||
|             </if> | ||||
|             <if test="originCode != '' and originCode != null"> | ||||
|                 AND originCode = #{originCode} | ||||
|             </if> | ||||
|             <if test="invStorageCode != '' and invStorageCode != null"> | ||||
|                 AND invStorageCode = #{invStorageCode} | ||||
|             </if> | ||||
|             <if test="invWarehouseCode != '' and invWarehouseCode != null"> | ||||
|                 AND invWarehouseCode = #{invWarehouseCode} | ||||
|             </if> | ||||
|         </where> | ||||
| 
 | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <select id="findAllCode" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest" | ||||
|             resultType="java.lang.String"> | ||||
|         SELECT originCode FROM inv_prein_product_detail | ||||
|         <where> | ||||
|             <if test="productIdFk != '' and productIdFk != null"> | ||||
|                 AND productIdFk = #{productIdFk} | ||||
|             </if> | ||||
|             <if test="customerId != '' and customerId != null"> | ||||
|                 AND customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="mainAction != '' and mainAction != null"> | ||||
|                 AND mainAction = #{mainAction} | ||||
|             </if> | ||||
|             <if test="action != '' and action != null"> | ||||
|                 AND action = #{action} | ||||
|             </if> | ||||
|             <if test="count != '' and count != null"> | ||||
|                 AND count = #{count} | ||||
|             </if> | ||||
| 
 | ||||
|             <if test="purchaseType != null"> | ||||
|                 AND purchaseType = #{purchaseType} | ||||
|             </if> | ||||
| 
 | ||||
|             <if test="batchNo != '' and batchNo != null"> | ||||
|                 AND batchNo = #{batchNo} | ||||
|             </if> | ||||
|             <if test="unitFk != '' and unitFk != null"> | ||||
|                 AND unitFk = #{unitFk} | ||||
|             </if> | ||||
|             <if test="supId != '' and supId != null"> | ||||
|                 AND supId = #{supId} | ||||
|             </if> | ||||
|             <if test="code != '' and code != null"> | ||||
|                 AND code = #{code} | ||||
|             </if> | ||||
|             <if test="originCode != '' and originCode != null"> | ||||
|                 AND originCode = #{originCode} | ||||
|             </if> | ||||
|             <if test="invStorageCode != '' and invStorageCode != null"> | ||||
|                 AND invStorageCode = #{invStorageCode} | ||||
|             </if> | ||||
|             <if test="invWarehouseCode != '' and invWarehouseCode != null"> | ||||
|                 AND invWarehouseCode = #{invWarehouseCode} | ||||
|             </if> | ||||
|         </where> | ||||
| 
 | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <select id="filterJoinInvProduct" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest" | ||||
|             resultType="com.glxp.api.admin.res.inventory.InvProductDetailJoinResponse"> | ||||
|         SELECT inv_prein_product_detail.* ,io_order.fromCorp,io_order.fromCorpId FROM inv_prein_product_detail | ||||
|         inner join io_order on inv_prein_product_detail.orderIdFk = io_order.id | ||||
|         <where> | ||||
|             <if test="productIdFk != '' and productIdFk != null"> | ||||
|                 AND productIdFk = #{productIdFk} | ||||
|             </if> | ||||
|             <if test="customerId != '' and customerId != null"> | ||||
|                 AND customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="mainAction != '' and mainAction != null"> | ||||
|                 AND inv_prein_product_detail.mainAction = #{mainAction} | ||||
|             </if> | ||||
|             <if test="action != '' and action != null"> | ||||
|                 AND inv_prein_product_detail.action = #{action} | ||||
|             </if> | ||||
|             <if test="count != '' and count != null"> | ||||
|                 AND count = #{count} | ||||
|             </if> | ||||
| 
 | ||||
|             <if test="purchaseType != null"> | ||||
|                 AND purchaseType = #{purchaseType} | ||||
|             </if> | ||||
| 
 | ||||
|             <if test="batchNo != '' and batchNo != null"> | ||||
|                 AND batchNo = #{batchNo} | ||||
|             </if> | ||||
|             <if test="unitFk != '' and unitFk != null"> | ||||
|                 AND unitFk = #{unitFk} | ||||
|             </if> | ||||
|             <if test="supId != '' and supId != null"> | ||||
|                 AND inv_prein_product_detail.supId = #{supId} | ||||
|             </if> | ||||
|             <if test="code != '' and code != null"> | ||||
|                 AND code = #{code} | ||||
|             </if> | ||||
|             <if test="originCode != '' and originCode != null"> | ||||
|                 AND originCode = #{originCode} | ||||
|             </if> | ||||
|             <if test="invStorageCode != '' and invStorageCode != null"> | ||||
|                 AND invStorageCode = #{invStorageCode} | ||||
|             </if> | ||||
|             <if test="invWarehouseCode != '' and invWarehouseCode != null"> | ||||
|                 AND invWarehouseCode = #{invWarehouseCode} | ||||
|             </if> | ||||
|         </where> | ||||
| 
 | ||||
|     </select> | ||||
| 
 | ||||
| 
 | ||||
|     <insert id="insertInvProductDetail" keyProperty="id" | ||||
|             parameterType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity"> | ||||
|         insert INTO inv_prein_product_detail | ||||
|         (code, productIdFk, orderIdFk, customerId, mainAction, action, count, updateTime, | ||||
|          purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId, originCode | ||||
|             , invStorageCode, invWarehouseCode) | ||||
|         values (#{code}, | ||||
|                 #{productIdFk}, #{orderIdFk}, | ||||
|                 #{customerId}, #{mainAction}, #{action}, #{count}, #{updateTime}, | ||||
|                 #{purchaseType}, #{batchNo}, #{productionDate}, #{expireDate}, #{unitFk}, #{stockIdFk} | ||||
|                    , #{supId}, #{originCode}, #{invStorageCode}, #{invWarehouseCode}) | ||||
| 
 | ||||
|     </insert> | ||||
| 
 | ||||
|     <insert id="insertInvProductDetails" keyProperty="id" | ||||
|             parameterType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity"> | ||||
|         insert INTO inv_prein_product_detail | ||||
|         (code, productIdFk, orderIdFk, customerId, mainAction, action, count, updateTime, | ||||
|         purchaseType, batchNo, productionDate, expireDate, unitFk, stockIdFk, supId,originCode | ||||
|         , invStorageCode, invWarehouseCode) | ||||
|         values | ||||
| 
 | ||||
|         <foreach collection="invProductDetailEntitys" item="item" index="index" | ||||
|                  separator=","> | ||||
|             ( | ||||
|             #{item.code}, | ||||
|             #{item.productIdFk},#{item.orderIdFk}, | ||||
|             #{item.customerId},#{item.mainAction},#{item.action},#{item.count},#{item.updateTime}, | ||||
|             #{item.purchaseType}, #{item.batchNo}, #{item.productionDate}, #{item.expireDate}, | ||||
|             #{item.unitFk},#{item.stockIdFk},#{item.supId},#{item.originCode}, #{item.invStorageCode}, | ||||
|             #{item.invWarehouseCode} | ||||
|             ) | ||||
|         </foreach> | ||||
| 
 | ||||
|     </insert> | ||||
| 
 | ||||
| 
 | ||||
|     <delete id="deleteById" parameterType="Map"> | ||||
|         DELETE | ||||
|         FROM inv_prein_product_detail | ||||
|         WHERE id = #{id} | ||||
|     </delete> | ||||
| 
 | ||||
|     <delete id="deleteByProductId" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest"> | ||||
|         DELETE | ||||
|         FROM inv_prein_product_detail | ||||
|         <where> | ||||
|             <if test="productIdFk != '' and productIdFk != null"> | ||||
|                 AND productIdFk = #{productIdFk} | ||||
|             </if> | ||||
|             <if test="batchNo != '' and batchNo != null"> | ||||
|                 AND batchNo = #{batchNo} | ||||
|             </if> | ||||
|             <if test="supId != '' and supId != null"> | ||||
|                 AND supId = #{supId} | ||||
|             </if> | ||||
|         </where> | ||||
| 
 | ||||
|     </delete> | ||||
| 
 | ||||
|     <update id="updateInvProductDetail" parameterType="com.glxp.api.admin.entity.inventory.InvProductDetailEntity"> | ||||
|         UPDATE inv_prein_product_detail | ||||
|         <trim prefix="set" suffixOverrides=","> | ||||
|             <if test="code != null">code=#{code},</if> | ||||
|             <if test="productIdFk != null">productIdFk=#{productIdFk},</if> | ||||
|             <if test="customerId != null">customerId=#{customerId},</if> | ||||
|             <if test="mainAction != null">mainAction=#{mainAction},</if> | ||||
|             <if test="action != null">action=#{action},</if> | ||||
|             <if test="count != null">count=#{count},</if> | ||||
|             <if test="unitFk != null">unitFk=#{unitFk},</if> | ||||
|             <if test="purchaseType != null">purchaseType=#{purchaseType},</if> | ||||
|             <if test="batchNo != null">batchNo=#{batchNo},</if> | ||||
|             <if test="productionDate != null">productionDate=#{productionDate},</if> | ||||
|             <if test="expireDate != null">expireDate=#{expireDate},</if> | ||||
|             <if test="stockIdFk != null">stockIdFk=#{stockIdFk},</if> | ||||
|             <if test="supId != null">supId=#{supId},</if> | ||||
|             <if test="originCode != null">originCode=#{originCode},</if> | ||||
|             <if test="invStorageCode != null">invStorageCode=#{invStorageCode},</if> | ||||
|             <if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if> | ||||
|         </trim> | ||||
|         WHERE id = #{id} | ||||
|     </update> | ||||
|     <select id="statCount" parameterType="com.glxp.api.admin.req.inventory.FilterInvProductDetailRequest" | ||||
|             resultType="java.lang.Integer"> | ||||
|         SELECT count(0) FROM inv_prein_product_detail | ||||
|         <where> | ||||
|             <if test="productIdFk != '' and productIdFk != null"> | ||||
|                 AND productIdFk = #{productIdFk} | ||||
|             </if> | ||||
|             <if test="customerId != '' and customerId != null"> | ||||
|                 AND customerId = #{customerId} | ||||
|             </if> | ||||
|             <if test="mainAction != '' and mainAction != null"> | ||||
|                 AND mainAction = #{mainAction} | ||||
|             </if> | ||||
|             <if test="action != '' and action != null"> | ||||
|                 AND action = #{action} | ||||
|             </if> | ||||
|             <if test="purchaseType != null"> | ||||
|                 AND purchaseType = #{purchaseType} | ||||
|             </if> | ||||
|             <if test="batchNo != '' and batchNo != null"> | ||||
|                 AND batchNo = #{batchNo} | ||||
|             </if> | ||||
|             <if test="unitFk != '' and unitFk != null"> | ||||
|                 AND unitFk = #{unitFk} | ||||
|             </if> | ||||
|             <if test="stockIdFk != '' and stockIdFk != null"> | ||||
|                 AND stockIdFk = #{stockIdFk} | ||||
|             </if> | ||||
|             <if test="supId != '' and supId != null"> | ||||
|                 AND supId = #{supId} | ||||
|             </if> | ||||
|         </where> | ||||
| 
 | ||||
|     </select> | ||||
| </mapper> | ||||
					Loading…
					
					
				
		Reference in New Issue