Merge remote-tracking branch 'origin/master'

master
Yangwl 1 year ago
commit 8b39a2d210

@ -20,6 +20,42 @@ public class BoardDTO {
private List<String> days; private List<String> days;
private String startTime; private String startTime;
private String endTime; private String endTime;
private String productName;
private String productCode;
private String workorderCodeSap;
private String unit;
public String getWorkorderCodeSap() {
return workorderCodeSap;
}
public void setWorkorderCodeSap(String workorderCodeSap) {
this.workorderCodeSap = workorderCodeSap;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getStartTime() { public String getStartTime() {
return startTime; return startTime;

@ -42,8 +42,7 @@ public class DeviceInterfaceController {
} }
/** /**
* TOP10 *
* /
* *
* @return * @return
*/ */
@ -53,9 +52,7 @@ public class DeviceInterfaceController {
} }
/** /**
* -MTBF top10 * -MTBF
* /
* //
* *
* @param equOperation * @param equOperation
* @return * @return
@ -67,7 +64,6 @@ public class DeviceInterfaceController {
/** /**
* *
* /
* *
* @param equOperation * @param equOperation
* @return * @return

@ -1,5 +1,6 @@
package com.op.device.domain; package com.op.device.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel; import com.op.common.core.annotation.Excel;
@ -179,6 +180,16 @@ public class EquOperation extends BaseEntity {
//百分比 //百分比
private String intactRate; private String intactRate;
//设备看板时间范围——开始时间、结束时间
@JsonFormat(pattern = "yyyy-MM-dd")
private String startTime;
@JsonFormat(pattern = "yyyy-MM-dd")
private String endTime;
//设备看板维修质量 mttr
private String mttr;
public String getCreateTimeStart() { public String getCreateTimeStart() {
return createTimeStart; return createTimeStart;
} }
@ -462,6 +473,30 @@ public class EquOperation extends BaseEntity {
return timeDimension; return timeDimension;
} }
//开始时间、结束时间
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
//mttr
public void setMttr(String mttr) {
this.mttr = mttr;
}
public String getMttr() {
return mttr;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -14,323 +14,166 @@ import com.op.common.core.web.domain.BaseEntity;
/** /**
* equ_repair_work_order * equ_repair_work_order
* *
* @author Open Platform * @author
* @date 2023-10-19 * @date 2023-10-19
*/ */
public class EquRepairWorkOrder extends BaseEntity { public class EquRepairWorkOrder extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** @Excel(name = "维修主键")
* private String workId;//主键
*/
private String workId;
/**
*
*/
@Excel(name = "报修主键") @Excel(name = "报修主键")
private String orderId; private String orderId;//报修主键
/**
*
*/
@Excel(name = "维修单号") @Excel(name = "维修单号")
private String workCode; private String workCode;//维修单号
/**
*
*/
@Excel(name = "报修单号") @Excel(name = "报修单号")
private String orderCode; private String orderCode;//报修单号
/**
*
*/
@Excel(name = "是否立即处理") @Excel(name = "是否立即处理")
private String workHandle; private String workHandle;//是否立即处理
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划维修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "计划维修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workPlanTime; private Date workPlanTime;//计划维修时间
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划停机时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "计划停机时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workPlanDownTime; private Date workPlanDownTime;//计划停机时间
/**
*
*/
@Excel(name = "关联计划") @Excel(name = "关联计划")
private String orderRelevance; private String orderRelevance;//关联计划
/**
*
*/
@Excel(name = "维修人员") @Excel(name = "维修人员")
private String workPerson; private String workPerson;//维修人员
/**
*
*/
@Excel(name = "维修组") @Excel(name = "维修组")
private String workTeam; private String workTeam;//维修组
/**
*
*/
@Excel(name = "是否委外") @Excel(name = "是否委外")
private String workOutsource; private String workOutsource;//是否委外
/**
*
*/
@Excel(name = "是否停机维修") @Excel(name = "是否停机维修")
private String workDownMachine; private String workDownMachine;//是否停机维修
/**
*
*/
@Excel(name = "设备编码") @Excel(name = "设备编码")
private String equipmentCode; private String equipmentCode;//设备编码
/**
*
*/
@Excel(name = "原因分析") @Excel(name = "原因分析")
private String workReason; private String workReason;//原因分析
/**
*
*/
@Excel(name = "故障描述") @Excel(name = "故障描述")
private String workFaultDesc; private String workFaultDesc;//故障描述
/**
*
*/
@Excel(name = "维修用时") @Excel(name = "维修用时")
private String workCostTime; private String workCostTime;//维修用时
/**
*
*/
@Excel(name = "维修费用") @Excel(name = "维修费用")
private String workCost; private String workCost;//维修费用
/**
* id
*/
@Excel(name = "委外工单id") @Excel(name = "委外工单id")
private String outWorkId; private String outWorkId;//委外工单id
/**
*
*/
@Excel(name = "委外工单编码") @Excel(name = "委外工单编码")
private String outWorkCode; private String outWorkCode;//委外工单编码
/**
* 1
*/
@Excel(name = "备用字段1") @Excel(name = "备用字段1")
private String attr1; private String attr1;//备用字段1
/**
* 2
*/
@Excel(name = "备用字段2") @Excel(name = "备用字段2")
private String attr2; private String attr2;//备用字段2
/**
* 3
*/
@Excel(name = "备用字段3") @Excel(name = "备用字段3")
private String attr3; private String attr3;//备用字段3
/** @Excel(name = "删除标志")
* private String delFlag;//删除标志
*/
private String delFlag;
/**
*
*/
@Excel(name = "工厂编码") @Excel(name = "工厂编码")
private String factoryCode; private String factoryCode;//工厂编码
/**
*
*/
@Excel(name = "维修状态") @Excel(name = "维修状态")
private String workStatus; private String workStatus;//维修状态
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "维修开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workStartTime; private Date workStartTime;//维修开始时间
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workEndTime; private Date workEndTime;//维修结束时间
//维修停机真正开始时间 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date actualDownStartTime; @Excel(name = "维修实际开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualDownStartTime;//维修停机真正开始时间
//维修停机真正结束时间 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date actualDownEndTime; @Excel(name = "维修实际结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualDownEndTime;//维修停机真正开始时间
/** @Excel(name = "联系方式")
* private String workConnection;//联系方式
*/
private String workConnection;
/** @Excel(name = "故障类型")
* private String faultType;//故障类型
*/
private String equipmentStatusDescription;
/** @Excel(name = "设备状态描述")
* private String equipmentStatusDescription;//设备状态描述
*/
private String repairMeasures;
// 设备 @Excel(name = "维修措施")
/** private String repairMeasures;//设备维修措施
*
*/ @Excel(name = "故障停机时间")
private String faultDownTime;//故障停机时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "故障开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date faultStartTime;//故障开始时间
/////////////////////////////////////////////////////////设备表字段
@Excel(name = "设备名称") @Excel(name = "设备名称")
private String equipmentName; private String equipmentName;//设备名称
private String equipmentSpec;//规格型号
private String equipmentTypeName;//设备类型名称
private String equipmentLocation;//设备位置
private String department;//部门
private String workshopCode;//所属工作中心编码
private String workshopName;//所属工作中心名称
/** /////////////////////////////////////////////////////////////报修表
* private String orderDesc;//故障描述
*/
@Excel(name = "规格型号")
private String equipmentSpec;
/**
*
*/
@Excel(name = "设备类型名称")
private String equipmentTypeName;
/**
*
*/
@Excel(name = "设备位置")
private String equipmentLocation;
/**
*
*/
@Excel(name = "部门")
private String department;
/**
*
*/
@Excel(name = "所属工作中心编码")
private String workshopCode;
/**
*
*/
@Excel(name = "所属工作中心名称")
private String workshopName;
//报修
/**
*
*/
@Excel(name = "故障描述")
private String orderDesc;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "故障时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date orderBreakdownTime;//故障时间
private Date orderBreakdownTime; private String orderSource;//报修来源
/**
*
*/
@Excel(name = "报修来源")
private String orderSource;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "报修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date orderTime;//报修时间
private Date orderTime; private String orderRepairmanCode;//报修人
private String orderConnection;//报修人联系方式
/** //////////////////////////////////////////////////////////////班组表
* @Excel(name = "班组名称")
*/ private String teamName;//班组名称
private String orderRepairmanCode; @Excel(name = "班组人员")
private String teamPerson;//班组人员
/** /////////////////////////////////////////////////////////////时间列表 虚拟字段
*
*/
private String orderConnection;
//班组
/**
*
*/
private String teamName;
/**
*
*/
private String teamPerson;
//时间列表 虚拟字段
private List<Date> workPlanTimeArray; private List<Date> workPlanTimeArray;
private List<Date> workPlanDownTimeArray; private List<Date> workPlanDownTimeArray;
//计划开始时间、结束时间 private String workPlanTimeStart;//计划开始时间、结束时间
private String workPlanTimeStart;
private String workPlanTimeEnd; private String workPlanTimeEnd;
//计划停机开始时间、结束时间 private String workPlanDownTimeStart; //计划停机开始时间、结束时间
private String workPlanDownTimeStart;
private String workPlanDownTimeEnd; private String workPlanDownTimeEnd;
//委外虚拟字段 ///////////////////////////////////////////////////////////委外
/** private String outSourcePerson;//委外人员
* private String outSourceReason;//委外维修原因
*/ private String workOutsourcingUnit;//委外单位
private String outSourcePerson; private String outSourceConnection;//联系方式
/**
*
*/
private String outSourceReason;
/**
*
*/
private String workOutsourcingUnit;
/**
*
*/
private String outSourceConnection;
/**
*
*/
private String faultType;
//手持 //手持
//用户id private String userId;//用户id
private String userId;
//检查项列表 //检查项列表
private List<EquOrder> detailList; private List<EquOrder> detailList;
@ -349,11 +192,14 @@ public class EquRepairWorkOrder extends BaseEntity {
//检查项列表 //检查项列表
private List<EquOrderStandard> standardList; private List<EquOrderStandard> standardList;
//图片文件
private String fileList;
private List<BaseFileData> files;
//维修前 维修后 //维修前 维修后
public String getAfterRepairFile() { public String getAfterRepairFile() {
return afterRepairFile; return afterRepairFile;
} }
public void setAfterRepairFile(String afterRepairFile) { public void setAfterRepairFile(String afterRepairFile) {
this.afterRepairFile = afterRepairFile; this.afterRepairFile = afterRepairFile;
} }
@ -361,7 +207,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public List<BaseFileData> getAfterRepairFiles() { public List<BaseFileData> getAfterRepairFiles() {
return afterRepairFiles; return afterRepairFiles;
} }
public void setAfterRepairFiles(List<BaseFileData> afterRepairFiles) { public void setAfterRepairFiles(List<BaseFileData> afterRepairFiles) {
this.afterRepairFiles = afterRepairFiles; this.afterRepairFiles = afterRepairFiles;
} }
@ -369,7 +214,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public String getBeforeRepairFile() { public String getBeforeRepairFile() {
return beforeRepairFile; return beforeRepairFile;
} }
public void setBeforeRepairFile(String beforeRepairFile) { public void setBeforeRepairFile(String beforeRepairFile) {
this.beforeRepairFile = beforeRepairFile; this.beforeRepairFile = beforeRepairFile;
} }
@ -377,16 +221,12 @@ public class EquRepairWorkOrder extends BaseEntity {
public List<BaseFileData> getBeforeRepairFiles() { public List<BaseFileData> getBeforeRepairFiles() {
return beforeRepairFiles; return beforeRepairFiles;
} }
public void setBeforeRepairFiles(List<BaseFileData> beforeRepairFiles) { this.beforeRepairFiles = beforeRepairFiles; }
public void setBeforeRepairFiles(List<BaseFileData> beforeRepairFiles) {
this.beforeRepairFiles = beforeRepairFiles;
}
//detailList 检查项详情 //detailList 检查项详情
public List<EquOrder> getDetailList() { public List<EquOrder> getDetailList() {
return detailList; return detailList;
} }
public void setDetailList(List<EquOrder> detailList) { public void setDetailList(List<EquOrder> detailList) {
this.detailList = detailList; this.detailList = detailList;
} }
@ -395,7 +235,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderDesc(String orderDesc) { public void setOrderDesc(String orderDesc) {
this.orderDesc = orderDesc; this.orderDesc = orderDesc;
} }
public String getOrderDesc() { public String getOrderDesc() {
return orderDesc; return orderDesc;
} }
@ -403,7 +242,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderBreakdownTime(Date orderBreakdownTime) { public void setOrderBreakdownTime(Date orderBreakdownTime) {
this.orderBreakdownTime = orderBreakdownTime; this.orderBreakdownTime = orderBreakdownTime;
} }
public Date getOrderBreakdownTime() { public Date getOrderBreakdownTime() {
return orderBreakdownTime; return orderBreakdownTime;
} }
@ -411,7 +249,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderSource(String orderSource) { public void setOrderSource(String orderSource) {
this.orderSource = orderSource; this.orderSource = orderSource;
} }
public String getOrderSource() { public String getOrderSource() {
return orderSource; return orderSource;
} }
@ -419,7 +256,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderTime(Date orderTime) { public void setOrderTime(Date orderTime) {
this.orderTime = orderTime; this.orderTime = orderTime;
} }
public Date getOrderTime() { public Date getOrderTime() {
return orderTime; return orderTime;
} }
@ -427,7 +263,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderRepairmanCode(String orderRepairmanCode) { public void setOrderRepairmanCode(String orderRepairmanCode) {
this.orderRepairmanCode = orderRepairmanCode; this.orderRepairmanCode = orderRepairmanCode;
} }
public String getOrderRepairmanCode() { public String getOrderRepairmanCode() {
return orderRepairmanCode; return orderRepairmanCode;
} }
@ -435,7 +270,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderConnection(String orderConnection) { public void setOrderConnection(String orderConnection) {
this.orderConnection = orderConnection; this.orderConnection = orderConnection;
} }
public String getOrderConnection() { public String getOrderConnection() {
return orderConnection; return orderConnection;
} }
@ -444,7 +278,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setEquipmentName(String equipmentName) { public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName; this.equipmentName = equipmentName;
} }
public String getEquipmentName() { public String getEquipmentName() {
return equipmentName; return equipmentName;
} }
@ -452,7 +285,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setEquipmentSpec(String equipmentSpec) { public void setEquipmentSpec(String equipmentSpec) {
this.equipmentSpec = equipmentSpec; this.equipmentSpec = equipmentSpec;
} }
public String getEquipmentSpec() { public String getEquipmentSpec() {
return equipmentSpec; return equipmentSpec;
} }
@ -460,7 +292,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setEquipmentTypeName(String equipmentTypeName) { public void setEquipmentTypeName(String equipmentTypeName) {
this.equipmentTypeName = equipmentTypeName; this.equipmentTypeName = equipmentTypeName;
} }
public String getEquipmentTypeName() { public String getEquipmentTypeName() {
return equipmentTypeName; return equipmentTypeName;
} }
@ -468,7 +299,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setEquipmentLocation(String equipmentLocation) { public void setEquipmentLocation(String equipmentLocation) {
this.equipmentLocation = equipmentLocation; this.equipmentLocation = equipmentLocation;
} }
public String getEquipmentLocation() { public String getEquipmentLocation() {
return equipmentLocation; return equipmentLocation;
} }
@ -476,7 +306,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setDepartment(String department) { public void setDepartment(String department) {
this.department = department; this.department = department;
} }
public String getDepartment() { public String getDepartment() {
return department; return department;
} }
@ -484,7 +313,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkshopCode(String workshopCode) { public void setWorkshopCode(String workshopCode) {
this.workshopCode = workshopCode; this.workshopCode = workshopCode;
} }
public String getWorkshopCode() { public String getWorkshopCode() {
return workshopCode; return workshopCode;
} }
@ -492,24 +320,22 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkshopName(String workshopName) { public void setWorkshopName(String workshopName) {
this.workshopName = workshopName; this.workshopName = workshopName;
} }
public String getWorkshopName() { public String getWorkshopName() {
return workshopName; return workshopName;
} }
//维修工单
public void setWorkId(String workId) { public void setWorkId(String workId) {
this.workId = workId; this.workId = workId;
} }
public String getWorkId() { public String getWorkId() {
return workId; return workId;
} }
public void setOrderId(String orderId) { public void setOrderId(String orderId) {
this.orderId = orderId; this.orderId = orderId;
} }
public String getOrderId() { public String getOrderId() {
return orderId; return orderId;
} }
@ -517,7 +343,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkCode(String workCode) { public void setWorkCode(String workCode) {
this.workCode = workCode; this.workCode = workCode;
} }
public String getWorkCode() { public String getWorkCode() {
return workCode; return workCode;
} }
@ -525,7 +350,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderCode(String orderCode) { public void setOrderCode(String orderCode) {
this.orderCode = orderCode; this.orderCode = orderCode;
} }
public String getOrderCode() { public String getOrderCode() {
return orderCode; return orderCode;
} }
@ -533,7 +357,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkHandle(String workHandle) { public void setWorkHandle(String workHandle) {
this.workHandle = workHandle; this.workHandle = workHandle;
} }
public String getWorkHandle() { public String getWorkHandle() {
return workHandle; return workHandle;
} }
@ -541,7 +364,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkPlanTime(Date workPlanTime) { public void setWorkPlanTime(Date workPlanTime) {
this.workPlanTime = workPlanTime; this.workPlanTime = workPlanTime;
} }
public Date getWorkPlanTime() { public Date getWorkPlanTime() {
return workPlanTime; return workPlanTime;
} }
@ -549,7 +371,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkPlanDownTime(Date workPlanDownTime) { public void setWorkPlanDownTime(Date workPlanDownTime) {
this.workPlanDownTime = workPlanDownTime; this.workPlanDownTime = workPlanDownTime;
} }
public Date getWorkPlanDownTime() { public Date getWorkPlanDownTime() {
return workPlanDownTime; return workPlanDownTime;
} }
@ -557,7 +378,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderRelevance(String orderRelevance) { public void setOrderRelevance(String orderRelevance) {
this.orderRelevance = orderRelevance; this.orderRelevance = orderRelevance;
} }
public String getOrderRelevance() { public String getOrderRelevance() {
return orderRelevance; return orderRelevance;
} }
@ -565,7 +385,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkPerson(String workPerson) { public void setWorkPerson(String workPerson) {
this.workPerson = workPerson; this.workPerson = workPerson;
} }
public String getWorkPerson() { public String getWorkPerson() {
return workPerson; return workPerson;
} }
@ -573,7 +392,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkTeam(String workTeam) { public void setWorkTeam(String workTeam) {
this.workTeam = workTeam; this.workTeam = workTeam;
} }
public String getWorkTeam() { public String getWorkTeam() {
return workTeam; return workTeam;
} }
@ -581,7 +399,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkOutsource(String workOutsource) { public void setWorkOutsource(String workOutsource) {
this.workOutsource = workOutsource; this.workOutsource = workOutsource;
} }
public String getWorkOutsource() { public String getWorkOutsource() {
return workOutsource; return workOutsource;
} }
@ -589,7 +406,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkDownMachine(String workDownMachine) { public void setWorkDownMachine(String workDownMachine) {
this.workDownMachine = workDownMachine; this.workDownMachine = workDownMachine;
} }
public String getWorkDownMachine() { public String getWorkDownMachine() {
return workDownMachine; return workDownMachine;
} }
@ -597,7 +413,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setEquipmentCode(String equipmentCode) { public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode; this.equipmentCode = equipmentCode;
} }
public String getEquipmentCode() { public String getEquipmentCode() {
return equipmentCode; return equipmentCode;
} }
@ -605,7 +420,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkReason(String workReason) { public void setWorkReason(String workReason) {
this.workReason = workReason; this.workReason = workReason;
} }
public String getWorkReason() { public String getWorkReason() {
return workReason; return workReason;
} }
@ -613,7 +427,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkFaultDesc(String workFaultDesc) { public void setWorkFaultDesc(String workFaultDesc) {
this.workFaultDesc = workFaultDesc; this.workFaultDesc = workFaultDesc;
} }
public String getWorkFaultDesc() { public String getWorkFaultDesc() {
return workFaultDesc; return workFaultDesc;
} }
@ -621,7 +434,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkCostTime(String workCostTime) { public void setWorkCostTime(String workCostTime) {
this.workCostTime = workCostTime; this.workCostTime = workCostTime;
} }
public String getWorkCostTime() { public String getWorkCostTime() {
return workCostTime; return workCostTime;
} }
@ -629,7 +441,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkCost(String workCost) { public void setWorkCost(String workCost) {
this.workCost = workCost; this.workCost = workCost;
} }
public String getWorkCost() { public String getWorkCost() {
return workCost; return workCost;
} }
@ -637,7 +448,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOutWorkId(String outWorkId) { public void setOutWorkId(String outWorkId) {
this.outWorkId = outWorkId; this.outWorkId = outWorkId;
} }
public String getOutWorkId() { public String getOutWorkId() {
return outWorkId; return outWorkId;
} }
@ -645,7 +455,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOutWorkCode(String outWorkCode) { public void setOutWorkCode(String outWorkCode) {
this.outWorkCode = outWorkCode; this.outWorkCode = outWorkCode;
} }
public String getOutWorkCode() { public String getOutWorkCode() {
return outWorkCode; return outWorkCode;
} }
@ -653,7 +462,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setAttr1(String attr1) { public void setAttr1(String attr1) {
this.attr1 = attr1; this.attr1 = attr1;
} }
public String getAttr1() { public String getAttr1() {
return attr1; return attr1;
} }
@ -661,7 +469,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setAttr2(String attr2) { public void setAttr2(String attr2) {
this.attr2 = attr2; this.attr2 = attr2;
} }
public String getAttr2() { public String getAttr2() {
return attr2; return attr2;
} }
@ -669,7 +476,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setAttr3(String attr3) { public void setAttr3(String attr3) {
this.attr3 = attr3; this.attr3 = attr3;
} }
public String getAttr3() { public String getAttr3() {
return attr3; return attr3;
} }
@ -677,7 +483,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setDelFlag(String delFlag) { public void setDelFlag(String delFlag) {
this.delFlag = delFlag; this.delFlag = delFlag;
} }
public String getDelFlag() { public String getDelFlag() {
return delFlag; return delFlag;
} }
@ -685,25 +490,20 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setFactoryCode(String factoryCode) { public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode; this.factoryCode = factoryCode;
} }
public String getFactoryCode() { public String getFactoryCode() {
return factoryCode; return factoryCode;
} }
//维修工单 新增字段 维修状态
public void setWorkStatus(String workStatus) { public void setWorkStatus(String workStatus) {
this.workStatus = workStatus; this.workStatus = workStatus;
} }
public String getWorkStatus() { public String getWorkStatus() {
return workStatus; return workStatus;
} }
//维修工单 新增字段 维修开始结束时间
public void setWorkStartTime(Date workStartTime) { public void setWorkStartTime(Date workStartTime) {
this.workStartTime = workStartTime; this.workStartTime = workStartTime;
} }
public Date getWorkStartTime() { public Date getWorkStartTime() {
return workStartTime; return workStartTime;
} }
@ -711,7 +511,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkEndTime(Date workEndTime) { public void setWorkEndTime(Date workEndTime) {
this.workEndTime = workEndTime; this.workEndTime = workEndTime;
} }
public Date getWorkEndTime() { public Date getWorkEndTime() {
return workEndTime; return workEndTime;
} }
@ -719,7 +518,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkConnection(String workConnection) { public void setWorkConnection(String workConnection) {
this.workConnection = workConnection; this.workConnection = workConnection;
} }
public String getWorkConnection() { public String getWorkConnection() {
return workConnection; return workConnection;
} }
@ -728,7 +526,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setTeamName(String teamName) { public void setTeamName(String teamName) {
this.teamName = teamName; this.teamName = teamName;
} }
public String getTeamName() { public String getTeamName() {
return teamName; return teamName;
} }
@ -736,7 +533,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setTeamPerson(String teamPerson) { public void setTeamPerson(String teamPerson) {
this.teamPerson = teamPerson; this.teamPerson = teamPerson;
} }
public String getTeamPerson() { public String getTeamPerson() {
return teamPerson; return teamPerson;
} }
@ -745,7 +541,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public List<Date> getWorkPlanTimeArray() { public List<Date> getWorkPlanTimeArray() {
return workPlanTimeArray; return workPlanTimeArray;
} }
public void setWorkPlanTimeArray(List<Date> workPlanTimeArray) { public void setWorkPlanTimeArray(List<Date> workPlanTimeArray) {
this.workPlanTimeArray = workPlanTimeArray; this.workPlanTimeArray = workPlanTimeArray;
} }
@ -753,33 +548,25 @@ public class EquRepairWorkOrder extends BaseEntity {
public List<Date> getWorkPlanDownTimeArray() { public List<Date> getWorkPlanDownTimeArray() {
return workPlanDownTimeArray; return workPlanDownTimeArray;
} }
public void setWorkPlanDownTimeArray(List<Date> workPlanDownTimeArray) { this.workPlanDownTimeArray = workPlanDownTimeArray; }
public void setWorkPlanDownTimeArray(List<Date> workPlanDownTimeArray) {
this.workPlanDownTimeArray = workPlanDownTimeArray;
}
//计划开始时间、结束时间 //计划开始时间、结束时间
public String getWorkPlanDownTimeStart() { public String getWorkPlanDownTimeStart() {
return workPlanDownTimeStart; return workPlanDownTimeStart;
} }
public void setWorkPlanDownTimeStart(String workPlanDownTimeStart) { this.workPlanDownTimeStart = workPlanDownTimeStart; }
public void setWorkPlanDownTimeStart(String workPlanDownTimeStart) {
this.workPlanDownTimeStart = workPlanDownTimeStart;
}
public String getWorkPlanDownTimeEnd() { public String getWorkPlanDownTimeEnd() {
return workPlanDownTimeEnd; return workPlanDownTimeEnd;
} }
public void setWorkPlanDownTimeEnd(String workPlanDownTimeEnd) { public void setWorkPlanDownTimeEnd(String workPlanDownTimeEnd) {
this.workPlanDownTimeEnd = workPlanDownTimeEnd; this.workPlanDownTimeEnd = workPlanDownTimeEnd;
} }
//计划停机开始时间、结束时间 //实际停机开始时间、结束时间
public Date getActualDownStartTime() { public Date getActualDownStartTime() {
return actualDownStartTime; return actualDownStartTime;
} }
public void setActualDownStartTime(Date actualDownStartTime) { public void setActualDownStartTime(Date actualDownStartTime) {
this.actualDownStartTime = actualDownStartTime; this.actualDownStartTime = actualDownStartTime;
} }
@ -787,16 +574,36 @@ public class EquRepairWorkOrder extends BaseEntity {
public Date getActualDownEndTime() { public Date getActualDownEndTime() {
return actualDownEndTime; return actualDownEndTime;
} }
public void setActualDownEndTime(Date actualDownEndTime) { public void setActualDownEndTime(Date actualDownEndTime) {
this.actualDownEndTime = actualDownEndTime; this.actualDownEndTime = actualDownEndTime;
} }
//委外维修人员/委外维修原因 虚拟字段 //停机开始时间、结束时间
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 String getFaultType() { return faultType; }
public void setFaultType(String faultType) { this.faultType = faultType; }
public String getEquipmentStatusDescription() { return equipmentStatusDescription; }
public void setEquipmentStatusDescription(String equipmentStatusDescription) { this.equipmentStatusDescription = equipmentStatusDescription; }
public String getRepairMeasures() { return repairMeasures; }
public void setRepairMeasures(String repairMeasures) { this.repairMeasures = repairMeasures; }
public String getFaultDownTime() { return faultDownTime; }
public void setFaultDownTime(String faultDownTime) { this.faultDownTime = faultDownTime; }
public Date getFaultStartTime() { return faultStartTime; }
public void setFaultStartTime(Date faultStartTime) { this.faultStartTime = faultStartTime; }
//委外
public void setOutSourceReason(String outSourceReason) { public void setOutSourceReason(String outSourceReason) {
this.outSourceReason = outSourceReason; this.outSourceReason = outSourceReason;
} }
public String getOutSourceReason() { public String getOutSourceReason() {
return outSourceReason; return outSourceReason;
} }
@ -804,7 +611,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOutSourcePerson(String outSourcePerson) { public void setOutSourcePerson(String outSourcePerson) {
this.outSourcePerson = outSourcePerson; this.outSourcePerson = outSourcePerson;
} }
public String getOutSourcePerson() { public String getOutSourcePerson() {
return outSourcePerson; return outSourcePerson;
} }
@ -812,7 +618,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkOutsourcingUnit(String workOutsourcingUnit) { public void setWorkOutsourcingUnit(String workOutsourcingUnit) {
this.workOutsourcingUnit = workOutsourcingUnit; this.workOutsourcingUnit = workOutsourcingUnit;
} }
public String getWorkOutsourcingUnit() { public String getWorkOutsourcingUnit() {
return workOutsourcingUnit; return workOutsourcingUnit;
} }
@ -820,7 +625,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOutSourceConnection(String outSourceConnection) { public void setOutSourceConnection(String outSourceConnection) {
this.outSourceConnection = outSourceConnection; this.outSourceConnection = outSourceConnection;
} }
public String getOutSourceConnection() { public String getOutSourceConnection() {
return outSourceConnection; return outSourceConnection;
} }
@ -829,92 +633,26 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setUserId(String userId) { public void setUserId(String userId) {
this.userId = userId; this.userId = userId;
} }
public String getUserId() { public String getUserId() {
return userId; return userId;
} }
//申领单
public List<EquSpareApply> getApplyList() { public List<EquSpareApply> getApplyList() {
return applyList; return applyList;
} }
public void setApplyList(List<EquSpareApply> applyList) { this.applyList = applyList; }
public void setApplyList(List<EquSpareApply> applyList) {
this.applyList = applyList;
}
//实际停机开始时间、结束时间
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;
}
//图片文件 //图片文件
private String fileList; public String getFileList() { return fileList; }
private List<BaseFileData> files; public void setFileList(String fileList) { this.fileList = fileList; }
//图片文件 public List<BaseFileData> getFiles() { return files; }
public String getFileList() { public void setFiles(List<BaseFileData> files) { this.files = files; }
return fileList;
}
public void setFileList(String fileList) {
this.fileList = fileList;
}
public List<BaseFileData> getFiles() {
return files;
}
public void setFiles(List<BaseFileData> files) {
this.files = files;
}
//标准列表 //标准列表
public List<EquOrderStandard> getStandardList() { public List<EquOrderStandard> getStandardList() { return standardList; }
return standardList; public void setStandardList(List<EquOrderStandard> standardList) { this.standardList = standardList; }
}
public void setStandardList(List<EquOrderStandard> standardList) {
this.standardList = standardList;
}
//故障类型
public String getFaultType() {
return faultType;
}
public void setFaultType(String faultType) {
this.faultType = faultType;
}
//设备状态描述
public String getEquipmentStatusDescription() {
return equipmentStatusDescription;
}
public void setEquipmentStatusDescription(String equipmentStatusDescription) {
this.equipmentStatusDescription = equipmentStatusDescription;
}
//维修措施
public String getRepairMeasures() {
return repairMeasures;
}
public void setRepairMeasures(String repairMeasures) {
this.repairMeasures = repairMeasures;
}
@Override @Override
public String toString() { public String toString() {

@ -54,9 +54,11 @@ public interface DeviceInterfaceMapper {
//设备稳定性 MTBF设备平均故障间隔 //设备稳定性 MTBF设备平均故障间隔
List<EquOperation> getMTBFList(EquOperation equOperation); List<EquOperation> getMTBFList(EquOperation equOperation);
//设备维修质量 MTTR
List<EquOperation> getMTTRList(EquOperation equOperation);
//设备完好率 //设备完好率
EquOperation getEquipmentIntactRate(EquOperation equOperation); List<EquOperation> getEquipmentIntactRate(EquOperation equOperation);
String getDeviceRefreshTime(EquOperationRecord equOperationRecord); String getDeviceRefreshTime(EquOperationRecord equOperationRecord);
@ -77,4 +79,7 @@ public interface DeviceInterfaceMapper {
// 通过设备编码获取设备运行记录 // 通过设备编码获取设备运行记录
Map<String, Double> selectSumEquipmentOperation(String equipmentCode); Map<String, Double> selectSumEquipmentOperation(String equipmentCode);
//设备总数
String getTotalEquipment();
} }

@ -28,7 +28,8 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
private DeviceInterfaceMapper deviceInterfaceMapper; private DeviceInterfaceMapper deviceInterfaceMapper;
/** /**
* *
*
* *
* @return * @return
*/ */
@ -51,81 +52,63 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
} }
/** /**
* *
* :/ * :/
* //*24 * /*24
* * 11
*
* /
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult getEquipmentInfo(EquOperation equOperation) { public AjaxResult getEquipmentInfo(EquOperation equOperation) {
if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){
//默认时间
if (equOperation.getTimeDimension() == null) { if (equOperation.getTimeDimension() == null) {
equOperation.setTimeDimension("yyyy"); equOperation.setTimeDimension("yyyy");
} }
// 获取所有设备信息 }
List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectEquipmentVOList(equOperation); List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectEquipmentVOList(equOperation);
return success(equipmentVOList); return success(equipmentVOList);
} }
/** /**
* TOP10 *
* / * MTTR:/
* *
*
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult getRepairQuantity(EquOperation equOperation) { public AjaxResult getRepairQuantity(EquOperation equOperation) {
equOperation.setCreateTime(DateUtils.getNowDate());
equOperation.setTimeDimension("yyyy"); if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){
if (equOperation.getTimeDimension() == null) {
// 获取维修工单中的设备列表 equOperation.setTimeDimension("dd");
List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectEquipmentList(equOperation);
for (IEquipmentVO equipmentVO : equipmentVOList) {
// 通过该设备code获取设备维修记录(只获取开始时间、结束时间)
List<EquRepairWorkOrder> workOrderList = deviceInterfaceMapper.selectRepairRecordByEquipmentCode(equipmentVO.getEquipmentCode());
if (workOrderList.size() != 0) {
double runTime = 0;
for (EquRepairWorkOrder workOrder : workOrderList) {
// 维修时间差值
long diffTime = workOrder.getWorkEndTime().getTime() - workOrder.getWorkStartTime().getTime();
// 累加时间
runTime += diffTime;
}
// 计算维修质量(故障时间(小时)/故障次数)
Double rapairQuantity = runTime / 3600000 / workOrderList.size();
String douStr = String.format("%.2f", rapairQuantity);
equipmentVO.setRapairQuantity(douStr);
} else {
// 没有该记录则默认为0
equipmentVO.setRapairQuantity("0.00");
} }
} }
List<EquOperation> equipmentList = deviceInterfaceMapper.getMTTRList(equOperation);
// 按照raparQuantity字段进行排序并使用subList获取前10个结果 return success(equipmentList);
List<IEquipmentVO> top10 = equipmentVOList.stream()
.sorted(Comparator.comparing(IEquipmentVO::getRapairQuantity).reversed())// 由正序改为 反转排序 倒序
.limit(10) // 限制结果数量为10 改为不限制结果数量
.collect(Collectors.toList()); //将结果收集到List中
return success(top10);
} }
/** /**
* -MTBF *
* / * MTBF/
*
*
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult getEquipmentStabilityList(EquOperation equOperation) { public AjaxResult getEquipmentStabilityList(EquOperation equOperation) {
//查询所有设备(设备停用的除外)
//判断查询年/月/日
equOperation.setCreateTime(DateUtils.getNowDate()); equOperation.setCreateTime(DateUtils.getNowDate());
if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){
if (equOperation.getTimeDimension() == null) { if (equOperation.getTimeDimension() == null) {
equOperation.setTimeDimension("dd"); equOperation.setTimeDimension("dd");
} }
}
List<EquOperation> equipmentList = deviceInterfaceMapper.getMTBFList(equOperation); List<EquOperation> equipmentList = deviceInterfaceMapper.getMTBFList(equOperation);
return success(equipmentList); return success(equipmentList);
} }
@ -133,17 +116,32 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
/** /**
* *
* -/ * -/
*
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult getEquipmentIntactRate(EquOperation equOperation) { public AjaxResult getEquipmentIntactRate(EquOperation equOperation) {
//查询所有设备(设备停用的除外) //查询所有设备(设备停用的除外)
EquOperation equipmentIntactRate = deviceInterfaceMapper.getEquipmentIntactRate(equOperation); equOperation.setCreateTime(DateUtils.getNowDate());
if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){
if (equOperation.getTimeDimension() == null) {
equOperation.setTimeDimension("dd");
}
}
List<EquOperation> example = deviceInterfaceMapper.getEquipmentIntactRate(equOperation);
Integer fault = 0;
for(EquOperation equOperation1 :example){
fault = fault + Integer.valueOf(equOperation1.getFaultEquipment());
}
EquOperation equipmentIntactRate = new EquOperation();
equipmentIntactRate.setTotalEquipment(deviceInterfaceMapper.getTotalEquipment());
Double totalEquipment = new Double(equipmentIntactRate.getTotalEquipment()); Double totalEquipment = new Double(equipmentIntactRate.getTotalEquipment());
Double operationEquipment = new Double(equipmentIntactRate.getOperationEquipment()); Double operationEquipment = new Double(Integer.valueOf(equipmentIntactRate.getTotalEquipment()) - fault);
Double intactRate = operationEquipment*100/totalEquipment; Double intactRate = operationEquipment*100/totalEquipment;
String douStr = String.format("%.2f", intactRate); String douStr = String.format("%.2f", intactRate);
equipmentIntactRate.setIntactRate(douStr); equipmentIntactRate.setIntactRate(douStr);
equipmentIntactRate.setOperationEquipment(String.valueOf(operationEquipment));
equipmentIntactRate.setFaultEquipment(String.valueOf(fault));
return success(equipmentIntactRate); return success(equipmentIntactRate);
} }

@ -751,7 +751,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
@DS("#header.poolName") @DS("#header.poolName")
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) { public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
try { try {
//1.判断是否停机 ////1.判断是否停机
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId()); EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId());
if (list.getWorkDownMachine().equals("1")) { if (list.getWorkDownMachine().equals("1")) {
//维修真正停机时间 //维修真正停机时间
@ -760,48 +760,58 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
//维修工单结束时间 //维修工单结束时间
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate()); equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
//2.计算维修工单用时 ////2.计算维修工单用时 + 故障停机时间
if (list.getWorkStartTime() != null && equRepairWorkOrder.getWorkEndTime() != null) { if (list.getWorkStartTime() != null && equRepairWorkOrder.getWorkEndTime() != null) {
////2.1计算维修日期差值
//2.1计算日期差值
ZoneId zoneId = ZoneId.systemDefault(); ZoneId zoneId = ZoneId.systemDefault();
LocalDateTime start = LocalDateTime.ofInstant(list.getWorkStartTime().toInstant(), zoneId); LocalDateTime workStart = LocalDateTime.ofInstant(list.getWorkStartTime().toInstant(), zoneId);
LocalDateTime end = LocalDateTime.ofInstant(equRepairWorkOrder.getWorkEndTime().toInstant(), zoneId); LocalDateTime workEnd = LocalDateTime.ofInstant(equRepairWorkOrder.getWorkEndTime().toInstant(), zoneId);
LocalDateTime tempDateTime = LocalDateTime.from(start); LocalDateTime workDateTime = LocalDateTime.from(workStart);
// long years = tempDateTime.until(end, ChronoUnit.YEARS); double workHours = workDateTime.until(workEnd, ChronoUnit.HOURS);
// tempDateTime = tempDateTime.plusYears(years); double workMinutes = ((workDateTime.until(workEnd, ChronoUnit.MINUTES) * 1.0) % 60) / 60;
// long months = tempDateTime.until(end, ChronoUnit.MONTHS); double workSeconds = ((workDateTime.until(workEnd, ChronoUnit.SECONDS) * 1.0) % 3600) / 3600;
// tempDateTime = tempDateTime.plusMonths(months); double workHour = BigDecimal.valueOf(workHours + workMinutes + workSeconds).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
// long days = tempDateTime.until(end, ChronoUnit.DAYS); //塞入维修用时
// tempDateTime = tempDateTime.plusDays(days); equRepairWorkOrder.setWorkCostTime(String.valueOf(workHour)+"小时");
double hours = tempDateTime.until(end, ChronoUnit.HOURS); ////2.2 计算故障停机时间差值
// tempDateTime = tempDateTime.plusHours(hours); //报修的故障时间 和 快速工单的故障开始时间
double minutes = ((tempDateTime.until(end, ChronoUnit.MINUTES) * 1.0) % 60) / 60; Date downStartTime = new Date();
// tempDateTime = tempDateTime.plusMinutes(minutes); if(list.getOrderBreakdownTime() != null){
double seconds = ((tempDateTime.until(end, ChronoUnit.SECONDS) * 1.0) % 3600) / 3600; downStartTime = list.getOrderBreakdownTime();
double hour = BigDecimal.valueOf(hours + minutes + seconds).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); }else if(list.getFaultStartTime() != null){
downStartTime = list.getFaultStartTime();
}
LocalDateTime downStart = LocalDateTime.ofInstant(downStartTime.toInstant(), zoneId);
LocalDateTime downEnd = LocalDateTime.ofInstant(equRepairWorkOrder.getWorkEndTime().toInstant(), zoneId);
LocalDateTime downDateTime = LocalDateTime.from(downStart);
//2.2查询完好率报表 double downHours = downDateTime.until(downEnd, ChronoUnit.HOURS);
double downMinutes = ((downDateTime.until(downEnd, ChronoUnit.MINUTES) * 1.0) % 60) / 60;
double downSeconds = ((downDateTime.until(downEnd, ChronoUnit.SECONDS) * 1.0) % 3600) / 3600;
double downHour = BigDecimal.valueOf(downHours + downMinutes + downSeconds).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
equRepairWorkOrder.setFaultDownTime(String.valueOf(downHour)+"小时");
////2.2查询当日完好率报表
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String time = sdf.format(equRepairWorkOrder.getWorkEndTime()); String time = sdf.format(equRepairWorkOrder.getWorkEndTime());
EquOperation equOperation = equOperationMapper.selectEquipmentIntegrityRate(time, equRepairWorkOrder.getEquipmentCode()); EquOperation equOperation = equOperationMapper.selectEquipmentIntegrityRate(time, equRepairWorkOrder.getEquipmentCode());
//2.3修改完好率报表 ////2.3修改完好率报表
if (equOperation != null) { if (equOperation != null) {
if (list.getWorkDownMachine().equals("1")) { if (list.getWorkDownMachine().equals("1")) {
DecimalFormat df = new DecimalFormat("#.##"); DecimalFormat df = new DecimalFormat("#.##");
//实际运行时间 = 实际运行时间 - 故障时间 //实际运行时间 = 实际运行时间 - 故障停机时间
double result = Double.parseDouble(equOperation.getActualOperationTime()) - hour; double result = Double.parseDouble(equOperation.getActualOperationTime()) - downHour;
//故障时间 = 原来的故障时间 + 这次的故障时间 //故障时间 = 原来的故障停机时间 + 这次的故障停机时间
double faultTime = Double.parseDouble(equOperation.getFaultTime()) + hour; double faultTime = Double.parseDouble(equOperation.getFaultTime()) + downHour;
BigDecimal faultTimeBD = new BigDecimal(faultTime);// 故障时间 BigDecimal faultTimeBD = new BigDecimal(faultTime);// 故障停机时间
BigDecimal operationTimeBD = new BigDecimal(equOperation.getOperationTime());//运行时间 BigDecimal operationTimeBD = new BigDecimal(equOperation.getOperationTime());//运行时间
equOperation.setActualOperationTime(String.valueOf(df.format(result)));//实际运行时间 equOperation.setActualOperationTime(String.valueOf(df.format(result)));//实际运行时间
equOperation.setFaultTime(String.valueOf(faultTime));//故障时间 equOperation.setFaultTime(String.valueOf(faultTime));//故障停机时间
equOperation.setFailureRate(faultTimeBD.multiply(new BigDecimal(100)).divide(operationTimeBD, 2, RoundingMode.HALF_UP).toString() + "%"); equOperation.setFailureRate(faultTimeBD.multiply(new BigDecimal(100)).divide(operationTimeBD, 2, RoundingMode.HALF_UP).toString() + "%");
equOperation.setShutdownTimes(equOperation.getShutdownTimes() + 1);//停机次数加1 equOperation.setShutdownTimes(equOperation.getShutdownTimes() + 1);//故障停机次数加1
} }
equOperation.setFailureTimes(equOperation.getFailureTimes() + 1);//故障次数加1 equOperation.setFailureTimes(equOperation.getFailureTimes() + 1);//故障次数加1
equOperation.setUpdateBy(SecurityUtils.getUsername()); equOperation.setUpdateBy(SecurityUtils.getUsername());
@ -811,7 +821,6 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
} }
////3.更新每一项点检/巡检检查项信息 ////3.更新每一项点检/巡检检查项信息
//判空
if (StringUtils.isNotEmpty(equRepairWorkOrder.getDetailList())) { if (StringUtils.isNotEmpty(equRepairWorkOrder.getDetailList())) {
List<EquOrder> checkLists = equRepairWorkOrder.getDetailList(); List<EquOrder> checkLists = equRepairWorkOrder.getDetailList();
for (EquOrder checkList : checkLists) { for (EquOrder checkList : checkLists) {
@ -852,7 +861,6 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
} }
////4.新建申领单 ////4.新建申领单
//判空
if (StringUtils.isNotEmpty(equRepairWorkOrder.getApplyList())) { if (StringUtils.isNotEmpty(equRepairWorkOrder.getApplyList())) {
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList(); List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
for (EquSpareApply equSpareApply : equSpareApplies) { for (EquSpareApply equSpareApply : equSpareApplies) {
@ -936,12 +944,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
// BigDecimal orderCost = BigDecimal.valueOf(Double.valueOf(equRepairWorkOrder.getWorkCost())); // BigDecimal orderCost = BigDecimal.valueOf(Double.valueOf(equRepairWorkOrder.getWorkCost()));
// equRepairWorkOrder.setWorkCost(String.valueOf(sparePartsCost.add(orderCost))); // equRepairWorkOrder.setWorkCost(String.valueOf(sparePartsCost.add(orderCost)));
//7.修改设备状态 由维修中改为正常运行 ////7.修改设备状态 由维修中改为正常运行
EquEquipment equEquipment = new EquEquipment(); EquEquipment equEquipment = new EquEquipment();
equEquipment.setEquipmentCode(example.getEquipmentCode()); equEquipment.setEquipmentCode(example.getEquipmentCode());
equEquipment.setEquipmentStatus("1"); equEquipment.setEquipmentStatus("1");
equRepairWorkOrderMapper.updateEquipmentStatus(equEquipment); equRepairWorkOrderMapper.updateEquipmentStatus(equEquipment);
return success("提交成功,维修完成!"); return success("提交成功,维修完成!");
} catch (Exception e) { } catch (Exception e) {
return error("提交失败!"); return error("提交失败!");

@ -460,10 +460,9 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
for (EquOperation operation : operationList) { for (EquOperation operation : operationList) {
operation.setId(IdUtils.fastSimpleUUID());// id operation.setId(IdUtils.fastSimpleUUID());// id
operation.setFactoryCode(poolName.replace("ds_", ""));// 工厂 operation.setFactoryCode(poolName.replace("ds_", ""));// 工厂
operation.setOperationTime(DateUtils.getTime());// 日期
operation.setOperationTime(operationTime);// 运行时间(默认运行时间) operation.setOperationTime(operationTime);// 运行时间(默认运行时间)
operation.setActualOperationTime(operationTime);// 实际运行时间(默认运行时间) operation.setActualOperationTime(operationTime);// 实际运行时间(默认运行时间)
operation.setCreateBy("jod"); operation.setCreateBy("job");
operation.setCreateTime(DateUtils.getNowDate()); operation.setCreateTime(DateUtils.getNowDate());
} }

@ -506,6 +506,7 @@ public class EquPlanServiceImpl implements IEquPlanService {
* @return * @return
*/ */
private AjaxResult formatEquItemCommon(List<EquPlanEqu> equPlanEquList, String planType, String message) { private AjaxResult formatEquItemCommon(List<EquPlanEqu> equPlanEquList, String planType, String message) {
String equipmentList = "";
for (EquPlanEqu data : equPlanEquList) { for (EquPlanEqu data : equPlanEquList) {
// 检查项名称临时对象 // 检查项名称临时对象
@ -552,11 +553,17 @@ public class EquPlanServiceImpl implements IEquPlanService {
data.setItemTempName(itemTempName.toString());//处理好的检查项名称置入检查项名称(用于前端信息回显) data.setItemTempName(itemTempName.toString());//处理好的检查项名称置入检查项名称(用于前端信息回显)
} else { } else {
// 未查询到对应检查项信息 // 未查询到对应检查项信息
equipmentList = equipmentList + '[' + data.getEquipmentCode() + "]";
}
}
if(!equipmentList.equals("")){
equipmentList = equipmentList + "设备未查询到对应检查项信息!";
message = equipmentList;
return error(500, message); return error(500, message);
} }else{
}
return success(equPlanEquList); return success(equPlanEquList);
} }
}
/** /**
* *

@ -169,12 +169,15 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int updateEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) { public int updateEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) {
Date date = DateUtils.getNowDate();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formattedDate = dateFormat.format(date);
//1.是否停机 //1.是否停机
if (equRepairWorkOrder.getWorkDownMachine().equals("0")) { if (equRepairWorkOrder.getWorkDownMachine().equals("0")) {
equRepairWorkOrder.setWorkPlanDownTime(null); equRepairWorkOrder.setWorkPlanDownTime(null);
} }
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername()); equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate()); equRepairWorkOrder.setUpdateTime(date);
//2.先删除每个维修工单对应图片,再新增照片 //2.先删除每个维修工单对应图片,再新增照片
equRepairWorkOrderMapper.deleteBaseFileBySourceId(equRepairWorkOrder.getWorkId()); equRepairWorkOrderMapper.deleteBaseFileBySourceId(equRepairWorkOrder.getWorkId());
@ -236,7 +239,7 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
equRepairWorkOrderMapper.updateEquipmentStatus(equEquipment); equRepairWorkOrderMapper.updateEquipmentStatus(equEquipment);
//5.2维修完成后 相应的设备完好率重新计算 小时计算 保留一位小数 实际故障时间 换算成小时 //5.2维修完成后 相应的设备完好率重新计算 小时计算 保留一位小数 实际故障时间 换算成小时
String hours = equRepairWorkOrder.getWorkCostTime().substring(0, equRepairWorkOrder.getWorkCostTime().length() - 2); //截掉后两位 String hours = equRepairWorkOrder.getFaultDownTime().substring(0, equRepairWorkOrder.getFaultDownTime().length() - 2); //截掉后两位
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String time = sdf.format(equRepairWorkOrder.getWorkEndTime()); String time = sdf.format(equRepairWorkOrder.getWorkEndTime());
EquOperation equOperation = equOperationMapper.selectEquipmentIntegrityRate(time, equRepairWorkOrder.getEquipmentCode()); EquOperation equOperation = equOperationMapper.selectEquipmentIntegrityRate(time, equRepairWorkOrder.getEquipmentCode());
@ -256,10 +259,33 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
equOperation.setFailureRate(faultTimeBD.multiply(new BigDecimal(100)).divide(operationTimeBD, 2, RoundingMode.HALF_UP).toString() + "%"); equOperation.setFailureRate(faultTimeBD.multiply(new BigDecimal(100)).divide(operationTimeBD, 2, RoundingMode.HALF_UP).toString() + "%");
equOperation.setShutdownTimes(equOperation.getShutdownTimes() + 1);//停机次数加1 equOperation.setShutdownTimes(equOperation.getShutdownTimes() + 1);//停机次数加1
} }
equOperation.setUpdateBy(SecurityUtils.getUsername());
equOperation.setUpdateTime(DateUtils.getNowDate()); //5.3更新
equOperation.setUpdateBy(SecurityUtils.getUsername());//更新人
equOperation.setUpdateTime(DateUtils.getNowDate());//更新时间
//故障次数增加,但是停机次数可能不增加 //故障次数增加,但是停机次数可能不增加
equOperation.setFailureTimes(equOperation.getFailureTimes() + 1);//故障次数加1 equOperation.setFailureTimes(equOperation.getFailureTimes() + 1);//故障次数加1
//取当天的
String GZMS = equOperation.getFailureDescription();
String GZYY = equOperation.getReasonAnalyze();
String GZCS = equOperation.getHandlingMethod();
if(GZMS != null){
equOperation.setFailureDescription(GZMS + formattedDate + ":"+ equRepairWorkOrder.getWorkFaultDesc() + ";");//故障描述
}else{
equOperation.setFailureDescription(formattedDate + ":"+ equRepairWorkOrder.getWorkFaultDesc() + ";");//故障描述
}
if(GZYY != null){
equOperation.setReasonAnalyze(GZYY + formattedDate + ":"+ equRepairWorkOrder.getWorkReason() + ";");//故障原因
}else{
equOperation.setReasonAnalyze(formattedDate + ":"+ equRepairWorkOrder.getWorkReason() + ";");//故障原因
}
if(GZCS != null){
equOperation.setHandlingMethod(GZCS + formattedDate + ":"+ equRepairWorkOrder.getRepairMeasures() + ";");//维修措施
}else{
equOperation.setHandlingMethod(formattedDate + ":"+ equRepairWorkOrder.getRepairMeasures() + ";");//维修措施
}
equOperationMapper.updateEquOperation(equOperation); equOperationMapper.updateEquOperation(equOperation);
} }
} }

@ -177,8 +177,9 @@ public class EquSpotCheckServiceImpl implements IEquSpotCheckService {
equipmentList = equipmentList + "设备未查询到对应检查项信息!"; equipmentList = equipmentList + "设备未查询到对应检查项信息!";
message = equipmentList; message = equipmentList;
return error(500, message); return error(500, message);
} }else{
return success(equPlanEquList); return success(equPlanEquList);
} }
}
} }

@ -56,6 +56,7 @@
<if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if> <if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if>
<if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if> <if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if>
<if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if> <if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if>
<if test="startTime != null and endTime != null ">and eo.create_time between #{startTime} and #{endTime} </if>
AND eo.del_flag = '0' AND eo.del_flag = '0'
AND be.del_flag = '0' AND be.del_flag = '0'
AND be.equipment_category = '0' AND be.equipment_category = '0'
@ -101,38 +102,74 @@
<!--设备稳定性 MTBF 年月日--> <!--设备稳定性 MTBF 年月日-->
<select id="getMTBFList" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation"> <select id="getMTBFList" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation">
select select
row_number() over (order by sum( row_number() over (order by cast(
case case
when eo.shutdown_times > 0 THEN cast(cast(eo.actual_operation_time as decimal(18,2))/eo.shutdown_times as when sum(eo.shutdown_times) > 0 THEN sum(cast(eo.actual_operation_time as decimal(18,2)))/sum(eo.shutdown_times)
decimal(18,2))
else 0 else 0
end end
) desc) as serialNumber, as decimal(18,2)) desc) as serialNumber,
eo.equipment_code as equipmentCode, eo.equipment_code as equipmentCode,
eo.equipment_name as equipmentName, eo.equipment_name as equipmentName,
cast(sum( cast(
case case
when eo.shutdown_times > 0 THEN cast(eo.actual_operation_time as decimal(18,2))/eo.shutdown_times when sum(eo.shutdown_times) > 0 THEN sum(cast(eo.actual_operation_time as decimal(18,2)))/sum(eo.shutdown_times)
else 0 else 0
end end
)/COUNT(equipment_code) as decimal(18,2))as mtbf as decimal(18,2))as mtbf
from equ_operation eo from equ_operation eo
<where> <where>
<if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if> <if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if>
<if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if> <if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if>
<if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if> <if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if>
<if test="startTime != null and endTime != null ">and eo.create_time between #{startTime} and #{endTime} </if>
</where> </where>
GROUP BY equipment_code,equipment_name GROUP BY equipment_code,equipment_name
</select> </select>
<!--设备维修质量 MTTR 年月日-->
<select id="getMTTRList" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation">
select
row_number() over (order by cast(
case
when sum(eo.shutdown_times) > 0 THEN sum(cast(eo.fault_time as decimal(18,2)))/sum(eo.shutdown_times)
else 0
end
as decimal(18,2)) desc) as serialNumber,
eo.equipment_code as equipmentCode,
eo.equipment_name as equipmentName,
cast(
case
when sum(eo.shutdown_times) > 0 THEN sum(cast(eo.fault_time as decimal(18,2)))/sum(eo.shutdown_times)
else 0
end
as decimal(18,2))as mttr
from equ_operation eo
<where>
<if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if>
<if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if>
<if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if>
<if test="startTime != null and endTime != null ">and eo.create_time between #{startTime} and #{endTime} </if>
</where>
group by equipment_code,equipment_name
</select>
<!--完好设备占比--> <!--完好设备占比-->
<select id="getEquipmentIntactRate" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation"> <select id="getEquipmentIntactRate" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation">
SELECT select
SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END) AS operationEquipment, case when (sum(cast(eo.fault_time as decimal(18,2)))/sum(cast(eo.operation_time as decimal(18,2)))) > 0.04 then 1 else 0 end as faultEquipment
SUM(CASE WHEN equipment_status = '0' or equipment_status = '2' THEN 1 Else 0 END) AS faultEquipment, from equ_operation eo
COUNT(*) AS totalEquipment <where>
FROM base_equipment <if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if>
WHERE del_flag = '0' AND status = '1' <if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if>
<if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if>
<if test="startTime != null and endTime != null ">and eo.create_time between #{startTime} and #{endTime} </if>
</where>
group by eo.equipment_code,eo.equipment_name
</select>
<!--设备总数-->
<select id="getTotalEquipment" resultType="java.lang.String">
select count(*) from base_equipment be where be.del_flag = '0' and be.status = '1'
</select> </select>
<select id="selectGroups" resultType="com.op.device.domain.vo.IEquFaultVO"> <select id="selectGroups" resultType="com.op.device.domain.vo.IEquFaultVO">

@ -83,7 +83,10 @@
</select> </select>
<select id="selectAllEquipmentList" resultType="com.op.device.domain.vo.EquCheckItemVO"> <select id="selectAllEquipmentList" resultType="com.op.device.domain.vo.EquCheckItemVO">
select equipment_name AS 'equipmentName',equipment_code AS 'equipmentCode' from base_equipment where del_flag = '0' and equipment_category = '0' select equipment_name AS 'equipmentName',equipment_code AS 'equipmentCode'
from base_equipment
where del_flag = '0'
and equipment_category != '1'
</select> </select>
<select id="selectCheckItemByEquipmentCode" parameterType="String" resultMap="EquCheckItemResult"> <select id="selectCheckItemByEquipmentCode" parameterType="String" resultMap="EquCheckItemResult">

@ -118,12 +118,10 @@
zx.equipment_name AS 'groupLine', zx.equipment_name AS 'groupLine',
be.workshop_name AS 'workshop' be.workshop_name AS 'workshop'
from base_equipment be from base_equipment be
left join equ_bind_auxiliary_equipment bae left join equ_bind_auxiliary_equipment bae on bae.auxiliary_equipment_code = be.equipment_code
on bae.auxiliary_equipment_code = be.equipment_code left join base_equipment zx on bae.equipment_code = zx.equipment_code
left join base_equipment zx
on bae.equipment_code = zx.equipment_code
where be.del_flag = '0' where be.del_flag = '0'
and be.equipment_category = '0' and be.equipment_category != '1'
</select> </select>
<select id="checkInsertOperation" resultType="java.lang.Integer"> <select id="checkInsertOperation" resultType="java.lang.Integer">

@ -43,6 +43,8 @@
<result property="faultType" column="fault_type"/> <result property="faultType" column="fault_type"/>
<result property="equipmentStatusDescription" column="equipment_status_description"/> <result property="equipmentStatusDescription" column="equipment_status_description"/>
<result property="repairMeasures" column="repair_measures"/> <result property="repairMeasures" column="repair_measures"/>
<result property="faultDownTime" column="fault_down_time"/>
<result property="faultStartTime" column="fault_start_time"/>
<!--设备--> <!--设备-->
<result property="equipmentName" column="equipment_name"/> <result property="equipmentName" column="equipment_name"/>
@ -88,7 +90,7 @@
</sql> </sql>
<sql id="selectEquRepairWorkOrderVo"> <sql id="selectEquRepairWorkOrderVo">
select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_start_time,work_end_time,work_cost_time, work_cost, work_status,out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code ,fault_type,equipment_status_description,repair_measures from equ_repair_work_order select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_start_time,work_end_time,work_cost_time, work_cost, work_status,out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code , fault_type , equipment_status_description , repair_measures , fault_down_time , fault_start_time from equ_repair_work_order
</sql> </sql>
<select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult"> <select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
@ -130,6 +132,8 @@
erwo.fault_type, erwo.fault_type,
erwo.equipment_status_description, erwo.equipment_status_description,
erwo.repair_measures, erwo.repair_measures,
erwo.fault_down_time,
erwo.fault_start_time,
be.equipment_name, be.equipment_name,
et.team_name, et.team_name,
et.team_person et.team_person
@ -225,6 +229,8 @@
erwo.fault_type, erwo.fault_type,
erwo.equipment_status_description, erwo.equipment_status_description,
erwo.repair_measures, erwo.repair_measures,
erwo.fault_down_time,
erwo.fault_start_time,
be.equipment_name, be.equipment_name,
et.team_name, et.team_name,
et.team_person et.team_person
@ -275,6 +281,8 @@
erwo.fault_type, erwo.fault_type,
erwo.equipment_status_description, erwo.equipment_status_description,
erwo.repair_measures, erwo.repair_measures,
erwo.fault_down_time,
erwo.fault_start_time,
be.equipment_name, be.equipment_name,
be.equipment_spec, be.equipment_spec,
be.equipment_type_name, be.equipment_type_name,
@ -341,6 +349,8 @@
<if test="faultType != null">fault_type,</if> <if test="faultType != null">fault_type,</if>
<if test="equipmentStatusDescription != null">equipment_status_description,</if> <if test="equipmentStatusDescription != null">equipment_status_description,</if>
<if test="repairMeasures != null">repair_measures,</if> <if test="repairMeasures != null">repair_measures,</if>
<if test="faultDownTime != null">fault_down_time,</if>
<if test="faultStartTime != null">fault_start_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workId != null">#{workId},</if> <if test="workId != null">#{workId},</if>
@ -378,8 +388,10 @@
<if test="delFlag != null">#{delFlag},</if> <if test="delFlag != null">#{delFlag},</if>
<if test="factoryCode != null">#{factoryCode},</if> <if test="factoryCode != null">#{factoryCode},</if>
<if test="faultType != null">#{fault_type},</if> <if test="faultType != null">#{fault_type},</if>
<if test="equipmentStatusDescription != null">equipment_status_description,</if> <if test="equipmentStatusDescription != null">#{equipmentStatusDescription},</if>
<if test="repairMeasures != null">repair_measures,</if> <if test="repairMeasures != null">#{repairMeasures},</if>
<if test="faultDownTime != null">#{faultDownTime},</if>
<if test="faultStartTime != null">#{faultStartTime},</if>
</trim> </trim>
</insert> </insert>
@ -420,10 +432,10 @@
<if test="delFlag != null">del_flag = #{delFlag},</if> <if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if> <if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="faultType != null">fault_type = #{faultType},</if> <if test="faultType != null">fault_type = #{faultType},</if>
<if test="equipmentStatusDescription != null">equipment_status_description = <if test="equipmentStatusDescription != null">equipment_status_description = #{equipmentStatusDescription},</if>
#{equipmentStatusDescription},
</if>
<if test="repairMeasures != null">repair_measures = #{repairMeasures},</if> <if test="repairMeasures != null">repair_measures = #{repairMeasures},</if>
<if test="faultDownTime != null">fault_down_time = #{faultDownTime},</if>
<if test="faultStartTime != null">fault_start_time = #{faultStartTime},</if>
</trim> </trim>
where work_id = #{workId} where work_id = #{workId}
and del_flag = '0' and del_flag = '0'
@ -485,10 +497,10 @@
where source_id = #{sourceId} where source_id = #{sourceId}
</select> </select>
<select id="selectEquRepairWorkOrderByWorkCode" parameterType="EquRepairWorkOrder" <select id="selectEquRepairWorkOrderByWorkCode" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
resultMap="EquRepairWorkOrderResult">
<include refid="selectEquRepairWorkOrderVo"/> <include refid="selectEquRepairWorkOrderVo"/>
where work_code = #{workCode} and del_flag = '0' where work_code = #{workCode}
and del_flag = '0'
</select> </select>
<insert id="insertBaseFileBatch"> <insert id="insertBaseFileBatch">

@ -34,8 +34,9 @@ public class MesBoardController extends BaseController {
return iMesBoradService.getLineList(mesBoard); return iMesBoradService.getLineList(mesBoard);
} }
/**计划产量、当前产量、15天的产量趋势图**/
@PostMapping("/getProduction15Days") @PostMapping("/getProduction15Days")
public AjaxResult getProduction15Days(BoardDTO mesBoard) { public AjaxResult getProduction15Days(@RequestBody BoardDTO mesBoard) {
if (StringUtils.isBlank(mesBoard.getFactoryCode())) { if (StringUtils.isBlank(mesBoard.getFactoryCode())) {
return error("[facotryCode] 不能为空"); return error("[facotryCode] 不能为空");
} }
@ -44,4 +45,16 @@ public class MesBoardController extends BaseController {
} }
return success(iMesBoradService.getProduction15Days(mesBoard)); return success(iMesBoradService.getProduction15Days(mesBoard));
} }
/**产线信息**/
@PostMapping("/getProductionLineInfo")
public AjaxResult getProductionLineInfo(@RequestBody BoardDTO mesBoard) {
if (StringUtils.isBlank(mesBoard.getFactoryCode())) {
return error("[factoryCode] 不能为空");
}
if (StringUtils.isBlank(mesBoard.getEquCode())) {
return error("[equCode] 不能为空");
}
return success(iMesBoradService.getProductionLineInfo(mesBoard));
}
} }

