订单计划管理(工单班次名称获取)

highway
wws 1 year ago
parent a491155b75
commit 0425f44ef9

@ -143,4 +143,12 @@ public interface ProOrderMapper {
public List<ProLine> selectPackageLine(); public List<ProLine> selectPackageLine();
public void updateOrderBatch(@Param("workers") List<ProOrderWorkorder> workers); public void updateOrderBatch(@Param("workers") List<ProOrderWorkorder> workers);
/**
* id
*
* @param shiftId
* @return
*/
String selectShiftNameById(String shiftId);
} }

@ -175,6 +175,8 @@ public class ProOrderServiceImpl implements IProOrderService {
List<ProOrderWorkorder> proOrderWorkorderList = proOrderWorkorderMapper.selectFirWorkOrder(id); List<ProOrderWorkorder> proOrderWorkorderList = proOrderWorkorderMapper.selectFirWorkOrder(id);
// 母工单循环遍历 // 母工单循环遍历
for (int i = 0; i < proOrderWorkorderList.size(); i++) { for (int i = 0; i < proOrderWorkorderList.size(); i++) {
// 通过班次id查询班次名称
String shiftDesc = proOrderMapper.selectShiftNameById(proOrderWorkorderList.get(i).getShiftId());
// 通过设备code查询出机型名称 // 通过设备code查询出机型名称
String prodLineName = proOrderMapper.selectProdLineName(proOrderWorkorderList.get(i).getProdLineCode()); String prodLineName = proOrderMapper.selectProdLineName(proOrderWorkorderList.get(i).getProdLineCode());
// 通过工单id查询批次号 // 通过工单id查询批次号
@ -192,15 +194,18 @@ public class ProOrderServiceImpl implements IProOrderService {
List<ProOrderWorkorder> thiProOrderWorkorders = proOrderWorkorderMapper.selectChildWorkOrder(secProOrderWorkorder.get(0).getWorkorderCode()); List<ProOrderWorkorder> thiProOrderWorkorders = proOrderWorkorderMapper.selectChildWorkOrder(secProOrderWorkorder.get(0).getWorkorderCode());
if (thiProOrderWorkorders.size() > 0 && thiProOrderWorkorders != null) { if (thiProOrderWorkorders.size() > 0 && thiProOrderWorkorders != null) {
// 将三级放入二级child // 将三级放入二级child
thiProOrderWorkorders.get(0).setShiftDesc(shiftDesc);
thiProOrderWorkorders.get(0).setProdLineCode(prodLineName); thiProOrderWorkorders.get(0).setProdLineCode(prodLineName);
thiProOrderWorkorders.get(0).setBatchCodeList(batchCodes); thiProOrderWorkorders.get(0).setBatchCodeList(batchCodes);
secProOrderWorkorder.get(0).setChildren(thiProOrderWorkorders); secProOrderWorkorder.get(0).setChildren(thiProOrderWorkorders);
} }
// 将二级放入到母工单child // 将二级放入到母工单child
secProOrderWorkorder.get(0).setShiftDesc(shiftDesc);
secProOrderWorkorder.get(0).setProdLineCode(prodLineName); secProOrderWorkorder.get(0).setProdLineCode(prodLineName);
secProOrderWorkorder.get(0).setBatchCodeList(batchCodes); secProOrderWorkorder.get(0).setBatchCodeList(batchCodes);
proOrderWorkorderList.get(i).setChildren(secProOrderWorkorder); proOrderWorkorderList.get(i).setChildren(secProOrderWorkorder);
} }
proOrderWorkorderList.get(i).setShiftDesc(shiftDesc);
proOrderWorkorderList.get(i).setProdLineCode(prodLineName); proOrderWorkorderList.get(i).setProdLineCode(prodLineName);
proOrderWorkorderList.get(i).setBatchCodeList(batchCodes); proOrderWorkorderList.get(i).setBatchCodeList(batchCodes);
} }

@ -121,7 +121,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE equipment_type_code = 'equ_type_bzx' WHERE equipment_type_code = 'equ_type_bzx'
</select> </select>
<insert id="insertProOrder" parameterType="ProOrder"> <select id="selectShiftNameById" resultType="java.lang.String">
SELECT bst.Shift_Desc_Global shiftDesc
FROM base_shifts_t bst
WHERE bst.Shift_Id = #{shiftId}
</select>
<insert id="insertProOrder" parameterType="ProOrder">
insert into pro_order insert into pro_order
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if> <if test="id != null">id,</if>

Loading…
Cancel
Save