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);
Integer getInventoryQuantity(@Param("code") String code);
Integer getInventoryQuantity(@Param("code") String code,@Param("invCode") String invCode);
//用货架查询
List<InvPlaceDetailResponse> filterSpaceList(FilterInvPlaceRequest filterInvPlaceOrderRequest);

@ -44,7 +44,7 @@ public interface InvPreProductDetailDao extends BaseMapperPlus<InvPreProductDeta
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);

@ -97,7 +97,7 @@ public interface InvProductDetailDao extends BaseMapperPlus<InvProductDetailDao,
*/
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);

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

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

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

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

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

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

@ -4,7 +4,7 @@ server:
spring:
datasource:
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
password: 123456
hikari:

@ -21,7 +21,7 @@
</select>
<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
where recordKeyFk = #{recordKey}
</select>

@ -20,7 +20,7 @@
</where>
</select>
<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
where recordKeyFk = #{recordKey}
</select>

@ -21,7 +21,7 @@
</select>
<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
where recordKeyFk = #{recordKey}
</select>

@ -21,7 +21,7 @@
</select>
<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
where recordKeyFk = #{recordKey}
</select>

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

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

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

Loading…
Cancel
Save