@ -202,6 +202,8 @@ public class MesReportWork extends BaseEntity {
private Long workTimes; private Long workTimes;
private String workCenter; private String workCenter;
private String shiftId; private String shiftId;
@Excel(name = "班次")
private String shiftName;
private String keywords; private String keywords;
private String workshopName; private String workshopName;
//凭证 //凭证
@ -211,6 +213,24 @@ public class MesReportWork extends BaseEntity {
private String sapCode; private String sapCode;
private String remark; private String remark;
public String getShiftName() {
return shiftName;
}
public void setShiftName(String shiftName) {
this.shiftName = shiftName;
}
@Override
public String getRemark() {
return remark;
}
@Override
public void setRemark(String remark) {
this.remark = remark;
}
public String getSapCode() { public String getSapCode() {
return sapCode; return sapCode;
} }

@ -77,6 +77,8 @@ public interface MesMapper {
List<BoardDTO> getLineList(BoardDTO boardDTO); List<BoardDTO> getLineList(BoardDTO boardDTO);
@MapKey("dayStr") @MapKey("productDate")
Map<String, MesReportWork> getProduction15Days(BoardDTO boardDTO); Map<String, MesReportWork> getProduction15Days(BoardDTO boardDTO);
BoardDTO getWorkOrder(BoardDTO boardDTO);
} }

@ -127,8 +127,6 @@ public interface MesReportWorkMapper {
public MesReportWork getReportWorkHz(MesReportWork mesReportWork); public MesReportWork getReportWorkHz(MesReportWork mesReportWork);
MesReportWork getEndReport(MesReportWork pWork);
List<MesReportWork> selectMesReportWorkList_S(MesReportWork mesReportWork); List<MesReportWork> selectMesReportWorkList_S(MesReportWork mesReportWork);
int reportSapCancel(MesReportWork mesReportWork); int reportSapCancel(MesReportWork mesReportWork);

@ -4,6 +4,7 @@ import com.op.common.core.web.domain.AjaxResult;
import com.op.system.api.domain.dto.BoardDTO; import com.op.system.api.domain.dto.BoardDTO;
import java.util.List; import java.util.List;
import java.util.Map;
public interface IMesBoradService { public interface IMesBoradService {
public AjaxResult finishProductBoard(BoardDTO boardDTO); public AjaxResult finishProductBoard(BoardDTO boardDTO);
@ -11,4 +12,5 @@ public interface IMesBoradService {
public List<BoardDTO> getLineList(BoardDTO boardDTO); public List<BoardDTO> getLineList(BoardDTO boardDTO);
public BoardDTO getProduction15Days(BoardDTO mesBoard); public BoardDTO getProduction15Days(BoardDTO mesBoard);
public Map<String,BoardDTO> getProductionLineInfo(BoardDTO mesBoard);
} }

@ -424,8 +424,6 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
//最终报工标识且sap报工成功关闭子母工单
//MesReportWork endReport = mesReportWorkMapper.getEndReport(pHzWork);
}else{ }else{
//报工不成功跳出循环 //报工不成功跳出循环
break; break;

@ -9,6 +9,7 @@ import com.op.mes.domain.MesReportWork;
import com.op.mes.mapper.MesMapper; import com.op.mes.mapper.MesMapper;
import com.op.mes.service.IMesBoradService; import com.op.mes.service.IMesBoradService;
import com.op.system.api.domain.dto.BoardDTO; import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -85,6 +86,19 @@ public class MesBoradServiceImpl implements IMesBoradService {
return dto; return dto;
} }
@Override
public Map<String,BoardDTO> getProductionLineInfo(BoardDTO boardDTO) {
DynamicDataSourceContextHolder.push(boardDTO.getFactoryCode());
Map<String,BoardDTO> dtoMap = new HashMap<>();
//当前工单信息
BoardDTO workOrder = mesMapper.getWorkOrder(boardDTO);
dtoMap.put("workOrder",workOrder);
return dtoMap;
}
//获取当前日期前几天 //获取当前日期前几天
private List<String> getDays(int dayNum){ private List<String> getDays(int dayNum){
List<String> days = new ArrayList<>(); List<String> days = new ArrayList<>();
@ -102,6 +116,8 @@ public class MesBoradServiceImpl implements IMesBoradService {
return days; return days;
} }
public static void main(String[] args){ public static void main(String[] args){
List<String> days = new ArrayList<>(); List<String> days = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

@ -218,7 +218,7 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer
/**修改sap物料损耗组成**/ /**修改sap物料损耗组成**/
R updateBomsSap = this.updateAttr1BomsSap(workOrders); R updateBomsSap = this.updateAttr1BomsSap(workOrders);
if(updateBomsSap.getCode()== 500){ if(updateBomsSap.getCode()== 500){
throw new IllegalArgumentException("修改组件异常"); throw new IllegalArgumentException("SAP修改组件异常:"+updateBomsSap.getMsg());
} }
return 1; return 1;

@ -143,15 +143,6 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
@DS("#header.poolName") @DS("#header.poolName")
public List<MesReportWork> getReportWorkHzList(MesReportWork mesReportWork) { public List<MesReportWork> getReportWorkHzList(MesReportWork mesReportWork) {
List<MesReportWork> dtos = mesReportWorkMapper.getReportWorkHzList(mesReportWork); List<MesReportWork> dtos = mesReportWorkMapper.getReportWorkHzList(mesReportWork);
// for(MesReportWork dto:dtos){
// if("1".equals(dto.getUploadStatus())){
// dto.setUploadStatus("sap报工成功");
// }else if("2".equals(dto.getUploadStatus())){
// dto.setUploadStatus("sap报工失败");
// }else if("0".equals(dto.getUploadStatus())){
// dto.setUploadStatus("待报工sap");
// }
// }
return dtos; return dtos;
} }

@ -305,4 +305,19 @@
and CONVERT(DATE, pow.product_date) BETWEEN DATEADD(DAY, -15, CONVERT(DATE, GETDATE())) AND CONVERT(DATE, GETDATE()) and CONVERT(DATE, pow.product_date) BETWEEN DATEADD(DAY, -15, CONVERT(DATE, GETDATE())) AND CONVERT(DATE, GETDATE())
group by pow.product_date,pow.quantity_split group by pow.product_date,pow.quantity_split
</select> </select>
<select id="getWorkOrder" resultType="com.op.system.api.domain.dto.BoardDTO">
select
pow.workorder_name equCode,
be.equipment_name equName,
pow.product_code productCode,
pow.product_name productName,
pow.workorder_code_sap workorderCodeSap,
pow.quantity_split totalNum,
pow.unit
from pro_order_workorder pow
left join base_equipment be on pow.workorder_name = be.equipment_code and be.equipment_type_code = 'equ_type_bzx'
where pow.workorder_name = #{equCode} and pow.status = 'w2'
and CONVERT ( DATE, pow.product_date ) = CONVERT ( DATE, GETDATE( ) )
and pow.parent_order = '0'
</select>
</mapper> </mapper>

@ -486,7 +486,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pow.workorder_code_sap workorderCodeSap, pow.workorder_code_sap workorderCodeSap,
pow.product_date productDate, pow.product_date productDate,
mrw.uploadTime, mrw.uploadTime,
mrw.uploadMsg mrw.uploadMsg,
pow.shift_id shiftId,
bst.Shift_Desc shiftName
from ( from (
select workorder_code workorderCode, select workorder_code workorderCode,
product_code productCode, product_code productCode,
@ -514,6 +516,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
,upload_time,upload_msg ,upload_time,upload_msg
) mrw ) mrw
left join pro_order_workorder pow on mrw.workorderCode = pow.workorder_code left join pro_order_workorder pow on mrw.workorderCode = pow.workorder_code
left join base_shifts_t bst on bst.Shift_Id =pow.shift_id
<where> <where>
pow.del_flag = '0' pow.del_flag = '0'
<if test="keywords != null and keywords != ''"> <if test="keywords != null and keywords != ''">
@ -549,7 +552,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test='parentOrder!="0"'> <if test='parentOrder!="0"'>
and mrw.parent_order = #{workorderCode} and mrw.parent_order = #{workorderCode}
</if> </if>
order by mrw.end_report order by mrw.batch
</select> </select>
<select id="getPrepareList" resultType="com.op.mes.domain.MesPrepareDetail"> <select id="getPrepareList" resultType="com.op.mes.domain.MesPrepareDetail">
select select
@ -596,11 +599,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code
left join base_equipment equ on equ.equipment_code = ow.workorder_name left join base_equipment equ on equ.equipment_code = ow.workorder_name
</select> </select>
<select id="getEndReport" resultType="com.op.mes.domain.MesReportWork">
select end_report endReport
from mes_report_work
where end_report = '1' and workorder_code = #{workorderCode}
</select>
<select id="selectMesReportWorkList_S" parameterType="MesReportWork" resultMap="MesReportWorkResult"> <select id="selectMesReportWorkList_S" parameterType="MesReportWork" resultMap="MesReportWorkResult">
SELECT SELECT
mrw.machine_name, mrw.machine_name,

@ -201,5 +201,7 @@ public interface ProOrderWorkorderMapper {
List<ProOrderWorkorder> getUnSplitOrder(@Param("orderIds") String[] orderIds); List<ProOrderWorkorder> getUnSplitOrder(@Param("orderIds") String[] orderIds);
ProOrderWorkorder selectSonOrder(String parentOrder); ProOrderWorkorder selectSonOrder(String parentOrder);
List<ProOrderWorkorder> getProductOrders(@Param("orderIds") String[] orderIds);
} }

@ -1123,11 +1123,13 @@ public class ProOrderServiceImpl implements IProOrderService {
} }
//完全拆分已经存在工单可以进行订单关闭的数据 //完全拆分已经存在工单可以进行订单关闭的数据
List<ProOrderWorkorder> checkWorkOrders = proOrderWorkorderMapper.getWorkOrderByOrders(orderIds); List<ProOrderWorkorder> productWorkOrders = proOrderWorkorderMapper.getProductOrders(orderIds);
if(checkWorkOrders.size() != orderIds.length){ if(!CollectionUtils.isEmpty(productWorkOrders)){
return 2; return 2;
} }
List<ProOrderWorkorder> checkWorkOrders = proOrderWorkorderMapper.getWorkOrderByOrders(orderIds);
for(ProOrderWorkorder workorder:checkWorkOrders){ for(ProOrderWorkorder workorder:checkWorkOrders){
//要删除的工单id们 //要删除的工单id们
List<String> delteIds = new ArrayList<>(); List<String> delteIds = new ArrayList<>();

@ -1331,12 +1331,12 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
} else { } else {
proOrderWorkorderMapper.updateProOrderWorkorder(proWorkOrder); proOrderWorkorderMapper.updateProOrderWorkorder(proWorkOrder);
//pro_order_workorder //pro_order_workorder
ProOrderWorkorder topWorkOrder = proOrderWorkorderMapper.getWorkOrderByCode(proWorkOrder.getWorkorderCode()); ProOrderWorkorder sonWorkOrder = proOrderWorkorderMapper.getSonWorkOrder(proWorkOrder);
while (!"0".equals(topWorkOrder.getParentOrder()) && StringUtils.isNotEmpty(topWorkOrder.getParentOrder())) { while (sonWorkOrder != null) {
//pro_order_workorder //pro_order_workorder
topWorkOrder = proOrderWorkorderMapper.getWorkOrderByCode(topWorkOrder.getParentOrder()); sonWorkOrder.setProdLineCode(proWorkOrder.getProdLineCode());
proWorkOrder.setWorkorderId(topWorkOrder.getWorkorderId()); proOrderWorkorderMapper.updateProOrderWorkorderM(sonWorkOrder);
proOrderWorkorderMapper.updateProOrderWorkorderM(proWorkOrder); sonWorkOrder = proOrderWorkorderMapper.getSonWorkOrder(sonWorkOrder);
} }
} }
return success("变更成功"); return success("变更成功");

@ -571,6 +571,16 @@
where po.parent_order = #{parentOrder} where po.parent_order = #{parentOrder}
and po.del_flag = '0' and po.del_flag = '0'
</select> </select>
<select id="getProductOrders" resultType="com.op.plan.domain.ProOrderWorkorder">
select workorder_code workorderCode,status
from pro_order_workorder
where order_id in
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
#{orderId}
</foreach>
and del_flag = '0'
and status in('w2','w3')
</select>
<insert id="createPrepareDetails"> <insert id="createPrepareDetails">
insert into mes_prepare_detail insert into mes_prepare_detail

@ -77,8 +77,7 @@ public class QcCheckProjectController extends BaseController {
ExcelUtil<QcCheckProject> util = new ExcelUtil<QcCheckProject>(QcCheckProject.class); ExcelUtil<QcCheckProject> util = new ExcelUtil<QcCheckProject>(QcCheckProject.class);
List<QcCheckProject> projectList = util.importExcel(file.getInputStream()); List<QcCheckProject> projectList = util.importExcel(file.getInputStream());
String operName = SecurityUtils.getUsername(); String operName = SecurityUtils.getUsername();
String message = qcCheckProjectService.importCheckProject(projectList, updateSupport, operName); return qcCheckProjectService.importCheckProject(projectList, updateSupport, operName);
return success(message);
} }
/** /**

@ -0,0 +1,137 @@
package com.op.quality.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.quality.domain.QcCheckTaskDefect;
import com.op.quality.service.IQcCheckTaskDefectService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* --Controller
*
* @author Open Platform
* @date 2024-03-28
*/
@RestController
@RequestMapping("/qcCheckTaskDefect")
public class QcCheckTaskDefectController extends BaseController {
@Autowired
private IQcCheckTaskDefectService qcCheckTaskDefectService;
/**
* --
*/
@RequiresPermissions("quality:qcCheckTaskDefect:list")
@GetMapping("/list")
public TableDataInfo list(QcCheckTaskDefect qcCheckTaskDefect) {
startPage();
List<QcCheckTaskDefect> list = qcCheckTaskDefectService.selectQcCheckTaskDefectList(qcCheckTaskDefect);
return getDataTable(list);
}
/**
* --
*/
@RequiresPermissions("quality:qcCheckTaskDefect:export")
@Log(title = "来料检验任务--不良数量", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcCheckTaskDefect qcCheckTaskDefect) {
List<QcCheckTaskDefect> list = qcCheckTaskDefectService.selectQcCheckTaskDefectList(qcCheckTaskDefect);
ExcelUtil<QcCheckTaskDefect> util = new ExcelUtil<QcCheckTaskDefect>(QcCheckTaskDefect. class);
util.exportExcel(response, list, "来料检验任务--不良数量数据");
}
/**
* --
*/
@RequiresPermissions("quality:qcCheckTaskDefect:query")
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
return success(qcCheckTaskDefectService.selectQcCheckTaskDefectByRecordId(recordId));
}
/**
* --
*/
@RequiresPermissions("quality:qcCheckTaskDefect:add")
@Log(title = "来料检验任务--不良数量", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody QcCheckTaskDefect qcCheckTaskDefect) {
return toAjax(qcCheckTaskDefectService.insertQcCheckTaskDefect(qcCheckTaskDefect));
}
/**
* --
*/
@RequiresPermissions("quality:qcCheckTaskDefect:edit")
@Log(title = "来料检验任务--不良数量", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody QcCheckTaskDefect qcCheckTaskDefect) {
return toAjax(qcCheckTaskDefectService.updateQcCheckTaskDefect(qcCheckTaskDefect));
}
/**
* --
*/
@RequiresPermissions("quality:qcCheckTaskDefect:remove")
@Log(title = "来料检验任务--不良数量", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public AjaxResult remove(@PathVariable String[] recordIds) {
return toAjax(qcCheckTaskDefectService.deleteQcCheckTaskDefectByRecordIds(recordIds));
}
/**
* PC
*/
@GetMapping("/getDefectValue/{belongToDetail}")
public TableDataInfo getDefectValue(@PathVariable String belongToDetail) {
List<QcCheckTaskDefect> list = qcCheckTaskDefectService.getDefectListByBelongToDetail(belongToDetail);
return getDataTable(list);
}
/**
* PC
*/
@PostMapping("/commitDefectValue")
public AjaxResult commitDefectValue(@RequestBody List<QcCheckTaskDefect> checkTaskDefects) {
if (CollectionUtils.isEmpty(checkTaskDefects)) {
return error("操作失败,不良数据为空");
}else {
return toAjax(qcCheckTaskDefectService.commitDefectValue(checkTaskDefects));
}
}
/**
* PC
*/
@PutMapping("/updateDefectValue")
public AjaxResult updateDefectValue(@RequestBody List<QcCheckTaskDefect> checkTaskDefects) {
if (CollectionUtils.isEmpty(checkTaskDefects)) {
return error("操作失败,不良数据为空");
}else {
return toAjax(qcCheckTaskDefectService.updateDefectValue(checkTaskDefects));
}
}
}

@ -195,14 +195,14 @@ public class QcCheckTaskIncomeController extends BaseController {
} }
logger.info("来料信息查询结果:" + JSONObject.toJSONString(incomeR)); logger.info("来料信息查询结果:" + JSONObject.toJSONString(incomeR));
List<QcCheckTaskIncomeDTO> incomeAll = JSONArray.parseArray(JSONObject.toJSONString(incomeR.getData()),QcCheckTaskIncomeDTO.class); List<QcCheckTaskIncomeDTO> incomeAll = JSONArray.parseArray(JSONObject.toJSONString(incomeR.getData()),QcCheckTaskIncomeDTO.class);
//已经生成过检验任务的采购订单 //已经生成过检验任务的采购订单-物料凭证编号
List<String> todayIncomeLists = qcCheckTaskIncomeService.getTodayIncomeLists(); List<String> todayIncomeLists = qcCheckTaskIncomeService.getTodayIncomeLists();
List<QcCheckTaskIncomeDTO> newIncomes= null; List<QcCheckTaskIncomeDTO> newIncomes= null;
if(CollectionUtils.isEmpty(todayIncomeLists)){ if(CollectionUtils.isEmpty(todayIncomeLists)){
newIncomes = incomeAll; newIncomes = incomeAll;
}else{ }else{
newIncomes = incomeAll.stream() newIncomes = incomeAll.stream()
.filter(item -> !todayIncomeLists.contains(item.getOrderNo())) .filter(item -> !todayIncomeLists.contains(item.getAttr1()))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }

@ -44,6 +44,12 @@ public class QcMaterialGroupController extends BaseController {
List<QcMaterialGroup> list = qcMaterialGroupService.selectQcMaterialGroupList(qcMaterialGroup); List<QcMaterialGroup> list = qcMaterialGroupService.selectQcMaterialGroupList(qcMaterialGroup);
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/getOriginalGroupList")
public TableDataInfo getOriginalGroupList(QcMaterialGroup qcMaterialGroup) {
List<QcMaterialGroup> list = qcMaterialGroupService.getOriginalGroupList(qcMaterialGroup);
return getDataTable(list);
}
/** /**
* *

@ -34,7 +34,7 @@ public class QcCheckProject extends BaseEntity {
/** /**
* *
*/ */
@Excel(name = "检验规则属性") @Excel(name = "检验规则属性", readConverterExp = "0=定性,1=定量")
private String propertyCode; private String propertyCode;
/** /**
@ -80,6 +80,8 @@ public class QcCheckProject extends BaseEntity {
private String defectLevel; private String defectLevel;
@Excel(name = "检验方案类型") @Excel(name = "检验方案类型")
private String projectType; private String projectType;
@Excel(name = "排序")
private Integer sort;
private String materialCode; private String materialCode;
private String typeCode; private String typeCode;
private String groupId; private String groupId;
@ -243,6 +245,14 @@ public class QcCheckProject extends BaseEntity {
this.serialNumber = serialNumber; this.serialNumber = serialNumber;
} }
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -185,6 +185,15 @@ public class QcCheckReportIncome extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date confirmTime; private Date confirmTime;
private Boolean myself; private Boolean myself;
private String shiftId;
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public Boolean getMyself() { public Boolean getMyself() {
return myself; return myself;

@ -88,6 +88,8 @@ public class QcCheckTaskDefect extends BaseEntity {
@Excel(name = "不合格数量") @Excel(name = "不合格数量")
private BigDecimal noOkQuality; private BigDecimal noOkQuality;
private String belongTodetail;
private String defectCodes; private String defectCodes;
private String defectNames; private String defectNames;
private String defectQualitys; private String defectQualitys;
@ -220,6 +222,14 @@ public class QcCheckTaskDefect extends BaseEntity {
this.noOkQuality = noOkQuality; this.noOkQuality = noOkQuality;
} }
public String getBelongTodetail() {
return belongTodetail;
}
public void setBelongTodetail(String belongTodetail) {
this.belongTodetail = belongTodetail;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -205,6 +205,15 @@ public class QcCheckTaskProduce extends BaseEntity {
private String confirm; private String confirm;
private String confirmRemark; private String confirmRemark;
private String confirmTime; private String confirmTime;
private String shiftId;
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String getConfirm() { public String getConfirm() {
return confirm; return confirm;

@ -28,6 +28,11 @@ public class QcMaterialGroup extends BaseEntity {
*/ */
@Excel(name = "物料组名称") @Excel(name = "物料组名称")
private String groupName; private String groupName;
/**
*
*/
@Excel(name = "物料组名称")
private String groupCode;
/** /**
* 1 * 1
@ -116,6 +121,14 @@ public class QcMaterialGroup extends BaseEntity {
this.children = children; this.children = children;
} }
public String getGroupCode() {
return groupCode;
}
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -24,7 +24,8 @@ public class QcMaterialGroupDetail extends BaseEntity {
*/ */
@Excel(name = "物料组id") @Excel(name = "物料组id")
private String groupId; private String groupId;
//物料组编码
private String groupCode;
/** /**
* *
*/ */
@ -54,6 +55,14 @@ public class QcMaterialGroupDetail extends BaseEntity {
*/ */
private String delFlag; private String delFlag;
public String getGroupCode() {
return groupCode;
}
public void setGroupCode(String groupCode) {
this.groupCode = groupCode;
}
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }

@ -18,7 +18,7 @@ public class QcProjectType extends BaseEntity {
* id * id
*/ */
private String id; private String id;
private String groupId;
/** /**
* *
*/ */
@ -54,6 +54,33 @@ public class QcProjectType extends BaseEntity {
@Excel(name = "版本") @Excel(name = "版本")
private String version; private String version;
private String productGroupName;
private String productGroup;
public String getProductGroupName() {
return productGroupName;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public void setProductGroupName(String productGroupName) {
this.productGroupName = productGroupName;
}
public String getProductGroup() {
return productGroup;
}
public void setProductGroup(String productGroup) {
this.productGroup = productGroup;
}
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }

@ -41,7 +41,7 @@ public class QcStaticTable extends BaseEntity {
private String typeCode; private String typeCode;
private String checkResult; private String checkResult;
private String noOkBatchRate; private String noOkBatchRate;
private String shiftId;
private String ymArrayStart; private String ymArrayStart;
private String ymArrayEnd; private String ymArrayEnd;
private List<String> legendData; private List<String> legendData;
@ -106,6 +106,14 @@ public class QcStaticTable extends BaseEntity {
private List<HashMap> details; private List<HashMap> details;
private String[] projectNoArray; private String[] projectNoArray;
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public String[] getProjectNoArray() { public String[] getProjectNoArray() {
return projectNoArray; return projectNoArray;
} }

@ -69,4 +69,7 @@ public interface QcCheckTaskDefectMapper {
public List<QcCheckTaskDefect> selectDefectByBelongTo(String belongTo); public List<QcCheckTaskDefect> selectDefectByBelongTo(String belongTo);
@MapKey("belongToDetail") @MapKey("belongToDetail")
public Map<String, QcCheckTaskDefect> getDefectMap(QcCheckTaskDetail qcCheckTaskDetail); public Map<String, QcCheckTaskDefect> getDefectMap(QcCheckTaskDetail qcCheckTaskDetail);
public List<QcCheckTaskDefect> getDefectListByBelongToDetail(String belongToDetail);
} }

@ -82,4 +82,6 @@ public interface QcCheckTypeProjectMapper {
int insertQcCheckTypeProjects(@Param("list") List<QcCheckTypeProject> typeProjects); int insertQcCheckTypeProjects(@Param("list") List<QcCheckTypeProject> typeProjects);
List<QcProjectType> getProjectOptions(QcCheckProject qcCheckProject); List<QcProjectType> getProjectOptions(QcCheckProject qcCheckProject);
QcProjectType getProductGroup(String materialCode);
} }

@ -29,6 +29,8 @@ public interface QcMaterialGroupMapper {
*/ */
public List<QcMaterialGroup> selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup); public List<QcMaterialGroup> selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup);
public List<QcMaterialGroup> getOriginalGroupList(QcMaterialGroup qcMaterialGroup);
/** /**
* *
* *

@ -51,6 +51,8 @@ public interface QcStaticTableMapper {
@MapKey("ymdms") @MapKey("ymdms")
Map<String, QcStaticTable> getProjectDetail(QcStaticTable qcStaticTable); Map<String, QcStaticTable> getProjectDetail(QcStaticTable qcStaticTable);
@MapKey("ymdms")
Map<String, QcStaticTable> getProjectDetailNight(QcStaticTable qcStaticTable);
List<String> getBatchnos(String orderNo); List<String> getBatchnos(String orderNo);

@ -2,6 +2,7 @@ package com.op.quality.service;
import java.util.List; import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.quality.domain.QcCheckProject; import com.op.quality.domain.QcCheckProject;
/** /**
@ -64,5 +65,5 @@ public interface IQcCheckProjectService {
* *
* @return * @return
*/ */
public String importCheckProject(List<QcCheckProject> projectList, Boolean isUpdateSupport, String operName); public AjaxResult importCheckProject(List<QcCheckProject> projectList, Boolean isUpdateSupport, String operName);
} }

@ -62,4 +62,10 @@ public interface IQcCheckTaskDefectService {
public int deleteQcCheckTaskDefectByBelongTo(String belongTo); public int deleteQcCheckTaskDefectByBelongTo(String belongTo);
public List<QcCheckTaskDefect> selectDefectByBelongTo(String belongTo); public List<QcCheckTaskDefect> selectDefectByBelongTo(String belongTo);
public int commitDefectValue(List<QcCheckTaskDefect> qcCheckTaskDefect);
public int updateDefectValue(List<QcCheckTaskDefect> qcCheckTaskDefects);
public List<QcCheckTaskDefect> getDefectListByBelongToDetail(String belongToDetail);
} }

@ -22,6 +22,13 @@ public interface IQcMaterialGroupService {
*/ */
public QcMaterialGroup selectQcMaterialGroupById(String id); public QcMaterialGroup selectQcMaterialGroupById(String id);
/**
*
* @param qcMaterialGroup
* @return
*/
public List<QcMaterialGroup> getOriginalGroupList(QcMaterialGroup qcMaterialGroup);
/** /**
* *
* *

@ -1,6 +1,7 @@
package com.op.quality.service.impl; package com.op.quality.service.impl;
import java.util.List; import java.util.List;
import java.util.Optional;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.exception.ServiceException; import com.op.common.core.exception.ServiceException;
@ -8,7 +9,10 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.bean.BeanValidators; import com.op.common.core.utils.bean.BeanValidators;
import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcProjectType;
import com.op.quality.mapper.QcProjectTypeMapper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -24,6 +28,9 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.validation.Validator; import javax.validation.Validator;
import static com.op.common.core.web.domain.AjaxResult.error;
import static com.op.common.core.web.domain.AjaxResult.success;
/** /**
* Service * Service
* *
@ -40,6 +47,9 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
@Autowired @Autowired
protected Validator validator; protected Validator validator;
@Autowired
private QcProjectTypeMapper qcProjectTypeMapper;
/** /**
* *
* *
@ -127,7 +137,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public String importCheckProject(List<QcCheckProject> projectList, Boolean isUpdateSupport, String operName) { public AjaxResult importCheckProject(List<QcCheckProject> projectList, Boolean isUpdateSupport, String operName) {
if (CollectionUtils.isEmpty(projectList)) { if (CollectionUtils.isEmpty(projectList)) {
throw new ServiceException("导入的检测项目数据为空!"); throw new ServiceException("导入的检测项目数据为空!");
} }
@ -139,6 +149,9 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName"; String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_", ""); String factoryCode = request.getHeader(key.substring(8)).replace("ds_", "");
//校验数据
AjaxResult checkResult = checkImportProject(projectList);
if (checkResult.isSuccess()) {
for (QcCheckProject project : projectList) { for (QcCheckProject project : projectList) {
try { try {
QcCheckProject pro = qcCheckProjectMapper.selectCheckProjectByRuleName(project.getRuleName(), project.getProjectType()); QcCheckProject pro = qcCheckProjectMapper.selectCheckProjectByRuleName(project.getRuleName(), project.getProjectType());
@ -176,7 +189,9 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
} else { } else {
successMsg.insert(0, "恭喜您,数据已全部导入成功! 共" + successNum + " 条,数据如下:"); successMsg.insert(0, "恭喜您,数据已全部导入成功! 共" + successNum + " 条,数据如下:");
} }
return successMsg.toString(); return success(successMsg.toString());
}
return checkResult;
} }
private String getOrderNum() { private String getOrderNum() {
@ -187,4 +202,53 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
orderNum = now + "0" + checkProject.getSerialNumber(); orderNum = now + "0" + checkProject.getSerialNumber();
return orderNum; return orderNum;
} }
public AjaxResult checkImportProject(List<QcCheckProject> qcCheckProjectList) {
if (CollectionUtils.isEmpty(qcCheckProjectList)) {
return error(500,"导入的订单信息不能为空!信息导入失败");
}
for (QcCheckProject project : qcCheckProjectList) {
if (StringUtils.isEmpty(project.getOrderNum())) {
return error(500,"检验规则编号不能为空,信息导入失败,请检查是否存在空数据项");
}
if (StringUtils.isEmpty(project.getRuleName())) {
return error(500,"检验规则名称不能为空,信息导入失败");
}
if (StringUtils.isEmpty(project.getPropertyCode())) {
return error(500,"检验规则属性不能为空,信息导入失败");
}
if (StringUtils.isEmpty(project.getProjectType())) {
return error(500,"检验方案类型不能为空,信息导入失败");
}else {
boolean flag = typeConverter(project);
if (!flag) {
String ruleName = project.getRuleName();
return error(500,"检验规则名称:"+ ruleName +"检验方案类型不规范,信息导入失败");
}
}
if (project.getSort() == null) {
return error(500,"排序不能为空,信息导入失败");
}
}
return success();
}
/**
*
*/
public boolean typeConverter(QcCheckProject project) {
String projectType = project.getProjectType();
List<QcProjectType> projectTypes = qcProjectTypeMapper.selectQcProjectTypeList(new QcProjectType());
//筛选出检验方案类型名称相同的项目
Optional<QcProjectType> matchedType = projectTypes.stream()
.filter(item -> projectType.equals(item.getProjectTypeName()))
.findFirst();
//使用code替换名称
if (matchedType.isPresent()) {
project.setProjectType(matchedType.get().getProjectTypeCode());
return true;
}else {
return false;
}
}
} }

