Merge remote-tracking branch 'origin/master'

# Conflicts:
#	ABAP_AS_WITH_POOL.jcoDestination
#	op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java
#	op-modules/op-mes/src/main/java/com/op/mes/service/IWCSInterfaceService.java
#	op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java
highway
Yangwl 1 year ago
commit fec239c59c

@ -1,114 +0,0 @@
**** Error file opened at 20230724 105509 China Standard Time Rel. 3.0.17 (2017-07-17) [721.913]
Error: >Mon Jul 24 10:55:09,173< RfcException:
message: Connect to SAP gateway failed
Connection parameters: TYPE=A DEST=ABAP_AS_WITH_POOL ASHOST=192.168.0.53 SYSNR=00 PCS=1
LOCATION CPIC (TCP/IP) on local host with Unicode
ERROR partner '192.168.0.53:3300' not reached
TIME Mon Jul 24 10:55:09 2023
RELEASE 721
COMPONENT NI (network interface)
VERSION 40
RC -10
MODULE nixxi.cpp
LINE 3289
DETAIL NiPConnect2: 192.168.0.53:3300
SYSTEM CALL connect
ERRNO 10060
ERRNO TEXT WSAETIMEDOUT: Connection timed out
COUNTER 2
return code: RFC_FAILURE (1)
error group: 102
key: RFC_ERROR_COMMUNICATION
Error: >Mon Jul 24 10:55:30,220< RfcException:
message: Connect to SAP gateway failed
Connection parameters: TYPE=A DEST=ABAP_AS_WITH_POOL ASHOST=192.168.0.53 SYSNR=00 PCS=1
LOCATION CPIC (TCP/IP) on local host with Unicode
ERROR partner '192.168.0.53:3300' not reached
TIME Mon Jul 24 10:55:30 2023
RELEASE 721
COMPONENT NI (network interface)
VERSION 40
RC -10
MODULE nixxi.cpp
LINE 3289
DETAIL NiPConnect2: 192.168.0.53:3300
SYSTEM CALL connect
ERRNO 10060
ERRNO TEXT WSAETIMEDOUT: Connection timed out
COUNTER 4
return code: RFC_FAILURE (1)
error group: 102
key: RFC_ERROR_COMMUNICATION
**** Error file opened at 20230725 103104 China Standard Time Rel. 3.0.17 (2017-07-17) [721.913]
Error: >Tue Jul 25 10:31:04,628< RfcException:
message: Connect to SAP gateway failed
Connection parameters: TYPE=A DEST=ABAP_AS_WITH_POOL ASHOST=192.168.0.53 SYSNR=00 PCS=1
LOCATION CPIC (TCP/IP) on local host with Unicode
ERROR partner '192.168.0.53:3300' not reached
TIME Tue Jul 25 10:31:04 2023
RELEASE 721
COMPONENT NI (network interface)
VERSION 40
RC -10
MODULE nixxi.cpp
LINE 3289
DETAIL NiPConnect2: 192.168.0.53:3300
SYSTEM CALL connect
ERRNO 10060
ERRNO TEXT WSAETIMEDOUT: Connection timed out
COUNTER 2
return code: RFC_FAILURE (1)
error group: 102
key: RFC_ERROR_COMMUNICATION
Error: >Tue Jul 25 10:31:25,675< RfcException:
message: Connect to SAP gateway failed
Connection parameters: TYPE=A DEST=ABAP_AS_WITH_POOL ASHOST=192.168.0.53 SYSNR=00 PCS=1
LOCATION CPIC (TCP/IP) on local host with Unicode
ERROR partner '192.168.0.53:3300' not reached
TIME Tue Jul 25 10:31:25 2023
RELEASE 721
COMPONENT NI (network interface)
VERSION 40
RC -10
MODULE nixxi.cpp
LINE 3289
DETAIL NiPConnect2: 192.168.0.53:3300
SYSTEM CALL connect
ERRNO 10060
ERRNO TEXT WSAETIMEDOUT: Connection timed out
COUNTER 4
return code: RFC_FAILURE (1)
error group: 102
key: RFC_ERROR_COMMUNICATION
**** Error file opened at 20230816 113444 China Standard Time Rel. 3.0.17 (2017-07-17) [721.913]
Error: >Wed Aug 16 11:34:44,064< >RfcGetException rc (7) message: Invalid value in OPTION field of value table for IN itab operator. operator.
<RfcGetException
**** Error file opened at 20230816 174253 China Standard Time Rel. 3.0.17 (2017-07-17) [721.913]
Error: >Wed Aug 16 17:42:53,538< >RfcGetException rc (7) message: Invalid value in OPTION field of value table for IN itab operator. operator.
<RfcGetException
**** Error file opened at 20230816 174447 China Standard Time Rel. 3.0.17 (2017-07-17) [721.913]
Error: >Wed Aug 16 17:44:47,079< >RfcGetException rc (7) message: Invalid value in OPTION field of value table for IN itab operator. operator.
<RfcGetException

