Merge remote-tracking branch 'origin/master'

master
Yangwl 11 months ago
commit b2dd3e1990

@ -392,7 +392,7 @@ public class MesReportWorkController extends BaseController {
return mesReportWorkService.getBatchList(ProOrderWorkorder);
}
/**获取母子报工记录**/
/**获取母子报工记录(废弃)---改为2.0查询各级报工详细列表**/
@RequiresPermissions("mes:reportWork:report")
@GetMapping("/getReportList")
public List getReportList(MesReportWork mesReportWork) {
@ -400,6 +400,14 @@ public class MesReportWorkController extends BaseController {
return rlist;
}
/**2.0查询各级报工详细列表**/
@RequiresPermissions("mes:reportWork:report")
@GetMapping("/getAllLevelReportList")
public List getAllLevelReportList(MesReportWork mesReportWork) {
List<MesReportWorkTabs> rlist = mesReportWorkService.getAllLevelReportList(mesReportWork);
return rlist;
}
@PostMapping("/submitReportPS")
public AjaxResult submitReportPS(@RequestBody List<MesReportWork> mesReportWorks) {
return toAjax(mesReportWorkService.submitReportPS(mesReportWorks));

@ -0,0 +1,48 @@
package com.op.mes.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* mes_report_work
*
* @author Open Platform
* @date 2023-08-24
*/
public class MesReportWorkTabs extends BaseEntity {
private static final long serialVersionUID = 1L;
private String libId;
private String title;
private List<MesReportWork> libList;
public String getLibId() {
return libId;
}
public void setLibId(String libId) {
this.libId = libId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public List<MesReportWork> getLibList() {
return libList;
}
public void setLibList(List<MesReportWork> libList) {
this.libList = libList;
}
}

@ -134,4 +134,6 @@ public interface MesReportWorkMapper {
int reportSapCancel(MesReportWork mesReportWork);
List<MesReportWork> getPutInOrderList(MesReportWork mesReportWorks);
ProOrderWorkorder getSonWorkOrder(String workorderCode);
}

@ -106,4 +106,6 @@ public interface IMesReportWorkService {
int reportSapCancel(MesReportWork mesReportWork);
List<MesReportWork> getPutInOrderList(MesReportWork mesReportWorks);
List<MesReportWorkTabs> getAllLevelReportList(MesReportWork mesReportWork);
}

@ -298,54 +298,39 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
//根据belong_work_order找到sap工单
List<MesReportWork> sapWorkOrders = mesReportWorkMapper.getSapWorkOrder(mesReportWork.getWorkorderCode());
if (CollectionUtils.isEmpty(sapWorkOrders) || sapWorkOrders.size() < 2) {
List<MesReportWork> workOrders = mesReportWorkMapper.getSapWorkOrder(mesReportWork.getWorkorderCode());
if (CollectionUtils.isEmpty(workOrders)) {
return R.fail("子母工单信息缺失");
}
/**子工单先报工,然后母工单报工**/
mesReportWork.setUploadStatus("1");//除了1报工成功的都需要报工
mesReportWork.setProdType("prod");
mesReportWork.setWorkorderCode(sapWorkOrders.get(1).getWorkorderCode());
MesReportWork sHzWorks = mesReportWorkMapper.getReportWorkHz(mesReportWork);
if (sHzWorks == null) {
return R.fail("未查询到子报工单");
}
//子工单报工
logger.info("==========================子工单报工开始");
R sapRson = this.reportHzToSap(sHzWorks);
logger.info("==========================子工单报工结束:" + JSONObject.toJSONString(sapRson));
if (sapRson.getCode() == 200) {
//一定是子单报工成功返回后,再母单报工
mesReportWork.setWorkorderCode(sapWorkOrders.get(0).getWorkorderCode());
MesReportWork pHzWork = mesReportWorkMapper.getReportWorkHz(mesReportWork);
if (pHzWork == null) {
return R.fail("未查询到母报工单");
R sapRson = null;
/**子工单先报工,然后母工单报工:workOrders内容就是-子子母**/
for(MesReportWork workOrder:workOrders){
mesReportWork.setUploadStatus("1");//除了1报工成功的都需要报工
mesReportWork.setProdType("prod");
mesReportWork.setWorkorderCode(workOrder.getWorkorderCode());
MesReportWork sHzWorks = mesReportWorkMapper.getReportWorkHz(mesReportWork);
if (sHzWorks == null) {
return R.fail(workOrder.getWorkorderCode()+"未查询到报工单");
}
try {
Thread.sleep(3000);
} catch (Exception e) {
e.printStackTrace();
//子工单报工
logger.info("==========================工单("+sHzWorks.getWorkorderCodeSap()+")报工开始");
sapRson = this.reportHzToSap(sHzWorks);
logger.info("==========================工单("+sHzWorks.getWorkorderCodeSap()+")报工结束:"
+ JSONObject.toJSONString(sapRson));
if (sapRson.getCode() == 200) {
try {
Thread.sleep(3000);
} catch (Exception e) {
e.printStackTrace();
}
//最终报工标识且sap报工成功关闭子母工单
//MesReportWork endReport = mesReportWorkMapper.getEndReport(pHzWork);
}else{
//报工不成功跳出循环
break;
}
//母工单报工
logger.info("==========================母工单报工开始");
pHzWork.setQuantityFeedback(sHzWorks.getQuantityFeedback());
pHzWork.setSac1(sHzWorks.getSac1());
R sapR = this.reportHzToSap(pHzWork);
logger.info("==========================母工单报工结束" + JSONObject.toJSONString(sapR));
return sapR;
//最终报工标识且sap报工成功关闭子母工单
// MesReportWork endReport = mesReportWorkMapper.getEndReport(pHzWork);
//-----改为由上位机触发
// if("1".equals(endReport.getEndReport())&&sapR.getCode()==200){
// MesReportWork rworkVo = new MesReportWork();
// rworkVo.setStatus("w3");
// rworkVo.setUpdateTime(DateUtils.getNowDate());
// rworkVo.setUpdateBy(SecurityUtils.getUsername());
// rworkVo.setWorkorderCode(belongWorkOrder);
// //pro_work_order status->w3报工--belong_work_order
// mesReportWorkMapper.updateOrderWorkStatus(rworkVo);
// }
}
return sapRson;
}

@ -151,6 +151,37 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
return mesReportWorkMapper.getReportList(mesReportWork);
}
@Override
@DS("#header.poolName")
public List<MesReportWorkTabs> getAllLevelReportList(MesReportWork mesReportWork) {
List<MesReportWorkTabs> tabs = new ArrayList<>();
MesReportWorkTabs pTabs = new MesReportWorkTabs();
int i = 1;
pTabs.setLibId("order"+i);
pTabs.setTitle("第"+i+"层工单信息");
mesReportWork.setParentOrder("0");
List<MesReportWork> liblist0 = mesReportWorkMapper.getReportList(mesReportWork);
pTabs.setLibList(liblist0);
tabs.add(pTabs);
ProOrderWorkorder sonWorkOrder = mesReportWorkMapper.getSonWorkOrder(mesReportWork.getWorkorderCode());
while(sonWorkOrder!=null){
int xh = ++i;
MesReportWorkTabs sTabs = new MesReportWorkTabs();
sTabs.setLibId("order"+xh);
sTabs.setTitle("第"+xh+"层工单信息");
mesReportWork.setParentOrder(sonWorkOrder.getParentOrder());
mesReportWork.setWorkorderCode(sonWorkOrder.getParentOrder());
List<MesReportWork> liblist = mesReportWorkMapper.getReportList(mesReportWork);
sTabs.setLibList(liblist);
tabs.add(sTabs);
sonWorkOrder = mesReportWorkMapper.getSonWorkOrder(sonWorkOrder.getWorkorderCode());
}
return tabs;
}
@Override
@DS("#header.poolName")
public int submitReportPS(List<MesReportWork> mesReportWorks) {

@ -473,7 +473,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
workorder_code workorderCode
from pro_order_workorder
where belong_work_order = #{workorderCode} and del_flag = '0' <!--and status = 'w2'-->
order by parent_order
order by order_code
</select>
<select id="getReportWorkHzList" resultType="com.op.mes.domain.MesReportWork">
select mrw.workorderCode,mrw.productCode,mrw.productName,mrw.machineCode,mrw.machineName,
@ -651,7 +651,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mrw.unit,
pow.factory_code factoryCode,
equ.workshop_name workshopName,
pow.attr2 version
po.atrr2 version
from mes_report_work mrw
left join pro_order_workorder pow on mrw.workorder_code = pow.workorder_code
left join base_equipment equ on equ.equipment_code = mrw.machine_code
@ -660,8 +660,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and mrw.workorder_code = #{workorderCode}
and mrw.del_flag = '0' and po.del_flag = '0'
</select>
<select id="getSonWorkOrder" resultType="com.op.mes.domain.ProOrderWorkorder">
select workorder_code workorderCode,
parent_order parentOrder
from pro_order_workorder
where parent_order = #{workorderCode}
and del_flag='0'
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>

@ -121,6 +121,23 @@ public class ProOrderWorkorderController extends BaseController {
List<ProOrderWorkorder> list = proOrderWorkorderService.selectProOrderWorkorderList(proOrderWorkorder);
return getDataTable(list);
}
/**查询生产工单列表--顶级母单**/
@RequiresPermissions("mes:pro:proworkorder:list")
@GetMapping("/listLevel0")
public TableDataInfo listLevel0(ProOrderWorkorder proOrderWorkorder) {
startPage();
List<ProOrderWorkorder> list = proOrderWorkorderService.getWorkorderLevel0List(proOrderWorkorder);
return getDataTable(list);
}
/**查询生产工单列表--下一级**/
@GetMapping("/getNextLevelWorkOrderList/{parentOrder}")
public List<ProOrderWorkorder> getNextLevelWorkOrderList(@PathVariable("parentOrder") String parentOrder) {
ProOrderWorkorder proOrderWorkorder = new ProOrderWorkorder();
proOrderWorkorder.setParentOrder(parentOrder);
List<ProOrderWorkorder> list = proOrderWorkorderService.getNextLevelWorkOrderList(proOrderWorkorder);
return list;
}
/**
*
@ -218,7 +235,7 @@ public class ProOrderWorkorderController extends BaseController {
}
/**
*
* workorderIds
*/
@RequiresPermissions("mes:pro:workorder:edit")
@Log(title = "下发生产工单", businessType = BusinessType.OTHER)

@ -286,6 +286,16 @@ public class ProOrderWorkorder extends TreeEntity {
*/
private String factoryCode;
private Boolean hasChildren;
public Boolean getHasChildren() {
return hasChildren;
}
public void setHasChildren(Boolean hasChildren) {
this.hasChildren = hasChildren;
}
public String getPproductCode() {
return pproductCode;
}

@ -178,5 +178,11 @@ public interface ProOrderWorkorderMapper {
List<ProOrderWorkorder> selectProOrderWorkorderList999(ProOrderWorkorder proOrderWorkorder);
ProWetMaterialPlanDetail getWetMaterial(String workorderId);
List<ProOrderWorkorder> getLevelWorkOrderList(ProOrderWorkorder proOrderWorkorder);
ProOrderWorkorder getSonWorkOrder(ProOrderWorkorder whiteOrder);
ProOrderWorkorder selectSonWorkOrder(String workorderCode);
}

@ -125,4 +125,8 @@ public interface IProOrderWorkorderService {
void deleteWhiteWorkorderByWorkOrder(List<ProOrderWorkorder> whiteWorkOrder);
AjaxResult subChangeWorkOrderM(SplitOrderDTO splitOrderDTO);
List<ProOrderWorkorder> getWorkorderLevel0List(ProOrderWorkorder proOrderWorkorder);
List<ProOrderWorkorder> getNextLevelWorkOrderList(ProOrderWorkorder proOrderWorkorder);
}

@ -321,8 +321,10 @@ public class ProOrderServiceImpl implements IProOrderService {
// code自增
endCode++;
} else {
// 设置子节点end_flag字段信息
workOrder.setEndFlag(1);
if(!"0".equals(workOrder.getParentOrder())) {
// 设置子节点end_flag字段信息
workOrder.setEndFlag(1);
}
// 更新数据库记录信息
proOrderWorkorderMapper.updateProOrderWorkorder(workOrder);
// 结束循环

@ -64,8 +64,6 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
@Autowired
private ProOrderMapper proOrderMapper;
@Autowired
private ProWorkorderProcessDetailMapper proWorkorderProcessDetailMapper;
@Autowired
private ProWetMaterialPlanDetailMapper proWetMaterialPlanDetailMapper;
@Autowired
private RemoteSapService remoteSapService;
@ -140,6 +138,71 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
return workorderList;
}
@Override
@DS("#header.poolName")
public List<ProOrderWorkorder> getWorkorderLevel0List(ProOrderWorkorder proOrderWorkorder) {
List<ProOrderWorkorder> workorderList = proOrderWorkorderMapper.getLevelWorkOrderList(proOrderWorkorder);
for (ProOrderWorkorder workorder : workorderList) {
// List<ProOrderWorkorder> childrens = new ArrayList<>();
// ProOrderWorkorder child = new ProOrderWorkorder();
// child.setWorkorderCode("test");
// childrens.add(child);
// workorder.setChildren(childrens);
workorder.setHasChildren(true);
String prodLineName = "";
String equipCods = "'";
JSONArray codeArray = JSONArray.parseArray(workorder.getProdLineCode());
for (int c = 0; c < codeArray.size(); c++) {
equipCods += codeArray.getJSONArray(c).getString(1) + "','";
}
Map<String, CascaderDTO> equipMap = proOrderMapper.getEquipInfoByCodes(equipCods.substring(1));//设备字典
for (int c = 0; c < codeArray.size(); c++) {
String equipCode = codeArray.getJSONArray(c).getString(1);
CascaderDTO eInfo = equipMap.get(equipCode);
if (eInfo != null) {
prodLineName += eInfo.getLabel() + ",";
}
}
workorder.setProdLineName(prodLineName);
// 通过工艺编码code查询出机型名称
workorder.setRouteName(proOrderWorkorderMapper.selectRouteNameByRouteCode(workorder.getRouteCode()));
}
return workorderList;
}
@Override
@DS("#header.poolName")
public List<ProOrderWorkorder> getNextLevelWorkOrderList(ProOrderWorkorder proOrderWorkorder) {
List<ProOrderWorkorder> workorderList = proOrderWorkorderMapper.getLevelWorkOrderList(proOrderWorkorder);
for (ProOrderWorkorder workorder : workorderList) {
String prodLineName = "";
String equipCods = "'";
JSONArray codeArray = JSONArray.parseArray(workorder.getProdLineCode());
for (int c = 0; c < codeArray.size(); c++) {
equipCods += codeArray.getJSONArray(c).getString(1) + "','";
}
Map<String, CascaderDTO> equipMap = proOrderMapper.getEquipInfoByCodes(equipCods.substring(1));//设备字典
for (int c = 0; c < codeArray.size(); c++) {
String equipCode = codeArray.getJSONArray(c).getString(1);
CascaderDTO eInfo = equipMap.get(equipCode);
if (eInfo != null) {
prodLineName += eInfo.getLabel() + ",";
}
}
workorder.setProdLineName(prodLineName);
// 通过工艺编码code查询出机型名称
workorder.setRouteName(proOrderWorkorderMapper.selectRouteNameByRouteCode(workorder.getRouteCode()));
workorder.setHasChildren(true);
}
return workorderList;
}
/**
*
*
@ -290,26 +353,30 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
wids.add(whiteOrder.getWorkorderId());
wcodes.add(whiteOrder.getWorkorderCode());
ordercodes.add(whiteOrder.getOrderCode());
Boolean isTop = true;
//成品的母工单//查上一级工单
while (isTop) {
//查上一级工单
whiteOrder.setWorkorderCode(whiteOrder.getParentOrder());
ProOrderWorkorder pWorkOrder = proOrderWorkorderMapper.getPWorkOrder(whiteOrder);
if (pWorkOrder != null) {
wids.add(pWorkOrder.getWorkorderId());
wcodes.add(pWorkOrder.getWorkorderCode());
ordercodes.add(pWorkOrder.getOrderCode());
}
if ("0".equals(pWorkOrder.getParentOrder())) {
BeanUtils.copyProperties(pWorkOrder, whiteOrder);
isTop = false;
Boolean isNotTop = true;
//成品的母工单//查下一级工单
while (isNotTop) {
if(!"0".equals(whiteOrder.getParentOrder())){
//查上一级工单
whiteOrder.setWorkorderCode(whiteOrder.getParentOrder());
ProOrderWorkorder sWorkOrder = proOrderWorkorderMapper.getSonWorkOrder(whiteOrder);
if (sWorkOrder != null) {
wids.add(sWorkOrder.getWorkorderId());
wcodes.add(sWorkOrder.getWorkorderCode());
ordercodes.add(sWorkOrder.getOrderCode());
}
if ("0".equals(sWorkOrder.getParentOrder())) {
BeanUtils.copyProperties(sWorkOrder, whiteOrder);
isNotTop = false;
}
}else{
isNotTop = false;
}
}
//顺序母子
Collections.reverse(wids);
Collections.reverse(wcodes);
Collections.reverse(ordercodes);
//顺序子母->母子
// Collections.reverse(wids);
// Collections.reverse(wcodes);
// Collections.reverse(ordercodes);
sapList = new ArrayList<>();
SapCreateOrder sap = new SapCreateOrder();
@ -356,11 +423,10 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
//关闭母子订单//订单的订单编码(关闭订单暂时隐藏)
SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery();
sapCloseOrderQuery.setLeadOrder(ordercodes.get(0));
sapCloseOrderQuery.setOrder(ordercodes.get(1));
sapCloseOrderQuery.setOrderCodes(ordercodes);
R closeR= remoteSapService.sapCloseOrder(sapCloseOrderQuery);
logger.info(whiteOrder.getWorkorderCode()+"下发工单后关闭母订单"+sapCloseOrderQuery.getLeadOrder()+":"+
sapCloseOrderQuery.getOrder()+":"+
logger.info(whiteOrder.getWorkorderCode()+"下发工单后关闭老订单"+
JSONObject.toJSONString(sapCloseOrderQuery)+
closeR.getCode()+","+
closeR.getMsg()+","+
closeR.getData());
@ -488,16 +554,6 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
return success(orderAndWork);
} else {
boolean run = true;
while (run) {
ProOrderWorkorder fatherWorkOrder = proOrderWorkorderMapper.selectWorkOrderByCode(proOrderWorkorder.getParentOrder());
// 如果存在父工单
if (fatherWorkOrder != null) {
BeanUtils.copyProperties(fatherWorkOrder, proOrderWorkorder);
} else {
run = false;
}
}
// 通过母订单id查询母订单详情
ProOrder proOrder = proOrderMapper.selectProOrderById(proOrderWorkorder.getOrderId());
if (proOrder != null) {
@ -894,7 +950,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
}
/**
* code
* code
*
* @param code
* @return
@ -905,34 +961,24 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
// 创建返回工单列表
List<ProOrderWorkorder> proOrderWorkorderList = new ArrayList<ProOrderWorkorder>();
// 查询该工单信息
ProOrderWorkorder proOrderWorkorder = proOrderWorkorderMapper.selectWorkOrderByCode(code);
formatProOrderWorkorder(proOrderWorkorder);
proOrderWorkorderList.add(proOrderWorkorder);
ProOrderWorkorder pWorkorder = proOrderWorkorderMapper.selectWorkOrderByCode(code);
formatProOrderWorkorder(pWorkorder);
proOrderWorkorderList.add(pWorkorder);
boolean flag = true;
// 临时存放parentCode
StringBuilder tempCode = new StringBuilder();
tempCode.append(proOrderWorkorder.getParentOrder());
String parentOrder = pWorkorder.getWorkorderCode();
//母查子遍历
while (flag) {
ProOrderWorkorder workorder = proOrderWorkorderMapper.selectWorkOrderByCode(tempCode.toString());
ProOrderWorkorder workorder = proOrderWorkorderMapper.selectSonWorkOrder(parentOrder);
if (workorder != null) {
formatProOrderWorkorder(workorder);
proOrderWorkorderList.add(workorder);
tempCode.setLength(0);
tempCode.append(workorder.getParentOrder());
parentOrder = workorder.getWorkorderCode();
} else {
flag = false;
}
}
// 反转list
List<ProOrderWorkorder> reversalWorkOrderList = new ArrayList<>();
for (int i = proOrderWorkorderList.size() - 1; i >= 0; i--) {
reversalWorkOrderList.add(proOrderWorkorderList.get(i));
}
return success(reversalWorkOrderList);
return success(proOrderWorkorderList);
}
/**
@ -1033,6 +1079,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
proOrderWorkorder.setShiftDesc(shiftDesc);
proOrderWorkorder.setBatchCodeList(batchCodes);
proOrderWorkorder.setBatchNumList(batchNums);
proOrderWorkorder.setHasChildren(null);//会直接导致树结构不展示
// 通过母工单workorder_id查询子工单
List<ProOrderWorkorder> childWorkorders = proOrderWorkorderMapper.selectChildWorkOrder(proOrderWorkorder.getWorkorderCode());
if (!childWorkorders.isEmpty()) {

@ -65,7 +65,7 @@
pow.workorder_code_sap,
ppow.product_code pproductCode,ppow.product_name pproductName,ppow.workorder_code_sap pworkorderCodeSap
from pro_order_workorder pow
left join pro_order_workorder ppow on pow.parent_order = ppow.workorder_code
left join pro_order_workorder ppow on pow.parent_order = ppow.workorder_code and ppow.del_flag = '0'
<where>
<if test="workorderCode != null and workorderCode != ''">and pow.workorder_code like concat('%',
#{workorderCode}, '%')
@ -95,7 +95,45 @@
</if>
<if test="productDateEnd != null ">and '${productDateEnd}' >= CONVERT(varchar(10),pow.product_date, 120)
</if>
and pow.del_flag = '0' and ppow.del_flag = '0'
and pow.del_flag = '0'
</where>
</select>
<select id="getLevelWorkOrderList" parameterType="ProOrderWorkorder" resultMap="ProOrderWorkorderResult">
select pow.workorder_id, pow.workorder_code, pow.workorder_name, pow.order_id, pow.order_code,
pow.product_code, pow.product_name,pow.product_spc, pow.unit, pow.quantity_split,
pow.route_code, pow.prod_line_code, pow.product_date,
pow.shift_id, pow.parent_order,pow.status, pow.prod_type,pow.factory_code,
pow.end_flag,pow.car_num,pow.sort_no,
pow.workorder_code_sap
from pro_order_workorder pow
<where>
<if test="workorderCode != null and workorderCode != ''">and pow.workorder_code like concat('%',
#{workorderCode}, '%')
</if>
<if test="workorderName != null and workorderName != ''">and pow.workorder_name like concat('%',
#{workorderName}, '%')
</if>
<if test="orderId != null and orderId != ''">and pow.order_id = #{orderId}</if>
<if test="orderCode != null and orderCode != ''">and pow.order_code like concat('%', #{orderCode}, '%')</if>
<if test="productCode != null and productCode != ''">
and ppow.product_code like concat('%', #{productCode},'%')
</if>
<if test="productName != null and productName != ''">
and ppow.product_name like concat('%', #{productName},'%')
</if>
<if test="productDate != null ">and pow.product_date = #{productDate}</if>
<if test="shiftId != null and shiftId != ''">and pow.shift_id = #{shiftId}</if>
<if test="status != null and status != ''">and pow.status = #{status}</if>
<if test="statusArray != null and statusArray != ''">and pow.status in (${statusArray})</if>
<if test="prodType != null and prodType != ''">and pow.prod_type = #{prodType}</if>
<if test="factoryCode != null and factoryCode != ''">and pow.factory_code = #{factoryCode}</if>
<if test="endFlag != null and endFlag != ''">and pow.end_flag = #{endFlag}</if>
<if test="productDateStart != null ">and CONVERT(varchar(10),pow.product_date, 120) >=
'${productDateStart}'
</if>
<if test="productDateEnd != null ">and '${productDateEnd}' >= CONVERT(varchar(10),pow.product_date, 120)</if>
and pow.parent_order = #{parentOrder}
and pow.del_flag = '0'
</where>
</select>
<select id="selectProOrderWorkorderList999" resultMap="ProOrderWorkorderResult">
@ -174,6 +212,12 @@
and del_flag = '0'
</select>
<select id="selectSonWorkOrder" resultMap="ProOrderWorkorderResult">
<include refid="selectProOrderWorkorderVo"/>
where parent_order = #{workorderCode}
and del_flag = '0'
</select>
<select id="selectEndWorkOrder" resultType="java.lang.String">
select TOP 1 workorder_code
FROM pro_order_workorder
@ -438,6 +482,14 @@
where workorder_code = #{workorderCode}
and del_flag = '0'
</select>
<select id="getSonWorkOrder" resultMap="ProOrderWorkorderResult">
select workorder_id, workorder_code, order_id, order_code,
product_code, product_name, product_date, parent_order,
quantity_split,unit,prod_type, factory_code
from pro_order_workorder
where parent_order = #{workorderCode}
and del_flag = '0'
</select>
<select id="getWetMaterial" resultType="com.op.plan.domain.ProWetMaterialPlanDetail">
select top 1 material_code materialCode,
material_name materialName

Loading…
Cancel
Save