@ -218,6 +218,7 @@ public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceSer
QcStaticTable qcStaticTable = new QcStaticTable(); QcStaticTable qcStaticTable = new QcStaticTable();
qcStaticTable.setOrderNo(qcCheckTaskProduce.getOrderNo()); qcStaticTable.setOrderNo(qcCheckTaskProduce.getOrderNo());
qcStaticTable.setShiftId(qcCheckTaskProduce.getShiftId());
List<QcStaticTable> checkInfos = qcStaticTableService.getXJCheckTableDetail(qcStaticTable); List<QcStaticTable> checkInfos = qcStaticTableService.getXJCheckTableDetail(qcStaticTable);
produce.setCheckInfos(checkInfos); produce.setCheckInfos(checkInfos);
QcCheckTaskProduce lastProduce = qcCheckReportIncomeMapper.getLastProductTypeInfo(qcCheckTaskProduce); QcCheckTaskProduce lastProduce = qcCheckReportIncomeMapper.getLastProductTypeInfo(qcCheckTaskProduce);

@ -1,5 +1,6 @@
package com.op.quality.service.impl; package com.op.quality.service.impl;
import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
@ -116,4 +117,56 @@ public class QcCheckTaskDefectServiceImpl implements IQcCheckTaskDefectService {
public List<QcCheckTaskDefect> selectDefectByBelongTo(String belongTo) { public List<QcCheckTaskDefect> selectDefectByBelongTo(String belongTo) {
return qcCheckTaskDefectMapper.selectDefectByBelongTo(belongTo); return qcCheckTaskDefectMapper.selectDefectByBelongTo(belongTo);
} }
/**
*
* @param qcCheckTaskDefects
* @return
*/
@Override
@DS("#header.poolName")
public int commitDefectValue(List<QcCheckTaskDefect> qcCheckTaskDefects) {
/**qc_check_task_defect**/
String userName = SecurityUtils.getUsername();
Date now = DateUtils.getNowDate();
//获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_","");
int count = 0;
for (QcCheckTaskDefect defect : qcCheckTaskDefects) {
defect.setRecordId(IdUtils.fastSimpleUUID());
defect.setCreateBy(userName);
defect.setCreateTime(now);
defect.setFactoryCode(factoryCode);
count += qcCheckTaskDefectMapper.insertQcCheckTaskDefect(defect);
}
return count;
}
/**
*
* @param qcCheckTaskDefects
* @return
*/
@Override
@DS("#header.poolName")
public int updateDefectValue(List<QcCheckTaskDefect> qcCheckTaskDefects) {
String userName = SecurityUtils.getUsername();
Date now = DateUtils.getNowDate();
int count = 0;
for (QcCheckTaskDefect defect : qcCheckTaskDefects) {
defect.setUpdateBy(userName);
defect.setUpdateTime(now);
count += qcCheckTaskDefectMapper.updateQcCheckTaskDefect(defect);
}
return count;
}
@Override
@DS("#header.poolName")
public List<QcCheckTaskDefect> getDefectListByBelongToDetail(String belongToDetail) {
List<QcCheckTaskDefect> defectList = qcCheckTaskDefectMapper.getDefectListByBelongToDetail(belongToDetail);
return defectList;
}
} }

