Merge branch 'dev' into test

dev
郑明梁 2 years ago
commit ab2bdfafbd

@ -44,7 +44,7 @@ public interface InvPreInProductDetailDao extends BaseMapperPlus<InvPreInProduct
List<IoOrderResponse> getInvPlaceOrderList(FilterInvPlaceRequest filterInvPlaceRequest); List<IoOrderResponse> getInvPlaceOrderList(FilterInvPlaceRequest filterInvPlaceRequest);
Integer getInventoryQuantity(@Param("code") String code); Integer getInventoryQuantity(@Param("code") String code,@Param("invCode") String invCode);
//用货架查询 //用货架查询
List<InvPlaceDetailResponse> filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest); List<InvPlaceDetailResponse> filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest);

@ -44,7 +44,7 @@ public interface InvPreProductDetailDao extends BaseMapperPlus<InvPreProductDeta
List<IoOrderResponse> getInvPlaceOrderList(FilterInvPlaceRequest filterInvPlaceRequest); List<IoOrderResponse> getInvPlaceOrderList(FilterInvPlaceRequest filterInvPlaceRequest);
Integer getInventoryQuantity(@Param("code") String code); Integer getInventoryQuantity(@Param("code") String code,@Param("invCode") String invCode);
//用货架查询 //用货架查询
List<InvPlaceDetailResponse> filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest); List<InvPlaceDetailResponse> filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest);

@ -97,7 +97,7 @@ public interface InvProductDetailDao extends BaseMapperPlus<InvProductDetailDao,
*/ */
List<IoOrderResponse> getInvPlaceOrderList(FilterInvPlaceRequest filterInvPlaceRequest); List<IoOrderResponse> getInvPlaceOrderList(FilterInvPlaceRequest filterInvPlaceRequest);
Integer getInventoryQuantity(@Param("code") String code); Integer getInventoryQuantity(@Param("code") String code,@Param("invCode") String invCode);
//用货架查询 //用货架查询
List<InvPlaceDetailResponse> filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest); List<InvPlaceDetailResponse> filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest);

