1.添加库存查询相关接口
							parent
							
								
									99dc7ea920
								
							
						
					
					
						commit
						acb39129e9
					
				| @ -0,0 +1,151 @@ | |||||||
|  | package com.glxp.api.controller.inv; | ||||||
|  | 
 | ||||||
|  | import cn.hutool.core.bean.BeanUtil; | ||||||
|  | import cn.hutool.core.collection.CollUtil; | ||||||
|  | import cn.hutool.core.util.StrUtil; | ||||||
|  | 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.constant.ConstantType; | ||||||
|  | import com.glxp.api.entity.inv.InvProductDetailEntity; | ||||||
|  | import com.glxp.api.entity.inv.InvProductEntity; | ||||||
|  | import com.glxp.api.req.inv.FilterInvProductDetailRequest; | ||||||
|  | import com.glxp.api.req.inv.FilterInvProductRequest; | ||||||
|  | import com.glxp.api.req.system.DeleteRequest; | ||||||
|  | import com.glxp.api.res.PageSimpleResponse; | ||||||
|  | import com.glxp.api.res.inv.InvProductDetailResponse; | ||||||
|  | import com.glxp.api.res.inv.InvProductPageResponse; | ||||||
|  | import com.glxp.api.res.inv.InvProductResponse; | ||||||
|  | import com.glxp.api.service.auth.CustomerService; | ||||||
|  | import com.glxp.api.service.auth.WarehouseUserService; | ||||||
|  | import com.glxp.api.service.inv.InvProductDetailService; | ||||||
|  | import com.glxp.api.service.inv.InvProductService; | ||||||
|  | import com.glxp.api.util.udi.FilterUdiUtils; | ||||||
|  | import lombok.extern.slf4j.Slf4j; | ||||||
|  | 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; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 库存查询接口 | ||||||
|  |  */ | ||||||
|  | @Slf4j | ||||||
|  | @RestController | ||||||
|  | public class InvProductController { | ||||||
|  | 
 | ||||||
|  |     @Resource | ||||||
|  |     private InvProductService invProductService; | ||||||
|  |     @Resource | ||||||
|  |     private InvProductDetailService invProductDetailService; | ||||||
|  |     @Resource | ||||||
|  |     private WarehouseUserService warehouseUserService; | ||||||
|  |     @Resource | ||||||
|  |     private CustomerService customerService; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 库存列表查询接口 | ||||||
|  |      * | ||||||
|  |      * @param filterInvProductRequest | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     @GetMapping("/spms/inv/product/filter") | ||||||
|  |     public BaseResponse filterList(FilterInvProductRequest filterInvProductRequest) { | ||||||
|  |         boolean showSup = false;  //前端控制表格显示列字段
 | ||||||
|  |         if (StrUtil.isNotBlank(filterInvProductRequest.getUdiCode())) { | ||||||
|  |             filterInvProductRequest.setNameCode(FilterUdiUtils.getDiStr(filterInvProductRequest.getUdiCode())); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if (StrUtil.isBlank(filterInvProductRequest.getInvCode())) { | ||||||
|  |             List<String> invCodes = warehouseUserService.selectCodeByUser(customerService.getUserIdStr()); | ||||||
|  |             if (CollUtil.isNotEmpty(invCodes)) { | ||||||
|  |                 filterInvProductRequest.setInvCodes(invCodes); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         List<InvProductResponse> list = invProductService.filterList(filterInvProductRequest); | ||||||
|  |         PageInfo<InvProductResponse> pageInfo = new PageInfo<>(list); | ||||||
|  |         InvProductPageResponse<InvProductResponse> pageResponse = new InvProductPageResponse(); | ||||||
|  |         pageResponse.setList(pageInfo.getList()); | ||||||
|  |         pageResponse.setTotal(pageResponse.getTotal()); | ||||||
|  |         pageResponse.setShowSup(showSup); | ||||||
|  |         return ResultVOUtils.success(pageResponse); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询库存详情 | ||||||
|  |      * | ||||||
|  |      * @param filterInvProductDetailRequest | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     @GetMapping("/spms/inv/product/filterDetail") | ||||||
|  |     public BaseResponse filterInvProductDetail(FilterInvProductDetailRequest filterInvProductDetailRequest) { | ||||||
|  |         if (StrUtil.isBlank(filterInvProductDetailRequest.getBatchNo())) { | ||||||
|  |             filterInvProductDetailRequest.setBatchNo("empty"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.filterInvProductDetailList(filterInvProductDetailRequest); | ||||||
|  |         PageInfo<InvProductDetailEntity> pageInfo = new PageInfo<>(invProductDetailEntities); | ||||||
|  | 
 | ||||||
|  |         List<InvProductDetailResponse> list = new ArrayList<>(); | ||||||
|  |         if (CollUtil.isNotEmpty(invProductDetailEntities)) { | ||||||
|  |             invProductDetailEntities.forEach(invProductDetailEntity -> { | ||||||
|  |                 InvProductDetailResponse response = new InvProductDetailResponse(); | ||||||
|  |                 BeanUtil.copyProperties(invProductDetailEntity, response); | ||||||
|  |                 if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { | ||||||
|  |                     response.setMainActionStr("出库"); | ||||||
|  |                     response.setOutCount(invProductDetailEntity.getCount()); | ||||||
|  |                 } else { | ||||||
|  |                     response.setMainActionStr("入库"); | ||||||
|  |                     response.setInCount(invProductDetailEntity.getCount()); | ||||||
|  |                 } | ||||||
|  |                 list.add(response); | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         PageSimpleResponse<InvProductDetailResponse> pageSimpleResponse = new PageSimpleResponse<>(); | ||||||
|  |         pageSimpleResponse.setTotal(pageInfo.getTotal()); | ||||||
|  |         pageSimpleResponse.setList(list); | ||||||
|  |         return ResultVOUtils.success(pageSimpleResponse); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 删除库存 | ||||||
|  |      * | ||||||
|  |      * @param deleteRequest | ||||||
|  |      * @param bindingResult | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     @PostMapping("/spms/inv/product/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.findById(deleteRequest.getId()); | ||||||
|  |         if (null != invProductEntity) { | ||||||
|  |             FilterInvProductDetailRequest detailRequest = new FilterInvProductDetailRequest(); | ||||||
|  |             detailRequest.setSupId(invProductEntity.getSupId()); | ||||||
|  |             detailRequest.setRelId(String.valueOf(invProductEntity.getRelIdFk())); | ||||||
|  |             detailRequest.setInvCode(invProductEntity.getInvCode()); | ||||||
|  |             if (StrUtil.isBlank(invProductEntity.getBatchNo())) { | ||||||
|  |                 detailRequest.setBatchNo("empty"); | ||||||
|  |             } else { | ||||||
|  |                 detailRequest.setBatchNo(invProductEntity.getBatchNo()); | ||||||
|  |             } | ||||||
|  |             invProductService.deleteById(id); | ||||||
|  |             invProductDetailService.deleteInvProductDetail(detailRequest); | ||||||
|  |             return ResultVOUtils.success("删除成功"); | ||||||
|  |         } else { | ||||||
|  |             return ResultVOUtils.error(500, "删除失败"); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -1,10 +1,21 @@ | |||||||
| package com.glxp.api.dao.inv; | package com.glxp.api.dao.inv; | ||||||
| 
 | 
 | ||||||
| import com.glxp.api.dao.BaseMapperPlus; | import com.glxp.api.dao.BaseMapperPlus; | ||||||
| import com.glxp.api.entity.inv.InvPreinDetailEntity; |  | ||||||
| import com.glxp.api.entity.inv.InvProductEntity; | import com.glxp.api.entity.inv.InvProductEntity; | ||||||
|  | import com.glxp.api.req.inv.FilterInvProductRequest; | ||||||
|  | import com.glxp.api.res.inv.InvProductResponse; | ||||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||||
| 
 | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
| @Mapper | @Mapper | ||||||
| public interface InvProductDao extends BaseMapperPlus<InvProductDao, InvProductEntity, InvProductEntity> { | public interface InvProductDao extends BaseMapperPlus<InvProductDao, InvProductEntity, InvProductEntity> { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询库存列表 | ||||||
|  |      * | ||||||
|  |      * @param filterInvProductRequest | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     List<InvProductResponse> filterList(FilterInvProductRequest filterInvProductRequest); | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,10 +1,22 @@ | |||||||
| package com.glxp.api.dao.inv; | package com.glxp.api.dao.inv; | ||||||
| 
 | 
 | ||||||
| import com.glxp.api.dao.BaseMapperPlus; | import com.glxp.api.dao.BaseMapperPlus; | ||||||
| import com.glxp.api.entity.inv.InvPreinDetailEntity; |  | ||||||
| import com.glxp.api.entity.inv.InvProductDetailEntity; | import com.glxp.api.entity.inv.InvProductDetailEntity; | ||||||
|  | import com.glxp.api.req.inv.FilterInvProductDetailRequest; | ||||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||||
| 
 | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
| @Mapper | @Mapper | ||||||
| public interface InvProductDetailDao extends BaseMapperPlus<InvProductDetailDao, InvProductDetailEntity, InvProductDetailEntity> { | public interface InvProductDetailDao extends BaseMapperPlus<InvProductDetailDao, InvProductDetailEntity, InvProductDetailEntity> { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 查询库存详情列表 | ||||||
|  |      * | ||||||
|  |      * @param filterInvProductDetailRequest | ||||||
|  |      * @return | ||||||
|  |      */ | ||||||
|  |     List<InvProductDetailEntity> filterInvProductDetailList(FilterInvProductDetailRequest filterInvProductDetailRequest); | ||||||
|  | 
 | ||||||
|  |     boolean deleteInvProductDetail(FilterInvProductDetailRequest detailRequest); | ||||||
| } | } | ||||||
|  | |||||||
| @ -0,0 +1,83 @@ | |||||||
|  | package com.glxp.api.req.inv; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.util.page.ListPageRequest; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 库存详情查询参数 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class FilterInvProductDetailRequest extends ListPageRequest { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * UDI码 | ||||||
|  |      */ | ||||||
|  |     private String code; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 出入库单据类型 | ||||||
|  |      */ | ||||||
|  |     private String mainAction; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 单据类型 | ||||||
|  |      */ | ||||||
|  |     private String action; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 供应商ID | ||||||
|  |      */ | ||||||
|  |     private String supId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 耗材字典ID | ||||||
|  |      */ | ||||||
|  |     private String relId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 最小销售标识 | ||||||
|  |      */ | ||||||
|  |     private String nameCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 单据号 | ||||||
|  |      */ | ||||||
|  |     private String orderId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 部门编码 | ||||||
|  |      */ | ||||||
|  |     private String deptCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库编码 | ||||||
|  |      */ | ||||||
|  |     private String invCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 货位编码 | ||||||
|  |      */ | ||||||
|  |     private String invSpaceCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 原始编码 | ||||||
|  |      */ | ||||||
|  |     private String originCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 批次号 | ||||||
|  |      */ | ||||||
|  |     private String batchNo; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 产品ID集合 | ||||||
|  |      */ | ||||||
|  |     private List<String> productIdList; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 更新时间 | ||||||
|  |      */ | ||||||
|  |     private String updateTime; | ||||||
|  | } | ||||||
| @ -0,0 +1,101 @@ | |||||||
|  | package com.glxp.api.req.inv; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.util.page.ListPageRequest; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.List; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 库存查询参数 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class FilterInvProductRequest extends ListPageRequest { | ||||||
|  | 
 | ||||||
|  |     private String id; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 产品名称 | ||||||
|  |      */ | ||||||
|  |     private String cpmctymc; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 产品标识DI | ||||||
|  |      */ | ||||||
|  |     private String nameCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * UDI码 | ||||||
|  |      */ | ||||||
|  |     private String udiCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 耗材字典ID | ||||||
|  |      */ | ||||||
|  |     private String relIdFk; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 规格型号 | ||||||
|  |      */ | ||||||
|  |     private String ggxh; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 批次号 | ||||||
|  |      */ | ||||||
|  |     private String batchNo; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 生产日期 | ||||||
|  |      */ | ||||||
|  |     private String productionDate; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 失效日期 | ||||||
|  |      */ | ||||||
|  |     private String expireDate; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 生产厂家 | ||||||
|  |      */ | ||||||
|  |     private String ylqxzcrbarmc; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 批准文号 | ||||||
|  |      */ | ||||||
|  |     private String zczbhhzbapzbh; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 客户ID | ||||||
|  |      */ | ||||||
|  |     private String customerId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 供应商ID | ||||||
|  |      */ | ||||||
|  |     private String supId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 供应商名称 | ||||||
|  |      */ | ||||||
|  |     private String supName; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 部门编码 | ||||||
|  |      */ | ||||||
|  |     private String deptCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库编码 | ||||||
|  |      */ | ||||||
|  |     private String invCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库数组 | ||||||
|  |      */ | ||||||
|  |     private List<String> invCodes; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 产品类别 | ||||||
|  |      */ | ||||||
|  |     private String cplb; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,124 @@ | |||||||
|  | package com.glxp.api.res.inv; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | import java.util.Date; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 库存详情数据VO | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class InvProductDetailResponse { | ||||||
|  | 
 | ||||||
|  |     private Integer id; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * UDI码 | ||||||
|  |      */ | ||||||
|  |     private String code; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 订单号外键 | ||||||
|  |      */ | ||||||
|  |     private String orderId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 耗材字典ID | ||||||
|  |      */ | ||||||
|  |     private Long relId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 最小销售标识 | ||||||
|  |      */ | ||||||
|  |     private String nameCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 批次号 | ||||||
|  |      */ | ||||||
|  |     private String batchNo; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 生产日期 | ||||||
|  |      */ | ||||||
|  |     private String produceDate; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 失效日期 | ||||||
|  |      */ | ||||||
|  |     private String expireDate; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 序列号 | ||||||
|  |      */ | ||||||
|  |     private String serialNo; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 供应商 | ||||||
|  |      */ | ||||||
|  |     private String supId; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 扫码数量 | ||||||
|  |      */ | ||||||
|  |     private Integer count; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 实际数量 | ||||||
|  |      */ | ||||||
|  |     private Integer reCount; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 部门编码 | ||||||
|  |      */ | ||||||
|  |     private String deptCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 仓库编码 | ||||||
|  |      */ | ||||||
|  |     private String invCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 货位编码 | ||||||
|  |      */ | ||||||
|  |     private String invSpaceCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 原始编码 | ||||||
|  |      */ | ||||||
|  |     private String originCode; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 采购类型 | ||||||
|  |      */ | ||||||
|  |     private Integer purchaseType; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 更新时间 | ||||||
|  |      */ | ||||||
|  |     private Date updateTime; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 单据出入库类型 | ||||||
|  |      */ | ||||||
|  |     private String mainAction; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 单据类型编码 | ||||||
|  |      */ | ||||||
|  |     private String action; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 出入库类型中文字符串 | ||||||
|  |      */ | ||||||
|  |     private String mainActionStr; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 入库数量 | ||||||
|  |      */ | ||||||
|  |     private Integer inCount; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 出库数量 | ||||||
|  |      */ | ||||||
|  |     private Integer outCount; | ||||||
|  | } | ||||||
| @ -0,0 +1,17 @@ | |||||||
|  | package com.glxp.api.res.inv; | ||||||
|  | 
 | ||||||
|  | import com.glxp.api.res.PageSimpleResponse; | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 库存查询分页对象 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class InvProductPageResponse<T> extends PageSimpleResponse<T> { | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * 前端页面控制字段 | ||||||
|  |      */ | ||||||
|  |     private boolean showSup; | ||||||
|  | 
 | ||||||
|  | } | ||||||
| @ -0,0 +1,10 @@ | |||||||
|  | package com.glxp.api.res.inv; | ||||||
|  | 
 | ||||||
|  | import lombok.Data; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 库存数据VO | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class InvProductResponse { | ||||||
|  | } | ||||||
| @ -0,0 +1,83 @@ | |||||||
|  | <?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.dao.inv.InvProductDao"> | ||||||
|  |     <select id="filterList" resultType="com.glxp.api.res.inv.InvProductResponse" | ||||||
|  |             parameterType="com.glxp.api.req.inv.FilterInvProductRequest"> | ||||||
|  |         select ip.id, | ||||||
|  |                ip.nameCode, | ||||||
|  |                bp.cpmctymc, | ||||||
|  |                ip.relIdFk, | ||||||
|  |                bp.ggxh, | ||||||
|  |                ip.batchNo, | ||||||
|  |                ip.productionDate, | ||||||
|  |                ip.expireDate, | ||||||
|  |                bp.ylqxzcrbarmc, | ||||||
|  |                bp.zczbhhzbapzbh, | ||||||
|  |                ip.inCount, | ||||||
|  |                ip.outCount, | ||||||
|  |                ip.reCount, | ||||||
|  |                ip.customerId, | ||||||
|  |                basic_corp.name     supName, | ||||||
|  |                ip.supId, | ||||||
|  |                auth_dept.name      deptName, | ||||||
|  |                auth_warehouse.name invName, | ||||||
|  |                ip.deptCode, | ||||||
|  |                ip.invCode | ||||||
|  |         from inv_product ip | ||||||
|  |                  inner join basic_udirel on ip.relIdFk = basic_udirel.id | ||||||
|  |                  inner join basic_products bp on basic_udirel.uuid = bp.uuid | ||||||
|  |                  left join basic_corp on ip.supId = basic_corp.erpId | ||||||
|  |                  left join auth_dept on auth_dept.code = ip.deptCode | ||||||
|  |                  left join auth_warehouse on auth_warehouse.code = ip.invCode | ||||||
|  |         <where> | ||||||
|  |             bp.diType = 1 | ||||||
|  |             <if test="cpmctymc != null and cpmctymc != ''"> | ||||||
|  |                 AND bp.cpmctymc like concat('%', #{cpmctymc}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="nameCode != null and nameCode != ''"> | ||||||
|  |                 AND ip.nameCode like concat('%', #{nameCode}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="relIdFk != null and relIdFk != ''"> | ||||||
|  |                 AND ip.relIdFk = #{relIdFk} | ||||||
|  |             </if> | ||||||
|  |             <if test="ggxh != null and ggxh != ''"> | ||||||
|  |                 AND bp.ggxh like concat('%', #{ggxh}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="batchNo != null and batchNo != ''"> | ||||||
|  |                 AND ip.batchNo like concat('%', #{batchNo}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="productionDate != null and productionDate != ''"> | ||||||
|  |                 AND ip.productionDate = #{productionDate} | ||||||
|  |             </if> | ||||||
|  |             <if test="expireDate != null and expireDate != ''"> | ||||||
|  |                 AND ip.expireDate = #{expireDate} | ||||||
|  |             </if> | ||||||
|  |             <if test="ylqxzcrbarmc != null and ylqxzcrbarmc != ''"> | ||||||
|  |                 AND bp.ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''"> | ||||||
|  |                 AND bp.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="customerId != null and customerId != ''"> | ||||||
|  |                 AND ip.customerId = #{customerId} | ||||||
|  |             </if> | ||||||
|  |             <if test="supId != null and supId != ''"> | ||||||
|  |                 AND ip.supId = #{supId} | ||||||
|  |             </if> | ||||||
|  |             <if test="deptCode != null and deptCode != ''"> | ||||||
|  |                 AND ip.deptCode = #{deptCode} | ||||||
|  |             </if> | ||||||
|  |             <if test="invCode != null and invCode != ''"> | ||||||
|  |                 AND ip.invCode = #{invCode} | ||||||
|  |             </if> | ||||||
|  |             <if test="invCodes != null and invCodes.size() != 0"> | ||||||
|  |                 AND ip.invCode in | ||||||
|  |                 <foreach collection="invCodes" item="item" index="index" open="(" close=")" separator=","> | ||||||
|  |                     #{item} | ||||||
|  |                 </foreach> | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |     </select> | ||||||
|  | </mapper> | ||||||
| @ -0,0 +1,83 @@ | |||||||
|  | <?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.dao.inv.InvProductDetailDao"> | ||||||
|  |     <select id="filterInvProductDetailList" resultType="com.glxp.api.entity.inv.InvProductDetailEntity" | ||||||
|  |             parameterType="com.glxp.api.req.inv.FilterInvProductDetailRequest"> | ||||||
|  |         select * | ||||||
|  |         from inv_product_detail | ||||||
|  |         <where> | ||||||
|  |             <if test="code != null and code != ''"> | ||||||
|  |                 AND originCode = #{code} | ||||||
|  |             </if> | ||||||
|  |             <if test="mainAction != null and mainAction != ''"> | ||||||
|  |                 AND mainAction = #{mainAction} | ||||||
|  |             </if> | ||||||
|  |             <if test="action != null and action != ''"> | ||||||
|  |                 AND action = #{action} | ||||||
|  |             </if> | ||||||
|  |             <if test="supId != null and supId != ''"> | ||||||
|  |                 and supId = #{supId} | ||||||
|  |             </if> | ||||||
|  |             <if test="relId != null and relId != ''"> | ||||||
|  |                 AND relId = #{relId} | ||||||
|  |             </if> | ||||||
|  |             <if test="nameCode != null and nameCode != ''"> | ||||||
|  |                 AND nameCode like concat('%', #{nameCode}, '%') | ||||||
|  |             </if> | ||||||
|  |             <if test="orderId != null and orderId != ''"> | ||||||
|  |                 AND orderId = #{orderId} | ||||||
|  |             </if> | ||||||
|  |             <if test="deptCode != null and deptCode != ''"> | ||||||
|  |                 AND deptCode = #{deptCode} | ||||||
|  |             </if> | ||||||
|  |             <if test="invCode != null and invCode != ''"> | ||||||
|  |                 AND invCode = #{invCode} | ||||||
|  |             </if> | ||||||
|  |             <if test="invSpaceCode != null and invSpaceCode != ''"> | ||||||
|  |                 AND invSpaceCode = #{invSpaceCode} | ||||||
|  |             </if> | ||||||
|  |             <if test="originCode != null and originCode != ''"> | ||||||
|  |                 AND originCode = #{originCode} | ||||||
|  |             </if> | ||||||
|  |             <if test="batchNo != null and batchNo != ''"> | ||||||
|  |                 AND batchNo = #{batchNo} | ||||||
|  |             </if> | ||||||
|  |             <if test="batchNo == 'empty'"> | ||||||
|  |                 AND batchNo is null | ||||||
|  |             </if> | ||||||
|  |             <if test="productIdList != null and productIdList.size() != 0"> | ||||||
|  |                 AND relId in | ||||||
|  |                 <foreach collection="productIdList" item="item" index="index" open="(" close=")" separator=","> | ||||||
|  |                     #{item} | ||||||
|  |                 </foreach> | ||||||
|  |             </if> | ||||||
|  |             <if test="updateTime != null and updateTime != ''"> | ||||||
|  |                 AND updateTime <![CDATA[ <= ]]> #{updateTime} | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |     </select> | ||||||
|  | 
 | ||||||
|  |     <delete id="deleteInvProductDetail"> | ||||||
|  |         delete | ||||||
|  |         from inv_product_detail | ||||||
|  |         <where> | ||||||
|  |             <if test="relId != null and relId != ''"> | ||||||
|  |                 AND relId = #{relId} | ||||||
|  |             </if> | ||||||
|  |             <if test="batchNo != null and batchNo != '' and batchNo != 'empty'"> | ||||||
|  |                 AND batchNo = #{batchNo} | ||||||
|  |             </if> | ||||||
|  |             <if test="batchNo == 'empty'"> | ||||||
|  |                 AND batchNo is null | ||||||
|  |             </if> | ||||||
|  |             <if test="supId != null and supId != ''"> | ||||||
|  |                 AND supId = #{supId} | ||||||
|  |             </if> | ||||||
|  |             <if test="invCode != null and invCode != ''"> | ||||||
|  |                 AND invCode = #{invCode} | ||||||
|  |             </if> | ||||||
|  |         </where> | ||||||
|  |     </delete> | ||||||
|  | </mapper> | ||||||
					Loading…
					
					
				
		Reference in New Issue