@ -41,7 +41,7 @@ import javax.servlet.http.HttpServletRequest;
* @date 2023-10-19 * @date 2023-10-19
*/ */
@Service @Service
public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements IQcCheckTaskIncomeService {
protected Logger logger = LoggerFactory.getLogger(getClass()); protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired @Autowired
private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper; private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper;
@ -85,6 +85,9 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
@Autowired @Autowired
private QcCheckTaskDefectMapper qcCheckTaskDefectMapper; private QcCheckTaskDefectMapper qcCheckTaskDefectMapper;
// @Autowired
// private QcCheckUnqualifiedService qcCheckUnqualifiedService;
/** /**
* *
* *
@ -145,7 +148,6 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
qcCheckTaskIncome.setCheckNo(bpDD+liushuiStr); qcCheckTaskIncome.setCheckNo(bpDD+liushuiStr);
/**取检测项**/ /**取检测项**/
QcCheckTypeProject qctp= new QcCheckTypeProject(); QcCheckTypeProject qctp= new QcCheckTypeProject();
qctp.setTypeId(qcCheckTaskIncome.getCheckType());//生产过程检验 qctp.setTypeId(qcCheckTaskIncome.getCheckType());//生产过程检验
@ -157,10 +159,19 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
//共性 //共性
if(group == null){//默认 if(group == null){//默认
group = new QcMaterialGroupDetail(); group = new QcMaterialGroupDetail();
group.setGroupId("729971295b734782b544f9d6d06fb8b9"); QcProjectType initGroup = qcCheckTypeProjectMapper.getProductGroup(qcCheckTaskIncome.getMaterialCode());
if(initGroup != null){
group.setGroupId(initGroup.getGroupId());
}else{
return 0;//没有找到检测项目
} }
}
List<QcCheckTaskDetail> itemsGG = new ArrayList<>();
if(StringUtils.isNotBlank(group.getGroupId())){
qctp.setGroupId(group.getGroupId()); qctp.setGroupId(group.getGroupId());
List<QcCheckTaskDetail> itemsGG = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp); itemsGG = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
}
items.addAll(itemsGG); items.addAll(itemsGG);
/**qc_check_task_detail**/ /**qc_check_task_detail**/
@ -721,6 +732,8 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
unqualified.setType(checkType); unqualified.setType(checkType);
n = qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified); n = qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified);
logger.info("qc_check_unqualified:" + n); logger.info("qc_check_unqualified:" + n);
//qcCheckUnqualifiedService.updateQcCheckUnqualified(qcCheckUnqualified);
} }
return 1 ; return 1 ;
} }

