Browse Source

20250415

master
qiezi 1 year ago
parent
commit
46678d7613
  1. 31
      src/main/java/com/heai/modules/board/entity/Inventory.java
  2. 10
      src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java
  3. 119
      src/main/resources/mapper/taskmanage/TaskDatailDao.xml

31
src/main/java/com/heai/modules/board/entity/Inventory.java

@ -1,6 +1,8 @@
package com.heai.modules.board.entity; package com.heai.modules.board.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ -20,6 +22,8 @@ public class Inventory {
private BigDecimal qtyOnHand; private BigDecimal qtyOnHand;
private String umId; private String umId;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date firstInDate; private Date firstInDate;
private String freezeFlag; private String freezeFlag;
@ -29,8 +33,12 @@ public class Inventory {
private String familyName; private String familyName;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date latestOutDate; private Date latestOutDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date activeDate; private Date activeDate;
private String partnerId; private String partnerId;
@ -38,8 +46,12 @@ public class Inventory {
private String site; private String site;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date manufactureDate; private Date manufactureDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date expiredDate; private Date expiredDate;
private String demandPartnerId; private String demandPartnerId;
@ -49,6 +61,8 @@ public class Inventory {
private String latestCountDate; private String latestCountDate;
private String groupID; private String groupID;
private String partGroup; private String partGroup;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date latestInDate; private Date latestInDate;
private BigDecimal qtyReserved; private BigDecimal qtyReserved;
@ -56,8 +70,21 @@ public class Inventory {
private BigDecimal standartStockValue; private BigDecimal standartStockValue;
private BigDecimal actualStockValue; private BigDecimal actualStockValue;
private Date finalStartDate;
private Date finalEndDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date startFirstInDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date endFirstInDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date startExpiredDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date endExpiredDate;
private String loginUser; private String loginUser;
private int summaryType;
} }

10
src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java

@ -797,6 +797,16 @@ public class BoardServiceImpl implements BoardService {
public List<Inventory> queryPartInventory(Inventory inventory) { public List<Inventory> queryPartInventory(Inventory inventory) {
SysUserEntity loginUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); SysUserEntity loginUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
inventory.setLoginUser(loginUser.getUsername()); inventory.setLoginUser(loginUser.getUsername());
if (Objects.nonNull(inventory.getEndFirstInDate())){
inventory.getEndFirstInDate().setHours(23);
inventory.getEndFirstInDate().setMinutes(59);
inventory.getEndFirstInDate().setSeconds(59);
}
if (Objects.nonNull(inventory.getEndExpiredDate())){
inventory.getEndExpiredDate().setHours(23);
inventory.getEndExpiredDate().setMinutes(59);
inventory.getEndExpiredDate().setSeconds(59);
}
return baseMapper.queryPartInventory(inventory); return baseMapper.queryPartInventory(inventory);
} }
} }

119
src/main/resources/mapper/taskmanage/TaskDatailDao.xml

@ -216,38 +216,42 @@
</select> </select>
<select id="queryPartInventory" resultType="com.heai.modules.board.entity.Inventory"> <select id="queryPartInventory" resultType="com.heai.modules.board.entity.Inventory">
Select T.Site,
T.PartNo,
P.PartDescription,
P.Spec,
T.WarehouseID,
P.UMID,
T.LocationID,
T.BatchNo,
T.FirstInDate,
T.LatestCountDate,
T.Freezeflag,
P.PartType,
P.FamilyID,
dbo.Get_PartFamilyDesc(P.Site, P.FamilyID) as FamilyName,
P.GroupID,
dbo.Get_PartGroupDesc(T.Site, P.GroupID) as PartGroup,
T.LatestOutDate,
T.LatestInDate,
T.ActiveDate,
T.PartnerID,
T.PartnerType,
T.ManufactureDate,
T.ExpiredDate,
sum(Round(T.QtyOnHand, 3)) as QtyOnHand,
sum(Round(isnull(T.QtyReserved, 0), 3)) as QtyReserved,
sum(Round(isnull(T.InStandardValue, 0), 4) -
Round(isnull(T.OutStandardValue, 0), 4)) as StandartStockValue,
sum(Round(isnull(T.InActualValue, 0), 4) -
Round(isnull(T.OutActualValue, 0), 4)) as ActualStockValue,
T.DemandPartnerType,
T.DemandPartnerID,
T.DemandPartnerName
Select T.Site,
T.PartNo,
P.PartDescription,
P.Spec,
<if test="summaryType != null and summaryType >= 1">
T.WarehouseID,
</if>
P.UMID,
<if test="summaryType != null and summaryType >= 2">
T.LocationID,
</if>
<if test="summaryType != null and summaryType >= 3">
T.BatchNo,
</if>
min(T.FirstInDate) as FirstInDate,
max(T.LatestCountDate) as LatestCountDate,
min(T.Freezeflag) as Freezeflag,
P.PartType,
P.FamilyID,
dbo.Get_PartFamilyDesc(P.Site, P.FamilyID) as FamilyName,
P.GroupID,
dbo.Get_PartGroupDesc(T.Site, P.GroupID) as PartGroup,
max(T.LatestOutDate) as LatestOutDate,
max(T.LatestInDate) as LatestInDate,
max(T.ActiveDate) as ActiveDate,
max(T.PartnerID) as PartnerID,
max(T.PartnerType) as PartnerType,
min(T.ManufactureDate) as ManufactureDate,
max(T.ExpiredDate) as ExpiredDate,
sum(Round(T.QtyOnHand, 3)) as QtyOnHand,
sum(Round(isnull(T.QtyReserved, 0), 3)) as QtyReserved,
sum(Round(isnull(T.InStandardValue, 0), 4) - Round(isnull(T.OutStandardValue, 0), 4)) as StandartStockValue,
sum(Round(isnull(T.InActualValue, 0), 4) - Round(isnull(T.OutActualValue, 0), 4)) as ActualStockValue,
max(T.DemandPartnerType) as DemandPartnerType,
max(T.DemandPartnerID) as DemandPartnerID,
max(T.DemandPartnerName) as DemandPartnerName
from InventoryStock as T, from InventoryStock as T,
Part as P Part as P
where T.Site = P.Site where T.Site = P.Site
@ -265,24 +269,55 @@
<if test="site != null and site != ''"> <if test="site != null and site != ''">
and T.Site = #{site} and T.Site = #{site}
</if> </if>
<if test="partType != null and partType != ''">
and P.PartType like #{partType}
</if>
<if test="warehouseId != null and warehouseId != ''"> <if test="warehouseId != null and warehouseId != ''">
and T.WarehouseID = #{warehouseId} and T.WarehouseID = #{warehouseId}
</if> </if>
<if test="locationId != null and locationId != ''">
<if test="locationId != null and locationId != '' and summaryType != null and summaryType >= 2">
and T.LocationID = #{locationId} and T.LocationID = #{locationId}
</if> </if>
<if test="batchNo != null and batchNo != ''">
<if test="batchNo != null and batchNo != '' and summaryType != null and summaryType >= 3">
and T.BatchNo = #{batchNo} and T.BatchNo = #{batchNo}
</if> </if>
<if test="finalStartDate != null">
and T.FirstInDate > #{finalStartDate}
<if test="familyId != null and familyId != ''">
and P.FamilyID like #{familyId}
</if>
<if test="familyName != null and familyName != ''">
and dbo.Get_PartFamilyDesc(P.Site, P.FamilyID) like #{familyName}
</if>
<if test="startFirstInDate != null">
and T.FirstInDate >= #{startFirstInDate}
</if> </if>
<if test="finalEndDate != null">
and #{finalEndDate} > T.FirstInDate
<if test="endFirstInDate != null">
and #{endFirstInDate} >= T.FirstInDate
</if> </if>
group by T.Site, T.PartNo, P.PartDescription, P.Spec, T.WarehouseID, P.UMID, T.LocationID, T.BatchNo,
T.FirstInDate, T.LatestCountDate, T.Freezeflag, P.PartType, P.FamilyID, P.Site, P.FamilyID, P.GroupID,
T.Site, P.GroupID, T.LatestOutDate, T.LatestInDate, T.ActiveDate, T.PartnerID, T.PartnerType,
T.ManufactureDate, T.ExpiredDate, T.DemandPartnerType, T.DemandPartnerID, T.DemandPartnerName
<if test="startExpiredDate != null">
and T.ExpiredDate >= #{startExpiredDate}
</if>
<if test="endExpiredDate != null">
and #{endExpiredDate} >= T.ExpiredDate
</if>
group by
T.Site,
T.PartNo,
P.PartDescription,
P.Spec,
<if test="summaryType != null and summaryType >= 1">
T.WarehouseID,
</if>
P.UMID,
<if test="summaryType != null and summaryType >= 2">
T.LocationID,
</if>
<if test="summaryType != null and summaryType >= 3">
T.BatchNo,
</if>
P.Site,
P.FamilyID,
P.GroupID,
P.PartType
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save