Browse Source

20250414 部分内容修改

master
qiezi 1 year ago
parent
commit
3844e46525
  1. 27
      src/main/java/com/heai/modules/board/controller/InventoryController.java
  2. 63
      src/main/java/com/heai/modules/board/entity/Inventory.java
  3. 3
      src/main/java/com/heai/modules/board/service/BoardService.java
  4. 10
      src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java
  5. 4
      src/main/java/com/heai/modules/production/service/impl/PrintLabelRecordServiceImpl.java
  6. 3
      src/main/java/com/heai/modules/taskmanage/dao/TaskDetailDao.java
  7. 58
      src/main/resources/mapper/production/DailyPlanMapper.xml
  8. 71
      src/main/resources/mapper/taskmanage/TaskDatailDao.xml

27
src/main/java/com/heai/modules/board/controller/InventoryController.java

@ -0,0 +1,27 @@
package com.heai.modules.board.controller;
import com.heai.common.utils.R;
import com.heai.modules.board.entity.Inventory;
import com.heai.modules.board.service.BoardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/inventory")
public class InventoryController {
@Autowired
private BoardService boardService;
@PostMapping
private R inventory(@RequestBody Inventory inventory) {
List<Inventory> list = boardService.queryPartInventory(inventory);
return R.ok().put("rows",list);
}
}

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

@ -0,0 +1,63 @@
package com.heai.modules.board.entity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class Inventory {
private String partNo;
private String partDescription;
private String spec;
private String warehouseId;
private String locationId;
private String batchNo;
private BigDecimal qtyOnHand;
private String umId;
private Date firstInDate;
private String freezeFlag;
private String partType;
private String familyId;
private String familyName;
private Date latestOutDate;
private Date activeDate;
private String partnerId;
private String partnerType;
private String site;
private Date manufactureDate;
private Date expiredDate;
private String demandPartnerId;
private String demandPartnerName;
private String demandPartnerType;
private String latestCountDate;
private String groupID;
private String partGroup;
private Date latestInDate;
private BigDecimal qtyReserved;
private BigDecimal standartStockValue;
private BigDecimal actualStockValue;
private Date finalStartDate;
private Date finalEndDate;
private String loginUser;
}

3
src/main/java/com/heai/modules/board/service/BoardService.java

@ -2,6 +2,7 @@ package com.heai.modules.board.service;
import com.heai.modules.board.entity.BIBoardAddressData;
import com.heai.modules.board.entity.Inventory;
import com.heai.modules.board.entity.ViewKanbanCODelNotifyData;
import com.heai.modules.board.entity.ViewKanbanSoHunlianPlanData;
import com.heai.modules.production.entity.*;
@ -269,4 +270,6 @@ public interface BoardService {
BigDecimal getPartValue(String site,String partNo);
boolean isPackingWorkCenter(String site,String workCenterNo);
List<Inventory> queryPartInventory(Inventory inventory);
}

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

@ -4,6 +4,7 @@ package com.heai.modules.board.service.impl;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heai.common.utils.DateUtil;
import com.heai.common.utils.WeekUtil;
import com.heai.modules.app.annotation.LoginUser;
import com.heai.modules.board.dao.BoardMapper;
import com.heai.modules.board.entity.*;
import com.heai.modules.board.service.BoardService;
@ -13,9 +14,11 @@ import com.heai.modules.production.dao.SoScheduledListMapper;
import com.heai.modules.production.dao.TcpMapper;
import com.heai.modules.production.entity.*;
import com.heai.modules.production.service.PrintLabelRecordService;
import com.heai.modules.sys.entity.SysUserEntity;
import com.heai.modules.taskmanage.dao.TaskDetailDao;
import com.heai.modules.taskmanage.vo.TaskDetailVo;
import com.heai.modules.taskmanage.vo.TaskListVo;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -789,4 +792,11 @@ public class BoardServiceImpl implements BoardService {
}
return true;
}
@Override
public List<Inventory> queryPartInventory(Inventory inventory) {
SysUserEntity loginUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
inventory.setLoginUser(loginUser.getUsername());
return baseMapper.queryPartInventory(inventory);
}
}

4
src/main/java/com/heai/modules/production/service/impl/PrintLabelRecordServiceImpl.java

