自动排查bug修复

master
zhaoxiaolin 7 months ago
parent 4f6b7c2990
commit fcacb113eb

@ -9,6 +9,15 @@ public class ProLine {
private Long efficiency;
private String dh;
private String factoryDh;
private String umrez;
public String getUmrez() {
return umrez;
}
public void setUmrez(String umrez) {
this.umrez = umrez;
}
public String getFactoryDh() {
return factoryDh;

@ -252,4 +252,6 @@ public interface ProOrderMapper {
int updateAutoSplitWork(String orderCode);
int updateAutoSplitOrder(String orderCode);
void updateAutoSplitOrderO2(String orderCode);
}

@ -460,6 +460,7 @@ public class ProOrderServiceImpl implements IProOrderService {
/**pro_order**/
int s = proOrderMapper.updateAutoSplitOrder(proOrder.getOrderCode());
proOrderMapper.updateAutoSplitOrderO2(proOrder.getOrderCode());
logger.info("s:"+s);
return R.ok();
}
@ -1411,13 +1412,11 @@ public class ProOrderServiceImpl implements IProOrderService {
for(int wm=0;wm<workorders.size();wm++){
BigDecimal wquaRatio = null;
if(wm != 0){//子单需要折算数量
wquaRatio = new BigDecimal(workorders.get(wm).getQuantitySplit())
.divide(new BigDecimal(workorders.get(0).getQuantitySplit()),2,BigDecimal.ROUND_UP);//proOrderWorkorderMapper.getQuaRatio(workorders.get(m-1).getProductCode());
wquaRatio = new BigDecimal(plineInfo.getUmrez());//proOrderWorkorderMapper.getQuaRatio(workorders.get(m-1).getProductCode());
workorders.get(wm).setQuantitySplit(wquaRatio.multiply(new BigDecimal(workorders.get(0).getQuantitySplit()))
.longValue());
}
}
int pm = proOrderWorkorderMapper.insertWorkorders(workorders);
System.out.println("pm:"+pm);
}

@ -427,6 +427,7 @@
where del_flag= '2' and belong_work_order like concat(#{orderCode},'-%')
</update>
<update id="updateAutoSplitOrder">
<!--
update pro_order
set status = 'o2',
quantity_split = quantity
@ -434,6 +435,25 @@
select order_code from pro_order_workorder
where del_flag= '0' and belong_work_order like concat(#{orderCode},'-%')
)
-->
update po
set po.quantity_split = pow.quantity_split
from (
select order_code,sum(quantity_split) quantity_split from pro_order_workorder
where del_flag= '0' and belong_work_order like concat(#{orderCode},'-%')
group by order_code
) pow
left join pro_order po on po.order_code = pow.order_code
where po.del_flag= '0'
</update>
<update id="updateAutoSplitOrderO2">
update pro_order
set status = (case when quantity = quantity_split then 'o2' else 'o1' end)
where del_flag= '0' and order_code in(
select order_code from pro_order_workorder
where del_flag= '0' and belong_work_order like concat(#{orderCode},'-%')
)
</update>
<delete id="deleteProOrderById" parameterType="String">

@ -650,11 +650,13 @@
</select>
<select id="getLineProductInfo" resultType="com.op.plan.domain.ProLine">
select mlp.efficiency efficiency,
bp.dh,sf.ancestors factoryDh
be.dh,sf.ancestors factoryDh,
bp.umrez
from mes_line_product mlp
left join base_equipment bp on mlp.line_code = bp.equipment_code
left join base_equipment be on mlp.line_code = be.equipment_code
left join sys_factory sf on sf.factory_code = mlp.factory_code and sf.del_flag = '0'
where mlp.del_flag = '0' and product_code = #{prodCode}
left join base_product bp on bp.product_code = mlp.product_code
where mlp.del_flag = '0' and mlp.product_code = #{prodCode}
and mlp.line_code = #{lineCode} and bp.del_flag = '0'
</select>
<select id="getProcessCode" resultType="java.lang.String">
@ -784,7 +786,7 @@
product_name,unit,quantity_split,route_code,prod_line_code,
product_date,parent_order, status,create_by,create_time,
prod_type,factory_code,end_flag,del_flag,sort_no,
belong_work_order,shift_id
belong_work_order,shift_id,product_id
)VALUES
<foreach collection="list" item="d" index="index" separator=",">
(
@ -792,7 +794,7 @@
#{d.productName},#{d.unit},#{d.quantitySplit},#{d.routeCode},#{d.prodLineCode},
#{d.productDate},#{d.parentOrder},#{d.status},#{d.createBy},#{d.createTime},
#{d.prodType}, #{d.factoryCode},#{d.endFlag},'2',#{d.sortNo},
#{d.belongWorkOrder},#{d.shiftId}
#{d.belongWorkOrder},#{d.shiftId},'autoSplit'
)
</foreach>
</insert>

Loading…
Cancel
Save