@ -1,6 +1,7 @@
package com.op.quality.service.impl; package com.op.quality.service.impl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -388,12 +389,23 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
Date nowTime = DateUtils.getNowDate(); Date nowTime = DateUtils.getNowDate();
Date startTime = productTask.getCreateTime(); Date startTime = productTask.getCreateTime();
LocalTime startTime0 = LocalTime.parse("11:30");
LocalTime endTime0 = LocalTime.parse("12:30");
LocalTime currentTime = LocalTime.now();
if (!currentTime.isAfter(startTime0.minusSeconds(1)) && !currentTime.isBefore(endTime0.plusSeconds(1))) {
// 当前时间在11:30到12:30之间不执行任务
logger.info("++++++++++++过程检验巡检任务生成午间休息++++++++++++++");
} else {
long mins = DateUtil.between(startTime, nowTime, DateUnit.MINUTE); long mins = DateUtil.between(startTime, nowTime, DateUnit.MINUTE);
if(mins>=60){ if(mins>=60){
int m = insertQcCheckTaskProduce(productTask); int m = insertQcCheckTaskProduce(productTask);
logger.info("++++++++++++过程检验巡检任务生成" + m + "++++++++++++++"); logger.info("++++++++++++过程检验巡检任务生成" + m + "++++++++++++++");
} }
} }
}
logger.info("++++++++++++" + poolName + "++++过程检验巡检结束++++++++++"); logger.info("++++++++++++" + poolName + "++++过程检验巡检结束++++++++++");
} }
} }

@ -48,10 +48,22 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public QcMaterialGroup selectQcMaterialGroupById(String id) { public QcMaterialGroup selectQcMaterialGroupById(String id) {
return qcMaterialGroupMapper.selectQcMaterialGroupById(id); return qcMaterialGroupMapper.selectQcMaterialGroupById(id);
} }
/**
*
* @param qcMaterialGroup
* @return
*/
@Override
@DS("#header.poolName")
public List<QcMaterialGroup> getOriginalGroupList(QcMaterialGroup qcMaterialGroup) {
return qcMaterialGroupMapper.getOriginalGroupList(qcMaterialGroup);
}
@Override @Override
//@DataScope(deptAlias = "d") //@DataScope(deptAlias = "d")
@DS("#header.poolName") @DS("#header.poolName")