@ -183,8 +183,8 @@ public class PrintLabelRecordServiceImpl extends ServiceImpl<PrintLabelRecordMap
if (Objects.isNull(bag)){
throw new RuntimeException("袋子不存在");
}
if (!"已入库".equals(bag.getStatus())){
throw new RuntimeException("袋子状态不是已入库");
if ("已拆袋".equals(bag.getStatus())){
throw new RuntimeException("袋子状态不符合拆袋要求");
}
Integer count = outboundLabelScanService
.lambdaQuery()

3
src/main/java/com/heai/modules/taskmanage/dao/TaskDetailDao.java

@ -2,6 +2,7 @@ package com.heai.modules.taskmanage.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heai.modules.board.entity.Inventory;
import com.heai.modules.taskmanage.entity.TaskDetailEntity;
import com.heai.modules.taskmanage.vo.TaskDetailVo;
import com.heai.modules.taskmanage.vo.TaskListVo;
@ -46,4 +47,6 @@ public interface TaskDetailDao extends BaseMapper<TaskDetailEntity> {
* @date: 2022/10/9 13:17
*/
List<TaskDetailVo> taskDetailReportList(TaskListVo params);
List<Inventory> queryPartInventory(Inventory inventory);
}

58
src/main/resources/mapper/production/DailyPlanMapper.xml

@ -1208,16 +1208,54 @@
</delete>
<select id="getSfdcList" resultType="com.heai.modules.production.entity.SfdcCancel">
select a.site,a.OrderNo,a.ItemNo ,a.SeqNo,a.WorkCenterNo,a.ReportDate,a.OperatorID,a.ReportQty,a.ApproveQty,a.ReportedManfTime,a.StatisticDate,
a.AssJobSeqNo,a.Scheduled_ResourceId ResourceID,b.S_ShiftNo ShiftNo,b.partNo,dbo.Get_ItemDesc(a.site,a.OrderNo,a.ItemNo) operation_desc,c.OperatorName,b.S_ShiftNo ShiftDesc,e.ResourceDesc,Reverseflag
,a.reportWeight,a.approveWeight,a.moldQty,a.stopTime,dbo.Get_Part_SpecDesc(a.site,b.partNo) partSpec,dbo.Get_Part_SpecDesc(a.site,b.partNo) PartDesc,wasteWeight,b.jobType,
f.Remark as scrapRemark,f.DefectQty as scrapQty,g.Remark as acceptRemark,g.DefectQty as acceptQty,b.RepairSOFlag
,a.c_sys_scrap_rate as csysScrapRate,case when a.ReportQty!=0 then Round((a.ReportQty-a.ApproveQty)*100/a.ReportQty,2) else 0 end as scrapRate
from sfdc a LEFT JOIN SOScheduledRouting b on a.Site=b.Site and a.AssJobSeqNo=b.SeqNo
left join Operator c on a.site=c.site and a.OperatorID=c.OperatorID
left join WorkCenterResource e on a.Site=e.Site and a.Scheduled_ResourceId =e.ResourceID and a.WorkCenterNo=e.WorkCenterNo
left join SFDC_DefectHist f on a.site=f.site and a.OrderNo=f.OrderNo and a.seqNo=f.SeqNo and f.DefectCode='PQ001'
left join SFDC_DefectHist g on a.site=g.site and a.OrderNo=g.OrderNo and a.seqNo=g.SeqNo and g.DefectCode='PQ003'
select a.site,
a.OrderNo,
a.ItemNo,
a.SeqNo,
a.WorkCenterNo,
a.ReportDate,
a.OperatorID,
a.ReportQty,
a.ApproveQty,
a.ReportedManfTime,
a.StatisticDate,
a.AssJobSeqNo,
a.Scheduled_ResourceId ResourceID,
b.S_ShiftNo ShiftNo,
b.partNo,
dbo.Get_ItemDesc(a.site, a.OrderNo, a.ItemNo) operation_desc,
c.OperatorName,
b.S_ShiftNo ShiftDesc,
e.ResourceDesc,
Reverseflag
,
a.reportWeight,
a.approveWeight,
a.moldQty,
a.stopTime,
dbo.Get_Part_SpecDesc(a.site, b.partNo) partSpec,
dbo.Get_Part_SpecDesc(a.site, b.partNo) PartDesc,
wasteWeight,
b.jobType,
f.Remark as scrapRemark,
f.DefectQty as scrapQty,
g.Remark as acceptRemark,
g.DefectQty as acceptQty,
b.RepairSOFlag
,
a.c_sys_scrap_rate as csysScrapRate,
case
when a.ReportQty!=0 then Round((a.ReportQty - a.ApproveQty) * 100 / a.ReportQty, 2)
else 0 end as scrapRate
from sfdc a
LEFT JOIN SOScheduledRouting b on a.Site = b.Site and a.AssJobSeqNo = b.SeqNo
left join Operator c on a.site = c.site and a.OperatorID = c.OperatorID
left join WorkCenterResource e on a.Site = e.Site and a.Scheduled_ResourceId = e.ResourceID and
a.WorkCenterNo = e.WorkCenterNo
left join SFDC_DefectHist f on a.site = f.site and a.OrderNo = f.OrderNo and a.seqNo = f.SeqNo and
f.DefectCode = 'PQ001'
left join SFDC_DefectHist g on a.site = g.site and a.OrderNo = g.OrderNo and a.seqNo = g.SeqNo and
g.DefectCode = 'PQ003'
<where>
and a.AssJobSeqNo is not null
<if test="orderNo != null and orderNo != ''">

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

@ -215,5 +215,74 @@
</select>
<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
from InventoryStock as T,
Part as P
where T.Site = P.Site
and T.PartNo = P.PartNo
and T.Site in (Select Site from AccessSite where upper(UserID) = #{loginUser})
<if test="partNo != null and partNo != ''">
and T.PartNo like #{partNo}
</if>
<if test="partDescription != null and partDescription != ''">
and P.PartDescription like #{partDescription}
</if>
<if test="spec != null and spec != ''">
and P.Spec like #{spec}
</if>
<if test="site != null and site != ''">
and T.Site = #{site}
</if>
<if test="warehouseId != null and warehouseId != ''">
and T.WarehouseID = #{warehouseId}
</if>
<if test="locationId != null and locationId != ''">
and T.LocationID = #{locationId}
</if>
<if test="batchNo != null and batchNo != ''">
and T.BatchNo = #{batchNo}
</if>
<if test="finalStartDate != null">
and T.FirstInDate > #{finalStartDate}
</if>
<if test="finalEndDate != null">
and #{finalEndDate} > T.FirstInDate
</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
</select>
</mapper>
Loading…
Cancel
Save