@ -0,0 +1,90 @@
package com.op.system.api.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
*
*
* @author OP
*/
public class SysSapLog {
private String id;
private String messsge;
private Date createTime;
private String reqcode;
private String method;
private String remark;
private String status;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMesssge() {
return messsge;
}
public void setMesssge(String messsge) {
this.messsge = messsge;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getReqcode() {
return reqcode;
}
public void setReqcode(String reqcode) {
this.reqcode = reqcode;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("messsge", getMesssge())
.append("createTime", getCreateTime())
.append("reqcode", getReqcode())
.append("method", getMethod())
.append("remark", getRemark())
.append("status", getStatus())
.toString();
}
}

@ -54,7 +54,7 @@ public class ProRfidProcessDetail extends BaseEntity {
/** 出时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出时间", width = 30, dateFormat = "yyyy-MM-dd")
@Excel(name = "出时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date outTime;
/** 状态0待办1完成 */
@ -107,6 +107,39 @@ public class ProRfidProcessDetail extends BaseEntity {
@Excel(name = "订单号")
private String orderCode;
@Excel(name = "产品编码")
private String productName;
@Excel(name = "生产时间")
private String productDate;
@Excel(name = "班次")
private String shiftId;
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String getProductDate() {
return productDate;
}
public void setProductDate(String productDate) {
this.productDate = productDate;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getOrderCode() {
return orderCode;
}
@ -288,29 +321,35 @@ public class ProRfidProcessDetail extends BaseEntity {
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordId", getRecordId())
.append("workorderCode", getWorkorderCode())
.append("rfid", getRfid())
.append("factoryCode", getFactoryCode())
.append("machineCode", getMachineCode())
.append("nowProcessId", getNowProcessId())
.append("nextProcessId", getNextProcessId())
.append("orderNum", getOrderNum())
.append("inTime", getInTime())
.append("outTime", getOutTime())
.append("status", getStatus())
.append("remark", getRemark())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("workBatchCode", getWorkBatchCode())
.append("bindStatus", getBindStatus())
.toString();
return "ProRfidProcessDetail{" +
"recordId='" + recordId + '\'' +
", workorderCode='" + workorderCode + '\'' +
", rfid='" + rfid + '\'' +
", factoryCode='" + factoryCode + '\'' +
", machineCode='" + machineCode + '\'' +
", prodLineCode='" + prodLineCode + '\'' +
", nowProcessId='" + nowProcessId + '\'' +
", nextProcessId='" + nextProcessId + '\'' +
", orderNum=" + orderNum +
", inTime=" + inTime +
", outTime=" + outTime +
", status='" + status + '\'' +
", attr1='" + attr1 + '\'' +
", attr2='" + attr2 + '\'' +
", attr3='" + attr3 + '\'' +
", attr4='" + attr4 + '\'' +
", workBatchCode='" + workBatchCode + '\'' +
", bindStatus='" + bindStatus + '\'' +
", productCode='" + productCode + '\'' +
", productModel='" + productModel + '\'' +
", nowProcessCode='" + nowProcessCode + '\'' +
", nowProcessName='" + nowProcessName + '\'' +
", nextProcessCode='" + nextProcessCode + '\'' +
", nextProcessName='" + nextProcessName + '\'' +
", orderCode='" + orderCode + '\'' +
", productName='" + productName + '\'' +
", productDate='" + productDate + '\'' +
", shiftId='" + shiftId + '\'' +
'}';
}
}

@ -142,4 +142,13 @@ public class SapRFW {
'}';
}
}
@Override
public String toString() {
return "{" +
"aufnr:"+aufnr+","+
"gamng:"+gamng+","+
"lt_gs:"+lt_gs.toString()+","+
"lt_hw:"+lt_hw.toString()+","+
"}";
}
}

@ -1,5 +1,8 @@
package com.op.system.api.domain.sap;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class SapShopOrderQuery {
// S_AUFNR订单号 S_MATNR物料号 S_ERDAT(创建日期)
@ -39,4 +42,12 @@ public class SapShopOrderQuery {
public void setErdat(String erdat) {
this.erdat = erdat;
}
@Override
public String toString() {
return "{aufnr:"+":"+getAufnr()+","+
"matnr"+":"+getMatnr()+","+
"erdat"+":"+getErdat()+","+
"erdat"+":"+getWerk()+"}";
}
}

@ -107,8 +107,8 @@ public class EquRepairWorkOrderController extends BaseController {
*/
@RequiresPermissions("device:repairOrder:apply")
@PostMapping("/apply")
public AjaxResult apply(@RequestBody EquOutsourceWork equOutsourceWork) {
return toAjax(equOutsourceWorkService.insertEquOutsourceWork(equOutsourceWork));
public AjaxResult apply(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return toAjax(equRepairWorkOrderService.applyEquOutsourceWork(equRepairWorkOrder));
}
/**
@ -117,7 +117,7 @@ public class EquRepairWorkOrderController extends BaseController {
@RequiresPermissions("device:repairOrder:write")
@PostMapping("/write")
public AjaxResult write(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
equRepairWorkOrder.setWorkCost(equRepairWorkOrder.getWorkCost()+"元");
equRepairWorkOrder.setWorkCost(equRepairWorkOrder.getWorkCost());
return toAjax(equRepairWorkOrderService.updateEquRepairWorkOrder(equRepairWorkOrder));
}

@ -94,4 +94,12 @@ public class EquTeamController extends BaseController {
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(equTeamService.deleteEquTeamByIds(ids));
}
//查询设备维修班组
@GetMapping("/getMaintenanceTeamList")
public TableDataInfo getMaintenanceTeamList(EquTeam equTeam) {
startPage();
List<EquTeam> list = equTeamService.getMaintenanceTeamList(equTeam);
return getDataTable(list);
}
}

@ -8,6 +8,7 @@ import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquPlan;
import com.op.device.service.IEquUpkeepOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -66,8 +67,8 @@ public class EquUpkeepOrderController extends BaseController {
@RequiresPermissions("device:upkeepOrder:add")
@Log(title = "保养工单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquOrder equOrder) {
return toAjax(equUpkeepOrderService.insertEquOrder(equOrder));
public AjaxResult add(@RequestBody EquPlan equPlan) {
return equUpkeepOrderService.insertEquOrder(equPlan);
}
/**

@ -0,0 +1,182 @@
package com.op.device.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* equ_order_equ_spare
*
* @author Open Platform
* @date 2023-11-02
*/
public class EquOrderEquSpare extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 编码 */
@Excel(name = "编码")
private String code;
/** 主工单信息 */
@Excel(name = "主工单信息")
private String orderCode;
/** 关联上级code */
@Excel(name = "关联上级code")
private String parentCode;
/** 备件code */
@Excel(name = "备件code")
private String materialCode;
/** 备件名称 */
@Excel(name = "备件名称")
private String materialDesc;
/** 备件类型 */
@Excel(name = "备件类型")
private String spareType;
/** 申领数量 */
@Excel(name = "申领数量")
private BigDecimal applyNum;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标识 */
private String delFlag;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setCode(String code) {
this.code = code;
}
public String getCode() {
return code;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setParentCode(String parentCode) {
this.parentCode = parentCode;
}
public String getParentCode() {
return parentCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialDesc(String materialDesc) {
this.materialDesc = materialDesc;
}
public String getMaterialDesc() {
return materialDesc;
}
public void setSpareType(String spareType) {
this.spareType = spareType;
}
public String getSpareType() {
return spareType;
}
public void setApplyNum(BigDecimal applyNum) {
this.applyNum = applyNum;
}
public BigDecimal getApplyNum() {
return applyNum;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("code", getCode())
.append("orderCode", getOrderCode())
.append("parentCode", getParentCode())
.append("materialCode", getMaterialCode())
.append("materialDesc", getMaterialDesc())
.append("spareType", getSpareType())
.append("applyNum", getApplyNum())
.append("factoryCode", getFactoryCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -25,8 +25,12 @@ public class EquOutsourceWork extends BaseEntity {
@Excel(name = "报修编码")
private String orderCode;
/** 维修人员 */
@Excel(name = "维修人员")
/** 维修编码 */
@Excel(name = "维修编码")
private String repairCode;
/** 委外维修人员 */
@Excel(name = "委外维修人员")
private String workPerson;
/** 委外单位 */
@ -41,16 +45,12 @@ public class EquOutsourceWork extends BaseEntity {
@Excel(name = "原因")
private String workReason;
/** 委外原因 */
@Excel(name = "委外原因")
private String outSourceReason;
/** 委外类型 */
@Excel(name = "委外类型")
private String workType;
/** 管理单号 */
@Excel(name = "管理单号")
/** 设备编码 */
@Excel(name = "设备编码")
private String equipmentCode;
/** 委外费用 */
@ -80,10 +80,30 @@ public class EquOutsourceWork extends BaseEntity {
@Excel(name = "工厂编码")
private String factoryCode;
// 设备
/** 设备名称 */
@Excel(name = "设备名称")
private String equipmentName;
/** 规格型号 */
@Excel(name = "规格型号")
private String equipmentSpec;
/** 设备类型名称 */
@Excel(name = "设备类型名称")
private String equipmentTypeName;
/** 设备位置 */
@Excel(name = "设备位置")
private String equipmentLocation;
/** 部门 */
@Excel(name = "部门")
private String department;
public void setWorkId(String workId) {
this.workId = workId;
}
public String getWorkId() {
return workId;
}
@ -91,7 +111,6 @@ public class EquOutsourceWork extends BaseEntity {
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
@ -99,107 +118,142 @@ public class EquOutsourceWork extends BaseEntity {
public void setWorkCode(String workCode) {
this.workCode = workCode;
}
public String getWorkCode() {
return workCode;
}
public void setRepairCode(String repairCode) {
this.repairCode = repairCode;
}
public String getRepairCode() {
return repairCode;
}
public void setWorkPerson(String workPerson) {
this.workPerson = workPerson;
}
public String getWorkPerson() {
return workPerson;
}
public void setWorkOutsourcingUnit(String workOutsourcingUnit) {
this.workOutsourcingUnit = workOutsourcingUnit;
}
public String getWorkOutsourcingUnit() {
return workOutsourcingUnit;
}
public void setWorkConnection(String workConnection) {
this.workConnection = workConnection;
}
public String getWorkConnection() {
return workConnection;
}
public void setWorkReason(String workReason) {
this.workReason = workReason;
}
public String getWorkReason() {
return workReason;
}
public void setWorkType(String workType) {
this.workType = workType;
}
public String getWorkType() {
return workType;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setWorkCost(String workCost) {
this.workCost = workCost;
}
public String getWorkCost() {
return workCost;
}
public void setWorkCostTime(String workCostTime) {
this.workCostTime = workCostTime;
}
public String getWorkCostTime() {
return workCostTime;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setOutSourceReason(String outSourceReason) {
this.outSourceReason = outSourceReason;
//设备
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getEquipmentName() {
return equipmentName;
}
public void setEquipmentSpec(String equipmentSpec) {
this.equipmentSpec = equipmentSpec;
}
public String getEquipmentSpec() {
return equipmentSpec;
}
public void setEquipmentTypeName(String equipmentTypeName) {
this.equipmentTypeName = equipmentTypeName;
}
public String getEquipmentTypeName() {
return equipmentTypeName;
}
public void setEquipmentLocation(String equipmentLocation) {
this.equipmentLocation = equipmentLocation;
}
public String getEquipmentLocation() {
return equipmentLocation;
}
public void setDepartment(String department) {
this.department = department;
}
public String getOutSourceReason() {
return outSourceReason;
public String getDepartment() {
return department;
}
@Override
@ -208,6 +262,7 @@ public class EquOutsourceWork extends BaseEntity {
.append("workId", getWorkId())
.append("orderCode", getWorkCode())
.append("workCode", getWorkCode())
.append("repairCode", getRepairCode())
.append("workPerson", getWorkPerson())
.append("workOutsourcingUnit", getWorkOutsourcingUnit())
.append("workConnection", getWorkConnection())

@ -84,6 +84,10 @@ public class EquRepairOrder extends BaseEntity {
/** 删除标志 */
private String delFlag;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
//设备
/** 设备类型名称 */
@Excel(name = "设备类型名称")
@ -410,6 +414,13 @@ public class EquRepairOrder extends BaseEntity {
return workDownMachine;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -1,6 +1,8 @@
package com.op.device.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -73,10 +75,6 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "原因分析")
private String workReason;
/** 委外原因 */
@Excel(name = "委外原因")
private String outSourceReason;
/** 故障描述 */
@Excel(name = "故障描述")
private String workFaultDesc;
@ -131,7 +129,6 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private String workEndTime;
// 设备
/** 设备名称 */
@Excel(name = "设备名称")
@ -153,7 +150,6 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "部门")
private String department;
//报修
/** 故障描述 */
@Excel(name = "故障描述")
@ -181,6 +177,35 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "联系方式")
private String orderConnection;
//班组
/** 班组名称 */
@Excel(name = "班组名称")
private String teamName;
/** 班组人员 */
@Excel(name = "班组人员")
private String teamPerson;
//时间列表 虚拟字段
private List<Date> workPlanTimeArray;
private List<Date> workPlanDownTimeArray;
//计划开始时间、结束时间
private String workPlanTimeStart;
private String workPlanTimeEnd;
//计划停机开始时间、结束时间
private String workPlanDownTimeStart;
private String workPlanDownTimeEnd;
//委外虚拟字段
/** 委外维修人员 */
private String outSourcePerson;
/** 委外维修原因 */
private String outSourceReason;
/** 委外单位 */
private String workOutsourcingUnit;
/** 联系方式 */
private String workConnection;
//报修
public void setOrderDesc(String orderDesc) {
@ -263,14 +288,13 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkId(String workId) {
this.workId = workId;
}
public String getWorkId() {
return workId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderId() {
return orderId;
}
@ -278,7 +302,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkCode(String workCode) {
this.workCode = workCode;
}
public String getWorkCode() {
return workCode;
}
@ -286,155 +309,146 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setWorkHandle(String workHandle) {
this.workHandle = workHandle;
}
public String getWorkHandle() {
return workHandle;
}
public void setWorkPlanTime(Date workPlanTime) {
this.workPlanTime = workPlanTime;
}
public Date getWorkPlanTime() {
return workPlanTime;
}
public void setWorkPlanDownTime(Date workPlanDownTime) {
this.workPlanDownTime = workPlanDownTime;
}
public Date getWorkPlanDownTime() {
return workPlanDownTime;
}
public void setOrderRelevance(String orderRelevance) {
this.orderRelevance = orderRelevance;
}
public String getOrderRelevance() {
return orderRelevance;
}
public void setWorkPerson(String workPerson) {
this.workPerson = workPerson;
}
public String getWorkPerson() {
return workPerson;
}
public void setOutSourceReason(String outSourceReason) {
this.outSourceReason = outSourceReason;
}
public String getOutSourceReason() {
return outSourceReason;
}
public void setWorkTeam(String workTeam) {
this.workTeam = workTeam;
}
public String getWorkTeam() {
return workTeam;
}
public void setWorkOutsource(String workOutsource) {
this.workOutsource = workOutsource;
}
public String getWorkOutsource() {
return workOutsource;
}
public void setWorkDownMachine(String workDownMachine) {
this.workDownMachine = workDownMachine;
}
public String getWorkDownMachine() {
return workDownMachine;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setWorkReason(String workReason) {
this.workReason = workReason;
}
public String getWorkReason() {
return workReason;
}
public void setWorkFaultDesc(String workFaultDesc) {
this.workFaultDesc = workFaultDesc;
}
public String getWorkFaultDesc() {
return workFaultDesc;
}
public void setWorkCostTime(Date workCostTime) {
this.workCostTime = workCostTime;
}
public Date getWorkCostTime() {
return workCostTime;
}
public void setWorkCost(String workCost) {
this.workCost = workCost;
}
public String getWorkCost() {
return workCost;
}
public void setOutWorkId(String outWorkId) {
this.outWorkId = outWorkId;
}
public String getOutWorkId() {
return outWorkId;
}
public void setOutWorkCode(String outWorkCode) {
this.outWorkCode = outWorkCode;
}
public String getOutWorkCode() {
return outWorkCode;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@ -443,7 +457,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkStatus(String workStatus) {
this.workStatus = workStatus;
}
public String getWorkStatus() {
return workStatus;
}
@ -452,7 +465,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkStartTime(String workStartTime) {
this.workStartTime = workStartTime;
}
public String getWorkStartTime() {
return workStartTime;
}
@ -460,11 +472,97 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkEndTime(String workEndTime) {
this.workEndTime = workEndTime;
}
public String getWorkEndTime() {
return workEndTime;
}
//班组
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getTeamName() {
return teamName;
}
public void setTeamPerson(String teamPerson) {
this.teamPerson = teamPerson;
}
public String getTeamPerson() {
return teamPerson;
}
//时间列表
public List<Date> getWorkPlanTimeArray() {
return workPlanTimeArray;
}
public void setWorkPlanTimeArray(List<Date> workPlanTimeArray) {
this.workPlanTimeArray = workPlanTimeArray;
}
public List<Date> getWorkPlanDownTimeArray() {
return workPlanDownTimeArray;
}
public void setWorkPlanDownTimeArray(List<Date> workPlanDownTimeArray) {
this.workPlanDownTimeArray = workPlanDownTimeArray;
}
//计划开始时间、结束时间
public String getWorkPlanDownTimeStart() {
return workPlanDownTimeStart;
}
public void setWorkPlanDownTimeStart(String workPlanDownTimeStart) {
this.workPlanDownTimeStart = workPlanDownTimeStart;
}
public String getWorkPlanDownTimeEnd() {
return workPlanDownTimeEnd;
}
public void setWorkPlanDownTimeEnd(String workPlanDownTimeEnd) {
this.workPlanDownTimeEnd = workPlanDownTimeEnd;
}
//计划停机开始时间、结束时间
public String getWorkPlanTimeStart() {
return workPlanTimeStart;
}
public void setWorkPlanTimeStart(String workPlanTimeStart) {
this.workPlanTimeStart = workPlanTimeStart;
}
public String getWorkPlanTimeEnd() {
return workPlanTimeEnd;
}
public void setWorkPlanTimeEnd(String workPlanTimeEnd) {
this.workPlanTimeEnd = workPlanTimeEnd;
}
//委外维修人员/委外维修原因 虚拟字段
public void setOutSourceReason(String outSourceReason) {
this.outSourceReason = outSourceReason;
}
public String getOutSourceReason() {
return outSourceReason;
}
public void setOutSourcePerson(String outSourcePerson) {
this.outSourcePerson = outSourcePerson;
}
public String getOutSourcePerson() {
return outSourcePerson;
}
public void setWorkOutsourcingUnit(String workOutsourcingUnit) {
this.workOutsourcingUnit = workOutsourcingUnit;
}
public String getWorkOutsourcingUnit() {
return workOutsourcingUnit;
}
public void setWorkConnection(String workConnection) {
this.workConnection = workConnection;
}
public String getWorkConnection() {
return workConnection;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,61 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquOrderEquSpare;
/**
* Mapper
*
* @author Open Platform
* @date 2023-11-02
*/
public interface EquOrderEquSpareMapper {
/**
*
*
* @param id
* @return
*/
public EquOrderEquSpare selectEquOrderEquSpareById(String id);
/**
*
*
* @param equOrderEquSpare
* @return
*/
public List<EquOrderEquSpare> selectEquOrderEquSpareList(EquOrderEquSpare equOrderEquSpare);
/**
*
*
* @param equOrderEquSpare
* @return
*/
public int insertEquOrderEquSpare(EquOrderEquSpare equOrderEquSpare);
/**
*
*
* @param equOrderEquSpare
* @return
*/
public int updateEquOrderEquSpare(EquOrderEquSpare equOrderEquSpare);
/**
*
*
* @param id
* @return
*/
public int deleteEquOrderEquSpareById(String id);
/**
*
*
* @param ids
* @return
*/
public int deleteEquOrderEquSpareByIds(String[] ids);
}

@ -92,4 +92,10 @@ public interface EquOrderMapper {
* @return
*/
EquOrder selectEquOrderByOrderId(String orderId);
/**
*
* @return
*/
int selectSerialNumber();
}

@ -58,4 +58,7 @@ public interface EquTeamMapper {
* @return
*/
public int deleteEquTeamByIds(String[] ids);
//查询设备维修组列表
public List<EquTeam> getMaintenanceTeamList(EquTeam equTeam);
}

@ -2,6 +2,7 @@ package com.op.device.service;
import java.util.List;
import com.op.device.domain.EquOutsourceWork;
import com.op.device.domain.EquRepairWorkOrder;
/**
* Service

@ -62,4 +62,7 @@ public interface IEquRepairWorkOrderService {
//获取维修人员列表
public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment);
//委外申请
public int applyEquOutsourceWork(EquRepairWorkOrder equRepairWorkOrder);
}

@ -57,4 +57,7 @@ public interface IEquTeamService {
* @return
*/
public int deleteEquTeamById(String id);
//维修组列表
List<EquTeam> getMaintenanceTeamList(EquTeam equTeam);
}

@ -1,6 +1,8 @@
package com.op.device.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquPlan;
import java.util.List;
@ -33,7 +35,7 @@ public interface IEquUpkeepOrderService {
* @param equOrder
* @return
*/
public int insertEquOrder(EquOrder equOrder);
public AjaxResult insertEquOrder(EquPlan equPlan);
/**
*

@ -13,6 +13,10 @@ import org.springframework.stereotype.Service;
import com.op.device.mapper.EquOutsourceWorkMapper;
import com.op.device.domain.EquOutsourceWork;
import com.op.device.service.IEquOutsourceWorkService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* Service
@ -61,22 +65,18 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService {
@Override
@DS("#header.poolName")
public int insertEquOutsourceWork(EquOutsourceWork equOutsourceWork) {
//转委外
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
String equipmentCode = equOutsourceWork.getEquipmentCode();
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
if(equOutsourceWork.getWorkId()!= null){
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
equRepairWorkOrder.setWorkId(equOutsourceWork.getWorkId());
equRepairWorkOrder.setWorkOutsource("1");
equRepairWorkOrder.setOutWorkCode(equOutsourceWork.getWorkCode());
equRepairWorkOrderMapper.updateWorkOutsource(equRepairWorkOrder);
equOutsourceWork.setWorkId("");
}
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
equOutsourceWork.setWorkReason(equOutsourceWork.getOutSourceReason());
equOutsourceWork.setCreateTime(DateUtils.getNowDate());
equOutsourceWork.setCreateBy(SecurityUtils.getUsername());
equOutsourceWork.setOrderCode("无");
equOutsourceWork.setRepairCode("无");
//工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equOutsourceWork.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
return equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
}

@ -17,6 +17,10 @@ import org.springframework.stereotype.Service;
import com.op.device.mapper.EquRepairOrderMapper;
import com.op.device.domain.EquRepairOrder;
import com.op.device.service.IEquRepairOrderService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* Service
@ -79,6 +83,9 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername());
equRepairOrder.setOrderStatus("待审核");
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// String key = "#header.poolName";
// equRepairOrder.setFactory(request.getHeader(key.substring(8)).replace("ds_",""));
return equRepairOrderMapper.insertEquRepairOrder(equRepairOrder);
}
@ -115,9 +122,14 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equRepairWorkOrder.setWorkDownMachine("0");
}
equRepairWorkOrder.setWorkFaultDesc(equRepairOrder.getOrderDesc());
equRepairWorkOrder.setWorkStatus("0");
equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
//工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
equRepairOrder.setOrderStatus("审核通过");
}else if(equRepairOrder.getRepairDestination().equals("不维修")){
@ -129,11 +141,18 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equOutsourceWork.setOrderCode(equRepairOrder.getOrderCode());
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode();
equOutsourceWork.setEquipmentCode(equipmentCode);
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equOutsourceWork.setRepairCode("无");
equOutsourceWork.setWorkConnection(equRepairOrder.getWorkConnection());
equOutsourceWork.setWorkOutsourcingUnit(equRepairOrder.getWorkOutsourcingUnit());
equOutsourceWork.setWorkPerson(equRepairOrder.getOutSourcePerson());
equOutsourceWork.setWorkReason(equRepairOrder.getOutSourceReason());
equOutsourceWork.setCreateBy(SecurityUtils.getUsername());
equOutsourceWork.setCreateTime(DateUtils.getNowDate());
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equOutsourceWork.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
equRepairOrder.setOrderStatus("审核通过");
}else if(equRepairOrder.getRepairDestination().equals("立即维修")){

@ -1,5 +1,6 @@
package com.op.device.service.impl;
import java.text.SimpleDateFormat;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
@ -7,11 +8,17 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquEquipment;
import com.op.device.domain.EquOutsourceWork;
import com.op.device.mapper.EquOutsourceWorkMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquRepairWorkOrderMapper;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.service.IEquRepairWorkOrderService;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* Service
@ -24,6 +31,9 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
@Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
@Autowired
private EquOutsourceWorkMapper equOutsourceWorkMapper;
/**
*
*
@ -45,6 +55,22 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
@Override
@DS("#header.poolName")
public List<EquRepairWorkOrder> selectEquRepairWorkOrderList(EquRepairWorkOrder equRepairWorkOrder) {
if (equRepairWorkOrder.getWorkPlanTimeArray() != null) {
// 设置创建日期开始和结束值
if (equRepairWorkOrder.getWorkPlanTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equRepairWorkOrder.setWorkPlanTimeStart(formatter.format(equRepairWorkOrder.getWorkPlanTimeArray().get(0)));
equRepairWorkOrder.setWorkPlanTimeEnd(formatter.format(equRepairWorkOrder.getWorkPlanTimeArray().get(1)));
}
}
if (equRepairWorkOrder.getWorkPlanDownTimeArray() != null) {
// 设置更新日期开始和结束
if (equRepairWorkOrder.getWorkPlanDownTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equRepairWorkOrder.setWorkPlanDownTimeStart(formatter.format(equRepairWorkOrder.getWorkPlanDownTimeArray().get(0)));
equRepairWorkOrder.setWorkPlanDownTimeEnd(formatter.format(equRepairWorkOrder.getWorkPlanDownTimeArray().get(1)));
}
}
return equRepairWorkOrderMapper.selectEquRepairWorkOrderList(equRepairWorkOrder);
}
@ -62,9 +88,16 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairWorkOrder.getEquipmentCode();
//维修单号
equRepairWorkOrder.setOrderCode("无");
equRepairWorkOrder.setOutWorkCode("无");
equRepairWorkOrder.setWorkStatus("待维修");
equRepairWorkOrder.setWorkCode("WX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
//工厂号
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
return equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
}
@ -72,11 +105,15 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
*
*
* @param equRepairWorkOrder
* @return
* @return outSourcePerson
*/
@Override
@DS("#header.poolName")
public int updateEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) {
if(equRepairWorkOrder.getWorkDownMachine().equals("0")){
equRepairWorkOrder.setWorkPlanDownTime(null);
}
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
return equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
}
@ -110,4 +147,32 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
public List<EquEquipment> getMaintenancePersonList(EquEquipment equEquipment) {
return equRepairWorkOrderMapper.getMaintenancePersonList(equEquipment);
}
//委外申请
@Override
@DS("#header.poolName")
public int applyEquOutsourceWork(EquRepairWorkOrder equRepairWorkOrder) {
//转委外
EquOutsourceWork equOutsourceWork = new EquOutsourceWork();
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
//委外工单号
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairWorkOrder.getEquipmentCode();
equOutsourceWork.setOrderCode("无");
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equOutsourceWork.setEquipmentCode(equipmentCode);
equOutsourceWork.setRepairCode(equRepairWorkOrder.getWorkCode());
equOutsourceWork.setWorkReason(equRepairWorkOrder.getOutSourceReason());
equOutsourceWork.setWorkPerson(equRepairWorkOrder.getOutSourcePerson());
equOutsourceWork.setWorkOutsourcingUnit(equRepairWorkOrder.getWorkOutsourcingUnit());
equOutsourceWork.setWorkConnection(equRepairWorkOrder.getWorkConnection());
equOutsourceWork.setCreateTime(DateUtils.getNowDate());
equOutsourceWork.setCreateBy(SecurityUtils.getUsername());
if(equRepairWorkOrder.getWorkId()!= null){
equRepairWorkOrder.setWorkOutsource("1");
equRepairWorkOrder.setOutWorkCode(equOutsourceWork.getWorkCode());
equRepairWorkOrderMapper.updateWorkOutsource(equRepairWorkOrder);
}
return equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
}
}

@ -99,4 +99,13 @@ public class EquTeamServiceImpl implements IEquTeamService {
public int deleteEquTeamById(String id) {
return equTeamMapper.deleteEquTeamById(id);
}
/**
*
*/
@Override
@DS("#header.poolName")
public List<EquTeam> getMaintenanceTeamList(EquTeam equTeam) {
return equTeamMapper.getMaintenanceTeamList(equTeam);
}
}

@ -1,15 +1,26 @@
package com.op.device.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.device.domain.EquOrder;
import com.op.device.mapper.EquOrderMapper;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.*;
import com.op.device.mapper.*;
import com.op.device.service.IEquUpkeepOrderService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import static com.op.common.core.web.domain.AjaxResult.success;
/**
* Service
*
@ -20,6 +31,16 @@ import java.util.List;
public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
@Autowired
private EquOrderMapper equOrderMapper;
@Autowired
private EquOrderEquSpareMapper equOrderEquSpareMapper;
@Autowired
private EquOrderStandardMapper equOrderStandardMapper;
@Autowired
private EquOrderDetailMapper equOrderDetailMapper;
@Autowired
private EquOrderPersonMapper equOrderPersonMapper;
@Autowired
private EquOrderEquMapper equOrderEquMapper;
/**
*
@ -46,16 +67,136 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
}
/**
*
* TODO
*
* @param equOrder
* @param equPlan
* @return
*/
@Override
@DS("#header.poolName")
public int insertEquOrder(EquOrder equOrder) {
public AjaxResult insertEquOrder(EquPlan equPlan) {
//获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
String str = request.getHeader(key.substring(8));
int index = str.indexOf("_");
String factory = str.substring(index + 1);
// 生成主工单信息
EquOrder equOrder = new EquOrder();
BeanUtils.copyProperties(equPlan,equOrder);
equOrder.setOrderId(IdUtils.fastSimpleUUID());
// 流水号
String serialNum = String.format("%03d",equOrderMapper.selectSerialNumber());
equOrder.setOrderCode("F"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+serialNum);
equOrder.setPlanLoopType("");
equOrder.setPlanLoopStart(equPlan.getPlanTimeArray().get(0));
equOrder.setPlanLoopEnd(equPlan.getPlanTimeArray().get(1));
// 设置工单状态
equOrder.setOrderStatus("0");
equOrder.setFactoryCode(factory);
equOrder.setCreateBy(SecurityContextHolder.getUserName());
equOrder.setCreateTime(DateUtils.getNowDate());
return equOrderMapper.insertEquOrder(equOrder);
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setUpdateTime(DateUtils.getNowDate());
equOrder.setPlanType("maintenance");
// 工单插入数据库
equOrderMapper.insertEquOrder(equOrder);
// 生成工单-设备
EquOrderEqu equ = new EquOrderEqu();
List<EquPlanEqu> equPlanEquList = equPlan.getEquipmentItem();
EquPlanEqu equPlanEqu = equPlanEquList.get(0);
BeanUtils.copyProperties(equPlanEqu,equ);
equ.setId(IdUtils.fastSimpleUUID());
equ.setCode("E"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+"001");
equ.setParentCode(equOrder.getOrderCode());
equ.setOrderCode(equOrder.getOrderCode());
equ.setFactoryCode(factory);
equ.setAttr1("");
equ.setCreateBy(SecurityContextHolder.getUserName());
// 设备插入
equOrderEquMapper.insertEquOrderEqu(equ);
// 生成工单-备件
List<EquOrderEquSpare> spareList = new ArrayList<>();
List<EquPlanEquSpare> equSpareList = equPlanEqu.getSpareList();
int spareSerialNum = 0;
for (EquPlanEquSpare spare : equSpareList) {
EquOrderEquSpare spareTemp = new EquOrderEquSpare();
BeanUtils.copyProperties(spare,spareTemp);
spareTemp.setId(IdUtils.fastSimpleUUID());
spareTemp.setCode("S"+equOrder.getOrderCode()+String.format("%03d",++spareSerialNum));
spareTemp.setOrderCode(equOrder.getOrderCode());
spareTemp.setParentCode(equ.getCode());
spareTemp.setFactoryCode(factory);
spareTemp.setCreateBy(SecurityContextHolder.getUserName());
spareTemp.setCreateTime(DateUtils.getNowDate());
spareTemp.setUpdateBy(SecurityContextHolder.getUserName());
spareTemp.setUpdateTime(DateUtils.getNowDate());
// 插入备件信息
equOrderEquSpareMapper.insertEquOrderEquSpare(spareTemp);
spareList.add(spareTemp);
}
// 备件置入
System.out.println(spareList);
// 生成工单-设备-保养项
List<EquPlanDetail> detailList = equPlanEqu.getEquPlanDetailList();
int detailSerialNum = 0;
for (EquPlanDetail detail : detailList) {
EquOrderDetail equOrderDetail = new EquOrderDetail();
List<EquOrderStandard> orderStandardList = new ArrayList<>();
List<EquPlanStandard> standardList = detail.getEquPlanStandardList();
BeanUtils.copyProperties(detail,equOrderDetail);
equOrderDetail.setId(IdUtils.fastSimpleUUID());
equOrderDetail.setCode("C"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+String.format("%03d",++detailSerialNum));
equOrderDetail.setOrderCode(equOrder.getOrderCode());
equOrderDetail.setParentCode(equ.getCode());
equOrderDetail.setFactroyCode(factory);
equOrderDetail.setStandardList(orderStandardList);
equOrderDetail.setCreateBy(SecurityContextHolder.getUserName());
equOrderDetail.setCreateTime(DateUtils.getNowDate());
equOrderDetail.setUpdateBy(SecurityContextHolder.getUserName());
equOrderDetail.setUpdateTime(DateUtils.getNowDate());
// 插入检查项信息
equOrderDetailMapper.insertEquOrderDetail(equOrderDetail);
int standardSerialNum = 0;
for (EquPlanStandard standard : standardList) {
EquOrderStandard orderStandard = new EquOrderStandard();
BeanUtils.copyProperties(standard,orderStandard);
orderStandard.setId(IdUtils.fastSimpleUUID());
orderStandard.setCode("S"+equOrder.getOrderCode()+String.format("%03d",++standardSerialNum));
orderStandard.setParentCode(equOrderDetail.getCode());
orderStandard.setOrderCode(equOrder.getOrderCode());
orderStandard.setCreateBy(SecurityContextHolder.getUserName());
orderStandard.setCreateTime(DateUtils.getNowDate());
orderStandard.setUpdateBy(SecurityContextHolder.getUserName());
orderStandard.setUpdateTime(DateUtils.getNowDate());
// 插入标准信息
equOrderStandardMapper.insertEquOrderStandard(orderStandard);
}
}
// 生成工单-人员
List<SysUser> personList = equPlan.getPersonList();
for (SysUser user : personList) {
EquOrderPerson equOrderPerson = new EquOrderPerson();
equOrderPerson.setId(IdUtils.fastSimpleUUID());
// TODO 要改变编码格式
equOrderPerson.setOrderCode(equOrder.getOrderCode());
equOrderPerson.setFactoryCode(factory);
equOrderPerson.setUserId(user.getUserId());
equOrderPerson.setCreateBy(SecurityContextHolder.getUserName());
equOrderPerson.setCreateTime(DateUtils.getNowDate());
equOrderPerson.setUpdateBy(SecurityContextHolder.getUserName());
equOrderPerson.setUpdateTime(DateUtils.getNowDate());
// 插入人员信息
equOrderPersonMapper.insertEquOrderPerson(equOrderPerson);
}
return success();
}
/**

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.device.mapper.EquOrderEquSpareMapper">
<resultMap type="EquOrderEquSpare" id="EquOrderEquSpareResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="orderCode" column="order_code" />
<result property="parentCode" column="parent_code" />
<result property="materialCode" column="material_code" />
<result property="materialDesc" column="material_desc" />
<result property="spareType" column="spare_type" />
<result property="applyNum" column="apply_num" />
<result property="factoryCode" column="factory_code" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectEquOrderEquSpareVo">
select id, code, order_code, parent_code, material_code, material_desc, spare_type, apply_num, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_order_equ_spare
</sql>
<select id="selectEquOrderEquSpareList" parameterType="EquOrderEquSpare" resultMap="EquOrderEquSpareResult">
<include refid="selectEquOrderEquSpareVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="parentCode != null and parentCode != ''"> and parent_code = #{parentCode}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialDesc != null and materialDesc != ''"> and material_desc = #{materialDesc}</if>
<if test="spareType != null and spareType != ''"> and spare_type = #{spareType}</if>
<if test="applyNum != null "> and apply_num = #{applyNum}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
</where>
</select>
<select id="selectEquOrderEquSpareById" parameterType="String" resultMap="EquOrderEquSpareResult">
<include refid="selectEquOrderEquSpareVo"/>
where id = #{id}
</select>
<insert id="insertEquOrderEquSpare" parameterType="EquOrderEquSpare">
insert into equ_order_equ_spare
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="code != null">code,</if>
<if test="orderCode != null">order_code,</if>
<if test="parentCode != null">parent_code,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialDesc != null">material_desc,</if>
<if test="spareType != null">spare_type,</if>
<if test="applyNum != null">apply_num,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="code != null">#{code},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="parentCode != null">#{parentCode},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialDesc != null">#{materialDesc},</if>
<if test="spareType != null">#{spareType},</if>
<if test="applyNum != null">#{applyNum},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEquOrderEquSpare" parameterType="EquOrderEquSpare">
update equ_order_equ_spare
<trim prefix="SET" suffixOverrides=",">
<if test="code != null">code = #{code},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="parentCode != null">parent_code = #{parentCode},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialDesc != null">material_desc = #{materialDesc},</if>
<if test="spareType != null">spare_type = #{spareType},</if>
<if test="applyNum != null">apply_num = #{applyNum},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEquOrderEquSpareById" parameterType="String">
delete from equ_order_equ_spare where id = #{id}
</delete>
<delete id="deleteEquOrderEquSpareByIds" parameterType="String">
delete from equ_order_equ_spare where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -111,6 +111,12 @@
where order_id = #{orderId}
</select>
<select id="selectSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(order_id)+1 AS serialNum
FROM equ_order
WHERE CONVERT(date, GETDATE()) = CONVERT(date,create_time) and del_flag = '0'
</select>
<insert id="insertEquOrder" parameterType="EquOrder">
insert into equ_order
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="workId" column="work_id" />
<result property="workCode" column="work_code" />
<result property="orderCode" column="order_code" />
<result property="repairCode" column="repair_code" />
<result property="workPerson" column="work_person" />
<result property="workOutsourcingUnit" column="work_outsourcing_unit" />
<result property="workConnection" column="work_connection" />
@ -25,24 +26,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
<!--设备-->
<result property="equipmentName" column="equipment_name" />
<result property="equipmentSpec" column="equipment_spec" />
<result property="equipmentTypeName" column="equipment_type_name" />
<result property="equipmentLocation" column="equipment_location" />
<result property="department" column="department" />
</resultMap>
<sql id="selectEquOutsourceWorkVo">
select work_id, work_code,order_code, work_person, work_outsourcing_unit, work_connection, work_reason, work_type, equipment_code, work_cost, work_cost_time, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_outsource_work
select work_id, work_code,order_code, repair_code, work_person, work_outsourcing_unit, work_connection, work_reason, work_type, equipment_code, work_cost, work_cost_time, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_outsource_work
</sql>
<select id="selectEquOutsourceWorkList" parameterType="EquOutsourceWork" resultMap="EquOutsourceWorkResult">
<include refid="selectEquOutsourceWorkVo"/>
select
eow.work_id,
eow.work_code,
eow.order_code,
eow.repair_code,
eow.work_person,
eow.work_outsourcing_unit,
eow.work_connection,
eow.work_reason,
eow.work_type,
eow.equipment_code,
eow.work_cost,
eow.work_cost_time,
eow.attr1,
eow.attr2,
eow.attr3,
eow.del_flag,
eow.create_by,
eow.create_time,
eow.update_by,
eow.update_time,
eow.factory_code,
be.equipment_name,
be.equipment_type_name,
be.equipment_spec,
be.department,
be.equipment_location
from equ_outsource_work eow
left join base_equipment be on eow.equipment_code = be.equipment_code
<where>
<if test="workCode != null and workCode != ''"> and work_code = #{workCode}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="workPerson != null and workPerson != ''"> and work_person = #{workPerson}</if>
<if test="workOutsourcingUnit != null and workOutsourcingUnit != ''"> and work_outsourcing_unit = #{workOutsourcingUnit}</if>
<if test="workConnection != null and workConnection != ''"> and work_connection = #{workConnection}</if>
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if>
<if test="workCode != null and workCode != ''"> and work_code like concat('%', #{workCode}, '%')</if>
<if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
<if test="repairCode != null and repairCode != ''"> and repair_code like concat('%', #{repairCode}, '%')</if>
<if test="workPerson != null and workPerson != ''"> and work_person like concat('%', #{workPerson}, '%')</if>
<if test="workOutsourcingUnit != null and workOutsourcingUnit != ''"> and work_outsourcing_unit like concat('%', #{workOutsourcingUnit}, '%')</if>
<if test="workConnection != null and workConnection != ''"> and work_connection like concat('%', #{workConnection}, '%')</if>
<if test="workReason != null and workReason != ''"> and work_reason like concat('%', #{workReason}, '%')</if>
<if test="workType != null and workType != ''"> and work_type = #{workType}</if>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
<if test="workCost != null and workCost != ''"> and work_cost like concat('%', #{workCost}, '%')</if>
<if test="workCostTime != null and workCostTime != ''"> and work_cost_time = #{workCostTime}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
@ -50,8 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null and createTime != ''"> and create_time = #{createTime}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
and del_flag = '0'
ORDER BY create_time DESC
and eow.del_flag = '0'
ORDER BY eow.create_time DESC
</where>
</select>
@ -66,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="workId != null">work_id,</if>
<if test="workCode != null">work_code,</if>
<if test="orderCode != null">order_code,</if>
<if test="repairCode != null">repair_code,</if>
<if test="workPerson != null">work_person,</if>
<if test="workOutsourcingUnit != null">work_outsourcing_unit,</if>
<if test="workConnection != null">work_connection,</if>
@ -88,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="workId != null">#{workId},</if>
<if test="workCode != null">#{workCode},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="repairCode != null">#{repairCode},</if>
<if test="workPerson != null">#{workPerson},</if>
<if test="workOutsourcingUnit != null">#{workOutsourcingUnit},</if>
<if test="workConnection != null">#{workConnection},</if>
@ -113,6 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=",">
<if test="workCode != null">work_code = #{workCode},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="repairCode != null">repair_code = #{repairCode},</if>
<if test="workPerson != null">work_person = #{workPerson},</if>
<if test="workOutsourcingUnit != null">work_outsourcing_unit = #{workOutsourcingUnit},</if>
<if test="workConnection != null">work_connection = #{workConnection},</if>

@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
<result property="repairDestination" column="repair_destination" />
<!-- 设备 -->
<result property="equipmentTypeName" column="equipment_type_name" />
@ -46,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectEquRepairOrderVo">
select order_id, order_code, equipment_code, order_desc, order_breakdown_time, order_source, order_time, order_handle, order_repairman, order_connection, order_status, order_relevance, order_picture, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,repair_destination from equ_repair_order
select order_id, order_code, equipment_code, order_desc, order_breakdown_time, order_source, order_time, order_handle, order_repairman, order_connection, order_status, order_relevance, order_picture, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,factory_code,repair_destination from equ_repair_order
</sql>
<select id="selectEquRepairOrderList" parameterType="EquRepairOrder" resultMap="EquRepairOrderResult">
@ -69,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="createTime != null and createTime != ''"> and create_time = #{createTime}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="repairDestination != null and repairDestination != ''"> and repair_destination = #{repairDestination}</if>
and del_flag = '0'
ORDER BY create_time DESC
@ -94,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ero.create_time,
ero.update_by,
ero.update_time,
ero.factory_code,
ero.repair_destination,
be.equipment_name,
be.equipment_type_name,
@ -141,6 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="repairDestination != null">repair_destination,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -165,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="repairDestination != null">#{repairDestination},</if>
</trim>
</insert>
@ -192,6 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="repairDestination != null">repair_destination = #{repairDestination},</if>
</trim>
where order_id = #{orderId}

@ -50,6 +50,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="orderTime" column="order_time" />
<result property="orderRepairman" column="order_repairman" />
<result property="orderConnection" column="order_connection" />
<!--班组-->
<result property="teamName" column="team_name" />
<result property="teamPerson" column="team_person" />
</resultMap>
<sql id="selectEquRepairWorkOrderVo">
@ -57,38 +60,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
<include refid="selectEquRepairWorkOrderVo"/>
select
erwo.work_id,
erwo.order_id,
erwo.order_code,
erwo.work_code,
erwo.work_handle,
erwo.work_plan_time,
erwo.work_plan_down_time,
erwo.order_relevance,
erwo.work_person,
erwo.work_team,
erwo.work_outsource,
erwo.work_down_machine,
erwo.equipment_code,
erwo.work_reason,
erwo.work_fault_desc,
erwo.work_start_time,
erwo.work_end_time,
erwo.work_cost_time,
erwo.work_cost,
erwo.work_status,
erwo.out_work_id,
erwo.out_work_code,
erwo.attr1,
erwo.attr2,
erwo.attr3,
erwo.create_by,
erwo.create_time,
erwo.update_time,
erwo.update_by,
erwo.del_flag,
erwo.factory_code,
be.equipment_name,
et.team_name,
et.team_person
from equ_repair_work_order erwo
left join base_equipment be on erwo.equipment_code = be.equipment_code
left join equ_team et on erwo.work_team = et.team_code
<where>
<!--报修id 维修code 报修code-->
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="workCode != null and workCode != ''"> and work_code like concat('%', #{workCode}, '%')</if>
<if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
<if test="orderId != null and orderId != ''"> and erwo.order_id = #{orderId}</if>
<if test="workCode != null and workCode != ''"> and erwo.work_code like concat('%', #{workCode}, '%')</if>
<if test="orderCode != null and orderCode != ''"> and erwo.order_code like concat('%', #{orderCode}, '%')</if>
<!--设备code 设备故障描述 计划维修时间 是否停机 计划停机时间-->
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
<if test="workFaultDesc != null and workFaultDesc != ''"> and work_fault_desc = #{workFaultDesc}</if>
<if test="workPlanTime != null "> and work_plan_time = #{workPlanTime}</if>
<if test="workDownMachine != null and workDownMachine != ''"> and work_down_machine = #{workDownMachine}</if>
<if test="workPlanDownTime != null "> and work_plan_down_time = #{workPlanDownTime}</if>
<if test="equipmentCode != null and equipmentCode != ''"> and erwo.equipment_code like concat('%', #{equipmentCode}, '%')</if>
<if test="workFaultDesc != null and workFaultDesc != ''"> and erwo.work_fault_desc = #{workFaultDesc}</if>
<if test="workPlanTimeStart != null "> and CONVERT(date,work_plan_time) >= #{workPlanTimeStart}</if>
<if test="workPlanTimeEnd != null "> and #{workPlanTimeEnd} >= CONVERT(date,erwo.work_plan_time)</if>
<if test="workDownMachine != null and workDownMachine != ''"> and erwo.work_down_machine = #{workDownMachine}</if>
<if test="workPlanDownTimeStart != null "> and CONVERT(date,work_plan_down_time) >= #{workPlanDownTimeStart}</if>
<if test="workPlanDownTimeEnd != null "> and #{workPlanDownTimeEnd} >= CONVERT(date,erwo.work_plan_down_time)</if>
<!--维修人员 维修组-->
<if test="workPerson != null and workPerson != ''"> and work_person like concat('%', #{workPerson}, '%')</if>
<if test="workTeam != null and workTeam != ''"> and work_team like concat('%', #{workTeam}, '%')</if>
<if test="workPerson != null and workPerson != ''"> and erwo.work_person like concat('%', #{workPerson}, '%')</if>
<if test="workTeam != null and workTeam != ''"> and erwo.work_team like concat('%', #{workTeam}, '%')</if>
<!--是否委外 委外工单编码-->
<if test="workOutsource != null and workOutsource != ''"> and work_outsource = #{workOutsource}</if>
<if test="outWorkCode != null and outWorkCode != ''"> and out_work_code = #{outWorkCode}</if>
<if test="workOutsource != null and workOutsource != ''"> and erwo.work_outsource = #{workOutsource}</if>
<if test="outWorkCode != null and outWorkCode != ''"> and erwo.out_work_code like concat('%', #{outWorkCode}, '%')</if>
<!--故障原因 维修开始时间 维修结束时间 花费时间 费用 维修状态 -->
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if>
<if test="workStartTime != null "> and work_start_time = #{workStartTime}</if>
<if test="workEndTime != null "> and work_end_time = #{workEndTime}</if>
<if test="workCostTime != null "> and work_cost_time = #{workCostTime}</if>
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if>
<if test="workStatus != null and workStatus != ''"> and work_status = #{workStatus}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="workReason != null and workReason != ''"> and erwo.work_reason = #{workReason}</if>
<if test="workStartTime != null "> and erwo.work_start_time = #{workStartTime}</if>
<if test="workEndTime != null "> and erwo.work_end_time = #{workEndTime}</if>
<if test="workCostTime != null "> and erwo.work_cost_time = #{workCostTime}</if>
<if test="workCost != null and workCost != ''"> and erwo.work_cost = #{workCost}</if>
<if test="workStatus != null and workStatus != ''"> and erwo.work_status = #{workStatus}</if>
<if test="factoryCode != null and factoryCode != ''"> and erwo.factory_code = #{factoryCode}</if>
<!--没有用上-->
<if test="workHandle != null and workHandle != ''"> and work_handle = #{workHandle}</if>
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if>
and del_flag = '0'
<if test="workHandle != null and workHandle != ''"> and erwo.work_handle = #{workHandle}</if>
<if test="orderRelevance != null and orderRelevance != ''"> and erwo.order_relevance = #{orderRelevance}</if>
and erwo.del_flag = '0'
</where>
ORDER BY create_time DESC
ORDER BY erwo.create_time DESC
</select>
<select id="selectEquRepairWorkOrderByWorkId" parameterType="String" resultMap="EquRepairWorkOrderResult">
@ -133,10 +175,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ero.order_source,
ero.order_time,
ero.order_repairman,
ero.order_connection
ero.order_connection,
eow.work_person AS outSourcePerson,
eow.work_outsourcing_unit AS workOutsourcingUnit,
eow.work_connection AS workConnection,
eow.work_reason AS outSourceReason
from equ_repair_work_order erwo
left join base_equipment be on erwo.equipment_code = be.equipment_code
left join equ_repair_order ero on erwo.order_code = ero.order_code
left join equ_outsource_work eow on erwo.out_work_code = eow.work_code
where erwo.work_id = #{workId}
and erwo.del_flag = '0'
ORDER BY create_time DESC
@ -220,7 +267,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="workHandle != null">work_handle = #{workHandle},</if>
<if test="workPlanTime != null">work_plan_time = #{workPlanTime},</if>
<if test="workPlanDownTime != null">work_plan_down_time = #{workPlanDownTime},</if>
work_plan_down_time = #{workPlanDownTime},
<if test="orderRelevance != null">order_relevance = #{orderRelevance},</if>
<if test="workPerson != null">work_person = #{workPerson},</if>
<if test="workTeam != null">work_team = #{workTeam},</if>

@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectEquTeamById" parameterType="String" resultMap="EquTeamResult">
<include refid="selectEquTeamVo"/>
where id = #{id}
where del_flag = '0'
and del_flag = '0'
</select>
<insert id="insertEquTeam" parameterType="EquTeam">
@ -98,4 +98,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getMaintenanceTeamList" parameterType="EquTeam" resultMap="EquTeamResult">
<include refid="selectEquTeamVo"/>
where del_flag = '0'
and team_type = '维修班组'
</select>
</mapper>

@ -73,7 +73,7 @@ public class RyTask {
remotePlanService.syncSAPOrders();
}
/**每5分钟报工一次**/
/**每5分钟报工一次(废弃)**/
public void reportWorkTask(){
logger.info("++报工接口+开始++reportWorkTask+++++");
remoteMesService.reportWorkTask();

@ -6,6 +6,7 @@ import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.system.api.domain.dto.BoardDTO;
@ -103,6 +104,19 @@ public class WCSInterfaceController extends BaseController {
}
return success(wCInterfaceService.getMesBoardEquProductionToday(boardDTO));
}
/**上位机报工**/
@PostMapping("/reportWork")
public AjaxResult reportWork(@RequestBody MesReportWork mesReportWork) {
if(StringUtils.isBlank(mesReportWork.getFactoryCode())){
return error("[factoryCode] is null");
}
if(StringUtils.isBlank(mesReportWork.getReportCode())){
return error("[reportCode] is null");
}
return success(wCInterfaceService.reportWork(mesReportWork));
}
/************************************************************/
/****************************数据库清理************************/
/************************************************************/
@ -112,6 +126,7 @@ public class WCSInterfaceController extends BaseController {
List<String> tables = new ArrayList<>();
tables.add("mes_plc_log");
tables.add("mes_interface_log");
tables.add("sys_sap_log");
return success(wCInterfaceService.dataClearTask(tables));
}
//定期备份清理表

@ -3,6 +3,7 @@ package com.op.mes.mapper;
import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.system.api.domain.SysDept;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataItemsDTO;
@ -50,5 +51,7 @@ public interface MesMapper {
void deleteBkDate(@Param("table")String addMonthTable,@Param("startDate") String startDate, @Param("endDate")String endDate);
void addSapLog(SysSapLog sysSapLog);
List<Map<String, String>> selectcxjList();
}

@ -89,4 +89,8 @@ public interface MesReportWorkMapper {
List<MesHourReport> getEquNames(MesHourReport mesHourReport);
List<MesShift> selectProShift();
MesReportWork getProdResult(MesReportWork work);
ProOrderWorkorder getOrderByCode(String workorderCode);
}

@ -2,6 +2,7 @@ package com.op.mes.service;
import com.op.common.core.domain.R;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.MesShift;
import com.op.mes.domain.dto.BaseEquipmentDto;
import com.op.mes.domain.dto.LGInfoDto;
@ -34,5 +35,7 @@ public interface IWCSInterfaceService {
R dataBKTask(List<String> tables);
R reportWork(MesReportWork mesReportWork);
Map getDryRoomData(BoardDTO boardDTO);
}

@ -6,25 +6,32 @@ import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.bean.BeanUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.MesShift;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.domain.dto.LGInfoDto;
import com.op.mes.mapper.MesMapper;
import com.op.mes.mapper.MesReportWorkMapper;
import com.op.mes.mapper.ProRfidProcessDetailMapper;
import com.op.mes.service.IWCSInterfaceService;
import com.op.system.api.RemoteSapService;
import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysDept;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.system.api.domain.sap.SapRFW;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
@ -54,6 +61,9 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
@Autowired
private RemoteUserService remoteUserService;
@Autowired
private RemoteSapService remoteSapService;
/**
* JSON
* {
@ -259,6 +269,74 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
return R.ok(true);
}
@Override
public R reportWork(MesReportWork mesReportWork) {
DynamicDataSourceContextHolder.push("ds_"+mesReportWork.getFactoryCode());// 这是数据源的key
mesReportWork.setUploadStatus("1");//除了1报工成功的都需要报工
mesReportWork.setProdType("prod");
List<MesReportWork> reportWorks = mesReportWorkMapper.getReportWorkList(mesReportWork);
if(CollectionUtils.isEmpty(reportWorks)){
return R.fail("未查询报工单");
}
MesReportWork work = reportWorks.get(0);
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量
SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改
ltgs.setConf_activity1(work.getSac1());//人工
ltgs.setConf_activity2(work.getSac2());
ltgs.setConf_activity3(work.getSac3());//机器
ltgs.setConf_activity4(work.getSac4());
ltgs.setConf_activity5(work.getSac5());//折旧
ltgs.setConf_activity6(work.getSac6());
SapRFW.lt_hw lthw = sapRFW.getLt_hw();//MES生产订单报工货物移动修改
lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO;
lthw.setMaterial(work.getProcessCode());
//添加调用sap日志
SysSapLog sysSapLog = new SysSapLog();
sysSapLog.setId(IdUtils.fastSimpleUUID());
sysSapLog.setMesssge(sapRFW.toString());
sysSapLog.setMethod("reportWork");
sysSapLog.setReqcode("请求");
sysSapLog.setCreateTime(DateUtils.getNowDate());
mesMapper.addSapLog(sysSapLog);
R r = remoteSapService.sapRFWOrder(sapRFW);
//上传成功更改mes_report_work状态
if (r.getCode() == 200) {
work.setUploadStatus("1");
} else {
work.setUploadStatus("2");
work.setUploadMsg(r.getMsg());
}
work.setUploadTime(DateUtils.getNowDate());
mesReportWorkMapper.updateSyncSapStatus(work);
//工单完成数量>工单数量:关闭订单
MesReportWork proResult = mesReportWorkMapper.getProdResult(work);
ProOrderWorkorder topOrder = this.getTopOrder(work.getWorkorderCode());
if(proResult.getQuantityFeedback().compareTo(new BigDecimal(topOrder.getQuantitySplit()))>=0){
//工单完成,关闭工单
remoteSapService.sapCloseOrder(work.getOrderCode());
work.setStatus("w4");
work.setUpdateTime(DateUtils.getNowDate());
//pro_work_order status->w4报工
mesReportWorkMapper.updateWorkOrderStatus(work);
}
return R.ok();
}
//根据工单子单编码获取最顶级订单的母单
private ProOrderWorkorder getTopOrder(String workorderCode) {
//pro_order_workorder
ProOrderWorkorder topOrder = mesReportWorkMapper.getOrderByCode(workorderCode);
while (!"0".equals(topOrder.getParentOrder()) && StringUtils.isNotEmpty(topOrder.getParentOrder())) {
//pro_order_workorder
topOrder = mesReportWorkMapper.getOrderByCode(topOrder.getParentOrder());
}
return topOrder;
}
public void dateBKFunc(String poolName,List<String> tables){

@ -236,8 +236,8 @@ public class MesPrepareServiceImpl implements IMesPrepareService {
try {
dateSources.forEach(dateSource -> {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++报工开始++++++++++");
Runnable run = () -> reportWorkByFactory(dateSource.get("poolName"));
executorService.execute(run);
//Runnable run = () -> reportWorkByFactory(dateSource.get("poolName"));
//executorService.execute(run);
});
} catch (Exception e) {
logger.error("service == deviceOfflineTimingTask == exception", e);
@ -249,17 +249,16 @@ public class MesPrepareServiceImpl implements IMesPrepareService {
}
//报工
public void reportWorkByFactory(String poolName) {
DynamicDataSourceContextHolder.push(poolName);// 这是数据源的key
MesReportWork mesReportWork = new MesReportWork();
MesReportWork mesReportWork = new MesReportWork();
mesReportWork.setUploadStatus("1");//除了1报工成功的都需要报工
mesReportWork.setProdType("prod");
List<MesReportWork> reportWorks = mesReportWorkMapper.getReportWorkList(mesReportWork);
for(MesReportWork work:reportWorks){
for(MesReportWork work:reportWorks) {
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量
SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改
ltgs.setConf_activity1(work.getSac1());
ltgs.setConf_activity1(work.getSac1());//人工
ltgs.setConf_activity2(work.getSac2());
ltgs.setConf_activity3(work.getSac3());
ltgs.setConf_activity4(work.getSac4());
@ -270,9 +269,9 @@ public class MesPrepareServiceImpl implements IMesPrepareService {
lthw.setMaterial(work.getProcessCode());
R r = remoteSapService.sapRFWOrder(sapRFW);
//上传成功更改mes_report_work状态
if(r.getCode() == 200){
if (r.getCode() == 200) {
work.setUploadStatus("1");
}else{
} else {
work.setUploadStatus("2");
work.setUploadMsg(r.getMsg());
}

@ -12,6 +12,7 @@ import com.op.mes.domain.*;
import com.op.mes.domain.dto.LineChartDto;
import com.op.mes.domain.dto.LineChartSeriesDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.mes.service.IWCSInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesReportWorkMapper;
@ -29,6 +30,8 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
@Autowired
private MesReportWorkMapper mesReportWorkMapper;
@Autowired
private IWCSInterfaceService iWCSInterfaceService;
/**
*
*
@ -63,6 +66,7 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
@DS("#header.poolName")
public int insertMesReportWork(MesReportWork mesReportWork) {
mesReportWork.setCreateTime(DateUtils.getNowDate());
iWCSInterfaceService.reportWork(mesReportWork);
return mesReportWorkMapper.insertMesReportWork(mesReportWork);
}

@ -156,6 +156,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="createNewTable">
SELECT TOP 0 * INTO ${tableNew} FROM mes_material_transfer_result
</insert>
<insert id="addSapLog">
insert into sys_sap_log
(id,messsge,create_time,reqcode,method,remark,status)
values(
#{id},#{messsge}, #{createTime}, #{reqcode},#{method},#{remark},#{status})
</insert>
<select id="copyBkDateByTable">
insert into ${table}
select * FROM mes_material_transfer_result

@ -189,6 +189,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code
left join pro_route rte on rte.route_code = ow.route_code
where mrw.upload_status != #{uploadStatus} and mrw.prod_type = #{prodType}
<if test="productDateEnd != null ">
and ow.order_code = #{orderCode}
</if>
order by mrw.create_time
</select>
<select id="getDailyReport" resultType="com.op.mes.domain.MesDailyReport">
@ -330,6 +333,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT bst.Shift_Id shiftId,bst.Shift_Desc shiftDesc
FROM base_shifts_t bst
</select>
<select id="getProdResult" resultType="com.op.mes.domain.MesReportWork">
select
mrw.workorder_code,
sum(mrw.quantity_feedback) quantityFeedback
from mes_report_work mrw
where mrw.del_flag = '0' and mrw.workorder_code = #{workorderode}
group by mrw.workorder_code
</select>
<select id="getOrderByCode" resultType="com.op.mes.domain.ProOrderWorkorder">
select workorder_code workorderCode,
parent_order parentOrder,
quantity_split quantitySplit
from pro_order_workorder where workorder_code = #{workorderCode}
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work

@ -64,11 +64,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pp.process_name as nextProcessName,
ppp.process_code as nowProcessCode,
ppp.process_name as nowProcessName,
pow.order_code as orderCode
pow.order_code as orderCode,
pow.product_code as productCode,
pow.product_name as productName,
pow.product_date as productDate,
pow.shift_id as shiftId
from pro_rfid_process_detail ppd
left join pro_process pp on pp.process_id = ppd.next_process_id
left join pro_process ppp on ppp.process_id = ppd.now_process_id
left join pro_order_workorder pow on pow.workorder_code = ppd.workorder_code
order by ppd.in_time desc
<where>
<if test="workorderCode != null and workorderCode != ''"> and ppd.workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="rfid != null and rfid != ''"> and rfid like concat('%', #{rfid}, '%')</if>

@ -2,6 +2,7 @@ package com.op.plan.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@ -171,6 +172,15 @@ public class ProOrderController extends BaseController {
return success(proOrderService.getProShifts());
}
/**
*
* @return
*/
@PutMapping("/getProSortNo")
public int getProSortNo(@RequestBody ProOrder proOrder) {
return proOrderService.getProSortNo(proOrder);
}
/**
* list
*
@ -252,8 +262,8 @@ public class ProOrderController extends BaseController {
*/
@Log(title = "手动执行同步SAP订单", businessType = BusinessType.INSERT)
@PostMapping("/syncSAP")
public AjaxResult syncSAP() {
return proOrderService.syncSAP();
public void syncSAP() {
proOrderService.syncSAP();
}
@Log(title = "自动同步SAP订单", businessType = BusinessType.INSERT)

@ -158,7 +158,7 @@ public class ProOrderWorkorderController extends BaseController {
@Log(title = "生产工单", businessType = BusinessType.DELETE)
@DeleteMapping("/{workorderIds}")
public AjaxResult remove(@PathVariable String[] workorderIds) {
//什么时候可以删除工单TODO;没进入生产之前都可以?
//没进入生产之前都可以删除
// 根据工单的ids查工单的信息
List<ProOrderWorkorder> proOrderWorkorders = proOrderWorkorderService.selectProOrderWorkorderByWorkIds(workorderIds);
if (ObjectUtils.isEmpty(proOrderWorkorders)) {
@ -195,15 +195,11 @@ public class ProOrderWorkorderController extends BaseController {
} else {
throw new ServiceException("工单已进行生产,不允许删除!");
}
// 判断是否含有湿料计划 boolean值存在为true不存在为false
// if (proWetMaterialPlanDetailService.selectProWetMaterialPlanDetailByWorkId(proOrderWorkorder.getWorkorderId())) {
// throw new ServiceException("工单已创建湿料计划,不能删除!");
// }
}
String[] orderWorkerIds = strings.toArray(new String[0]);
// 删除成品工单
if (proWorkOrder.size() > 0) {
if (orderWorkerIds.length > 0) {
proOrderWorkorderService.deleteProOrderWorkorderByWorkorderIds(orderWorkerIds);
}
return toAjax(1);

@ -62,6 +62,16 @@ public class ProOrder extends TreeEntity {
private String bomBo;
private String syncUser;
private String productDate;
public String getProductDate() {
return productDate;
}
public void setProductDate(String productDate) {
this.productDate = productDate;
}
public String getBomBo() {
return bomBo;
}
@ -138,7 +148,7 @@ public class ProOrder extends TreeEntity {
private String materialCode;
private String materialName;
private Integer sortNo;
// 车数
private Integer carNum;
@ -338,6 +348,14 @@ public class ProOrder extends TreeEntity {
return prodType;
}
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -150,6 +150,7 @@ public class ProOrderWorkorder extends TreeEntity {
// 车数
private Integer carNum;
private Integer sortNo;
public Integer getCarNum() {
return carNum;
@ -506,6 +507,14 @@ public class ProOrderWorkorder extends TreeEntity {
this.prodLineCodeArray = prodLineCodeArray;
}
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -65,6 +65,8 @@ public class ProOrderDTO {
private Integer carNum;
private Integer sortNo;
public Integer getCarNum() {
return carNum;
}
@ -83,6 +85,14 @@ public class ProOrderDTO {
private List<ProOrderDTO> children;
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
@Override
public String toString() {
return "ProOrderDTO{" +

@ -29,6 +29,15 @@ public class SplitOrderDTO {
private String materialCode;
private String materialName;
private Integer sortNo;
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
public String getMaterialCode() {
return materialCode;

@ -9,6 +9,7 @@ import com.op.plan.domain.ProOrder;
import com.op.plan.domain.ProShift;
import com.op.plan.domain.*;
import com.op.plan.domain.vo.CascaderDTO;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.model.SapProOrder;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
@ -220,4 +221,6 @@ public interface ProOrderMapper {
* @param orderCode
*/
void updateOrderStatusCompleteByOrderCode(String orderCode);
void addSapLog(SysSapLog sysSapLog);
}

@ -148,5 +148,7 @@ public interface ProOrderWorkorderMapper {
* @return
*/
List<ProOrderWorkorder> selectProOrderWorkorderByOrderId(String orderId);
int getProSortNo(ProOrder proOrder);
}

@ -97,7 +97,7 @@ public interface IProOrderService {
public AjaxResult getOrderList(String id);
public AjaxResult syncSAP();
public void syncSAP();
/**
*
@ -134,4 +134,6 @@ public interface IProOrderService {
* @return
*/
AjaxResult getCascadeProOrder(String orderCode);
int getProSortNo(ProOrder proOrder);
}

@ -27,6 +27,7 @@ import com.op.plan.domain.dto.SplitOrderDTO;
import com.op.plan.mapper.*;
import com.op.system.api.RemoteSapService;
import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.sap.SapShopOrderQuery;
import com.op.system.api.model.SapProOrder;
@ -130,7 +131,7 @@ public class ProOrderServiceImpl implements IProOrderService {
// 如果不重复
if (checkout) {
// 如果是白坯订单
/****白坯订单*****/
if (splitOrderDTO.getProduct().getProdType().equals("white")){
boolean flag = false;
@ -180,7 +181,11 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrderMapper.updateWhiteOrder(proOrder);
// 设置工单通用属性
ProOrderWorkorder proOrderWorkorder = setCommonWorkAttribute(proOrder, splitOrderDTO.getProductDate(), splitOrderDTO.getProdLineCode(), splitOrderDTO.getShiftId(), splitOrderDTO.getRouteCode());
ProOrderWorkorder proOrderWorkorder = setCommonWorkAttribute(
proOrder, splitOrderDTO.getProductDate(),
splitOrderDTO.getProdLineCode(), splitOrderDTO.getShiftId(),
splitOrderDTO.getRouteCode(),splitOrderDTO.getSortNo()
);
// 设置批次表通用信息
ProOrderWorkorderBatch proOrderWorkorderBatch = setCommonBatchAttribute();
// 设置工单
@ -197,7 +202,7 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrderWorkorder.setEndFlag(1);
proOrderWorkorder.setCarNum(splitOrderDTO.getCarNum());
// 插入工单
// 插入工单/**pro_order_workorder**/
proOrderWorkorderMapper.insertProOrderWorkorder(proOrderWorkorder);
setBatch(proOrderWorkorderBatch,splitOrderDTO.getFormFields(),proOrderWorkorder.getWorkorderId(),1L);
@ -234,12 +239,16 @@ public class ProOrderServiceImpl implements IProOrderService {
return success();
}else {
}else {/****成品订单*****/
// 创建订单对象并将信息copy进去
ProOrder proOrder = new ProOrder();
BeanUtils.copyProperties(splitOrderDTO.getProduct(), proOrder);
// 设置工单通用属性
ProOrderWorkorder proOrderWorkorder = setCommonWorkAttribute(proOrder, splitOrderDTO.getProductDate(), splitOrderDTO.getProdLineCode(), splitOrderDTO.getShiftId(), splitOrderDTO.getRouteCode());
ProOrderWorkorder proOrderWorkorder = setCommonWorkAttribute(
proOrder, splitOrderDTO.getProductDate(),
splitOrderDTO.getProdLineCode(), splitOrderDTO.getShiftId(),
splitOrderDTO.getRouteCode(),splitOrderDTO.getSortNo()
);
// 创建批次表通用对象
ProOrderWorkorderBatch workBatch = setCommonBatchAttribute();
// code
@ -262,12 +271,9 @@ public class ProOrderServiceImpl implements IProOrderService {
workOrder.setWorkorderCode(proOrder.getOrderCode() + "-" + endCode);
// 3.设置父工单
workOrder.setParentOrder(parentOrder.toString());
// 工单对应车数-白坯订单操作
// if (proOrder.getProdType().equals("white")) {
// int everyNum = (int) Math.ceil(proOrder.getQuantity() / proOrder.getCarNum());
// int carNum = (int) Math.ceil(splitOrderDTO.getSplitNum() / everyNum);
// workOrder.setCarNum(carNum);
// }
workOrder.setSortNo(splitOrderDTO.getSortNo());
// 将工单信息更新至数据库
proOrderWorkorderMapper.insertProOrderWorkorder(workOrder);
// 生成批次表信息并更新至数据库
@ -295,34 +301,6 @@ public class ProOrderServiceImpl implements IProOrderService {
}
}
}
// 关闭订单,判断是否拆分完成
// ProOrder order = proOrderMapper.selectProOrderById(splitOrderDTO.getProduct().getId());
// Long quantitySplit = order.getQuantitySplit();
// Long quantity1 = order.getQuantity();
// if (quantity1.equals(quantitySplit)) {
// // 需要关闭订单的codeList
// List<String> orderCodes = new ArrayList<>();
// // 临时存放code
// StringBuilder orderCode = new StringBuilder();
// orderCode.append(order.getOrderCode());
// while(true) {
// orderCodes.add(orderCode.toString());
// String selectOrderCode = proOrderMapper.selectChildProOrderCodeByCode(orderCode.toString());
// if (selectOrderCode == null) {
// break;
// }
// orderCode.setLength(0);
// orderCode.append(selectOrderCode);
// }
//
// // 关闭订单
// for (String code : orderCodes) {
// remoteSapService.sapCloseOrder(code);
// }
//
// }
return success();
}
@ -418,32 +396,39 @@ public class ProOrderServiceImpl implements IProOrderService {
*/
@Override
@DS("#header.poolName")
public AjaxResult syncSAP() {
public void syncSAP() {
SapShopOrderQuery sapqo = new SapShopOrderQuery();
// sapqo.setCreateTime(DateUtils.addDays(DateUtils.getNowDate(),-4));
// //获取当前所选工厂
// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// String key = "#header.poolName";
// sapqo.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
sapqo.setWerk(request.getHeader(key.substring(8)).replace("ds_",""));
SapProOrder maxCreateTime = proOrderMapper.getMaxCreatetime();
if(maxCreateTime == null ){
sapqo.setErdat(DateFormatUtils.format(new Date(), "yyyyMMdd"));//S_ERDAT(创建日期) 例如20230923
}else{
sapqo.setErdat(maxCreateTime.getCreateTimeStr());//S_ERDAT(创建日期) 例如20230923
}
//添加调用sap日志
SysSapLog sysSapLog = new SysSapLog();
sysSapLog.setId(IdUtils.fastSimpleUUID());
sysSapLog.setMesssge(sapqo.toString());
sysSapLog.setMethod("syncSAP");
sysSapLog.setReqcode("请求");
sysSapLog.setCreateTime(DateUtils.getNowDate());
proOrderMapper.addSapLog(sysSapLog);
//取>=20230923的sap数据
R<List<SapProOrder>> rSapProOrder = remoteSapService.shopOrderSync(sapqo);//sap只能同步指定日期的数据
if(rSapProOrder == null){
return AjaxResult.error("无"+sapqo.getErdat()+"之后的最新订单");
}
List<SapProOrder> newOrders = rSapProOrder.getData();
syncSAPFunc(newOrders,SecurityUtils.getUsername());
return success();
if(CollectionUtils.isEmpty(newOrders)){
System.out.println("无"+sapqo.getErdat()+"之后的最新订单");
}else {
syncSAPFunc(newOrders, "Job");
}
}
public String syncSAPFunc(List<SapProOrder> newOrders,String syncUser){
@ -687,6 +672,12 @@ public class ProOrderServiceImpl implements IProOrderService {
return success(proOrderVO);
}
@Override
@DS("#header.poolName")
public int getProSortNo(ProOrder proOrder) {
return proOrderWorkorderMapper.getProSortNo(proOrder);
}
public void getSAPOrderByFactory(String poolName) {
DynamicDataSourceContextHolder.push(poolName);// 这是数据源的key
// SapProOrder sapqo = new SapProOrder();//proOrderMapper.getMaxCreatetime();
@ -703,12 +694,22 @@ public class ProOrderServiceImpl implements IProOrderService {
sapqo.setErdat(maxCreateTime.getCreateTimeStr());//S_ERDAT(创建日期) 例如20230923
}
//添加调用sap日志
SysSapLog sysSapLog = new SysSapLog();
sysSapLog.setId(IdUtils.fastSimpleUUID());
sysSapLog.setMesssge(sapqo.toString());
sysSapLog.setMethod("shopOrderSync");
sysSapLog.setReqcode("请求");
sysSapLog.setCreateTime(DateUtils.getNowDate());
proOrderMapper.addSapLog(sysSapLog);
R<List<SapProOrder>> rSapProOrder = remoteSapService.shopOrderSync(sapqo);
List<SapProOrder> newOrders = rSapProOrder.getData();
if(CollectionUtils.isEmpty(newOrders)){
logger.error("无"+sapqo.getErdat()+"之后的最新订单");
System.out.println("无"+sapqo.getErdat()+"之后的最新订单");
}else {
syncSAPFunc(newOrders, "Job");
}
syncSAPFunc(newOrders,"Job");
}
/**
@ -827,7 +828,7 @@ public class ProOrderServiceImpl implements IProOrderService {
* @param proOrder
* @return
*/
private ProOrderWorkorder setCommonWorkAttribute(ProOrder proOrder, Date date, String proLineCode, String shiftId, String routeCode) {
private ProOrderWorkorder setCommonWorkAttribute(ProOrder proOrder, Date date, String proLineCode, String shiftId, String routeCode, Integer orderNum) {
ProOrderWorkorder proOrderWorkorder = new ProOrderWorkorder();
// 更新者
proOrderWorkorder.setUpdateBy(SecurityContextHolder.getUserName());
@ -847,6 +848,8 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrderWorkorder.setProductSpc(proOrder.getProdSpc());
// 产线
proOrderWorkorder.setProdLineCode(proLineCode);
// 产线
proOrderWorkorder.setOrderNum(orderNum);
// 班次
proOrderWorkorder.setShiftId(shiftId);
// TODO 产品类型(pro_type)
@ -873,7 +876,7 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrder.setUpdateBy(SecurityContextHolder.getUserName());
proOrder.setUpdateTime(date);
// 订单状态逻辑
if (proOrder.getQuantity().longValue() == (proOrder.getQuantitySplit().longValue() + Long.valueOf(proOrder.getAtrr1()))) {
if (proOrder.getQuantity().longValue() == proOrder.getQuantitySplit().longValue()) {
// 已拆分
proOrder.setStatus("o2");
}else {
@ -897,6 +900,7 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrderWorkorder.setQuantitySplit(Long.valueOf(proOrder.getAtrr1()));
// 设置工单产品类型
proOrderWorkorder.setProdType(proOrder.getOrderType());
return proOrderWorkorder;
}

@ -17,6 +17,7 @@ import com.op.plan.domain.vo.CascaderDTO;
import com.op.plan.mapper.*;
import com.op.plan.service.IProOrderWorkorderService;
import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.MesPrepareDTO;
import com.op.system.api.domain.dto.MesPrepareDetailDTO;
import com.op.system.api.domain.sap.SapCreateOrder;
@ -96,12 +97,11 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
Map<String, CascaderDTO> equipMap = proOrderMapper.getEquipInfoByCodes(equipCods.substring(1));//设备字典
for (int c = 0; c < codeArray.size(); c++) {
String equipCode = codeArray.getJSONArray(c).getString(1);
prodLineName += equipMap.get(equipCode).getLabel() + ",";
CascaderDTO eInfo = equipMap.get(equipCode);
if(eInfo != null){
prodLineName += eInfo.getLabel() + ",";
}
}
// Set<String> keys = equipMap.keySet();
// for (String key : keys) {
// prodLineName += equipMap.get(key).getLabel() + ",";
// }
workorder.setProdLineName(prodLineName);
// // 通过设备code查询出机型名称
@ -264,6 +264,16 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
sap.setDates(DateUtils.parseDateToStr("yyyy-MM-dd", whiteOrder.getProductDate()));//开始时间
sap.setDatee(DateUtils.parseDateToStr("yyyy-MM-dd", whiteOrder.getProductDate()));//完成时间
sapList.add(sap);
//添加调用sap日志
SysSapLog sysSapLog = new SysSapLog();
sysSapLog.setId(IdUtils.fastSimpleUUID());
sysSapLog.setMesssge(sapList.toString());
sysSapLog.setMethod("downProOrderWorkorderByWorkorderIds");
sysSapLog.setReqcode("请求");
sysSapLog.setCreateTime(DateUtils.getNowDate());
proOrderMapper.addSapLog(sysSapLog);
R<List<String>> r = remoteSapService.SapCreateOrder(sapList);
logger.info("sap工单回传" + r.getMsg());
if (500 == r.getCode()) {

@ -256,6 +256,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GETDATE(),
</trim>
</insert>
<insert id="addSapLog">
insert into sys_sap_log
(id,messsge,create_time,reqcode,method,remark,status)
values(
#{id},#{messsge}, #{createTime}, #{reqcode},#{method},#{remark},#{status})
</insert>
<update id="updateProOrder" parameterType="ProOrder">
update pro_order
@ -292,8 +298,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateOrder">
update pro_order
<trim prefix="SET" suffixOverrides=",">
<if test="atrr1 != null and quantitySplit != null">quantity_split += #{atrr1},</if>
<if test="quantitySplit == null">quantity_split = #{atrr1},</if>
<if test="quantitySplit != null">quantity_split = #{quantitySplit},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="status != null">status = #{status},</if>

@ -37,13 +37,14 @@
<result property="factoryCode" column="factory_code" />
<result property="endFlag" column="end_flag" />
<result property="carNum" column="car_num" />
<result property="sortNo" column="sort_no" />
</resultMap>
<sql id="selectProOrderWorkorderVo">
select workorder_id, workorder_code, workorder_name, order_id, order_code, product_id, product_code, product_name,
product_spc, unit, quantity_produced, quantity_split, route_code, prod_line_code, product_date,
shift_id, parent_order, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time,
update_by, update_time, prod_type, factory_code , end_flag , car_num
update_by, update_time, prod_type, factory_code , end_flag , car_num,sort_no
from pro_order_workorder
</sql>
@ -201,6 +202,7 @@
<if test="factoryCode != null">factory_code,</if>
<if test="endFlag != null">end_flag,</if>
<if test="carNum != null">car_num,</if>
<if test="sortNo != null">sort_no,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workorderId != null">#{workorderId},</if>
@ -235,6 +237,7 @@
<if test="factoryCode != null">#{factoryCode},</if>
<if test="endFlag != null">#{endFlag},</if>
<if test="carNum != null">#{carNum},</if>
<if test="sortNo != null">#{sortNo},</if>
</trim>
</insert>
<insert id="createPrepare">
@ -341,6 +344,10 @@
<include refid="selectProOrderWorkorderVo"/>
where order_id = #{orderId} and del_flag = '0'
</select>
<select id="getProSortNo" resultType="java.lang.Integer">
select count(0)+1 from pro_order_workorder
where product_date = #{productDate} and end_flag='1'
</select>
<insert id="createPrepareDetails">
insert into mes_prepare_detail
@ -422,7 +429,7 @@
<delete id="deleteProOrderWorkorderByWorkorderIds" parameterType="String">
update pro_order_workorder
set del_flag = '1'
where order_id in
where workorder_id in
<foreach item="workorderId" collection="array" open="(" separator="," close=")">
#{workorderId}
</foreach>

@ -0,0 +1,186 @@
package com.op.quality.controller;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcBomComponent;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckReportIncome;
import com.op.quality.domain.QcSupplier;
import com.op.quality.service.IQcCheckReportIncomeService;
import com.op.system.api.domain.SysUser;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
* Controller
*
* @author Open Platform
* @date 2023-10-19
*/
@RestController
@RequestMapping("/qcIncomeReport")
public class QcCheckReportIncomeController extends BaseController {
@Autowired
private IQcCheckReportIncomeService qcCheckReportIncomeService;
/**
*
*/
@RequiresPermissions("quality:qcIncomeReport:list")
@GetMapping("/list")
public TableDataInfo list(QcCheckReportIncome qcCheckReportIncome) {
//默认时间范围T 00:00:00~T+1 00:00:00
/*if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){
qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end
}*/
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start
// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end
// }
startPage();
List<QcCheckReportIncome> list = qcCheckReportIncomeService.selectQcCheckReportIncomeList(qcCheckReportIncome);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("quality:qcIncomeReport:export")
@Log(title = "来料检验", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) {
//默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){
qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end
}
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start
// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end
// }
List<QcCheckReportIncome> list = qcCheckReportIncomeService.selectQcCheckReportIncomeList(qcCheckReportIncome);
ExcelUtil<QcCheckReportIncome> util = new ExcelUtil<QcCheckReportIncome>(QcCheckReportIncome.class);
util.exportExcel(response, list, "来料检验数据");
}
/**
*
*/
@RequiresPermissions("quality:qcIncomeReport:query")
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
return success(qcCheckReportIncomeService.selectQcCheckReportIncomeByRecordId(recordId));
}
/**
*
*/
@RequiresPermissions("quality:qcIncomeReport:add")
@Log(title = "来料检验", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
int r = qcCheckReportIncomeService.insertQcCheckReportIncome(qcCheckReportIncome);
if(r>0){
return toAjax(r);
}
return error("添加失败:请检查物料的关联检测项");
}
/**
*
*/
@RequiresPermissions("quality:qcIncomeReport:edit")
@Log(title = "来料检验", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
return toAjax(qcCheckReportIncomeService.updateQcCheckReportIncome(qcCheckReportIncome));
}
/**
*
*/
@RequiresPermissions("quality:qcIncomeReport:remove")
@Log(title = "来料检验", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public AjaxResult remove(@PathVariable String[] recordIds) {
return toAjax(qcCheckReportIncomeService.deleteQcCheckReportIncomeByRecordIds(recordIds));
}
/**
* BOM
*/
@GetMapping("/getQcListBom")
public TableDataInfo getQcListBom(QcBomComponent bomComponent) {
startPage();
List<QcBomComponent> list = qcCheckReportIncomeService.getQcListBom(bomComponent);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/getQcListSupplier")
public TableDataInfo getQcListSupplier(QcSupplier qcSupplier) {
startPage();
List<QcSupplier> list = qcCheckReportIncomeService.getQcListSupplier(qcSupplier);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/getQcListUser")
public TableDataInfo getQcListUser(SysUser sysUser) {
startPage();
List<SysUser> list = qcCheckReportIncomeService.getQcListUser(sysUser);
return getDataTable(list);
}
/**
*
*/
@PutMapping("/changeIncomeStatus")
public AjaxResult changeIncomeStatus(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
qcCheckReportIncome.setUpdateBy(SecurityUtils.getUsername());
qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate());
return toAjax(qcCheckReportIncomeService.updateIncomeStatus(qcCheckReportIncome));
}
/**
*
* @param
* @return
*/
@GetMapping("/getCkeckProjectList")
public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
startPage();
List<QcCheckTaskDetail> list = qcCheckReportIncomeService.getCkeckProjectList(qcCheckTaskDetail);
return getDataTable(list);
}
}

@ -2,6 +2,8 @@ package com.op.quality.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.quality.domain.QcCheckReportIncome;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -72,7 +74,12 @@ public class QcCheckTypeController extends BaseController {
@Log(title = "检验节点维护", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody QcCheckType qcCheckType) {
return toAjax(qcCheckTypeService.insertQcCheckType(qcCheckType));
QcCheckType valiData = qcCheckTypeService.selectQcCheckTypeById(qcCheckType.getOrderCode());
if (valiData != null){
return AjaxResult.error("节点编码已存在,请重新输入!");
}else {
return toAjax(qcCheckTypeService.insertQcCheckType(qcCheckType));
}
}
/**

@ -0,0 +1,376 @@
package com.op.quality.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;
/**
* qc_check_task_income
*
* @author Open Platform
* @date 2023-10-19
*/
public class QcCheckReportIncome extends BaseEntity {
private static final long serialVersionUID = 1L;
/** id */
private String recordId;
/** 检验任务编号 */
@Excel(name = "检验任务编号")
private String checkNo;
/** 来料批次号 */
@Excel(name = "来料批次号")
private String incomeBatchNo;
/** 订单号 */
@Excel(name = "订单号")
private String orderNo;
/** 物料号 */
@Excel(name = "物料号")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 收货数量 */
@Excel(name = "收货数量")
private BigDecimal quality;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 供应商编码 */
@Excel(name = "供应商编码")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 来料时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "来料时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date incomeTime;
/** 检测地点 */
@Excel(name = "检测地点")
private String checkLoc;
/** 检测状态 */
@Excel(name = "检测状态")
private String checkStatus;
/** 检测人工号 */
@Excel(name = "检测人工号")
private String checkManCode;
/** 检测人姓名 */
@Excel(name = "检测人姓名")
private String checkManName;
/** 检验时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "检验时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date checkTime;
/** 检验结果Y合格 */
@Excel(name = "检验结果Y合格")
private String checkResult;
/** 是否启用1启用0停用 */
@Excel(name = "是否启用1启用0停用")
private String status;
/** 预留字段1 */
//@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
//@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
//@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
//@Excel(name = "预留字段4")
private String attr4;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
/** 删除标识1删除0正常 */
private String delFlag;
private String incomeTimeStart;
private String incomeTimeEnd;
private String checkTimeStart;
private String checkTimeEnd;
private String typeCode;
private String checkType;
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public String getIncomeTimeStart() {
return incomeTimeStart;
}
public void setIncomeTimeStart(String incomeTimeStart) {
this.incomeTimeStart = incomeTimeStart;
}
public String getIncomeTimeEnd() {
return incomeTimeEnd;
}
public void setIncomeTimeEnd(String incomeTimeEnd) {
this.incomeTimeEnd = incomeTimeEnd;
}
public String getCheckTimeStart() {
return checkTimeStart;
}
public void setCheckTimeStart(String checkTimeStart) {
this.checkTimeStart = checkTimeStart;
}
public String getCheckTimeEnd() {
return checkTimeEnd;
}
public void setCheckTimeEnd(String checkTimeEnd) {
this.checkTimeEnd = checkTimeEnd;
}
public void setRecordId(String recordId) {
this.recordId = recordId;
}
public String getRecordId() {
return recordId;
}
public void setCheckNo(String checkNo) {
this.checkNo = checkNo;
}
public String getCheckNo() {
return checkNo;
}
public void setIncomeBatchNo(String incomeBatchNo) {
this.incomeBatchNo = incomeBatchNo;
}
public String getIncomeBatchNo() {
return incomeBatchNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getOrderNo() {
return orderNo;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialName() {
return materialName;
}
public void setQuality(BigDecimal quality) {
this.quality = quality;
}
public BigDecimal getQuality() {
return quality;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getUnit() {
return unit;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getSupplierName() {
return supplierName;
}
public void setIncomeTime(Date incomeTime) {
this.incomeTime = incomeTime;
}
public Date getIncomeTime() {
return incomeTime;
}
public void setCheckLoc(String checkLoc) {
this.checkLoc = checkLoc;
}
public String getCheckLoc() {
return checkLoc;
}
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
public String getCheckStatus() {
return checkStatus;
}
public void setCheckManCode(String checkManCode) {
this.checkManCode = checkManCode;
}
public String getCheckManCode() {
return checkManCode;
}
public void setCheckManName(String checkManName) {
this.checkManName = checkManName;
}
public String getCheckManName() {
return checkManName;
}
public void setCheckTime(Date checkTime) {
this.checkTime = checkTime;
}
public Date getCheckTime() {
return checkTime;
}
public void setCheckResult(String checkResult) {
this.checkResult = checkResult;
}
public String getCheckResult() {
return checkResult;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordId", getRecordId())
.append("checkNo", getCheckNo())
.append("incomeBatchNo", getIncomeBatchNo())
.append("orderNo", getOrderNo())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("quality", getQuality())
.append("unit", getUnit())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.append("incomeTime", getIncomeTime())
.append("checkLoc", getCheckLoc())
.append("checkStatus", getCheckStatus())
.append("checkManCode", getCheckManCode())
.append("checkManName", getCheckManName())
.append("checkTime", getCheckTime())
.append("checkResult", getCheckResult())
.append("status", getStatus())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -1,10 +1,13 @@
package com.op.quality.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import java.util.Date;
/**
* qc_check_unqualified
*
@ -61,6 +64,173 @@ public class QcCheckUnqualified extends BaseEntity {
private String type;
private String checkType;
private String checkName;
private String checkNo;
private String incomeBatchNo;
private String orderNo;
private String materialCode;
private String materialName;
private String quality;
private String unit;
private String supplierCode;
private String supplierName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "检验时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date incomeTime;
private String checkLoc;
private String checkStatus;
private String checkManCode;
private String checkManName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "检验时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private String checkTime;
private String checkResult;
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getCheckName() {
return checkName;
}
public void setCheckName(String checkName) {
this.checkName = checkName;
}
public String getCheckNo() {
return checkNo;
}
public void setCheckNo(String checkNo) {
this.checkNo = checkNo;
}
public String getIncomeBatchNo() {
return incomeBatchNo;
}
public void setIncomeBatchNo(String incomeBatchNo) {
this.incomeBatchNo = incomeBatchNo;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getQuality() {
return quality;
}
public void setQuality(String quality) {
this.quality = quality;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public Date getIncomeTime() {
return incomeTime;
}
public void setIncomeTime(Date incomeTime) {
this.incomeTime = incomeTime;
}
public String getCheckLoc() {
return checkLoc;
}
public void setCheckLoc(String checkLoc) {
this.checkLoc = checkLoc;
}
public String getCheckStatus() {
return checkStatus;
}
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
public String getCheckManCode() {
return checkManCode;
}
public void setCheckManCode(String checkManCode) {
this.checkManCode = checkManCode;
}
public String getCheckManName() {
return checkManName;
}
public void setCheckManName(String checkManName) {
this.checkManName = checkManName;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime;
}
public String getCheckResult() {
return checkResult;
}
public void setCheckResult(String checkResult) {
this.checkResult = checkResult;
}
public String getType() {
return type;
}

@ -0,0 +1,77 @@
package com.op.quality.mapper;
import com.op.quality.domain.QcBomComponent;
import com.op.quality.domain.QcCheckReportIncome;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcSupplier;
import com.op.system.api.domain.SysUser;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-10-19
*/
@Mapper
public interface QcCheckReportIncomeMapper {
/**
*
*
* @param recordId
* @return
*/
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId);
/**
*
*
* @param qcCheckReportIncome
* @return
*/
public List<QcCheckReportIncome> selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome);
/**
*
*
* @param qcCheckReportIncome
* @return
*/
public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome);
/**
*
*
* @param qcCheckReportIncome
* @return
*/
public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome);
/**
*
*
* @param recordId
* @return
*/
public int deleteQcCheckReportIncomeByRecordId(String recordId);
/**
*
*
* @param recordIds
* @return
*/
public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds);
public List<QcBomComponent> getQcListBom(QcBomComponent bomComponent);
public List<QcSupplier> getQcListSupplier(QcSupplier qcSupplier);
public List<SysUser> getQcListUser(SysUser sysUser);
int getTodayMaxNum(QcCheckReportIncome qcCheckReportIncome);
List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail);
}

@ -0,0 +1,74 @@
package com.op.quality.service;
import com.op.quality.domain.*;
import com.op.system.api.domain.SysUser;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-10-19
*/
public interface IQcCheckReportIncomeService {
/**
*
*
* @param recordId
* @return
*/
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId);
/**
*
*
* @param qcCheckReportIncome
* @return
*/
public List<QcCheckReportIncome> selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome);
/**
*
*
* @param qcCheckReportIncome
* @return
*/
public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome);
/**
*
*
* @param qcCheckReportIncome
* @return
*/
public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome);
/**
*
*
* @param recordIds
* @return
*/
public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds);
/**
*
*
* @param recordId
* @return
*/
public int deleteQcCheckReportIncomeByRecordId(String recordId);
public List<QcBomComponent> getQcListBom(QcBomComponent bomComponent);
public List<QcSupplier> getQcListSupplier(QcSupplier qcSupplier);
public List<SysUser> getQcListUser(SysUser sysUser);
int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome);
List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail);
public List<QcCheckReportIncome> getPrintData(QcCheckReportIncome qcCheckReportIncome);
}

@ -16,6 +16,7 @@ import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.quality.service.IQcCheckTaskIncomeService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -99,12 +100,6 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
qcCheckTaskIncome.setCheckNo(bpDD+liushuiStr);
/**qc_check_task_income**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckTaskIncome.setRecordId(beLongId);
qcCheckTaskIncome.setFactoryCode(factoryCode);
qcCheckTaskIncome.setCreateTime(nowDate);
qcCheckTaskIncomeMapper.insertQcCheckTaskIncome(qcCheckTaskIncome);
/**取检测项**/
QcCheckTypeProject qctp= new QcCheckTypeProject();
@ -127,6 +122,13 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
return 0;//没有找到检测项目
}
/**qc_check_task**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckTaskIncome.setRecordId(beLongId);
qcCheckTaskIncome.setFactoryCode(factoryCode);
qcCheckTaskIncome.setCreateTime(nowDate);
qcCheckTaskIncomeMapper.insertQcCheckTaskIncome(qcCheckTaskIncome);
/**qc_check_task_detail**/
for(QcCheckTaskDetail item:items){
item.setRecordId(IdUtils.fastSimpleUUID());
item.setBelongTo(beLongId);

@ -99,13 +99,6 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
qcCheckTaskProduce.setCheckNo(bpDD+liushuiStr);
/**qc_check_task_produce**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckTaskProduce.setRecordId(beLongId);
qcCheckTaskProduce.setFactoryCode(factoryCode);
qcCheckTaskProduce.setCreateTime(nowDate);
qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
/**取检测项**/
QcCheckTypeProject qctp= new QcCheckTypeProject();
qctp.setTypeId(qcCheckTaskProduce.getCheckType());//生产过程检验
@ -127,6 +120,13 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
return 0;//没有找到检测项目
}
/**qc_check_task**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckTaskProduce.setRecordId(beLongId);
qcCheckTaskProduce.setFactoryCode(factoryCode);
qcCheckTaskProduce.setCreateTime(nowDate);
qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
/**qc_check_task_detail**/
for(QcCheckTaskDetail item:items){
item.setRecordId(IdUtils.fastSimpleUUID());
item.setBelongTo(beLongId);

@ -100,13 +100,6 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
qcCheckTaskWarehousing.setCheckNo(bpDD+liushuiStr);
/**qc_check_task_warehousing**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckTaskWarehousing.setRecordId(beLongId);
qcCheckTaskWarehousing.setFactoryCode(factoryCode);
qcCheckTaskWarehousing.setCreateTime(nowDate);
qcCheckTaskWarehousingMapper.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing);
/**取检测项**/
QcCheckTypeProject qctp= new QcCheckTypeProject();
qctp.setTypeId(qcCheckTaskWarehousing.getCheckType());//生产过程检验
@ -128,6 +121,13 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
return 0;//没有找到检测项目
}
/**qc_check_task**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckTaskWarehousing.setRecordId(beLongId);
qcCheckTaskWarehousing.setFactoryCode(factoryCode);
qcCheckTaskWarehousing.setCreateTime(nowDate);
qcCheckTaskWarehousingMapper.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing);
/**qc_check_task_detail**/
for(QcCheckTaskDetail item:items){
item.setRecordId(IdUtils.fastSimpleUUID());
item.setBelongTo(beLongId);

@ -0,0 +1,201 @@
package com.op.quality.service.serviceImpl;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.*;
import com.op.quality.mapper.*;
import com.op.quality.service.IQcCheckReportIncomeService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-10-19
*/
@Service
public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeService {
@Autowired
private QcCheckReportIncomeMapper qcCheckReportIncomeMapper;
@Autowired
private QcCheckTypeProjectMapper qcCheckTypeProjectMapper;
@Autowired
private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper;
@Autowired
private QcCheckTaskDetailMapper qcCheckTaskDetailMapper;
/**
*
*
* @param recordId
* @return
*/
@Override
@DS("#header.poolName")
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) {
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId);
}
/**
*
*
* @param qcCheckReportIncome
* @return
*/
@Override
@DS("#header.poolName")
public List<QcCheckReportIncome> selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome) {
qcCheckReportIncome.setDelFlag("0");
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeList(qcCheckReportIncome);
}
/**
*
*
* @param qcCheckReportIncome
* @return
*/
@Override
@DS("#header.poolName")
public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) {
String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate());
int liushuiNum = qcCheckReportIncomeMapper.getTodayMaxNum(qcCheckReportIncome);
String liushuiStr = String.format("%04d", liushuiNum);
String createBy = SecurityUtils.getUsername();
Date nowDate= DateUtils.getNowDate();
//获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_","");
qcCheckReportIncome.setCheckNo(bpDD+liushuiStr);
/**qc_check_task_income**/
String beLongId = IdUtils.fastSimpleUUID();
qcCheckReportIncome.setRecordId(beLongId);
qcCheckReportIncome.setFactoryCode(factoryCode);
qcCheckReportIncome.setCreateTime(nowDate);
qcCheckReportIncomeMapper.insertQcCheckReportIncome(qcCheckReportIncome);
/**取检测项**/
QcCheckTypeProject qctp= new QcCheckTypeProject();
qctp.setTypeId(qcCheckReportIncome.getCheckType());//生产过程检验
qctp.setMaterialCode(qcCheckReportIncome.getMaterialCode());//特性
/**qc_check_type_project**/
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
if(CollectionUtils.isEmpty(items)){
/**qc_material_group_detail**/
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckReportIncome.getMaterialCode());
if(group == null){
return 0;//没有找到检测项目
}
qctp.setGroupId(group.getGroupId());//共性
items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
}
/**qc_check_task_detail**/
if(CollectionUtils.isEmpty(items)){
return 0;//没有找到检测项目
}
for(QcCheckTaskDetail item:items){
item.setRecordId(IdUtils.fastSimpleUUID());
item.setBelongTo(beLongId);
item.setCreateTime(nowDate);
item.setCreateBy(createBy);
item.setFactoryCode(factoryCode);
item.setStatus("N");
}
return qcCheckTaskDetailMapper.addBatch(items);
}
/**
*
*
* @param qcCheckReportIncome
* @return
*/
@Override
@DS("#header.poolName")
public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) {
qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate());
return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome);
}
/**
*
*
* @param recordIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds) {
return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordIds(recordIds);
}
/**
*
*
* @param recordId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteQcCheckReportIncomeByRecordId(String recordId) {
return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordId(recordId);
}
@Override
@DS("#header.poolName")
public List<QcBomComponent> getQcListBom(QcBomComponent bomComponent) {
return qcCheckReportIncomeMapper.getQcListBom(bomComponent);
}
@Override
@DS("#header.poolName")
public List<QcSupplier> getQcListSupplier(QcSupplier qcSupplier) {
return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier);
}
//在公共库里不需要切库
@Override
public List<SysUser> getQcListUser(SysUser sysUser) {
return qcCheckReportIncomeMapper.getQcListUser(sysUser);
}
@Override
@DS("#header.poolName")
public int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome) {
return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome);
}
@Override
@DS("#header.poolName")
public List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
return qcCheckReportIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
}
@Override
public List<QcCheckReportIncome> getPrintData(QcCheckReportIncome qcCheckReportIncome) {
return null;
}
}

@ -62,7 +62,7 @@ public class QcCheckTypeServiceImpl implements IQcCheckTypeService {
@DS("#header.poolName")
public int insertQcCheckType(QcCheckType qcCheckType) {
if (StringUtils.isNotBlank(qcCheckType.getCheckName())){
qcCheckType.setId(IdUtils.fastSimpleUUID());
qcCheckType.setId(qcCheckType.getOrderCode());
qcCheckType.setCreateBy(SecurityUtils.getUsername());
qcCheckType.setCreateTime(DateUtils.getNowDate());
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();

@ -120,6 +120,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSerialNumber" resultType="com.op.quality.domain.QcCheckProject">
SELECT COUNT(id)+1 AS serialNumber
FROM qc_check_project
WHERE del_flag = '0'
WHERE CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
</select>
</mapper>

@ -0,0 +1,247 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcCheckReportIncomeMapper">
<resultMap type="QcCheckReportIncome" id="QcCheckReportIncomeResult">
<result property="recordId" column="record_id" />
<result property="checkNo" column="check_no" />
<result property="incomeBatchNo" column="income_batch_no" />
<result property="orderNo" column="order_no" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="quality" column="quality" />
<result property="unit" column="unit" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="incomeTime" column="income_time" />
<result property="checkLoc" column="check_loc" />
<result property="checkStatus" column="check_status" />
<result property="checkManCode" column="check_man_code" />
<result property="checkManName" column="check_man_name" />
<result property="checkTime" column="check_time" />
<result property="checkResult" column="check_result" />
<result property="status" column="status" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectQcCheckReportIncomeVo">
select record_id, check_no, income_batch_no, order_no, material_code, material_name, quality, unit, supplier_code, supplier_name, income_time, check_loc, check_status, check_man_code, check_man_name, check_time, check_result, status, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_check_task
</sql>
<select id="selectQcCheckReportIncomeList" parameterType="QcCheckReportIncome" resultMap="QcCheckReportIncomeResult">
<include refid="selectQcCheckReportIncomeVo"/>
<where>
<if test="checkNo != null and checkNo != ''"> and check_no = #{checkNo}</if>
<if test="incomeBatchNo != null and incomeBatchNo != ''"> and income_batch_no = #{incomeBatchNo}</if>
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="quality != null "> and quality = #{quality}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="incomeTime != null "> and income_time = #{incomeTime}</if>
<if test="checkLoc != null and checkLoc != ''"> and check_loc = #{checkLoc}</if>
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
<if test="checkManCode != null and checkManCode != ''"> and check_man_code = #{checkManCode}</if>
<if test="checkManName != null and checkManName != ''"> and check_man_name like concat('%', #{checkManName}, '%')</if>
<if test="checkTime != null "> and check_time = #{checkTime}</if>
<if test="checkResult != null and checkResult != ''"> and check_result = #{checkResult}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="incomeTimeStart != null "> and CONVERT(varchar(30),income_time, 120) >= #{incomeTimeStart}</if>
<if test="incomeTimeEnd != null "> and #{incomeTimeEnd} > CONVERT(varchar(30),income_time, 120)</if>
<if test="checkTimeStart != null "> and CONVERT(varchar(30),check_time, 120) >= #{checkTimeStart}</if>
<if test="checkTimeEnd != null "> and #{checkTimeEnd} > CONVERT(varchar(30),check_time, 120)</if>
</where>
</select>
<select id="selectQcCheckReportIncomeByRecordId" parameterType="String" resultMap="QcCheckReportIncomeResult">
<include refid="selectQcCheckReportIncomeVo"/>
where record_id = #{recordId}
</select>
<select id="getQcListBom" resultType="com.op.quality.domain.QcBomComponent">
select product_code component,product_desc_zh componentName
from base_product
where del_flag = '0'
<if test="component != null and component != ''"> and product_code like concat('%', #{component}, '%')</if>
<if test="componentName != null and componentName != ''"> and product_desc_zh like concat('%', #{componentName}, '%')</if>
</select>
<select id="getQcListSupplier" resultType="com.op.quality.domain.QcSupplier">
select supplier_code supplierCode,
zh_desc supplierName,
address,
contact_phone contactPhone
from base_supplier where active_flag = '1' and del_flag ='0'
<if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if>
<if test="supplierName != null and supplierName != ''"> and zh_desc like concat('%', #{supplierName}, '%')</if>
</select>
<select id="getQcListUser" resultType="com.op.system.api.domain.SysUser">
select user_id userId,
user_name userCode,
nick_name userName,
phonenumber
from sys_user where del_flag = '0' and status = '0'
<if test="userCode != null and userCode != ''"> and user_name like concat('%', #{userCode}, '%')</if>
<if test="userName != null and userName != ''"> and nick_name like concat('%', #{userName}, '%')</if>
</select>
<select id="getTodayMaxNum" resultType="java.lang.Integer">
select count(0)+1
from qc_check_task
where CONVERT(varchar(10),create_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
</select>
<select id="getCkeckProjectList" resultType="com.op.quality.domain.QcCheckTaskDetail">
select td.record_id recordId,
td.project_id projectId,
td.project_no projectNo,
td.rule_name ruleName,
td.property_code propertyCode,
td.check_mode checkMode,
td.check_tool checkTool,
td.unit_code unitCode,
td.check_standard checkStandard,
td.actual_value actualValue,
td.status,
td.remark,
td.create_by createBy,
td.create_time createTime,
td.update_by updateBy,
td.update_time updateTime,
qctp.upper_diff upperDiff,
qctp.down_diff downDiff,
qctp.sample
from qc_check_task_detail td
left join qc_check_type_project qctp on td.type_project_id = qctp.id
where td.belong_to = #{recordId}
</select>
<insert id="insertQcCheckReportIncome" parameterType="QcCheckReportIncome">
insert into qc_check_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">record_id,</if>
<if test="checkNo != null">check_no,</if>
<if test="incomeBatchNo != null">income_batch_no,</if>
<if test="orderNo != null">order_no,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="quality != null">quality,</if>
<if test="unit != null">unit,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="incomeTime != null">income_time,</if>
<if test="checkLoc != null">check_loc,</if>
<if test="checkStatus != null">check_status,</if>
<if test="checkManCode != null">check_man_code,</if>
<if test="checkManName != null">check_man_name,</if>
<if test="checkTime != null">check_time,</if>
<if test="checkResult != null">check_result,</if>
<if test="status != null">status,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
<if test="checkNo != null">#{checkNo},</if>
<if test="incomeBatchNo != null">#{incomeBatchNo},</if>
<if test="orderNo != null">#{orderNo},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="quality != null">#{quality},</if>
<if test="unit != null">#{unit},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="incomeTime != null">#{incomeTime},</if>
<if test="checkLoc != null">#{checkLoc},</if>
<if test="checkStatus != null">#{checkStatus},</if>
<if test="checkManCode != null">#{checkManCode},</if>
<if test="checkManName != null">#{checkManName},</if>
<if test="checkTime != null">#{checkTime},</if>
<if test="checkResult != null">#{checkResult},</if>
<if test="status != null">#{status},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateQcCheckReportIncome" parameterType="QcCheckReportIncome">
update qc_check_task
<trim prefix="SET" suffixOverrides=",">
<if test="checkNo != null">check_no = #{checkNo},</if>
<if test="incomeBatchNo != null">income_batch_no = #{incomeBatchNo},</if>
<if test="orderNo != null">order_no = #{orderNo},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="quality != null">quality = #{quality},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="incomeTime != null">income_time = #{incomeTime},</if>
<if test="checkLoc != null">check_loc = #{checkLoc},</if>
<if test="checkStatus != null">check_status = #{checkStatus},</if>
<if test="checkManCode != null">check_man_code = #{checkManCode},</if>
<if test="checkManName != null">check_man_name = #{checkManName},</if>
<if test="checkTime != null">check_time = #{checkTime},</if>
<if test="checkResult != null">check_result = #{checkResult},</if>
<if test="status != null">status = #{status},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where record_id = #{recordId}
</update>
<delete id="deleteQcCheckReportIncomeByRecordId" parameterType="String">
delete from qc_check_task where record_id = #{recordId}
</delete>
<delete id="deleteQcCheckReportIncomeByRecordIds" parameterType="String">
delete from qc_check_task where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>

@ -29,29 +29,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from qc_check_unqualified
</sql>
<select id="selectQcCheckUnqualifiedList" parameterType="QcCheckUnqualified" resultMap="QcCheckUnqualifiedResult">
select id, task_id, status, next_node_code, next_node_name, remark,
attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag
from qc_check_unqualified
<select id="selectQcCheckUnqualifiedList" parameterType="QcCheckUnqualified" resultType="com.op.quality.domain.QcCheckUnqualified">
select qcu.id,qcu.task_id taskId,qcu.status,qcu.next_node_code nextNodeCode,qcu.next_node_name nextNodeName,qcu.remark,
qcu.create_time createTime,
qct.check_type checkType,qtn.check_name checkName,qct.check_no checkNo,qct.income_batch_no incomeBatchNo,qct.order_no orderNo,
qct.material_code materialCode,qct.material_name materialName,qct.quality,qct.unit,qct.supplier_code supplierCode,
qct.supplier_name supplierName,qct.income_time incomeTime,qct.check_loc checkLoc,qct.check_status checkStatus,qct.check_man_code checkManCode,
qct.check_man_name checkManName,qct.check_time checkTime,qct.check_result checkResult
from qc_check_unqualified qcu
left join qc_check_task qct on qcu.task_id = qct.record_id
left join qc_check_type qtn on qtn.id = qct.check_type
<where>
<if test="taskId != null and taskId != ''"> and task_id like concat('%', #{taskId}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="orderNo != null and orderNo != ''"> and qct.order_no like concat('%', #{orderNo}, '%')</if>
<if test="checkNo != null and checkNo != ''"> and qct.check_no like concat('%', #{checkNo}, '%')</if>
<if test="nextNodeCode != null and nextNodeCode != ''"> and next_node_code = #{nextNodeCode}</if>
<if test="nextNodeName != null and nextNodeName != ''"> and next_node_name like concat('%', #{nextNodeName}, '%')</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
and del_flag = #{delFlag}
<if test="checkTimeStart != null "> and CONVERT(varchar(30),create_time, 120) >= #{checkTimeStart}</if>
<if test="checkTimeEnd != null "> and #{checkTimeEnd} > CONVERT(varchar(30),create_time, 120)</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="materialCode != null and materialCode != ''"> and qct.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and qct.material_name like concat('%', #{materialName}, '%')</if>
and qcu.del_flag = '0'
<if test="checkTimeStart != null "> and CONVERT(varchar(30),qct.check_time, 120) >= #{checkTimeStart}</if>
<if test="checkTimeEnd != null "> and #{checkTimeEnd} > CONVERT(varchar(30),qct.check_time, 120)</if>
</where>
</select>
<select id="selectQcCheckUnqualifiedById" parameterType="String" resultMap="QcCheckUnqualifiedResult">
<include refid="selectQcCheckUnqualifiedVo"/>
where id = #{id}
<select id="selectQcCheckUnqualifiedById" parameterType="String" resultType="com.op.quality.domain.QcCheckUnqualified">
select qcu.id,qcu.task_id taskId,qcu.status,qcu.next_node_code nextNodeCode,qcu.next_node_name nextNodeName,qcu.remark,
qcu.create_time createTime,
qct.check_type checkType,qtn.check_name checkName,qct.check_no checkNo,qct.income_batch_no incomeBatchNo,qct.order_no orderNo,
qct.material_code materialCode,qct.material_name materialName,qct.quality,qct.unit,qct.supplier_code supplierCode,
qct.supplier_name supplierName,qct.income_time incomeTime,qct.check_loc checkLoc,qct.check_status checkStatus,qct.check_man_code checkManCode,
qct.check_man_name checkManName,qct.check_time checkTime,qct.check_result checkResult
from qc_check_unqualified qcu
left join qc_check_task qct on qcu.task_id = qct.record_id
left join qc_check_type qtn on qtn.id = qct.check_type
where qcu.id = #{id}
</select>
<insert id="insertQcCheckUnqualified" parameterType="QcCheckUnqualified">

@ -63,8 +63,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from pro_route_product pp
where pp.route_id = #{routeId}
)
<if test="itemName != null and itemName != ''"> and bp.product_desc_zh like concat('%', #{itemName}, '%')</if>
<if test="itemName != null and itemName != ''"> and (bp.product_desc_zh like concat('%', #{itemName}, '%')
or bp.product_code like concat('%', #{itemName}, '%'))</if>
</select>
<!-- <select id="getRouteProdProductListDo" resultType="com.op.technology.domain.ProRouteProduct">-->
@ -81,7 +81,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from pro_route_product pp
left join base_product bp on pp.item_code = bp.product_code
where pp.route_id = #{routeId}
<if test="itemName != null and itemName != ''"> and bp.product_desc_zh like concat('%', #{itemName}, '%')</if>
<if test="itemName != null and itemName != ''"> and (bp.product_desc_zh like concat('%', #{itemName}, '%')
or bp.product_code like concat('%', #{itemName}, '%'))</if>
</select>
<insert id="insertProRouteProduct" parameterType="ProRouteProduct">

Loading…
Cancel
Save