报工-自动添加项目编码2

master
zhaoxiaolin 7 months ago
parent 0e973d74c1
commit c97e3fc817

@ -83,4 +83,6 @@ public interface MesReportWorkConsumeMapper {
MesReportWorkConsume getNewConsumeInfo(String workorderCode);
List<MesReportWorkConsume> getSumConsumeList(MesReportWorkConsume consumeqo);
int getSumConsumeListNum(MesReportWorkConsume consumeqo);
}

@ -628,7 +628,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
if(StringUtils.isNotBlank(consume.getRspos())){//自主加的物料
lthw.setRspos(consume.getRspos());//sap物料项目凭证
}else{
int xhnumber = Integer.parseInt(consumes.get(0).getRspos())+1;
int xhnumber = mesReportWorkConsumeMapper.getSumConsumeListNum(consumeqo);;
String paddedNumber = String.format("%04d", xhnumber);
lthw.setRspos(paddedNumber);//sap物料项目凭证(手动添加的,系统进行累加)
}

@ -187,7 +187,20 @@
and mrwc.workorder_code = #{workorderCode}
and mrw.machine_code = #{machineCode} and mrwc.recoil = #{recoil}
) t group by t.materialCode,t.rspos
order by t.rspos desc
</select>
<select id="getSumConsumeListNum" resultType="java.lang.Integer">
select count(0)+1 from(
select DISTINCT
mrwc.material_code materialCode,
mrwc.quantity,
mrwc.rspos
from mes_report_work_consume mrwc
left join mes_report_work mrw on mrw.report_code = mrwc.report_code
left join pro_order_workorder pow on mrwc.workorder_code = pow.workorder_code
where mrwc.del_flag = '0' and pow.del_flag = '0'
and mrwc.workorder_code = #{workorderCode} and mrwc.rspos is not null
and mrw.machine_code = #{machineCode}
)t
</select>
<insert id="insertMesReportWorkConsume" parameterType="MesReportWorkConsume">

Loading…
Cancel
Save