Browse Source

20250508

master
qiezi 1 year ago
parent
commit
3bf8bf5d77
  1. 5
      src/main/java/com/heai/modules/production/controller/DailyPlanController.java
  2. 3
      src/main/java/com/heai/modules/production/service/ReworkRecordService.java
  3. 6
      src/main/java/com/heai/modules/production/service/impl/ReworkRecordServiceImpl.java
  4. 66
      src/main/resources/mapper/production/DailyPlanMapper.xml
  5. 8
      src/main/resources/mapper/production/ReworkRecordMapper.xml
  6. 2
      src/main/resources/mapper/taskmanage/TaskDatailDao.xml

5
src/main/java/com/heai/modules/production/controller/DailyPlanController.java

@ -1144,4 +1144,9 @@ public class DailyPlanController {
reworkRecordService.cancelRework(reworkRecord);
return R.ok("操作成功");
}
@PostMapping("/operator")
public R queryOperator(@RequestBody ReworkRecord reworkRecord){
List<OperatorData> list = reworkRecordService.queryOperator(reworkRecord);
return R.ok().put("rows",list);
}
}

3
src/main/java/com/heai/modules/production/service/ReworkRecordService.java

@ -1,6 +1,7 @@
package com.heai.modules.production.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.heai.modules.production.entity.OperatorData;
import com.heai.modules.production.entity.ReworkRecord;
import com.heai.modules.production.entity.ReworkRecordData;
@ -28,4 +29,6 @@ public interface ReworkRecordService extends IService<ReworkRecord> {
void removeRework(ReworkRecord reworkRecord);
void cancelRework(ReworkRecord reworkRecord);
List<OperatorData> queryOperator(ReworkRecord reworkRecord);
}

6
src/main/java/com/heai/modules/production/service/impl/ReworkRecordServiceImpl.java

@ -20,6 +20,7 @@ import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -126,4 +127,9 @@ public class ReworkRecordServiceImpl extends ServiceImpl<ReworkRecordMapper,Rewo
}
baseMapper.cancelRework(reworkRecord);
}
@Override
public List<OperatorData> queryOperator(ReworkRecord reworkRecord) {
return baseMapper.queryOperator(reworkRecord);
}
}

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