@ -34,6 +34,10 @@ public class ExcelVO {
@ApiModelProperty(value = "批次号") @ApiModelProperty(value = "批次号")
private String batchNo; private String batchNo;
@ExcelProperty("仓库")
@ApiModelProperty(value = "仓库")
private String deptName;
@ExcelProperty({"期初","数量"}) @ExcelProperty({"期初","数量"})
@ApiModelProperty(value = "数量") @ApiModelProperty(value = "数量")
private Integer beginCount; private Integer beginCount;
@ -83,6 +87,8 @@ public class ExcelVO {
@ApiModelProperty(value = "金额") @ApiModelProperty(value = "金额")
private BigDecimal balanceAmount; private BigDecimal balanceAmount;
//无需导出字段使用此注解 //无需导出字段使用此注解
//@JsonSerialize(using = ToStringSerializer.class) //@JsonSerialize(using = ToStringSerializer.class)

@ -196,6 +196,7 @@ public class ExcelServiceImpl implements ExcelService {
vo.setId(i+1); vo.setId(i+1);
vo.setProductName(ioStatDayEntities.get(i).getProductName()); vo.setProductName(ioStatDayEntities.get(i).getProductName());
vo.setGgxh(ioStatDayEntities.get(i).getGgxh()); vo.setGgxh(ioStatDayEntities.get(i).getGgxh());
vo.setDeptName(ioStatDayEntities.get(i).getDeptName());
vo.setBatchNo(ioStatDayEntities.get(i).getBatchNo()); vo.setBatchNo(ioStatDayEntities.get(i).getBatchNo());
vo.setBeginCount(ioStatDayEntities.get(i).getBeginCount()); vo.setBeginCount(ioStatDayEntities.get(i).getBeginCount());
vo.setBeginPrice(ioStatDayEntities.get(i).getBeginPrice()); vo.setBeginPrice(ioStatDayEntities.get(i).getBeginPrice());
@ -219,6 +220,7 @@ public class ExcelServiceImpl implements ExcelService {
vo.setProductName(ioStatMonthEntities.get(i).getProductName()); vo.setProductName(ioStatMonthEntities.get(i).getProductName());
vo.setGgxh(ioStatMonthEntities.get(i).getGgxh()); vo.setGgxh(ioStatMonthEntities.get(i).getGgxh());
vo.setBatchNo(ioStatMonthEntities.get(i).getBatchNo()); vo.setBatchNo(ioStatMonthEntities.get(i).getBatchNo());
vo.setDeptName(ioStatMonthEntities.get(i).getDeptName());
vo.setBeginCount(ioStatMonthEntities.get(i).getBeginCount()); vo.setBeginCount(ioStatMonthEntities.get(i).getBeginCount());
vo.setBeginPrice(ioStatMonthEntities.get(i).getBeginPrice()); vo.setBeginPrice(ioStatMonthEntities.get(i).getBeginPrice());
vo.setBeginAmount(ioStatMonthEntities.get(i).getBeginAmount()); vo.setBeginAmount(ioStatMonthEntities.get(i).getBeginAmount());
@ -241,6 +243,7 @@ public class ExcelServiceImpl implements ExcelService {
vo.setProductName(ioStatQuarterEntities.get(i).getProductName()); vo.setProductName(ioStatQuarterEntities.get(i).getProductName());
vo.setGgxh(ioStatQuarterEntities.get(i).getGgxh()); vo.setGgxh(ioStatQuarterEntities.get(i).getGgxh());
vo.setBatchNo(ioStatQuarterEntities.get(i).getBatchNo()); vo.setBatchNo(ioStatQuarterEntities.get(i).getBatchNo());
vo.setDeptName(ioStatQuarterEntities.get(i).getDeptName());
vo.setBeginCount(ioStatQuarterEntities.get(i).getBeginCount()); vo.setBeginCount(ioStatQuarterEntities.get(i).getBeginCount());
vo.setBeginPrice(ioStatQuarterEntities.get(i).getBeginPrice()); vo.setBeginPrice(ioStatQuarterEntities.get(i).getBeginPrice());
vo.setBeginAmount(ioStatQuarterEntities.get(i).getBeginAmount()); vo.setBeginAmount(ioStatQuarterEntities.get(i).getBeginAmount());
@ -263,6 +266,7 @@ public class ExcelServiceImpl implements ExcelService {
vo.setProductName(ioStatYearEntities.get(i).getProductName()); vo.setProductName(ioStatYearEntities.get(i).getProductName());
vo.setGgxh(ioStatYearEntities.get(i).getGgxh()); vo.setGgxh(ioStatYearEntities.get(i).getGgxh());
vo.setBatchNo(ioStatYearEntities.get(i).getBatchNo()); vo.setBatchNo(ioStatYearEntities.get(i).getBatchNo());
vo.setDeptName(ioStatYearEntities.get(i).getDeptName());
vo.setBeginCount(ioStatYearEntities.get(i).getBeginCount()); vo.setBeginCount(ioStatYearEntities.get(i).getBeginCount());
vo.setBeginPrice(ioStatYearEntities.get(i).getBeginPrice()); vo.setBeginPrice(ioStatYearEntities.get(i).getBeginPrice());
vo.setBeginAmount(ioStatYearEntities.get(i).getBeginAmount()); vo.setBeginAmount(ioStatYearEntities.get(i).getBeginAmount());

@ -139,7 +139,8 @@ public class IoStatQuarterServiceImpl implements IoStatQuarterService {
String orderNo = gennerOrderUtils.createStatOrderNo(orderNoTypeBean); String orderNo = gennerOrderUtils.createStatOrderNo(orderNoTypeBean);
statOrderEntity.setRecordKey(orderNo); statOrderEntity.setRecordKey(orderNo);
statOrderEntity.setType(2); statOrderEntity.setType(2);
statOrderEntity.setDate(yesterday); DateTime dateTime=DateUtil.offsetDay(yesterday,+1);
statOrderEntity.setDate(dateTime);
statOrderEntity.setTitle(yesterday.year() + " 年 " + yesterday.quarter() + " 季度出入库汇总"); statOrderEntity.setTitle(yesterday.year() + " 年 " + yesterday.quarter() + " 季度出入库汇总");
Date updateTime = new Date(); Date updateTime = new Date();

@ -130,7 +130,8 @@ public class IoStatYearServiceImpl implements IoStatYearService {
String orderNo = gennerOrderUtils.createStatOrderNo(orderNoTypeBean); String orderNo = gennerOrderUtils.createStatOrderNo(orderNoTypeBean);
statOrderEntity.setRecordKey(orderNo); statOrderEntity.setRecordKey(orderNo);
statOrderEntity.setType(1); statOrderEntity.setType(1);
statOrderEntity.setDate(yesterday); DateTime dateTime=DateUtil.offsetDay(yesterday,+1);
statOrderEntity.setDate(dateTime);
statOrderEntity.setTitle(yesterday.year() + " 年度出入库汇总"); statOrderEntity.setTitle(yesterday.year() + " 年度出入库汇总");
Date updateTime = new Date(); Date updateTime = new Date();

@ -269,6 +269,7 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) { if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_PREIN) {
QueryWrapper<InvPreInProductDetailEntity> ew = new QueryWrapper<>(); QueryWrapper<InvPreInProductDetailEntity> ew = new QueryWrapper<>();
ew.eq("orderId", bindInvSpaceRequest.getOId()); ew.eq("orderId", bindInvSpaceRequest.getOId());
ew.eq("invCode", bindInvSpaceRequest.getInvCode());
ew.eq("mainAction", "WareHouseIn"); ew.eq("mainAction", "WareHouseIn");
List<InvPreInProductDetailEntity> invPreInProductDetailEntityList = invPreInProductDetailDao.selectList(ew); List<InvPreInProductDetailEntity> invPreInProductDetailEntityList = invPreInProductDetailDao.selectList(ew);
if (invPreInProductDetailEntityList.size() == 0) { if (invPreInProductDetailEntityList.size() == 0) {
@ -291,6 +292,7 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) { } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_ADVANCE) {
QueryWrapper<InvPreProductDetailEntity> ew = new QueryWrapper<>(); QueryWrapper<InvPreProductDetailEntity> ew = new QueryWrapper<>();
ew.eq("orderId", bindInvSpaceRequest.getOId()); ew.eq("orderId", bindInvSpaceRequest.getOId());
ew.eq("invCode", bindInvSpaceRequest.getInvCode());
ew.eq("mainAction", "WareHouseIn"); ew.eq("mainAction", "WareHouseIn");
List<InvPreProductDetailEntity> invPreProductDetailEntityList = invPreProductDetailDao.selectList(ew); List<InvPreProductDetailEntity> invPreProductDetailEntityList = invPreProductDetailDao.selectList(ew);
for (InvPreProductDetailEntity invPreProductDetailEntity : invPreProductDetailEntityList) { for (InvPreProductDetailEntity invPreProductDetailEntity : invPreProductDetailEntityList) {
@ -309,6 +311,7 @@ public class InvPlaceOrderServiceImpl implements InvPlaceOrderService {
} else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL) { } else if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL) {
QueryWrapper<InvProductDetailEntity> ew = new QueryWrapper<>(); QueryWrapper<InvProductDetailEntity> ew = new QueryWrapper<>();
ew.eq("orderId", bindInvSpaceRequest.getOId()); ew.eq("orderId", bindInvSpaceRequest.getOId());
ew.eq("invCode", bindInvSpaceRequest.getInvCode());
ew.eq("mainAction", "WareHouseIn"); ew.eq("mainAction", "WareHouseIn");
List<InvProductDetailEntity> invProductDetailEntityList = invProductDetailDao.selectList(ew); List<InvProductDetailEntity> invProductDetailEntityList = invProductDetailDao.selectList(ew);
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntityList) { for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntityList) {

@ -515,7 +515,7 @@ public class InvPlaceServiceImpl implements InvPlaceService {
return "该产品库存不足!"; return "该产品库存不足!";
} }
} else { } else {
count = invPreInProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); count = invPreInProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode(),bindInvSpaceRequest.getInvCode());
} }
if (count == null || count <= 0) { if (count == null || count <= 0) {
return "该产品库存不足!"; return "该产品库存不足!";
@ -545,7 +545,7 @@ public class InvPlaceServiceImpl implements InvPlaceService {
} }
count = invPreProductDetailEntity.getInCount(); count = invPreProductDetailEntity.getInCount();
} else { } else {
count = invPreProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); count = invPreProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode(),bindInvSpaceRequest.getInvCode());
} }
if (count == null || count <= 0) { if (count == null || count <= 0) {
@ -576,7 +576,7 @@ public class InvPlaceServiceImpl implements InvPlaceService {
} }
count = invProductDetailEntity.getInCount(); count = invProductDetailEntity.getInCount();
} else { } else {
count = invProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode()); count = invProductDetailDao.getInventoryQuantity(bindInvSpaceRequest.getCode(),bindInvSpaceRequest.getInvCode());
} }
if (count == null || count <= 0) { if (count == null || count <= 0) {

@ -4,7 +4,7 @@ server:
spring: spring:
datasource: datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/wms_cs?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root username: root
password: 123456 password: 123456
hikari: hikari:

@ -21,7 +21,7 @@
</select> </select>
<select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatDayEntity"> <select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatDayEntity">
select * select *, ( SELECT NAME FROM auth_dept WHERE io_stat_day.deptCode = auth_dept.CODE ) deptName
from io_stat_day from io_stat_day
where recordKeyFk = #{recordKey} where recordKeyFk = #{recordKey}
</select> </select>

@ -20,7 +20,7 @@
</where> </where>
</select> </select>
<select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatMonthEntity"> <select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatMonthEntity">
select * select *, ( SELECT NAME FROM auth_dept WHERE io_stat_month.deptCode = auth_dept.CODE ) deptName
from io_stat_month from io_stat_month
where recordKeyFk = #{recordKey} where recordKeyFk = #{recordKey}
</select> </select>

@ -21,7 +21,7 @@
</select> </select>
<select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatQuarterEntity"> <select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatQuarterEntity">
select * select *, ( SELECT NAME FROM auth_dept WHERE io_stat_quarter.deptCode = auth_dept.CODE ) deptName
from io_stat_quarter from io_stat_quarter
where recordKeyFk = #{recordKey} where recordKeyFk = #{recordKey}
</select> </select>

@ -21,7 +21,7 @@
</select> </select>
<select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatYearEntity"> <select id="filterListByRecordKey" resultType="com.glxp.api.entity.inout.IoStatYearEntity">
select * select *, ( SELECT NAME FROM auth_dept WHERE io_stat_year.deptCode = auth_dept.CODE ) deptName
from io_stat_year from io_stat_year
where recordKeyFk = #{recordKey} where recordKeyFk = #{recordKey}
</select> </select>

@ -64,32 +64,32 @@
<select id="findGroupBySpace" resultType="com.glxp.api.res.inv.InvPreinProductResponse"> <select id="findGroupBySpace" resultType="com.glxp.api.res.inv.InvPreinProductResponse">
select ipp.id, select ipp.id,
ipp.nameCode, ipp.nameCode,
bp.cpmctymc, bp.cpmctymc,
ipp.relId, ipp.relId,
bp.ggxh, bp.ggxh,
ipp.batchNo, ipp.batchNo,
ipp.produceDate, ipp.produceDate,
ipp.expireDate, ipp.expireDate,
bp.ylqxzcrbarmc, bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh, bp.zczbhhzbapzbh,
ipp.inCount, ipp.inCount,
ipp.outCount, ipp.outCount,
ipp.reCount, ipp.reCount,
basic_corp.name supName, basic_corp.name supName,
ipp.supId, ipp.supId,
auth_dept.name deptName, auth_dept.name deptName,
auth_warehouse.name invName, auth_warehouse.name invName,
as.name spaceName, as.name spaceName,
ipp.deptCode, ipp.deptCode,
ipp.invCode ipp.invCode
from inv_prein_product_detail ipp from inv_prein_product_detail ipp
inner join basic_udirel on ipp.relId = basic_udirel.id inner join basic_udirel on ipp.relId = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ipp.supId = basic_corp.erpId left join basic_corp on ipp.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ipp.deptCode left join auth_dept on auth_dept.code = ipp.deptCode
left join auth_warehouse on auth_warehouse.code = ipp.invCode left join auth_warehouse on auth_warehouse.code = ipp.invCode
left join auth_space `as` on ipp.code = `as`.code left join auth_space `as` on ipp.code = `as`.code
<where> <where>
<if test="cpmctymc != null and cpmctymc != ''"> <if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%') AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
@ -166,21 +166,21 @@
</delete> </delete>
<select id="getInvProductInfo" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse"> <select id="getInvProductInfo" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
select ipd.code, select ipd.code,
ipd.relId, ipd.relId,
ipd.batchNo, ipd.batchNo,
ipd.serialNo, ipd.serialNo,
ipd.invSpaceCode, ipd.invSpaceCode,
ipd.invCode, ipd.invCode,
bp.cpmctymc productName, bp.cpmctymc productName,
bp.ggxh, bp.ggxh,
bp.measname, bp.measname,
bp.zczbhhzbapzbh, bp.zczbhhzbapzbh,
bp.manufactory, bp.manufactory,
(select name from auth_space s where s.code = ipd.invSpaceCode) invSpaceName, (select name from auth_space s where s.code = ipd.invSpaceCode) invSpaceName,
(select name from basic_corp bc where bc.erpId = ipd.supId) supName (select name from basic_corp bc where bc.erpId = ipd.supId) supName
from inv_prein_product_detail ipd from inv_prein_product_detail ipd
left join basic_udirel bu on bu.id = ipd.relId left join basic_udirel bu on bu.id = ipd.relId
left join basic_products bp on bp.uuid = bu.uuid left join basic_products bp on bp.uuid = bu.uuid
<where> <where>
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND ipd.invCode = #{invCode} AND ipd.invCode = #{invCode}
@ -201,7 +201,7 @@
<update id="batchBindSpace"> <update id="batchBindSpace">
update inv_prein_product_detail update inv_prein_product_detail
set invSpaceCode = #{invSpaceCode} set invSpaceCode = #{invSpaceCode}
where id in where id in
<foreach collection="ids" index="index" item="item" open="(" close=")" separator=","> <foreach collection="ids" index="index" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
@ -209,17 +209,17 @@
<select id="getInvPlaceOrderList" resultType="com.glxp.api.res.inout.IoOrderResponse"> <select id="getInvPlaceOrderList" resultType="com.glxp.api.res.inout.IoOrderResponse">
select ipd.orderId billNo, select ipd.orderId billNo,
(select name from basic_bussiness_type where action = o.action) billTypeName, (select name from basic_bussiness_type where action = o.action) billTypeName,
o.mainAction, o.mainAction,
o.fromCorp, o.fromCorp,
o.corpOrderId, o.corpOrderId,
o.fromType, o.fromType,
o.createTime, o.createTime,
o.auditTime, o.auditTime,
(select employeeName from auth_user where id = o.reviewUser) reviewUserName (select employeeName from auth_user where id = o.reviewUser) reviewUserName
from inv_prein_product_detail ipd from inv_prein_product_detail ipd
left join io_order o on ipd.orderId = o.billNo left join io_order o on ipd.orderId = o.billNo
<where> <where>
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND ipd.invCode = #{invCode} AND ipd.invCode = #{invCode}
@ -231,76 +231,77 @@
group by ipd.orderId group by ipd.orderId
</select> </select>
<select id="getInventoryQuantity" resultType="Integer"> <select id="getInventoryQuantity" resultType="java.lang.Integer">
SELECT ifnull(SUM(inCount), 0) - ifnull(SUM(outCount), 0) SELECT ifnull(SUM(inCount), 0) - ifnull(SUM(outCount), 0)
FROM inv_prein_product_detail ipd FROM inv_prein_product_detail ipd
WHERE CODE = #{code} WHERE CODE = #{code}
and invCode = #{invCode}
and (invSpaceCode is null or invSpaceCode = '') and (invSpaceCode is null or invSpaceCode = '')
</select> </select>
<select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse"> <select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
SELECT t1.nameCode, SELECT t1.nameCode,
t1.relId, t1.relId,
(SELECT NAME FROM auth_dept WHERE auth_dept.`code` = t1.deptCode) AS deptName, (SELECT NAME FROM auth_dept WHERE auth_dept.`code` = t1.deptCode) AS deptName,
(SELECT NAME FROM auth_warehouse WHERE auth_warehouse.`code` = t1.invCode) AS invName, (SELECT NAME FROM auth_warehouse WHERE auth_warehouse.`code` = t1.invCode) AS invName,
(SELECT NAME FROM auth_space WHERE auth_space.`code` = t1.invSpaceCode) AS invSpaceName, (SELECT NAME FROM auth_space WHERE auth_space.`code` = t1.invSpaceCode) AS invSpaceName,
SUM(t1.reCount) as count, SUM(t1.reCount) as count,
bp.cpmctymc as productName, bp.cpmctymc as productName,
bp.ggxh, bp.ggxh,
t1.batchNo, t1.batchNo,
t1.produceDate as productionDate, t1.produceDate as productionDate,
t1.expireDate, t1.expireDate,
bp.measname, bp.measname,
bp.zczbhhzbapzbh, bp.zczbhhzbapzbh,
bp.ylqxzcrbarmc, bp.ylqxzcrbarmc,
bp.manufactory, bp.manufactory,
(SELECT `name` FROM basic_corp WHERE erpId = t1.supId) supName (SELECT `name` FROM basic_corp WHERE erpId = t1.supId) supName
FROM inv_prein_product_detail t1 FROM inv_prein_product_detail t1
LEFT JOIN basic_udirel bu ON bu.id = t1.relId LEFT JOIN basic_udirel bu ON bu.id = t1.relId
LEFT JOIN basic_products bp ON bp.uuid = bu.uuid LEFT JOIN basic_products bp ON bp.uuid = bu.uuid
<where> <where>
<if test="code != null and code != ''"> <if test="code != null and code != ''">
AND t1.code = #{code} AND t1.code = #{code}
and t1.invSpaceCode IS NOT NULL and t1.invSpaceCode IS NOT NULL
and t1.invSpaceCode != '' and t1.invSpaceCode != ''
</if> </if>
<if test="invSpaceCode != null and invSpaceCode != ''"> <if test="invSpaceCode != null and invSpaceCode != ''">
AND t1.invSpaceCode = #{invSpaceCode} AND t1.invSpaceCode = #{invSpaceCode}
</if> </if>
</where> </where>
GROUP BY CODE, GROUP BY CODE,
invSpaceCode invSpaceCode
</select> </select>
<select id="findByGroupCode" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse"> <select id="findByGroupCode" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">
select pd.id, select pd.id,
pd.code, pd.code,
pd.relId, pd.relId,
pd.batchNo, pd.batchNo,
pd.produceDate productionDate, pd.produceDate productionDate,
pd.expireDate, pd.expireDate,
bp.ggxh, bp.ggxh,
bp.cpmctymc productName, bp.cpmctymc productName,
bp.zczbhhzbapzbh, bp.zczbhhzbapzbh,
bp.ylqxzcrbarmc, bp.ylqxzcrbarmc,
bp.nameCode, bp.nameCode,
bp.manufactory, bp.manufactory,
pd.invSpaceCode, pd.invSpaceCode,
pd.invCode, pd.invCode,
ad.name deptName, ad.name deptName,
aw.name invName, aw.name invName,
sp.name invSpaceName, sp.name invSpaceName,
ifnull(sum(pd.inCount), 0) as inCount, ifnull(sum(pd.inCount), 0) as inCount,
ifnull(sum(pd.outCount), 0) as outCount, ifnull(sum(pd.outCount), 0) as outCount,
pd.inCount - pd.outCount as reCount pd.inCount - pd.outCount as reCount
from inv_prein_product_detail pd from inv_prein_product_detail pd
left join basic_udirel bu on pd.relId = bu.id left join basic_udirel bu on pd.relId = bu.id
left join basic_products bp on bp.uuid = bu.uuid left join basic_products bp on bp.uuid = bu.uuid
left join auth_dept ad on pd.deptCode = ad.code left join auth_dept ad on pd.deptCode = ad.code
left join auth_warehouse aw on pd.invCode = aw.code left join auth_warehouse aw on pd.invCode = aw.code
left join auth_space sp on pd.invSpaceCode = sp.code left join auth_space sp on pd.invSpaceCode = sp.code
and sp.invStorageCode = pd.deptCode and sp.invWarehouseCode = pd.invCode and sp.invStorageCode = pd.deptCode and sp.invWarehouseCode = pd.invCode
<where> <where>
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND pd.invCode = #{invCode} AND pd.invCode = #{invCode}
@ -315,21 +316,21 @@
<select id="findBySpaceList" resultType="com.glxp.api.entity.inv.InvPreInProductDetailEntity"> <select id="findBySpaceList" resultType="com.glxp.api.entity.inv.InvPreInProductDetailEntity">
select pd.id, select pd.id,
pd.code, pd.code,
pd.relId, pd.relId,
pd.batchNo, pd.batchNo,
pd.produceDate, pd.produceDate,
pd.expireDate, pd.expireDate,
pd.invSpaceCode, pd.invSpaceCode,
pd.deptCode, pd.deptCode,
pd.invCode, pd.invCode,
pd.supId, pd.supId,
pd.nameCode, pd.nameCode,
pd.invSpaceCode, pd.invSpaceCode,
ifnull(sum(pd.count), 0) as count, ifnull(sum(pd.count), 0) as count,
ifnull(sum(pd.inCount), 0) as inCount, ifnull(sum(pd.inCount), 0) as inCount,
ifnull(sum(pd.outCount), 0) as outCount, ifnull(sum(pd.outCount), 0) as outCount,
ifnull(sum(pd.reCount), 0) as reCount ifnull(sum(pd.reCount), 0) as reCount
from inv_prein_product_detail pd from inv_prein_product_detail pd
<where> <where>
reCount > 0 reCount > 0

@ -232,10 +232,11 @@
group by ipd.orderId group by ipd.orderId
</select> </select>
<select id="getInventoryQuantity" resultType="Integer"> <select id="getInventoryQuantity" resultType="java.lang.Integer">
SELECT ifnull(SUM(inCount), 0) - ifnull(SUM(outCount), 0) SELECT ifnull(SUM(inCount), 0) - ifnull(SUM(outCount), 0)
FROM inv_pre_product_detail ipd FROM inv_pre_product_detail ipd
WHERE CODE = #{code} WHERE CODE = #{code}
and invCode = #{invCode}
and (invSpaceCode is null or invSpaceCode = '') and (invSpaceCode is null or invSpaceCode = '')
</select> </select>

@ -357,11 +357,13 @@
group by ipd.orderId group by ipd.orderId
</select> </select>
<select id="getInventoryQuantity" resultType="Integer"> <select id="getInventoryQuantity" resultType="java.lang.Integer">
SELECT ifnull(SUM(inCount), 0) - ifnull(SUM(outCount), 0) SELECT ifnull(SUM(inCount), 0) - ifnull(SUM(outCount), 0)
FROM inv_product_detail ipd FROM inv_product_detail ipd
WHERE CODE = #{code} WHERE CODE = #{code}
and invCode = #{invCode}
and (invSpaceCode is null or invSpaceCode = '') and (invSpaceCode is null or invSpaceCode = '')
</select> </select>
<select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse"> <select id="filterSpaceList" resultType="com.glxp.api.res.inv.InvPlaceDetailResponse">

Loading…
Cancel
Save