@ -171,7 +171,13 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
@DS("#header.poolName") @DS("#header.poolName")
public List<QcStaticTable> getXJCheckTableDetail(QcStaticTable qcStaticTable) { public List<QcStaticTable> getXJCheckTableDetail(QcStaticTable qcStaticTable) {
List<QcStaticTable> projects = qcStaticTableMapper.getXJProjects(qcStaticTable); List<QcStaticTable> projects = qcStaticTableMapper.getXJProjects(qcStaticTable);
Map<String, QcStaticTable> detailMap = qcStaticTableMapper.getProjectDetail(qcStaticTable); Map<String, QcStaticTable> detailMap = null;
if(qcStaticTable.getShiftId().equals("5")){
detailMap = qcStaticTableMapper.getProjectDetail(qcStaticTable);
}else if(qcStaticTable.getShiftId().equals("2")){
detailMap = qcStaticTableMapper.getProjectDetailNight(qcStaticTable);
}
Map<String, QcStaticTable> picsMap = qcStaticTableMapper.picsMap(qcStaticTable); Map<String, QcStaticTable> picsMap = qcStaticTableMapper.picsMap(qcStaticTable);
for (QcStaticTable project : projects) { for (QcStaticTable project : projects) {
this.getDataFromMap(detailMap, project, picsMap); this.getDataFromMap(detailMap, project, picsMap);

@ -24,13 +24,13 @@
<result property="judge" column="judge"/> <result property="judge" column="judge"/>
<result property="defectLevel" column="defect_level"/> <result property="defectLevel" column="defect_level"/>
<result property="projectType" column="project_type"/> <result property="projectType" column="project_type"/>
<result property="sort" column="sort" />
</resultMap> </resultMap>
<sql id="selectQcCheckProjectVo"> <sql id="selectQcCheckProjectVo">
select id, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard, select id, order_num, rule_name, property_code, check_mode, check_tool, unit_code, check_standard,
attr1, create_by, create_time, update_by, update_time, factory_code, del_flag,sample_plan, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag,sample_plan,
judge,defect_level,project_type judge,defect_level,project_type,sort
from qc_check_project from qc_check_project
</sql> </sql>
@ -48,6 +48,7 @@
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="judge != null and judge != ''">and judge = #{judge}</if> <if test="judge != null and judge != ''">and judge = #{judge}</if>
<if test="projectType != null and projectType != ''">project_type = #{projectType}</if> <if test="projectType != null and projectType != ''">project_type = #{projectType}</if>
and del_flag = '0'
</where> </where>
order by create_time order by create_time
</select> </select>
@ -79,7 +80,7 @@
<if test="judge != null">judge,</if> <if test="judge != null">judge,</if>
<if test="defectLevel != null">defect_level,</if> <if test="defectLevel != null">defect_level,</if>
<if test="projectType != null">project_type,</if> <if test="projectType != null">project_type,</if>
<if test="sort != null">sort,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
@ -101,6 +102,7 @@
<if test="judge != null">#{judge},</if> <if test="judge != null">#{judge},</if>
<if test="defectLevel != null">#{defectLevel},</if> <if test="defectLevel != null">#{defectLevel},</if>
<if test="projectType != null">#{projectType},</if> <if test="projectType != null">#{projectType},</if>
<if test="sort != null">#{sort},</if>
</trim> </trim>
</insert> </insert>
@ -125,16 +127,17 @@
<if test="judge != null">judge = #{judge},</if> <if test="judge != null">judge = #{judge},</if>
<if test="defectLevel != null">defect_level = #{defectLevel},</if> <if test="defectLevel != null">defect_level = #{defectLevel},</if>
<if test="projectType != null">project_type = #{projectType},</if> <if test="projectType != null">project_type = #{projectType},</if>
<if test="sort != null">sort = #{sort},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteQcCheckProjectById" parameterType="String"> <delete id="deleteQcCheckProjectById" parameterType="String">
delete from qc_check_project where id = #{id} update qc_check_project set del_flag = '1' where id = #{id}
</delete> </delete>
<delete id="deleteQcCheckProjectByIds" parameterType="String"> <delete id="deleteQcCheckProjectByIds" parameterType="String">
delete from qc_check_project where id in update qc_check_project set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -21,10 +21,11 @@
<result property="belongTo" column="belong_to"/> <result property="belongTo" column="belong_to"/>
<result property="okQuality" column="ok_quality"/> <result property="okQuality" column="ok_quality"/>
<result property="noOkQuality" column="noOk_quality"/> <result property="noOkQuality" column="noOk_quality"/>
<result property="belongToDetail" column="belong_to_detail"/>
</resultMap> </resultMap>
<sql id="selectQcCheckTaskDefectVo"> <sql id="selectQcCheckTaskDefectVo">
select record_id, defect_code, defect_subclass, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag, belong_to, ok_quality, noOk_quality from qc_check_task_defect select record_id, defect_code, defect_subclass, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag, belong_to, ok_quality, noOk_quality, belong_to_detail from qc_check_task_defect
</sql> </sql>
<select id="selectQcCheckTaskDefectList" parameterType="QcCheckTaskDefect" resultMap="QcCheckTaskDefectResult"> <select id="selectQcCheckTaskDefectList" parameterType="QcCheckTaskDefect" resultMap="QcCheckTaskDefectResult">
@ -40,6 +41,7 @@
<if test="belongTo != null and belongTo != ''">and belong_to = #{belongTo}</if> <if test="belongTo != null and belongTo != ''">and belong_to = #{belongTo}</if>
<if test="okQuality != null ">and ok_quality = #{okQuality}</if> <if test="okQuality != null ">and ok_quality = #{okQuality}</if>
<if test="noOkQuality != null ">and noOk_quality = #{noOkQuality}</if> <if test="noOkQuality != null ">and noOk_quality = #{noOkQuality}</if>
and del_flag = '0'
</where> </where>
</select> </select>
@ -67,6 +69,7 @@
<if test="belongTo != null">belong_to,</if> <if test="belongTo != null">belong_to,</if>
<if test="okQuality != null">ok_quality,</if> <if test="okQuality != null">ok_quality,</if>
<if test="noOkQuality != null">noOk_quality,</if> <if test="noOkQuality != null">noOk_quality,</if>
<if test="belongToDetail != null">belong_to_detail,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if> <if test="recordId != null">#{recordId},</if>
@ -85,6 +88,7 @@
<if test="belongTo != null">#{belongTo},</if> <if test="belongTo != null">#{belongTo},</if>
<if test="okQuality != null">#{okQuality},</if> <if test="okQuality != null">#{okQuality},</if>
<if test="noOkQuality != null">#{noOkQuality},</if> <if test="noOkQuality != null">#{noOkQuality},</if>
<if test="belongToDetail != null">#{belongToDetail},</if>
</trim> </trim>
</insert> </insert>
@ -111,11 +115,11 @@
</update> </update>
<delete id="deleteQcCheckTaskDefectByRecordId" parameterType="String"> <delete id="deleteQcCheckTaskDefectByRecordId" parameterType="String">
delete from qc_check_task_defect where record_id = #{recordId} update qc_check_task_defect set del_flag = '1' where record_id = #{recordId}
</delete> </delete>
<delete id="deleteQcCheckTaskDefectByRecordIds" parameterType="String"> <delete id="deleteQcCheckTaskDefectByRecordIds" parameterType="String">
delete from qc_check_task_defect where record_id in update qc_check_task_defect set del_flag = '1' where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")"> <foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId} #{recordId}
</foreach> </foreach>
@ -160,4 +164,11 @@
GROUP by qctd.belong_to,qctd.belong_to_detail GROUP by qctd.belong_to,qctd.belong_to_detail
</select> </select>
<select id="getDefectListByBelongToDetail" resultMap="QcCheckTaskDefectResult">
SELECT record_id,defect_code, defect_subclass,ok_quality, noOk_quality,belong_to,belong_to_detail
FROM qc_check_task_defect
WHERE del_flag = '0' and belong_to_detail = #{belongToDetail}
order by defect_code
</select>
</mapper> </mapper>

@ -450,7 +450,7 @@
where equipment_type_code='equ_type_bzx' and status = '1' where equipment_type_code='equ_type_bzx' and status = '1'
</select> </select>
<select id="getTodayIncomeLists" resultType="java.lang.String"> <select id="getTodayIncomeLists" resultType="java.lang.String">
select order_no select attr1
from qc_check_task from qc_check_task
where check_type = 'checkTypeLL' where check_type = 'checkTypeLL'
and CONVERT(varchar(10),GETDATE(), 120) = CONVERT(varchar(10),create_time, 120) and CONVERT(varchar(10),GETDATE(), 120) = CONVERT(varchar(10),create_time, 120)

@ -82,7 +82,8 @@
<result property="confirm" column="confirm"/> <result property="confirm" column="confirm"/>
<result property="confirmManCode" column="confirm_man_code"/> <result property="confirmManCode" column="confirm_man_code"/>
<result property="confirmManName" column="confirm_man_name"/> <result property="confirmManName" column="confirm_man_name"/>
<result property="confirmManName" column="confirm_remark"/> <result property="confirmRemark" column="confirm_remark"/>
<result property="shiftId" column="shift_id"/>
</resultMap> </resultMap>
<sql id="selectQcCheckTaskProduceVo"> <sql id="selectQcCheckTaskProduceVo">
@ -339,7 +340,7 @@
</select> </select>
<select id="selectQcCheckReportIncomeList" parameterType="QcCheckReportIncome" <select id="selectQcCheckReportIncomeList" parameterType="QcCheckReportIncome"
resultMap="QcCheckReportIncomeResult"> resultMap="QcCheckReportIncomeResult">
select * from ( select t.*,pow.shift_id from (
select qct.record_id, qct.check_no, qct.income_batch_no, select qct.record_id, qct.check_no, qct.income_batch_no,
qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit, qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status, qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
@ -409,6 +410,7 @@
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_type,CONVERT(varchar(10),qct.create_time, 120), qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_type,CONVERT(varchar(10),qct.create_time, 120),
qct.confirm,qct.confirm_man_name qct.confirm,qct.confirm_man_name
) t ) t
left join pro_order_workorder pow on pow.workorder_code = t.order_no
where 1=1 where 1=1
<if test="checkType != null "> <if test="checkType != null ">
and t.check_type = #{checkType} and t.check_type = #{checkType}

@ -125,7 +125,7 @@
qcp.check_mode checkMode qcp.check_mode checkMode
<!--,qcp.check_standard checkStandard--> <!--,qcp.check_standard checkStandard-->
from qc_check_type_project qctp from qc_check_type_project qctp
left join qc_check_project qcp on qcp.id = qctp.project_id left join qc_check_project qcp on qcp.id = qctp.project_id and qcp.del_flag = '0'
where qctp.del_flag = '0' and qctp.status = '1' where qctp.del_flag = '0' and qctp.status = '1'
and qctp.material_code = #{materialCode} and qctp.material_code = #{materialCode}
and qctp.type_id = #{typeId} and qctp.type_id = #{typeId}
@ -284,11 +284,11 @@
</update> </update>
<delete id="deleteQcCheckTypeProjectById" parameterType="String"> <delete id="deleteQcCheckTypeProjectById" parameterType="String">
delete from qc_check_type_project where id = #{id} update qc_check_type_project set del_flag = '1' where id = #{id}
</delete> </delete>
<delete id="deleteQcCheckTypeProjectByIds" parameterType="String"> <delete id="deleteQcCheckTypeProjectByIds" parameterType="String">
delete from qc_check_type_project where id in update qc_check_type_project set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
@ -304,6 +304,7 @@
unit_code unitCode, unit_code unitCode,
check_standard checkStandard, check_standard checkStandard,
sample_plan samplePlan, sample_plan samplePlan,
sort,
judge , judge ,
defect_level defectLevel defect_level defectLevel
from qc_check_project from qc_check_project
@ -312,7 +313,7 @@
<if test="ruleName != null">and rule_name like concat('%',#{ruleName},'%')</if> <if test="ruleName != null">and rule_name like concat('%',#{ruleName},'%')</if>
and id not in( and id not in(
select project_id from qc_check_type_project select project_id from qc_check_type_project
where type_id = #{typeCode} where del_flag = '0' and type_id = #{typeCode}
<if test="samplePlan != null">and sample_plan = #{samplePlan}</if> <if test="samplePlan != null">and sample_plan = #{samplePlan}</if>
<if test="materialCode != null">and material_code = #{materialCode}</if> <if test="materialCode != null">and material_code = #{materialCode}</if>
) )
@ -323,4 +324,13 @@
from qc_project_type from qc_project_type
where del_flag = '0' where del_flag = '0'
</select> </select>
<select id="getProductGroup" resultType="com.op.quality.domain.QcProjectType">
select bp.product_group productGroup,
bp.product_group_name productGroupName,
qmg.id groupId
from base_product bp
left join qc_material_group qmg on qmg.group_code = bp.product_group
where bp.product_code like concat('%',#{materialCode},'%')
and bp.del_flag = '0'
</select>
</mapper> </mapper>

@ -22,7 +22,21 @@
</resultMap> </resultMap>
<sql id="selectQcGoalDistributeVo"> <sql id="selectQcGoalDistributeVo">
select id, belong_goal_id, supplier_code, supplier_name, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag from qc_goal_distribute select id,
belong_goal_id,
supplier_code,
supplier_name,
attr1,
attr2,
attr3,
attr4,
create_by,
create_time,
update_by,
update_time,
factory_code,
del_flag
from qc_goal_distribute
</sql> </sql>
<select id="selectQcGoalDistributeList" parameterType="QcGoalDistribute" resultMap="QcGoalDistributeResult"> <select id="selectQcGoalDistributeList" parameterType="QcGoalDistribute" resultMap="QcGoalDistributeResult">
@ -52,13 +66,14 @@
<if test="factoryCode != null and factoryCode != ''"> <if test="factoryCode != null and factoryCode != ''">
and factory_code = #{factoryCode} and factory_code = #{factoryCode}
</if> </if>
and del_flag = '0'
</where> </where>
</select> </select>
<select id="selectQcGoalDistributeById" parameterType="String" <select id="selectQcGoalDistributeById" parameterType="String"
resultMap="QcGoalDistributeResult"> resultMap="QcGoalDistributeResult">
<include refid="selectQcGoalDistributeVo"/> <include refid="selectQcGoalDistributeVo"/>
where id = #{id} where del_flag = '0' and id = #{id}
</select> </select>
<insert id="insertQcGoalDistribute" parameterType="QcGoalDistribute"> <insert id="insertQcGoalDistribute" parameterType="QcGoalDistribute">
@ -172,11 +187,11 @@
</update> </update>
<delete id="deleteQcGoalDistributeById" parameterType="String"> <delete id="deleteQcGoalDistributeById" parameterType="String">
delete from qc_goal_distribute where id = #{id} update qc_goal_distribute set del_flag = '1' where id = #{id}
</delete> </delete>
<delete id="deleteQcGoalDistributeByIds" parameterType="String"> <delete id="deleteQcGoalDistributeByIds" parameterType="String">
delete from qc_goal_distribute where id in update qc_goal_distribute set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
@ -228,7 +243,8 @@
FROM qc_goal_distribute gd FROM qc_goal_distribute gd
WHERE gd.belong_goal_id =#{ belongGoalId } WHERE gd.belong_goal_id =#{ belongGoalId }
) )
<if test="supplierName != null and supplierName != ''">and bp.product_desc_zh like concat('%', #{supplierName},'%') <if test="supplierName != null and supplierName != ''">and bp.product_desc_zh like concat('%',
#{supplierName},'%')
</if> </if>
</select> </select>

@ -60,6 +60,7 @@
<if test="parentGoal != null and parentGoal != ''"> <if test="parentGoal != null and parentGoal != ''">
and parent_goal = #{parentGoal} and parent_goal = #{parentGoal}
</if> </if>
and del_flag = '0'
</where> </where>
order by id desc order by id desc
</select> </select>
@ -94,6 +95,7 @@
<if test="parentGoal != null and parentGoal != ''"> <if test="parentGoal != null and parentGoal != ''">
and parent_goal = #{parentGoal} and parent_goal = #{parentGoal}
</if> </if>
and del_flag = '0'
</where> </where>
order by id asc order by id asc
</select> </select>
@ -101,7 +103,7 @@
<select id="selectQcGoalById" parameterType="String" <select id="selectQcGoalById" parameterType="String"
resultMap="QcGoalResult"> resultMap="QcGoalResult">
<include refid="selectQcGoalVo"/> <include refid="selectQcGoalVo"/>
where id = #{id} where del_flag= = '0' id = #{id}
</select> </select>
<insert id="insertQcGoal" parameterType="QcGoal"> <insert id="insertQcGoal" parameterType="QcGoal">
@ -249,11 +251,11 @@
</select> </select>
<delete id="deleteQcGoalById" parameterType="String"> <delete id="deleteQcGoalById" parameterType="String">
delete from qc_goal where id = #{id} update qc_goal set del_flag = '1' where id = #{id}
</delete> </delete>
<delete id="deleteQcGoalByIds" parameterType="String"> <delete id="deleteQcGoalByIds" parameterType="String">
delete from qc_goal where id in update qc_goal set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -33,6 +33,7 @@
</if> </if>
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
and del_flag = '0'
</where> </where>
</select> </select>
@ -96,11 +97,11 @@
</update> </update>
<delete id="deleteQcMaterialGroupDetailById" parameterType="String"> <delete id="deleteQcMaterialGroupDetailById" parameterType="String">
delete from qc_material_group_detail where id = #{id} update qc_material_group_detail set del_flag = '1' where id = #{id}
</delete> </delete>
<delete id="deleteQcMaterialGroupDetailByIds" parameterType="String"> <delete id="deleteQcMaterialGroupDetailByIds" parameterType="String">
delete from qc_material_group_detail where id in update qc_material_group_detail set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -26,6 +26,7 @@
<if test="groupName != null and groupName != ''">and group_name like concat('%', #{groupName}, '%')</if> <if test="groupName != null and groupName != ''">and group_name like concat('%', #{groupName}, '%')</if>
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
and del_flag = '0'
</where> </where>
/*select /*select
mg.id, mg.id,
@ -37,6 +38,14 @@
WHERE mg.del_flag = '0'*/ WHERE mg.del_flag = '0'*/
</select> </select>
<select id="getOriginalGroupList" parameterType="QcMaterialGroup" resultType="QcMaterialGroup">
SELECT DISTINCT
product_group groupCode,
concat(product_group_name,'(',product_group,')') groupName
FROM base_product
WHERE del_flag = '0' AND product_group_name IS NOT NULL
</select>
<select id="getMaterialChildrenList" parameterType="QcMaterialGroup" resultMap="QcMaterialGroupResult"> <select id="getMaterialChildrenList" parameterType="QcMaterialGroup" resultMap="QcMaterialGroupResult">
select select
id, id,
@ -61,6 +70,7 @@
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if> <if test="id != null">id,</if>
<if test="groupName != null">group_name,</if> <if test="groupName != null">group_name,</if>
<if test="groupCode != null">group_code,</if>
<if test="attr1 != null">attr1,</if> <if test="attr1 != null">attr1,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
@ -72,6 +82,7 @@
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
<if test="groupName != null">#{groupName},</if> <if test="groupName != null">#{groupName},</if>
<if test="groupCode != null">#{groupCode},</if>
<if test="attr1 != null">#{attr1},</if> <if test="attr1 != null">#{attr1},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
@ -86,6 +97,7 @@
update qc_material_group update qc_material_group
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="groupName != null">group_name = #{groupName},</if> <if test="groupName != null">group_name = #{groupName},</if>
<if test="groupCode != null">group_code = #{groupCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if> <if test="attr1 != null">attr1 = #{attr1},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
@ -98,11 +110,11 @@
</update> </update>
<delete id="deleteQcMaterialGroupById" parameterType="String"> <delete id="deleteQcMaterialGroupById" parameterType="String">
delete from qc_material_group where id = #{id} update qc_material_group set del_flag = '1' where id = #{id}
</delete> </delete>
<delete id="deleteQcMaterialGroupByIds" parameterType="String"> <delete id="deleteQcMaterialGroupByIds" parameterType="String">
delete from qc_material_group where id in update qc_material_group set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -36,6 +36,7 @@
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="standardNo != null and standardNo != ''">and standard_no = #{standardNo}</if> <if test="standardNo != null and standardNo != ''">and standard_no = #{standardNo}</if>
<if test="version != null and version != ''">and version = #{version}</if> <if test="version != null and version != ''">and version = #{version}</if>
and del_flag = '0'
</where> </where>
</select> </select>

@ -34,6 +34,7 @@
<if test="sampleQuality != null ">and sample_quality = #{sampleQuality}</if> <if test="sampleQuality != null ">and sample_quality = #{sampleQuality}</if>
<if test="checkType != null and checkType != ''">and check_type = #{checkType}</if> <if test="checkType != null and checkType != ''">and check_type = #{checkType}</if>
<if test="typeCode != null and typeCode != ''">and type_code = #{typeCode}</if> <if test="typeCode != null and typeCode != ''">and type_code = #{typeCode}</if>
and del_flag = '0'
</where> </where>
</select> </select>
@ -102,11 +103,11 @@
</update> </update>
<delete id="deleteQcSampleRuleById" parameterType="String"> <delete id="deleteQcSampleRuleById" parameterType="String">
delete from qc_sample_rule where id = #{id} update qc_sample_rule set del_flag = '1' where id = #{id}
</delete> </delete>
<delete id="deleteQcSampleRuleByIds" parameterType="String"> <delete id="deleteQcSampleRuleByIds" parameterType="String">
delete from qc_sample_rule where id in update qc_sample_rule set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -179,6 +179,34 @@
</select> </select>
<select id="getProjectDetailNight" resultType="com.op.quality.domain.QcStaticTable">
select qctd.record_id recordId,
qctd.project_id projectId,
qctd.status,
qctd.remark,
CONVERT(VARCHAR(5),qctd.create_time, 108),
concat(qctd.project_id,
case when '21:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '20:30' then '08'
when '22:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '21:30' then '09'
when '23:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '22:30' then '10'
when '23:59'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '23:30' then '11'
when '01:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '00:00' then '11'
when '02:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '01:30' then '12'
when '03:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '02:30' then '13'
when '04:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '03:30' then '14'
when '05:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '04:30' then '15'
when '06:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '05:30' then '16'
when '07:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '06:30' then '18'
when '08:30'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '07:30' then '19'
else '-' end
)ymdms
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
where qct.order_no = #{orderNo} and qct.check_type = 'checkTypeSCXJ' and qct.check_status = '2'
order by qctd.create_time
</select>
<select id="getBatchnos" resultType="java.lang.String"> <select id="getBatchnos" resultType="java.lang.String">
select powb.batch_code batchCode select powb.batch_code batchCode
from pro_order_workorder_batch powb from pro_order_workorder_batch powb

@ -42,6 +42,7 @@
FROM sys_user su FROM sys_user su
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id and sd.del_flag = '0' LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id and sd.del_flag = '0'
WHERE su.del_flag = '0' WHERE su.del_flag = '0'
<if test="userCode != null and userCode != ''">and su.user_name like concat('%', #{userCode}, '%')</if>
<if test="userName != null and userName != ''">and su.nick_name like concat('%', #{userName}, '%')</if> <if test="userName != null and userName != ''">and su.nick_name like concat('%', #{userName}, '%')</if>
<if test="deptId != null">and sd.dept_id = #{deptId}</if> <if test="deptId != null">and sd.dept_id = #{deptId}</if>
<if test="phonenumber != null and phonenumber != ''">and su.phonenumber like concat('%', #{phonenumber}, '%')</if> <if test="phonenumber != null and phonenumber != ''">and su.phonenumber like concat('%', #{phonenumber}, '%')</if>
@ -57,6 +58,7 @@
'%') '%')
</if> </if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
and del_flag = '0'
</where> </where>
--> -->
</select> </select>
@ -69,7 +71,7 @@
phonenumber, phonenumber,
create_time create_time
FROM sys_user FROM sys_user
WHERE user_name = #{userCode} WHERE del_flag = '0' and user_name = #{userCode}
</select> </select>
<select id="selectQcUserMaterialById" parameterType="String" resultMap="QcUserMaterialResult"> <select id="selectQcUserMaterialById" parameterType="String" resultMap="QcUserMaterialResult">
@ -102,8 +104,8 @@
select distinct um.material_code materialCode, select distinct um.material_code materialCode,
concat(bp.equipment_name,'(',bp.equipment_code,')') label concat(bp.equipment_name,'(',bp.equipment_code,')') label
from qc_user_material um from qc_user_material um
left join base_equipment bp on um.material_code = bp.equipment_code left join base_equipment bp on um.material_code = bp.equipment_code and bp.del_flag = '0'
where bp.equipment_type_code = 'equ_type_bzx' and um.user_code in where um.del_flag = '0' and bp.equipment_type_code = 'equ_type_bzx' and um.user_code in
<foreach collection="userCodes" item="userCode" open="(" close=")" separator=","> <foreach collection="userCodes" item="userCode" open="(" close=")" separator=",">
#{userCode} #{userCode}
</foreach> </foreach>
@ -114,7 +116,7 @@
<select id="getSelectedUsers" resultMap="QcUserMaterialResult"> <select id="getSelectedUsers" resultMap="QcUserMaterialResult">
select qum.user_code, qum.user_name select qum.user_code, qum.user_name
from qc_user_material qum from qc_user_material qum
where qum.material_code = #{materialCode} where qum.del_flag = '0' and qum.material_code = #{materialCode}
</select> </select>
<insert id="insertQcUserMaterial" parameterType="QcUserMaterial"> <insert id="insertQcUserMaterial" parameterType="QcUserMaterial">
insert into qc_user_material insert into qc_user_material
@ -176,11 +178,11 @@
</update> </update>
<delete id="deleteQcUserMaterialByUserCode" parameterType="String"> <delete id="deleteQcUserMaterialByUserCode" parameterType="String">
delete from qc_user_material where user_code = #{userCode} update qc_user_material set del_flag = '1' where user_code = #{userCode}
</delete> </delete>
<delete id="deleteQcUserMaterialByUserCodes" parameterType="String"> <delete id="deleteQcUserMaterialByUserCodes" parameterType="String">
delete from qc_user_material where user_code in update qc_user_material set del_flag = '1' where user_code in
<foreach item="userCode" collection="array" open="(" separator="," close=")"> <foreach item="userCode" collection="array" open="(" separator="," close=")">
#{userCode} #{userCode}
</foreach> </foreach>

@ -24,6 +24,10 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@RestController @RestController
@RequestMapping("/sap") @RequestMapping("/sap")
@ -66,8 +70,37 @@ public class SapController extends BaseController {
@PostMapping("/itemSync") @PostMapping("/itemSync")
@Log(title = "同步SAP物料清单", businessType = BusinessType.SAP) @Log(title = "同步SAP物料清单", businessType = BusinessType.SAP)
public R itemSync(@RequestBody SapItemQuery qo) { public R itemSync(@RequestBody SapItemQuery qo) {
// 加载sf-cloud库的sys_datasource // 加载sf-cloud库的sys_datasource
return sapItemSyncService.itemSync(qo); SysUser sysUser = new SysUser();
sysUser.setUserId(1L);
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
List<Map<String, String>> dateSources = dateSources0.getData();
ExecutorService executorService = new ThreadPoolExecutor(
dateSources.size(),
dateSources.size(),
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>());
try {
dateSources.forEach(dateSource -> {
if(!"ds_999".equals(dateSource.get("poolName"))){
SapItemQuery sapItemQuery = new SapItemQuery();
sapItemQuery.setWerks(dateSource.get("poolName").replace("ds_",""));
Runnable run = () -> sapItemSyncService.itemSync(sapItemQuery);
executorService.execute(run);
}
});
} catch (Exception e) {
logger.error("controller == createIncomeBatchTask == exception", e);
return R.fail("controller == createIncomeBatchTask == exception");
} finally {
executorService.shutdown();
}
return R.ok();
} }
/** /**

@ -53,6 +53,12 @@ public class SapItemSyncImpl implements SapItemSyncService {
@Override @Override
public R itemSync(SapItemQuery sapItemQuery) { public R itemSync(SapItemQuery sapItemQuery) {
try { try {
DynamicDataSourceContextHolder.push("ds_"+sapItemQuery.getWerks());
//TODO;
//sapItemQuery.setLaeda();
//sapItemQuery.setErsda();
// 获取调用 RFC 函数对象 // 获取调用 RFC 函数对象
//获取连接 //获取连接
log.info("物料基础数据同步输入参数---------" + JSONObject.toJSONString(sapItemQuery)); log.info("物料基础数据同步输入参数---------" + JSONObject.toJSONString(sapItemQuery));
@ -422,7 +428,7 @@ public class SapItemSyncImpl implements SapItemSyncService {
Date date = inputFormat.parse(inputDateTime); Date date = inputFormat.parse(inputDateTime);
qcCheckTaskIncomeDTO.setIncomeTime(date); qcCheckTaskIncomeDTO.setIncomeTime(date);
qcCheckTaskIncomeDTO.setFactoryCode(maraTable.getString("WERKS")); qcCheckTaskIncomeDTO.setFactoryCode(maraTable.getString("WERKS"));
qcCheckTaskIncomeDTO.setAttr1(maraTable.getString("USNAM"));//收货人 qcCheckTaskIncomeDTO.setAttr3(maraTable.getString("USNAM"));//收货人
qcCheckTaskIncomeDTO.setCreateTime(nowTime); qcCheckTaskIncomeDTO.setCreateTime(nowTime);
qcCheckTaskIncomeDTO.setCreateBy(createBy); qcCheckTaskIncomeDTO.setCreateBy(createBy);
qcCheckTaskIncomeDTOList.add(qcCheckTaskIncomeDTO); qcCheckTaskIncomeDTOList.add(qcCheckTaskIncomeDTO);

@ -339,8 +339,31 @@ public class WmsToWCSmissionController {
} }
/**
* --
*
*/
@PostMapping("/confirmFinishedProductTransferAndOutbound")
public AjaxResult confirmFinishedProductTransferAndOutbound(@RequestBody WmsAllocationOutEmbryo wmsRuturnPutEmbryo) {
return AjaxResult.success(wmsProductPutService.confirmFinishedProductTransferAndOutbound(wmsRuturnPutEmbryo));
}
/**
* --
*
*/
@PostMapping("/palletScanning")
public AjaxResult palletScanning(@RequestBody WmsFpStorageNewsSn wmsFpStorageNewsSn) {
return AjaxResult.success(wmsProductPutService.palletScanning(wmsFpStorageNewsSn));
}
/**
* --
*
*/
@PostMapping("/palletTransferConfirmation")
public AjaxResult palletTransferConfirmation(@RequestBody WmsFpStorageNewsSn wmsFpStorageNewsSn) {
return AjaxResult.success(wmsProductPutService.palletTransferConfirmation(wmsFpStorageNewsSn));
}
/** /**
* *
*/ */

@ -1,6 +1,14 @@
package com.op.wms.domain; package com.op.wms.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity; 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;
/** /**
* *
@ -12,4 +20,497 @@ public class WmsAllocationOutEmbryo extends BaseEntity {
* ID * ID
*/ */
private String id; private String id;
/**
*
*/
@Excel(name = "交货单号")
private String deliveryOrder;
/**
*
*/
@Excel(name = "项次")
private String itemNumber;
/**
*
*/
@Excel(name = "工厂编码")
private String factoryCode;
/**
*
*/
@Excel(name = "仓库编码")
private String whCode;
/**
*
*/
@Excel(name = "库区编码")
private String waCode;
/**
*
*/
@Excel(name = "库位编码")
private String wlCode;
/**
*
*/
@Excel(name = "出库地点")
private String deliveryPlace;
/**
*
*/
@Excel(name = "产品名称")
private String productName;
/**
*
*/
@Excel(name = "产品编码")
private String productCode;
/**
*
*/
@Excel(name = "产品分类")
private String productSort;
/**
*
*/
@Excel(name = "规格型号")
private String specification;
/**
*
*/
@Excel(name = "单位")
private String unitOfMeasure;
/**
*
*/
@Excel(name = "批次号")
private String lotNumber;
/**
*
*/
@Excel(name = "计划出库数量")
private BigDecimal planQuantity;
/**
*
*/
@Excel(name = "出库数量")
private BigDecimal outQuantity;
/**
* --01
*/
@Excel(name = "出库状态")
private String status;
/**
* SAP
*/
@Excel(name = "过账SAP状态")
private String sapStatus;
/**
* SAP
*/
@Excel(name = "过账SAP凭证")
private String sapProof;
/**
* SAP
*/
@Excel(name = "过账SAP返回信息")
private String sapMessage;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date outDate;
/**
* 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;
/**
* 5
*/
@Excel(name = "预留字段5")
private String attr5;
/**
* 6
*/
@Excel(name = "预留字段6")
private String attr6;
/**
* 7
*/
@Excel(name = "预留字段7")
private String attr7;
/**
* 8
*/
@Excel(name = "预留字段8")
private String attr8;
/**
* 9
*/
@Excel(name = "预留字段9")
private String attr9;
/**
* 10
*/
@Excel(name = "预留字段10")
private String attr10;
/**
*
*/
@Excel(name = "有效标记")
private String activeFlag;
private List<WmsProductPutTrayCode> wmsProductPutTrayCodeList;
public List<WmsProductPutTrayCode> getWmsProductPutTrayCodeList() {
return wmsProductPutTrayCodeList;
}
public void setWmsProductPutTrayCodeList(List<WmsProductPutTrayCode> wmsProductPutTrayCodeList) {
this.wmsProductPutTrayCodeList = wmsProductPutTrayCodeList;
}
public String getActiveFlag() {
return activeFlag;
}
public void setActiveFlag(String activeFlag) {
this.activeFlag = activeFlag;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setDeliveryOrder(String deliveryOrder) {
this.deliveryOrder = deliveryOrder;
}
public String getDeliveryOrder() {
return deliveryOrder;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public String getItemNumber() {
return itemNumber;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setWhCode(String whCode) {
this.whCode = whCode;
}
public String getWhCode() {
return whCode;
}
public void setWaCode(String waCode) {
this.waCode = waCode;
}
public String getWaCode() {
return waCode;
}
public void setWlCode(String wlCode) {
this.wlCode = wlCode;
}
public String getWlCode() {
return wlCode;
}
public void setDeliveryPlace(String deliveryPlace) {
this.deliveryPlace = deliveryPlace;
}
public String getDeliveryPlace() {
return deliveryPlace;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductSort(String productSort) {
this.productSort = productSort;
}
public String getProductSort() {
return productSort;
}
public void setSpecification(String specification) {
this.specification = specification;
}
public String getSpecification() {
return specification;
}
public void setUnitOfMeasure(String unitOfMeasure) {
this.unitOfMeasure = unitOfMeasure;
}
public String getUnitOfMeasure() {
return unitOfMeasure;
}
public void setLotNumber(String lotNumber) {
this.lotNumber = lotNumber;
}
public String getLotNumber() {
return lotNumber;
}
public void setPlanQuantity(BigDecimal planQuantity) {
this.planQuantity = planQuantity;
}
public BigDecimal getPlanQuantity() {
return planQuantity;
}
public void setOutQuantity(BigDecimal outQuantity) {
this.outQuantity = outQuantity;
}
public BigDecimal getOutQuantity() {
return outQuantity;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setSapStatus(String sapStatus) {
this.sapStatus = sapStatus;
}
public String getSapStatus() {
return sapStatus;
}
public void setSapProof(String sapProof) {
this.sapProof = sapProof;
}
public String getSapProof() {
return sapProof;
}
public void setSapMessage(String sapMessage) {
this.sapMessage = sapMessage;
}
public String getSapMessage() {
return sapMessage;
}
public void setOutDate(Date outDate) {
this.outDate = outDate;
}
public Date getOutDate() {
return outDate;
}
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 setAttr5(String attr5) {
this.attr5 = attr5;
}
public String getAttr5() {
return attr5;
}
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
public String getAttr6() {
return attr6;
}
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
public String getAttr7() {
return attr7;
}
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
public String getAttr8() {
return attr8;
}
public void setAttr9(String attr9) {
this.attr9 = attr9;
}
public String getAttr9() {
return attr9;
}
public void setAttr10(String attr10) {
this.attr10 = attr10;
}
public String getAttr10() {
return attr10;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deliveryOrder", getDeliveryOrder())
.append("itemNumber", getItemNumber())
.append("factoryCode", getFactoryCode())
.append("whCode", getWhCode())
.append("waCode", getWaCode())
.append("wlCode", getWlCode())
.append("deliveryPlace", getDeliveryPlace())
.append("productName", getProductName())
.append("productCode", getProductCode())
.append("productSort", getProductSort())
.append("specification", getSpecification())
.append("unitOfMeasure", getUnitOfMeasure())
.append("lotNumber", getLotNumber())
.append("planQuantity", getPlanQuantity())
.append("outQuantity", getOutQuantity())
.append("status", getStatus())
.append("sapStatus", getSapStatus())
.append("sapProof", getSapProof())
.append("sapMessage", getSapMessage())
.append("outDate", getOutDate())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("attr5", getAttr5())
.append("attr6", getAttr6())
.append("attr7", getAttr7())
.append("attr8", getAttr8())
.append("attr9", getAttr9())
.append("attr10", getAttr10())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
} }

@ -41,6 +41,21 @@ public class WmsFpStorageNewsSn extends BaseEntity {
@Excel(name = "库位编码") @Excel(name = "库位编码")
private String wlCode; private String wlCode;
/**
*
*/
@Excel(name = "目标库位编码")
private String towlCode;
public String getTowlCode() {
return towlCode;
}
public void setTowlCode(String towlCode) {
this.towlCode = towlCode;
}
/** /**
* *
*/ */

@ -2,6 +2,7 @@ package com.op.wms.mapper;
import java.util.List; import java.util.List;
import com.op.wms.domain.WmsAllocationOutEmbryo;
import com.op.wms.domain.WmsSellOutEmbryo; import com.op.wms.domain.WmsSellOutEmbryo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -76,4 +77,10 @@ public interface WmsSellOutEmbryoMapper {
* @return * @return
*/ */
public WmsSellOutEmbryo selectWmsSellOutEmbryoByOrderCodeAndProductCode(@Param("deliveryOrder") String deliveryOrder, @Param("productCode") String productCode); public WmsSellOutEmbryo selectWmsSellOutEmbryoByOrderCodeAndProductCode(@Param("deliveryOrder") String deliveryOrder, @Param("productCode") String productCode);
List<WmsAllocationOutEmbryo> selectWmsAllocationOutEmbryoList(WmsAllocationOutEmbryo wmsAllocationOutEmbryo);
WmsAllocationOutEmbryo selectWmsAllocationOutEmbryoById(String id);
void updateWmsAllocationOutEmbryo(WmsAllocationOutEmbryo wmsAllocationOutEmbryo);
} }

@ -120,4 +120,10 @@ public interface IWmsProductPutService {
List<WmsAllocationOutEmbryo> selectFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsRuturnPutEmbryo); List<WmsAllocationOutEmbryo> selectFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsRuturnPutEmbryo);
String confirmFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsRuturnPutEmbryo);
WmsFpStorageNewsSn palletScanning(WmsFpStorageNewsSn wmsFpStorageNewsSn);
String palletTransferConfirmation(WmsFpStorageNewsSn wmsFpStorageNewsSn);
} }

@ -231,7 +231,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsFpStorageNewsSn.setSn(wmsProductPut1.getSn()); wmsFpStorageNewsSn.setSn(wmsProductPut1.getSn());
wmsFpStorageNewsSn.setAmount(new BigDecimal(wmsProductPut1.getNumber())); wmsFpStorageNewsSn.setAmount(new BigDecimal(wmsProductPut1.getNumber()));
wmsFpStorageNewsSn.setBatchNumber(wmsProductPut.getBatchNumber()); wmsFpStorageNewsSn.setBatchNumber(wmsProductPut.getBatchNumber());
wmsFpStorageNewsSn.setUserDefined2(formattedDate); //wmsFpStorageNewsSn.setUserDefined2(formattedDate);
wmsFpStorageNewsSn.setCreateBy(wmsProductPut.getCreateBy()); wmsFpStorageNewsSn.setCreateBy(wmsProductPut.getCreateBy());
wmsFpStorageNewsSn.setCreateTime(new Date()); wmsFpStorageNewsSn.setCreateTime(new Date());
wmsFpStorageNewsSn.setActiveFlag("1"); wmsFpStorageNewsSn.setActiveFlag("1");
@ -830,7 +830,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsProductPutRecords.setProductName(wmsRuturnPutEmbryo.getProductName()); wmsProductPutRecords.setProductName(wmsRuturnPutEmbryo.getProductName());
wmsProductPutRecords.setProductCode(wmsRuturnPutEmbryo.getProductCode()); wmsProductPutRecords.setProductCode(wmsRuturnPutEmbryo.getProductCode());
wmsProductPutRecords.setWhCode(wmsRuturnPutEmbryo.getWhCode());//仓库编码 wmsProductPutRecords.setWhCode(wmsRuturnPutEmbryo.getWhCode());//仓库编码
wmsProductPutRecords.setFactoryCode(wmsRuturnPutEmbryo.getFactoryCode());
wmsProductPutRecords.setWlCode(wmsProductPut1.getWlCode());//库位编码 wmsProductPutRecords.setWlCode(wmsProductPut1.getWlCode());//库位编码
wmsProductPutRecords.setAttr1(wmsProductPut1.getSn());////托盘号编码 wmsProductPutRecords.setAttr1(wmsProductPut1.getSn());////托盘号编码
wmsProductPutRecords.setAttr2(wmsProductPut1.getNumber());//箱数 wmsProductPutRecords.setAttr2(wmsProductPut1.getNumber());//箱数
@ -850,7 +850,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsFpStorageNewsSn.setSn(wmsProductPut1.getSn()); wmsFpStorageNewsSn.setSn(wmsProductPut1.getSn());
wmsFpStorageNewsSn.setAmount(new BigDecimal(wmsProductPut1.getNumber())); wmsFpStorageNewsSn.setAmount(new BigDecimal(wmsProductPut1.getNumber()));
//wmsFpStorageNewsSn.setBatchNumber(wmsProductPut.getBatchNumber()); //wmsFpStorageNewsSn.setBatchNumber(wmsProductPut.getBatchNumber());
wmsFpStorageNewsSn.setUserDefined2(formattedDate); // wmsFpStorageNewsSn.setUserDefined2(formattedDate);
wmsFpStorageNewsSn.setCreateBy(wmsRuturnPutEmbryo.getCreateBy()); wmsFpStorageNewsSn.setCreateBy(wmsRuturnPutEmbryo.getCreateBy());
wmsFpStorageNewsSn.setCreateTime(new Date()); wmsFpStorageNewsSn.setCreateTime(new Date());
wmsFpStorageNewsSn.setActiveFlag("1"); wmsFpStorageNewsSn.setActiveFlag("1");
@ -885,9 +885,134 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
} }
@Override @Override
public List<WmsAllocationOutEmbryo> selectFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsRuturnPutEmbryo) { public List<WmsAllocationOutEmbryo> selectFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsAllocationOutEmbryo) {
DynamicDataSourceContextHolder.push("ds_" + wmsAllocationOutEmbryo.getFactoryCode());
List<WmsAllocationOutEmbryo> wmsAllocationOutEmbryoList= wmsSellOutEmbryoMapper.selectWmsAllocationOutEmbryoList(wmsAllocationOutEmbryo);
return wmsAllocationOutEmbryoList;
}
@Override
public String confirmFinishedProductTransferAndOutbound(WmsAllocationOutEmbryo wmsRuturnPutEmbryo) {
String result1="出库成功";
DynamicDataSourceContextHolder.push("ds_" + wmsRuturnPutEmbryo.getFactoryCode());
List<WmsProductPutTrayCode> wmsProductPutTrayCodeList= wmsRuturnPutEmbryo.getWmsProductPutTrayCodeList();
//成品销售出库--确认接口---修改出库单,--出库库存
WmsAllocationOutEmbryo wmsSellOutEmbryo1 = wmsSellOutEmbryoMapper.selectWmsAllocationOutEmbryoById(wmsRuturnPutEmbryo.getId());
Integer tem= wmsProductPutTrayCodeList.size();
BigDecimal OutQuantity= wmsSellOutEmbryo1.getOutQuantity().add(new BigDecimal(tem));//2
int result = wmsSellOutEmbryo1.getPlanQuantity().compareTo(OutQuantity);
WmsAllocationOutEmbryo wmsAllocationOutEmbryo=new WmsAllocationOutEmbryo();
if (result == 0){//出库完
wmsAllocationOutEmbryo.setStatus("1");
}else {
wmsAllocationOutEmbryo.setStatus("0");
}
wmsAllocationOutEmbryo.setId(wmsRuturnPutEmbryo.getId());
wmsAllocationOutEmbryo.setOutQuantity(OutQuantity);
wmsSellOutEmbryoMapper.updateWmsAllocationOutEmbryo(wmsAllocationOutEmbryo);
//订单修改完成
for(WmsProductPutTrayCode wmsProductPutTrayCode: wmsProductPutTrayCodeList){
//库存修改
//解除绑定
wmsProductPutTrayCode.setRelatStatus("0");
wmsProductPutTrayCodeMapper.updateWmsProductPutTrayCode(wmsProductPutTrayCode);
//改明细
WmsFpStorageNewsSn wmsFpStorageNewsSn=new WmsFpStorageNewsSn();
wmsFpStorageNewsSn.setSn(wmsProductPutTrayCode.getSn());
wmsFpStorageNewsSn.setWlCode(wmsProductPutTrayCode.getWlCode());
wmsFpStorageNewsSn.setActiveFlag("1");
wmsFpStorageNewsSn.setProductCode(wmsSellOutEmbryo1.getProductCode());
wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSnOut(wmsFpStorageNewsSn);
//判断如果托盘数据被出完,就关闭这个明细
List<WmsFpStorageNewsSn> wmsFpStorageNewsSns= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnList(wmsFpStorageNewsSn);
if (wmsFpStorageNewsSns.size()>0){
WmsFpStorageNewsSn wmsFpStorageNewsSn1= wmsFpStorageNewsSns.get(0);
BigDecimal ken= new BigDecimal(wmsFpStorageNewsSn1.getUserDefined2());
int comparisonResult = ken.compareTo(wmsFpStorageNewsSn1.getAmount());
if (comparisonResult == 0) {
// ken和amount相等
wmsFpStorageNewsSn1.setActiveFlag("0");
wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSn(wmsFpStorageNewsSn1);
}
}
//改主表
WmsFpStorageNews wmsFpStorageNews=new WmsFpStorageNews();
wmsFpStorageNews.setActiveFlag("1");
wmsFpStorageNews.setWlCode(wmsProductPutTrayCode.getWlCode());
wmsFpStorageNews.setProductCode(wmsSellOutEmbryo1.getProductCode());
wmsFpStorageNewsMapper.updateWmsFpStorageNewsOut(wmsFpStorageNews);
}
return result1;
}
@Override
public WmsFpStorageNewsSn palletScanning(WmsFpStorageNewsSn wmsFpStorageNewsSn) {
DynamicDataSourceContextHolder.push("ds_" + wmsFpStorageNewsSn.getFactoryCode());
wmsFpStorageNewsSn.setActiveFlag("1");
List<WmsFpStorageNewsSn> wmsFpStorageNewsSnList= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnList(wmsFpStorageNewsSn);
if (wmsFpStorageNewsSnList.size()>0){
return wmsFpStorageNewsSnList.get(0);
}
return null; return null;
} }
@Override
public String palletTransferConfirmation(WmsFpStorageNewsSn wmsFpStorageNewsSn) {
String result1="移库成功";
DynamicDataSourceContextHolder.push("ds_" + wmsFpStorageNewsSn.getFactoryCode());
String toWlCode=wmsFpStorageNewsSn.getTowlCode();
WmsFpStorageNewsSn wmsFpStorageNewsSn1= wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnByStorageId(wmsFpStorageNewsSn.getStorageId());
//减库存明细
wmsFpStorageNewsSn1.setActiveFlag("0");
wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSn(wmsFpStorageNewsSn1);
//减库存
WmsFpStorageNews wmsFpStorageNews= wmsFpStorageNewsMapper.selectWmsFpStorageNewsByProductCodeAndWlCode(wmsFpStorageNewsSn.getProductCode(),wmsFpStorageNewsSn.getWlCode());
BigDecimal amount = wmsFpStorageNews.getAmount();
BigDecimal amountsub = amount.subtract(wmsFpStorageNewsSn1.getAmount());
wmsFpStorageNews.setAmount(amountsub);
wmsFpStorageNewsMapper.updateWmsFpStorageNews(wmsFpStorageNews);
//添加库存明细
WmsFpStorageNewsSn wmsFpStorageNewsSn2 = new WmsFpStorageNewsSn();
wmsFpStorageNewsSn2.setStorageId(IdUtils.fastSimpleUUID());
wmsFpStorageNewsSn2.setFactoryCode(wmsFpStorageNewsSn.getFactoryCode());
wmsFpStorageNewsSn2.setWhCode(wmsFpStorageNewsSn.getWhCode());//仓库编码
wmsFpStorageNewsSn2.setWlCode(toWlCode);
wmsFpStorageNewsSn2.setProductCode(wmsFpStorageNewsSn.getProductCode());
wmsFpStorageNewsSn2.setProductName(wmsFpStorageNewsSn.getProductName());
wmsFpStorageNewsSn2.setSn(wmsFpStorageNewsSn.getSn());
wmsFpStorageNewsSn2.setAmount(wmsFpStorageNewsSn.getAmount());
//wmsFpStorageNewsSn.setBatchNumber(wmsProductPut.getBatchNumber());
// wmsFpStorageNewsSn2.setUserDefined2(formattedDate);
wmsFpStorageNewsSn2.setCreateBy(wmsFpStorageNewsSn.getCreateBy());
wmsFpStorageNewsSn2.setCreateTime(new Date());
wmsFpStorageNewsSn2.setActiveFlag("1");
wmsFpStorageNewsSnMapper.insertWmsFpStorageNewsSn(wmsFpStorageNewsSn2);
//添加库存
WmsFpStorageNews wmsFpStorageNews1 = new WmsFpStorageNews();
wmsFpStorageNews1.setWhCode(wmsFpStorageNewsSn.getWhCode());//仓库编码
wmsFpStorageNews1.setWlCode(toWlCode);
wmsFpStorageNews1.setStorageType("成品");
wmsFpStorageNews1.setProductCode(wmsFpStorageNewsSn.getProductCode());
wmsFpStorageNews1.setProductName(wmsFpStorageNewsSn.getProductName());
wmsFpStorageNews1.setFactoryCode(wmsFpStorageNewsSn.getFactoryCode());
wmsFpStorageNews1.setActiveFlag("1");
wmsFpStorageNews1.setUserDefined1(wmsFpStorageNews.getUserDefined1());
List<WmsFpStorageNews> wmsFpStorageNewsList = wmsFpStorageNewsMapper.selectWmsFpStorageNewsList(wmsFpStorageNews1);
wmsFpStorageNews1.setStorageId(IdUtils.fastSimpleUUID());
wmsFpStorageNews1.setAmount(wmsFpStorageNewsSn.getAmount());
wmsFpStorageNews1.setCreateBy(wmsFpStorageNewsSn.getCreateBy());
wmsFpStorageNews1.setCreateTime(new Date());
if (wmsFpStorageNewsList.size() > 0) {
WmsFpStorageNews wmsFpStorageNews2 = wmsFpStorageNewsList.get(0);
BigDecimal amount1 = wmsFpStorageNews2.getAmount();
BigDecimal amountAdd = amount1.add(wmsFpStorageNews.getAmount());
wmsFpStorageNews2.setAmount(amountAdd);
wmsFpStorageNewsMapper.updateWmsFpStorageNews(wmsFpStorageNews2);
} else {
wmsFpStorageNewsMapper.insertWmsFpStorageNews(wmsFpStorageNews1);
}
return result1;
}
} }

@ -212,7 +212,7 @@
<!--查询总数--> <!--查询总数-->
<select id="queryCount" parameterType="BaseArea" resultType="java.lang.Integer"> <select id="queryCount" parameterType="BaseArea" resultType="java.lang.Integer">
select count(*) select count(1)
from base_area from base_area
where del_flag = '0' where del_flag = '0'
</select> </select>

@ -267,7 +267,7 @@
</select> </select>
<select id="selectChildNodes" parameterType="com.op.wms.domain.BaseBom" resultType="Integer"> <select id="selectChildNodes" parameterType="com.op.wms.domain.BaseBom" resultType="Integer">
select count(*) as number select count(1) as number
from base_bom_component from base_bom_component
where cumc = #{component} where cumc = #{component}
and bom_code = #{bomCode} and bom_code = #{bomCode}

@ -152,7 +152,7 @@
</update> </update>
<select id="queryCount" parameterType="BaseWarehouse" resultType="java.lang.Integer"> <select id="queryCount" parameterType="BaseWarehouse" resultType="java.lang.Integer">
select count(*) select count(1)
from base_warehouse from base_warehouse
and del_flag = '0' and del_flag = '0'
</select> </select>

@ -160,14 +160,14 @@
<if test="productName != null">product_name,</if> <if test="productName != null">product_name,</if>
<if test="productCode != null">product_code,</if> <if test="productCode != null">product_code,</if>
<if test="productSort != null">product_sort,</if> <if test="productSort != null">product_sort,</if>
<if test="specification != null">specification,</if> <if test="speciFication != null">specification,</if>
<if test="unitOfMeasure != null">unit_of_measure,</if> <if test="unitOfMeasure != null">unit_of_measure,</if>
<if test="planQuantity != null">plan_quantity,</if> <if test="planQuantity != null">plan_quantity,</if>
<if test="putQuantity != null">put_quantity,</if> <if test="putQuantity != null">put_quantity,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="SAPStatus != null">SAP_status,</if> <if test="sapStatus != null">SAP_status,</if>
<if test="SAPProof != null">SAP_proof,</if> <if test="sapProof != null">SAP_proof,</if>
<if test="SAPMessage != null">SAP_message,</if> <if test="sapMessage != null">SAP_message,</if>
<if test="putDate != null">put_date,</if> <if test="putDate != null">put_date,</if>
<if test="attr1 != null">attr1,</if> <if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if> <if test="attr2 != null">attr2,</if>
@ -195,14 +195,14 @@
<if test="productName != null">#{productName},</if> <if test="productName != null">#{productName},</if>
<if test="productCode != null">#{productCode},</if> <if test="productCode != null">#{productCode},</if>
<if test="productSort != null">#{productSort},</if> <if test="productSort != null">#{productSort},</if>
<if test="specification != null">#{specification},</if> <if test="speciFication != null">#{speciFication},</if>
<if test="unitOfMeasure != null">#{unitOfMeasure},</if> <if test="unitOfMeasure != null">#{unitOfMeasure},</if>
<if test="planQuantity != null">#{planQuantity},</if> <if test="planQuantity != null">#{planQuantity},</if>
<if test="putQuantity != null">#{putQuantity},</if> <if test="putQuantity != null">#{putQuantity},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="SAPStatus != null">#{SAPStatus},</if> <if test="sapStatus != null">#{sapStatus},</if>
<if test="SAPProof != null">#{SAPProof},</if> <if test="sapProof != null">#{sapProof},</if>
<if test="SAPMessage != null">#{SAPMessage},</if> <if test="sapMessage != null">#{sapMessage},</if>
<if test="putDate != null">#{putDate},</if> <if test="putDate != null">#{putDate},</if>
<if test="attr1 != null">#{attr1},</if> <if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if> <if test="attr2 != null">#{attr2},</if>

@ -44,6 +44,45 @@
<result property="activeFlag" column="active_flag"/> <result property="activeFlag" column="active_flag"/>
</resultMap> </resultMap>
<resultMap type="WmsAllocationOutEmbryo" id="WmsAllocationOutEmbryoResult">
<result property="id" column="id"/>
<result property="deliveryOrder" column="delivery_order"/>
<result property="itemNumber" column="Item_number"/>
<result property="factoryCode" column="factory_code"/>
<result property="whCode" column="wh_code"/>
<result property="waCode" column="wa_code"/>
<result property="wlCode" column="wl_code"/>
<result property="deliveryPlace" column="delivery_place"/>
<result property="productName" column="product_name"/>
<result property="productCode" column="product_code"/>
<result property="productSort" column="product_sort"/>
<result property="specification" column="specification"/>
<result property="unitOfMeasure" column="unit_of_measure"/>
<result property="lotNumber" column="lot_number"/>
<result property="planQuantity" column="plan_quantity"/>
<result property="outQuantity" column="out_quantity"/>
<result property="status" column="status"/>
<result property="sapStatus" column="SAP_status"/>
<result property="sapProof" column="SAP_proof"/>
<result property="sapMessage" column="SAP_message"/>
<result property="outDate" column="out_date"/>
<result property="attr1" column="attr1"/>
<result property="attr2" column="attr2"/>
<result property="attr3" column="attr3"/>
<result property="attr4" column="attr4"/>
<result property="attr5" column="attr5"/>
<result property="attr6" column="attr6"/>
<result property="attr7" column="attr7"/>
<result property="attr8" column="attr8"/>
<result property="attr9" column="attr9"/>
<result property="attr10" column="attr10"/>
<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="remark" column="remark"/>
<result property="activeFlag" column="active_flag"/>
</resultMap>
<sql id="selectWmsSellOutEmbryoVo"> <sql id="selectWmsSellOutEmbryoVo">
select id, delivery_order, Item_number,active_flag, factory_code, wh_code, wa_code, wl_code, delivery_place, product_name, product_code, product_sort, specification, unit_of_measure, lot_number, plan_quantity, out_quantity, status, SAP_status, SAP_proof, SAP_message, out_date, attr1, attr2, attr3, attr4, attr5, attr6, attr7, attr8, attr9, attr10, create_by, create_time, update_by, update_time, remark from wms_sell_out_embryo select id, delivery_order, Item_number,active_flag, factory_code, wh_code, wa_code, wl_code, delivery_place, product_name, product_code, product_sort, specification, unit_of_measure, lot_number, plan_quantity, out_quantity, status, SAP_status, SAP_proof, SAP_message, out_date, attr1, attr2, attr3, attr4, attr5, attr6, attr7, attr8, attr9, attr10, create_by, create_time, update_by, update_time, remark from wms_sell_out_embryo
</sql> </sql>
@ -242,4 +281,168 @@
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="selectWmsAllocationOutEmbryoList" resultMap="WmsAllocationOutEmbryoResult">
SELECT
id,
delivery_order,
Item_number,
active_flag,
factory_code,
wh_code,
wa_code,
wl_code,
delivery_place,
product_name,
product_code,
product_sort,
specification,
unit_of_measure,
lot_number,
plan_quantity,
out_quantity,
status,
SAP_status,
SAP_proof,
SAP_message,
out_date,
attr1,
attr2,
attr3,
attr4,
attr5,
attr6,
attr7,
attr8,
attr9,
attr10,
create_by,
create_time,
update_by,
update_time,
remark
FROM
wms_allocation_out_embryo
<where>
<if test="deliveryOrder != null and deliveryOrder != ''">and delivery_order = #{deliveryOrder}</if>
<if test="itemNumber != null and itemNumber != ''">and Item_number = #{itemNumber}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="whCode != null and whCode != ''">and wh_code = #{whCode}</if>
<if test="waCode != null and waCode != ''">and wa_code = #{waCode}</if>
<if test="wlCode != null and wlCode != ''">and wl_code = #{wlCode}</if>
<if test="deliveryPlace != null and deliveryPlace != ''">and delivery_place = #{deliveryPlace}</if>
<if test="productName != null and productName != ''">and product_name like concat('%', #{productName},
'%')
</if>
<if test="productCode != null and productCode != ''">and product_code = #{productCode}</if>
<if test="productSort != null and productSort != ''">and product_sort = #{productSort}</if>
<if test="specification != null and specification != ''">and specification = #{specification}</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''">and unit_of_measure = #{unitOfMeasure}</if>
<if test="lotNumber != null and lotNumber != ''">and lot_number = #{lotNumber}</if>
<if test="planQuantity != null ">and plan_quantity = #{planQuantity}</if>
<if test="outQuantity != null ">and out_quantity = #{outQuantity}</if>
<if test="status != null and status != ''">and status = #{status}</if>
<if test="sapStatus != null and sapStatus != ''">and SAP_status = #{sapStatus}</if>
<if test="sapProof != null and sapProof != ''">and SAP_proof = #{sapProof}</if>
<if test="sapMessage != null and sapMessage != ''">and SAP_message = #{sapMessage}</if>
<if test="outDate != null ">and out_date = #{outDate}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</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="attr5 != null and attr5 != ''">and attr5 = #{attr5}</if>
<if test="attr6 != null and attr6 != ''">and attr6 = #{attr6}</if>
<if test="attr7 != null and attr7 != ''">and attr7 = #{attr7}</if>
<if test="attr8 != null and attr8 != ''">and attr8 = #{attr8}</if>
<if test="attr9 != null and attr9 != ''">and attr9 = #{attr9}</if>
<if test="attr10 != null and attr10 != ''">and attr10 = #{attr10}</if>
</where>
</select>
<select id="selectWmsAllocationOutEmbryoById" parameterType="String" resultMap="WmsAllocationOutEmbryoResult">
SELECT
id,
delivery_order,
Item_number,
active_flag,
factory_code,
wh_code,
wa_code,
wl_code,
delivery_place,
product_name,
product_code,
product_sort,
specification,
unit_of_measure,
lot_number,
plan_quantity,
COALESCE(out_quantity, 0)
status,
SAP_status,
SAP_proof,
SAP_message,
out_date,
attr1,
attr2,
attr3,
attr4,
attr5,
attr6,
attr7,
attr8,
attr9,
attr10,
create_by,
create_time,
update_by,
update_time,
remark
FROM
wms_allocation_out_embryo
where id = #{id}
</select>
<update id="updateWmsAllocationOutEmbryo" >
update wms_allocation_out_embryo
<trim prefix="SET" suffixOverrides=",">
<if test="deliveryOrder != null">delivery_order = #{deliveryOrder},</if>
<if test="itemNumber != null">Item_number = #{itemNumber},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="whCode != null">wh_code = #{whCode},</if>
<if test="waCode != null">wa_code = #{waCode},</if>
<if test="wlCode != null">wl_code = #{wlCode},</if>
<if test="deliveryPlace != null">delivery_place = #{deliveryPlace},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productSort != null">product_sort = #{productSort},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
<if test="lotNumber != null">lot_number = #{lotNumber},</if>
<if test="planQuantity != null">plan_quantity = #{planQuantity},</if>
<if test="outQuantity != null">out_quantity = #{outQuantity},</if>
<if test="status != null">status = #{status},</if>
<if test="sapStatus != null">SAP_status = #{sapStatus},</if>
<if test="sapProof != null">SAP_proof = #{sapProof},</if>
<if test="sapMessage != null">SAP_message = #{sapMessage},</if>
<if test="outDate != null">out_date = #{outDate},</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="attr5 != null">attr5 = #{attr5},</if>
<if test="attr6 != null">attr6 = #{attr6},</if>
<if test="attr7 != null">attr7 = #{attr7},</if>
<if test="attr8 != null">attr8 = #{attr8},</if>
<if test="attr9 != null">attr9 = #{attr9},</if>
<if test="attr10 != null">attr10 = #{attr10},</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="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
</mapper> </mapper>

Loading…
Cancel
Save