1.添加寄售库存实体类和查询接口
parent
5d26e2372e
commit
3c9a46b7fe
@ -0,0 +1,106 @@
|
||||
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.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.entity.inv.InvPreProductDetailEntity;
|
||||
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
|
||||
import com.glxp.api.req.inv.FilterInvPreProductRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.res.inv.InvPreProductDetailResponse;
|
||||
import com.glxp.api.res.inv.InvPreProductPageResponse;
|
||||
import com.glxp.api.res.inv.InvPreProductResponse;
|
||||
import com.glxp.api.service.auth.CustomerService;
|
||||
import com.glxp.api.service.auth.WarehouseUserService;
|
||||
import com.glxp.api.service.inv.InvPreProductDetailService;
|
||||
import com.glxp.api.service.inv.InvPreProductService;
|
||||
import com.glxp.api.util.udi.FilterUdiUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 寄售库存接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class InvPreProductController {
|
||||
|
||||
@Resource
|
||||
private InvPreProductService invPreProductService;
|
||||
@Resource
|
||||
private InvPreProductDetailService invPreProductDetailService;
|
||||
@Resource
|
||||
private WarehouseUserService warehouseUserService;
|
||||
@Resource
|
||||
private CustomerService customerService;
|
||||
|
||||
/**
|
||||
* 寄售库存查询接口
|
||||
*
|
||||
* @param filterInvPreProductRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/spms/inv/pre/product/filterList")
|
||||
public BaseResponse filterList(FilterInvPreProductRequest filterInvPreProductRequest) {
|
||||
boolean showSup = false; //前端控制表格显示字段
|
||||
if (StrUtil.isNotBlank(filterInvPreProductRequest.getUdiCode())) {
|
||||
filterInvPreProductRequest.setNameCode(FilterUdiUtils.getDiStr(filterInvPreProductRequest.getUdiCode()));
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(filterInvPreProductRequest.getInvCode())) {
|
||||
List<String> invCodes = warehouseUserService.selectCodeByUser(customerService.getUserIdStr());
|
||||
if (CollUtil.isNotEmpty(invCodes)) {
|
||||
filterInvPreProductRequest.setInvCodes(invCodes);
|
||||
}
|
||||
}
|
||||
|
||||
List<InvPreProductResponse> list = invPreProductService.filterList(filterInvPreProductRequest);
|
||||
PageInfo<InvPreProductResponse> pageInfo = new PageInfo<>(list);
|
||||
InvPreProductPageResponse<InvPreProductResponse> pageResponse = new InvPreProductPageResponse<>();
|
||||
pageResponse.setList(pageInfo.getList());
|
||||
pageResponse.setTotal(pageInfo.getTotal());
|
||||
pageResponse.setShowSup(showSup);
|
||||
return ResultVOUtils.success(pageResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询寄售库存详情
|
||||
*
|
||||
* @param detailRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/spms/inv/pre/product/filterDetail")
|
||||
public BaseResponse filterInvPreProductDetail(FilterInvPreProductDetailRequest detailRequest) {
|
||||
if (StrUtil.isBlank(detailRequest.getBatchNo())) {
|
||||
detailRequest.setBatchNo("empty");
|
||||
}
|
||||
|
||||
List<InvPreProductDetailEntity> invPreProductDetailEntities = invPreProductDetailService.filterPreProductDetailList(detailRequest);
|
||||
PageInfo<InvPreProductDetailEntity> pageInfo = new PageInfo<>(invPreProductDetailEntities);
|
||||
|
||||
List<InvPreProductDetailResponse> list = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(invPreProductDetailEntities)) {
|
||||
invPreProductDetailEntities.forEach(invPreProductDetailEntity -> {
|
||||
InvPreProductDetailResponse response = new InvPreProductDetailResponse();
|
||||
BeanUtil.copyProperties(invPreProductDetailEntity, response);
|
||||
//设置单据类型名称等单据相关参数
|
||||
invPreProductDetailService.setOrderInfo(response);
|
||||
list.add(response);
|
||||
});
|
||||
}
|
||||
|
||||
PageSimpleResponse<InvPreProductDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setList(list);
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.glxp.api.dao.inv;
|
||||
|
||||
import com.glxp.api.dao.BaseMapperPlus;
|
||||
import com.glxp.api.entity.inv.InvPreProductEntity;
|
||||
import com.glxp.api.req.inv.FilterInvPreProductRequest;
|
||||
import com.glxp.api.res.inv.InvPreProductResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 寄售库存Dao
|
||||
*/
|
||||
public interface InvPreProductDao extends BaseMapperPlus<InvPreProductDao, InvPreProductEntity, InvPreProductEntity> {
|
||||
|
||||
/**
|
||||
* 查询寄售库存VO列表
|
||||
*
|
||||
* @param invPreProductRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvPreProductResponse> filterList(FilterInvPreProductRequest invPreProductRequest);
|
||||
|
||||
/**
|
||||
* 查询寄售库存实体列表
|
||||
*
|
||||
* @param invPreProductRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvPreProductEntity> filterPreProductList(FilterInvPreProductRequest invPreProductRequest);
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.glxp.api.dao.inv;
|
||||
|
||||
import com.glxp.api.dao.BaseMapperPlus;
|
||||
import com.glxp.api.entity.inv.InvPreProductDetailEntity;
|
||||
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 寄售库存详情Dao
|
||||
*/
|
||||
public interface InvPreProductDetailDao extends BaseMapperPlus<InvPreProductDetailDao, InvPreProductDetailEntity, InvPreProductDetailEntity> {
|
||||
|
||||
/**
|
||||
* 查询库存详情实体列表
|
||||
*
|
||||
* @param invPreProductDetailRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvPreProductDetailEntity> filterPreProductDetailList(FilterInvPreProductDetailRequest invPreProductDetailRequest);
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
package com.glxp.api.entity.inv;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 寄售库存详情表
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "inv_pre_product_detail")
|
||||
public class InvPreProductDetailEntity {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* UDI码
|
||||
*/
|
||||
@TableField(value = "code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 出入单据类型
|
||||
*/
|
||||
@TableField(value = "mainAction")
|
||||
private String mainAction;
|
||||
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
@TableField(value = "`action`")
|
||||
private String action;
|
||||
|
||||
/**
|
||||
* 订单号外键
|
||||
*/
|
||||
@TableField(value = "orderId")
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 耗材字典ID
|
||||
*/
|
||||
@TableField(value = "relId")
|
||||
private Integer relId;
|
||||
|
||||
/**
|
||||
* 最小销售标识
|
||||
*/
|
||||
@TableField(value = "nameCode")
|
||||
private String nameCode;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@TableField(value = "batchNo")
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
@TableField(value = "produceDate")
|
||||
private String produceDate;
|
||||
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
@TableField(value = "expireDate")
|
||||
private String expireDate;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@TableField(value = "serialNo")
|
||||
private String serialNo;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@TableField(value = "supId")
|
||||
private String supId;
|
||||
|
||||
/**
|
||||
* 扫码数量
|
||||
*/
|
||||
@TableField(value = "`count`")
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
@TableField(value = "reCount")
|
||||
private Integer reCount;
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
@TableField(value = "deptCode")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
@TableField(value = "invCode")
|
||||
private String invCode;
|
||||
|
||||
/**
|
||||
* 货位编码
|
||||
*/
|
||||
@TableField(value = "invSpaceCode")
|
||||
private String invSpaceCode;
|
||||
|
||||
/**
|
||||
* 采购类型
|
||||
*/
|
||||
@TableField(value = "purchaseType")
|
||||
private Byte purchaseType;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "updateTime")
|
||||
private Date updateTime;
|
||||
|
||||
public static final String COL_ID = "id";
|
||||
|
||||
public static final String COL_CODE = "code";
|
||||
|
||||
public static final String COL_MAINACTION = "mainAction";
|
||||
|
||||
public static final String COL_ACTION = "action";
|
||||
|
||||
public static final String COL_ORDERID = "orderId";
|
||||
|
||||
public static final String COL_RELID = "relId";
|
||||
|
||||
public static final String COL_NAMECODE = "nameCode";
|
||||
|
||||
public static final String COL_BATCHNO = "batchNo";
|
||||
|
||||
public static final String COL_PRODUCEDATE = "produceDate";
|
||||
|
||||
public static final String COL_EXPIREDATE = "expireDate";
|
||||
|
||||
public static final String COL_SERIALNO = "serialNo";
|
||||
|
||||
public static final String COL_SUPID = "supId";
|
||||
|
||||
public static final String COL_COUNT = "count";
|
||||
|
||||
public static final String COL_RECOUNT = "reCount";
|
||||
|
||||
public static final String COL_DEPTCODE = "deptCode";
|
||||
|
||||
public static final String COL_INVCODE = "invCode";
|
||||
|
||||
public static final String COL_INVSPACECODE = "invSpaceCode";
|
||||
|
||||
public static final String COL_PURCHASETYPE = "purchaseType";
|
||||
|
||||
public static final String COL_UPDATETIME = "updateTime";
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package com.glxp.api.entity.inv;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 寄售库存表
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "inv_pre_product")
|
||||
public class InvPreProductEntity {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 耗材字典ID
|
||||
*/
|
||||
@TableField(value = "relIdFk")
|
||||
private Long relIdFk;
|
||||
|
||||
/**
|
||||
* 最小销售标识
|
||||
*/
|
||||
@TableField(value = "nameCode")
|
||||
private String nameCode;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@TableField(value = "batchNo")
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
@TableField(value = "productionDate")
|
||||
private String productionDate;
|
||||
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
@TableField(value = "expireDate")
|
||||
private String expireDate;
|
||||
|
||||
/**
|
||||
* 入库数量
|
||||
*/
|
||||
@TableField(value = "inCount")
|
||||
private Integer inCount;
|
||||
|
||||
/**
|
||||
* 出库数量
|
||||
*/
|
||||
@TableField(value = "outCount")
|
||||
private Integer outCount;
|
||||
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
@TableField(value = "reCount")
|
||||
private String reCount;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
@TableField(value = "customerId")
|
||||
private String customerId;
|
||||
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
@TableField(value = "supId")
|
||||
private String supId;
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
@TableField(value = "deptCode")
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
@TableField(value = "invCode")
|
||||
private String invCode;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "createTime")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "updateTime")
|
||||
private Date updateTime;
|
||||
|
||||
public static final String COL_ID = "id";
|
||||
|
||||
public static final String COL_RELIDFK = "relIdFk";
|
||||
|
||||
public static final String COL_NAMECODE = "nameCode";
|
||||
|
||||
public static final String COL_BATCHNO = "batchNo";
|
||||
|
||||
public static final String COL_PRODUCTIONDATE = "productionDate";
|
||||
|
||||
public static final String COL_EXPIREDATE = "expireDate";
|
||||
|
||||
public static final String COL_INCOUNT = "inCount";
|
||||
|
||||
public static final String COL_OUTCOUNT = "outCount";
|
||||
|
||||
public static final String COL_RECOUNT = "reCount";
|
||||
|
||||
public static final String COL_CUSTOMERID = "customerId";
|
||||
|
||||
public static final String COL_SUPID = "supId";
|
||||
|
||||
public static final String COL_DEPTCODE = "deptCode";
|
||||
|
||||
public static final String COL_INVCODE = "invCode";
|
||||
|
||||
public static final String COL_CREATETIME = "createTime";
|
||||
|
||||
public static final String COL_UPDATETIME = "updateTime";
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.glxp.api.req.inv;
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 寄售库存详情查询参数
|
||||
*/
|
||||
@Data
|
||||
public class FilterInvPreProductDetailRequest 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 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 FilterInvPreProductRequest 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,130 @@
|
||||
package com.glxp.api.res.inv;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 寄售库存详情VO
|
||||
*/
|
||||
@Data
|
||||
public class InvPreProductDetailResponse {
|
||||
|
||||
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 Integer purchaseType;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 单据出入库类型
|
||||
*/
|
||||
private String mainAction;
|
||||
|
||||
/**
|
||||
* 单据类型编码
|
||||
*/
|
||||
private String action;
|
||||
|
||||
/**
|
||||
* 单据类型名称
|
||||
*/
|
||||
private String actionName;
|
||||
|
||||
/**
|
||||
* 出入库类型中文字符串
|
||||
*/
|
||||
private String mainActionStr;
|
||||
|
||||
/**
|
||||
* 入库数量
|
||||
*/
|
||||
private Integer inCount;
|
||||
|
||||
/**
|
||||
* 出库数量
|
||||
*/
|
||||
private Integer outCount;
|
||||
|
||||
/**
|
||||
* 单据日期
|
||||
*/
|
||||
private String orderTime;
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.api.res.inv;
|
||||
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 寄售库存查询分页对象
|
||||
*/
|
||||
@Data
|
||||
public class InvPreProductPageResponse<T> extends PageSimpleResponse<T> {
|
||||
|
||||
/**
|
||||
* 前端页面控制字段
|
||||
*/
|
||||
private boolean showSup;
|
||||
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package com.glxp.api.res.inv;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 寄售库存VO
|
||||
*/
|
||||
@Data
|
||||
public class InvPreProductResponse {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 产品标识DI
|
||||
*/
|
||||
private String nameCode;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String cpmctymc;
|
||||
|
||||
/**
|
||||
* 耗材字典ID
|
||||
*/
|
||||
private String relIdFk;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String ggxh;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
private String productionDate;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private String expireDate;
|
||||
|
||||
/**
|
||||
* 生产厂家名称
|
||||
*/
|
||||
private String ylqxzcrbarmc;
|
||||
|
||||
/**
|
||||
* 批准文号
|
||||
*/
|
||||
private String zczbhhzbapzbh;
|
||||
|
||||
/**
|
||||
* 入库数量
|
||||
*/
|
||||
private Integer inCount;
|
||||
|
||||
/**
|
||||
* 出库数量
|
||||
*/
|
||||
private Integer outCount;
|
||||
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private Integer reCount;
|
||||
|
||||
/**
|
||||
* 客户ID
|
||||
*/
|
||||
private String customerId;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supName;
|
||||
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private String supId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String invName;
|
||||
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
private String deptCode;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String invCode;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.glxp.api.service.inv;
|
||||
|
||||
import com.glxp.api.entity.inv.InvPreProductDetailEntity;
|
||||
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
|
||||
import com.glxp.api.res.inv.InvPreProductDetailResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 寄售库存详情Service
|
||||
*/
|
||||
public interface InvPreProductDetailService {
|
||||
|
||||
int insert(InvPreProductDetailEntity invPreProductDetailEntity);
|
||||
|
||||
boolean update(InvPreProductDetailEntity invPreProductDetailEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
/**
|
||||
* 查询寄售库存详情列表
|
||||
*
|
||||
* @param invPreProductDetailRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvPreProductDetailEntity> filterPreProductDetailList(FilterInvPreProductDetailRequest invPreProductDetailRequest);
|
||||
|
||||
/**
|
||||
* 设置单据类型名称等单据相关参数
|
||||
*
|
||||
* @param response
|
||||
*/
|
||||
void setOrderInfo(InvPreProductDetailResponse response);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.glxp.api.service.inv;
|
||||
|
||||
import com.glxp.api.entity.inv.InvPreProductEntity;
|
||||
import com.glxp.api.req.inv.FilterInvPreProductRequest;
|
||||
import com.glxp.api.res.inv.InvPreProductResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 寄售库存Service
|
||||
*/
|
||||
public interface InvPreProductService {
|
||||
|
||||
int insert(InvPreProductEntity invPreProductEntity);
|
||||
|
||||
boolean update(InvPreProductEntity invPreProductEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
/**
|
||||
* 查询寄售库存VO
|
||||
*
|
||||
* @param invPreProductRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvPreProductResponse> filterList(FilterInvPreProductRequest invPreProductRequest);
|
||||
|
||||
/**
|
||||
* 查询寄售库存列表
|
||||
*
|
||||
* @param invPreProductRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvPreProductEntity> filterPreProductList(FilterInvPreProductRequest invPreProductRequest);
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.glxp.api.service.inv.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.constant.ConstantType;
|
||||
import com.glxp.api.dao.basic.BasicBussinessTypeDao;
|
||||
import com.glxp.api.dao.inout.IoOrderDao;
|
||||
import com.glxp.api.dao.inv.InvPreProductDetailDao;
|
||||
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
|
||||
import com.glxp.api.entity.inout.IoOrderEntity;
|
||||
import com.glxp.api.entity.inv.InvPreProductDetailEntity;
|
||||
import com.glxp.api.req.inv.FilterInvPreProductDetailRequest;
|
||||
import com.glxp.api.res.inv.InvPreProductDetailResponse;
|
||||
import com.glxp.api.service.inv.InvPreProductDetailService;
|
||||
import com.glxp.api.util.DateUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class InvPreProductDetailServiceImpl implements InvPreProductDetailService {
|
||||
|
||||
@Resource
|
||||
private InvPreProductDetailDao invPreProductDetailDao;
|
||||
@Resource
|
||||
private BasicBussinessTypeDao bussinessTypeDao;
|
||||
@Resource
|
||||
private IoOrderDao orderDao;
|
||||
|
||||
@Override
|
||||
public int insert(InvPreProductDetailEntity invPreProductDetailEntity) {
|
||||
return invPreProductDetailDao.insert(invPreProductDetailEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(InvPreProductDetailEntity invPreProductDetailEntity) {
|
||||
return invPreProductDetailDao.updateById(invPreProductDetailEntity) == 1 ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return invPreProductDetailDao.deleteById(id) == 1 ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InvPreProductDetailEntity> filterPreProductDetailList(FilterInvPreProductDetailRequest invPreProductDetailRequest) {
|
||||
if (null == invPreProductDetailRequest) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != invPreProductDetailRequest.getPage() && null != invPreProductDetailRequest.getLimit()) {
|
||||
PageHelper.offsetPage((invPreProductDetailRequest.getPage() - 1) * invPreProductDetailRequest.getLimit(), invPreProductDetailRequest.getLimit());
|
||||
}
|
||||
return invPreProductDetailDao.filterPreProductDetailList(invPreProductDetailRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOrderInfo(InvPreProductDetailResponse response) {
|
||||
//设置出入库中文及出入库数量
|
||||
if (response.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
||||
response.setMainActionStr("出库");
|
||||
response.setOutCount(response.getCount());
|
||||
} else {
|
||||
response.setMainActionStr("入库");
|
||||
response.setInCount(response.getCount());
|
||||
}
|
||||
//设置单据类型名称
|
||||
BasicBussinessTypeEntity busType = bussinessTypeDao.selectOne(new QueryWrapper<BasicBussinessTypeEntity>().select("name").eq("action", response.getAction()));
|
||||
response.setActionName(busType.getName());
|
||||
//设置单据日期
|
||||
IoOrderEntity order = orderDao.selectOne(new QueryWrapper<IoOrderEntity>().select("createTime").eq("billNo", response.getOrderId()));
|
||||
response.setOrderTime(DateUtil.toDateStr(order.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.glxp.api.service.inv.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.inv.InvPreProductDao;
|
||||
import com.glxp.api.entity.inv.InvPreProductEntity;
|
||||
import com.glxp.api.req.inv.FilterInvPreProductRequest;
|
||||
import com.glxp.api.res.inv.InvPreProductResponse;
|
||||
import com.glxp.api.service.inv.InvPreProductService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class InvPreProductServiceImpl implements InvPreProductService {
|
||||
|
||||
@Resource
|
||||
private InvPreProductDao invPreProductDao;
|
||||
|
||||
@Override
|
||||
public int insert(InvPreProductEntity invPreProductEntity) {
|
||||
return invPreProductDao.insert(invPreProductEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(InvPreProductEntity invPreProductEntity) {
|
||||
return invPreProductDao.updateById(invPreProductEntity) == 1 ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return invPreProductDao.deleteById(id) == 1 ? true : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InvPreProductResponse> filterList(FilterInvPreProductRequest invPreProductRequest) {
|
||||
if (null == invPreProductRequest) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != invPreProductRequest.getProductionDate() && null != invPreProductRequest.getLimit()) {
|
||||
PageHelper.offsetPage((invPreProductRequest.getPage() - 1) * invPreProductRequest.getLimit(), invPreProductRequest.getLimit());
|
||||
}
|
||||
return invPreProductDao.filterList(invPreProductRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InvPreProductEntity> filterPreProductList(FilterInvPreProductRequest invPreProductRequest) {
|
||||
if (null == invPreProductRequest) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != invPreProductRequest.getProductionDate() && null != invPreProductRequest.getLimit()) {
|
||||
PageHelper.offsetPage((invPreProductRequest.getPage() - 1) * invPreProductRequest.getLimit(), invPreProductRequest.getLimit());
|
||||
}
|
||||
return invPreProductDao.filterPreProductList(invPreProductRequest);
|
||||
}
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
<?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.InvPreProductDao">
|
||||
<select id="filterList" resultType="com.glxp.api.res.inv.InvPreProductResponse">
|
||||
select ipp.id,
|
||||
ipp.nameCode,
|
||||
bp.cpmctymc,
|
||||
ipp.relIdFk,
|
||||
bp.ggxh,
|
||||
ipp.batchNo,
|
||||
ipp.productionDate,
|
||||
ipp.expireDate,
|
||||
bp.ylqxzcrbarmc,
|
||||
bp.zczbhhzbapzbh,
|
||||
ipp.inCount,
|
||||
ipp.outCount,
|
||||
ipp.reCount,
|
||||
ipp.customerId,
|
||||
basic_corp.name supName,
|
||||
ipp.supId,
|
||||
auth_dept.name deptName,
|
||||
auth_warehouse.name invName,
|
||||
ipp.deptCode,
|
||||
ipp.invCode
|
||||
from inv_pre_product ipp
|
||||
inner join basic_udirel on ipp.relIdFk = basic_udirel.id
|
||||
inner join basic_products bp on basic_udirel.uuid = bp.uuid
|
||||
left join basic_corp on ipp.supId = basic_corp.erpId
|
||||
left join auth_dept on auth_dept.code = ipp.deptCode
|
||||
left join auth_warehouse on auth_warehouse.code = ipp.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 ipp.nameCode like concat('%', #{nameCode}, '%')
|
||||
</if>
|
||||
<if test="relIdFk != null and relIdFk != ''">
|
||||
AND ipp.relIdFk = #{relIdFk}
|
||||
</if>
|
||||
<if test="ggxh != null and ggxh != ''">
|
||||
AND bp.ggxh like concat('%', #{ggxh}, '%')
|
||||
</if>
|
||||
<if test="batchNo != null and batchNo != ''">
|
||||
AND ipp.batchNo like concat('%', #{batchNo}, '%')
|
||||
</if>
|
||||
<if test="productionDate != null and productionDate != ''">
|
||||
AND ipp.productionDate = #{productionDate}
|
||||
</if>
|
||||
<if test="expireDate != null and expireDate != ''">
|
||||
AND ipp.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 ipp.customerId = #{customerId}
|
||||
</if>
|
||||
<if test="supId != null and supId != ''">
|
||||
AND ipp.supId = #{supId}
|
||||
</if>
|
||||
<if test="deptCode != null and deptCode != ''">
|
||||
AND ipp.deptCode = #{deptCode}
|
||||
</if>
|
||||
<if test="invCode != null and invCode != ''">
|
||||
AND ipp.invCode = #{invCode}
|
||||
</if>
|
||||
<if test="invCodes != null and invCodes.size() != 0">
|
||||
AND ipp.invCode in
|
||||
<foreach collection="invCodes" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="filterPreProductList" resultType="com.glxp.api.entity.inv.InvPreProductEntity">
|
||||
select ipp.*
|
||||
from inv_pre_product ipp
|
||||
inner join basic_udirel on ipp.relIdFk = basic_udirel.id
|
||||
inner join basic_products bp on basic_udirel.uuid = bp.uuid
|
||||
left join basic_corp on ipp.supId = basic_corp.erpId
|
||||
left join auth_dept on auth_dept.code = ipp.deptCode
|
||||
left join auth_warehouse on auth_warehouse.code = ipp.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 ipp.nameCode like concat('%', #{nameCode}, '%')
|
||||
</if>
|
||||
<if test="relIdFk != null and relIdFk != ''">
|
||||
AND ipp.relIdFk = #{relIdFk}
|
||||
</if>
|
||||
<if test="ggxh != null and ggxh != ''">
|
||||
AND bp.ggxh like concat('%', #{ggxh}, '%')
|
||||
</if>
|
||||
<if test="batchNo != null and batchNo != ''">
|
||||
AND ipp.batchNo like concat('%', #{batchNo}, '%')
|
||||
</if>
|
||||
<if test="productionDate != null and productionDate != ''">
|
||||
AND ipp.productionDate = #{productionDate}
|
||||
</if>
|
||||
<if test="expireDate != null and expireDate != ''">
|
||||
AND ipp.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 ipp.customerId = #{customerId}
|
||||
</if>
|
||||
<if test="supId != null and supId != ''">
|
||||
AND ipp.supId = #{supId}
|
||||
</if>
|
||||
<if test="deptCode != null and deptCode != ''">
|
||||
AND ipp.deptCode = #{deptCode}
|
||||
</if>
|
||||
<if test="invCode != null and invCode != ''">
|
||||
AND ipp.invCode = #{invCode}
|
||||
</if>
|
||||
<if test="invCodes != null and invCodes.size() != 0">
|
||||
AND ipp.invCode in
|
||||
<foreach collection="invCodes" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,56 @@
|
||||
<?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.InvPreProductDetailDao">
|
||||
|
||||
<select id="filterPreProductDetailList" resultType="com.glxp.api.entity.inv.InvPreProductDetailEntity">
|
||||
select *
|
||||
from inv_pre_product_detail
|
||||
<where>
|
||||
<if test="code != null and code != ''">
|
||||
AND code = #{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="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>
|
||||
</mapper>
|
Loading…
Reference in New Issue