工单设备修改

highway
zhaoxiaolin 1 year ago
parent f221f0ec05
commit 93f60c6f6c

@ -77,6 +77,18 @@ public class ProOrderWorkorderController extends BaseController {
return proOrderWorkorderService.subChangeWorkOrder(splitOrderDTO); return proOrderWorkorderService.subChangeWorkOrder(splitOrderDTO);
} }
/**
* -
*
* @param splitOrderDTO
* @return
*/
@PostMapping("/subChangeWorkOrderM")
@RequiresPermissions("mes:pro:workorder:edit")
public AjaxResult subChangeWorkOrderM(@RequestBody SplitOrderDTO splitOrderDTO) {
return proOrderWorkorderService.subChangeWorkOrderM(splitOrderDTO);
}
/** /**
* list * list
* *

@ -154,5 +154,9 @@ public interface ProOrderWorkorderMapper {
void deleteProOrderWorkorderByOrderIds(String[] orderIds); void deleteProOrderWorkorderByOrderIds(String[] orderIds);
List<String> getBatchInfo(String workorderCode); List<String> getBatchInfo(String workorderCode);
ProOrderWorkorder getWorkOrderByCode(String workorderCode);
void updateProOrderWorkorderM(ProOrderWorkorder proWorkOrder);
} }

@ -120,4 +120,6 @@ public interface IProOrderWorkorderService {
* @param whiteWorkOrder * @param whiteWorkOrder
*/ */
void deleteWhiteWorkorderByWorkOrder(List<ProOrderWorkorder> whiteWorkOrder); void deleteWhiteWorkorderByWorkOrder(List<ProOrderWorkorder> whiteWorkOrder);
AjaxResult subChangeWorkOrderM(SplitOrderDTO splitOrderDTO);
} }

@ -1035,4 +1035,36 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
return workBatch; return workBatch;
} }
/**
*
*
* @param splitOrderDTO
* @return
*/
@Override
@DS("#header.poolName")
@Transactional
public AjaxResult subChangeWorkOrderM(SplitOrderDTO splitOrderDTO) {
ProOrderWorkorder proWorkOrder = splitOrderDTO.getProOrderWorkorder();
proWorkOrder.setProdLineCode(JSONArray.toJSONString(splitOrderDTO.getProdLineCodeArray()));
proWorkOrder.setUpdateBy(SecurityUtils.getUsername());
proWorkOrder.setUpdateTime(DateUtils.getNowDate());
// 白坯订单变更逻辑
if (splitOrderDTO.getProOrderWorkorder().getProdType().equals("white")) {
proOrderWorkorderMapper.updateProOrderWorkorderM(proWorkOrder);
}else{
proOrderWorkorderMapper.updateProOrderWorkorder(proWorkOrder);
//pro_order_workorder
ProOrderWorkorder topWorkOrder = proOrderWorkorderMapper.getWorkOrderByCode(proWorkOrder.getWorkorderCode());
while (!"0".equals(topWorkOrder.getParentOrder()) && StringUtils.isNotEmpty(topWorkOrder.getParentOrder())) {
//pro_order_workorder
topWorkOrder = proOrderWorkorderMapper.getWorkOrderByCode(topWorkOrder.getParentOrder());
proWorkOrder.setWorkorderId(topWorkOrder.getWorkorderId());
proOrderWorkorderMapper.updateProOrderWorkorderM(proWorkOrder);
}
}
return success("变更成功");
}
} }

@ -353,6 +353,13 @@
from pro_order_workorder_batch from pro_order_workorder_batch
where workorder_id = #{workorderId} and del_flag = '0' where workorder_id = #{workorderId} and del_flag = '0'
</select> </select>
<select id="getWorkOrderByCode" resultType="com.op.plan.domain.ProOrderWorkorder">
select workorder_id workorderId,
workorder_code workorderCode,
parent_order parentOrder
from pro_order_workorder
where workorder_code = #{workorderCode} and del_flag = '0'
</select>
<insert id="createPrepareDetails"> <insert id="createPrepareDetails">
insert into mes_prepare_detail insert into mes_prepare_detail
@ -424,6 +431,15 @@
where workorder_code = #{workorderId} where workorder_code = #{workorderId}
and del_flag = '0' and del_flag = '0'
</update> </update>
<update id="updateProOrderWorkorderM">
update pro_order_workorder
<trim prefix="SET" suffixOverrides=",">
<if test="prodLineCode != null">prod_line_code = #{prodLineCode},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where workorder_id = #{workorderId}
</update>
<delete id="deleteProOrderWorkorderByWorkorderId" parameterType="String"> <delete id="deleteProOrderWorkorderByWorkorderId" parameterType="String">
update pro_order_workorder update pro_order_workorder

Loading…
Cancel
Save