@ -307,38 +307,54 @@
a.PlanStartDate desc,s.itemNo
</select>
<select id="getShopOrderRoutingVPData" resultType="ShopOrderRoutingData">
select t.OrderNo as liuhuaOrderNo,t.site,SO.PartNo,dbo.Get_Part_SpecDesc(t.site,T.partno) as liuhuaPartDescSpec,t.partNo as liuhuaPartNo
,Convert(decimal(10,2),isnull(h.OrderQty * d.QtyAssembly / (1 - d.ScraptFactor/100.0),0.0)) as QtyRequired
,h.OrderDate as needDate
,h.orderNo as liuhuaTaskNo
,case when t.Status='已取消' then '已取消' else '' end as erpStatus
, so.OrderNo,s.workCenterNo,S.ItemNo,S.OperationDesc,isnull(ROUND(P.NetWeight/1000,5),1) weightFactor,
Round(isnull(ROUND(P.NetWeight/1000,5),1)*isnull(h.OrderQty * d.QtyAssembly / (1 - d.ScraptFactor/100.0),0.0),2) weight
, isnull(P.spec,'') +'/'+P.PartDescription as partDescription
,s.OperationDesc,s.efficiency,so.RepairSOFlag,dbo.Get_E_OriginalOrderTypeDesc(t.site, t.OrderNo) orderTypeDesc
select t.OrderNo as liuhuaOrderNo
, t.site
, SO.PartNo
, dbo.Get_Part_SpecDesc(t.site, T.partno) as liuhuaPartDescSpec
, t.partNo as liuhuaPartNo
, Convert(decimal (10, 2),
isnull(h.OrderQty * d.QtyAssembly / (1 - d.ScraptFactor / 100.0), 0.0)) as QtyRequired
, h.OrderDate as needDate
, h.orderNo as liuhuaTaskNo
, case when t.Status = '已取消' then '已取消' else '' end as erpStatus
, so.OrderNo
, s.workCenterNo
, S.ItemNo
, S.OperationDesc
, isnull(ROUND(P.NetWeight / 1000, 5), 1) weightFactor
, Round(isnull(ROUND(P.NetWeight / 1000, 5), 1) *
isnull(h.OrderQty * d.QtyAssembly / (1 - d.ScraptFactor / 100.0), 0.0), 2) weight
, isnull(P.spec, '') + '/' + P.PartDescription as partDescription
, s.OperationDesc
, s.efficiency
, so.RepairSOFlag
, dbo.Get_E_OriginalOrderTypeDesc(t.site, t.OrderNo) orderTypeDesc
from SOTaskOrderHeader as h
left join ShopOrder as t on h.Site=t.Site and h.OrderRef1=t.OrderNo ---硫化的订单t
left join ShopOrder as SO on t.site=SO.Site and t.orderNo=SO.Prelev_order_no and t.E_OriginalOrderType=SO.E_OriginalOrderType
left join ShopOrder as t on h.Site = t.Site and h.OrderRef1 = t.OrderNo ---硫化的订单t
left join ShopOrder as SO on t.site = SO.Site and t.orderNo = SO.Prelev_order_no and
t.E_OriginalOrderType = SO.E_OriginalOrderType
and (SO.PartNo like 'VP%') -----so是vp订单
left join SOBOM as d on t.Site=D.Site and T.OrderNo=D.OrderNo and D.ComponentPartNo =SO.PartNo
LEFT JOIN SORouting S on S.site=SO.site and S.OrderNo=SO.OrderNo
left join user_work_center uwc on s.site=uwc.site and s.workCenterNo =uwc.WorkCenterNo and uwc.userId= 'admin'
left join part P on so.site=p.site and so.partNo=p.partNo
left join SOTask_VPSchedule SV on h.site=SV.site and h.OrderNo=SV.TaskOrderNo and s.itemNo=sv.itemNo and so.orderNo=SV.orderNo
left join SOBOM as d on t.Site = D.Site and T.OrderNo = D.OrderNo and D.ComponentPartNo = SO.PartNo
LEFT JOIN SORouting S on S.site = SO.site and S.OrderNo = SO.OrderNo
left join user_work_center uwc
on s.site = uwc.site and s.workCenterNo = uwc.WorkCenterNo and uwc.userId = 'admin'
left join part P on so.site = p.site and so.partNo = p.partNo
left join SOTask_VPSchedule SV
on h.site = SV.site and h.OrderNo = SV.TaskOrderNo and s.itemNo = sv.itemNo and
so.orderNo = SV.orderNo
<where>
and uwc.WorkCenterNo is not null
and h.OrderRefType='生产订单'
and h.OrderRefType = '生产订单'
and t.partNo like 'SP%'
and t.Status != '已关闭' and t.Status != '已计划'
and h.Status !='已取消' and so.PartNo is not null
<!-- and isnull(SL.scheduledQty,0) =0-->
and SV.site is null
<if test="startDate1 != null ">
<if test="startDate1 != null">
AND h.orderDate >= #{startDate1}
</if>
<if test="endDate1 != null ">
<if test="endDate1 != null">
AND #{endDate1} >= h.orderDate
</if>
<if test="site != null and site != ''">
@ -348,7 +364,7 @@
AND SO.OrderNo LIKE #{orderNo}
</if>
<if test="partDescription != null and partDescription != ''">
AND isnull(P.spec,'') +'/'+P.PartDescription LIKE #{partDescription}
AND isnull(P.spec, '') +'/'+P.PartDescription LIKE #{partDescription}
</if>
<if test="partNo != null and partNo != ''">
AND SO.PartNo LIKE #{partNo}
@ -357,7 +373,8 @@
and S.ItemNo = #{itemNo}
</if>
<if test="partDescription != null and partDescription != ''">
and P.Spec+'/'+isnull(P.PartDescription,'') like #{partDescription}
and P.Spec+'/'+isnull(P.PartDescription
, '') like #{partDescription}
</if>
<if test="liuhuaTaskNo != null and liuhuaTaskNo != ''">
and h.orderNo like #{liuhuaTaskNo}
@ -366,10 +383,11 @@
and t.partNo like #{liuhuaPartNo}
</if>
<if test="liuhuaPartDescSpec != null and liuhuaPartDescSpec != ''">
and dbo.Get_Part_SpecDesc(t.site,T.partno) like #{liuhuaPartDescSpec}
and dbo.Get_Part_SpecDesc(t.site
, T.partno) like #{liuhuaPartDescSpec}
</if>
</where>
order by case when dbo.Get_E_OriginalOrderTypeDesc(t.site, t.OrderNo) in ('变更订单','加急订单') then 1 else 2 end , h.OrderDate ,so.partNo,s.itemNo
order by case when dbo.Get_E_OriginalOrderTypeDesc(t.site, t.OrderNo) in ('变更订单', '加急订单') then 1 else 2 end , h.OrderDate ,so.partNo,s.itemNo
</select>
<update id="updateSOTaskCombineTime">
update SOTaskOrderHeader set CombineTime = GetDate() where site=#{site} and orderNo=#{orderNo}

8
src/main/resources/mapper/production/ReworkRecordMapper.xml

@ -156,8 +156,14 @@
lineleader,
tv_id
from Operator
where site = #{site}
<where>
<if test="site != null and site != ''">
and site = #{site}
</if>
<if test="operatorId != null and operatorId != ''">
and OperatorID = #{operatorId}
</if>
</where>
</select>
<update id="cancelRework">

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

@ -229,6 +229,7 @@
</if>
<if test="params.summaryType != null and params.summaryType >= 3">
T.BatchNo,
</if>
max(T.LatestOutDate) as LatestOutDate,
max(T.LatestInDate) as LatestInDate,
max(T.ActiveDate) as ActiveDate,
@ -236,7 +237,6 @@
max(T.ExpiredDate) as ExpiredDate,
max(T.DemandPartnerType) as DemandPartnerType,
max(T.DemandPartnerName) as DemandPartnerName,
</if>
min(T.FirstInDate) as FirstInDate,
sum(Round(T.QtyOnHand, 3)) as QtyOnHand
from InventoryStock as T,

Loading…
Cancel
Save