Merge remote-tracking branch 'origin/master'

master
wws 2 years ago
commit 28e2f90ce5

@ -0,0 +1,609 @@
package com.op.system.api.domain.mes;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
* mes_report_work
*
* @author Open Platform
* @date 2023-08-24
*/
public class MesReportWorkDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 记录id */
private String id;
/** 报工单编号 */
@Excel(name = "报工单编号")
private String reportCode;
/** 报工类型报工类型SELF自行报工、UNI统一报工 */
@Excel(name = "报工类型报工类型SELF上位机报工、UNI系统报工")
private String reportType;
/** 生产工单编码 */
@Excel(name = "生产工单编码")
private String workorderCode;
/** 产品编码 */
@Excel(name = "产品编码")
private String productCode;
/** 产品名称 */
@Excel(name = "产品名称")
private String productName;
/** 规格型号 */
@Excel(name = "规格型号")
private String spec;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 排产数量 */
@Excel(name = "排产数量")
private BigDecimal quantity;
/** 本次报工数量 */
@Excel(name = "本次报工数量")
private BigDecimal quantityFeedback;
/** 合格数量 */
//@Excel(name = "合格数量")
private BigDecimal quantityQualified;
/** 不合格数量 */
//@Excel(name = "不合格数量")
private BigDecimal quantityUnqualified;
/** 报工人员 */
@Excel(name = "报工人员")
private String userName;
/** 人员名称 */
@Excel(name = "人员名称")
private String nickName;
/** 报工途径PAD、MOBILE、PC */
//@Excel(name = "报工途径PAD、MOBILE、PC")
private String feedbackChannel;
/** 报工时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "报工时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date feedbackTime;
/** 录入人员 */
@Excel(name = "录入人员")
private String recordUser;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 工时 */
@Excel(name = "工时")
private Long workTime;
/** 线体编码 */
@Excel(name = "线体编码")
private String machineCode;
/** 线体名称 */
@Excel(name = "线体名称")
private String machineName;
/** 班组编码 */
@Excel(name = "班组编码")
private String teamCode;
/** 班次编码 */
@Excel(name = "班次编码")
private String shiftCode;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "SAP报工时间")
private Date uploadTime;
@Excel(name = "SAP报工状态0待报工1成功2失败")
private String uploadStatus;
@Excel(name = "SAP报工信息")
private String uploadMsg;
/** 预留字段1 */
//@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
//@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
//@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
//@Excel(name = "预留字段4")
private String attr4;
@Excel(name = "计划生产日期")
private String productDate;
private String productDateStart;
private String productDateEnd;
@Excel(name = "订单编号")
private String orderCode;
@Excel(name = "规格型号")
private String productSpc;
@Excel(name = "工序名称")
private String processName;
@Excel(name = "工序编码")
private String processCode;
private String factoryCode;
private String factoryName;
private String carCode;
private String carName;
private String workorderCodeSap;
private String routeCode;
private String sac1;
private String sac2;
private String sac3;
private String sac4;
private String sac5;
private String sac6;
private String prodType;
private String createTimeStart;
private String createTimeEnd;
private String feedbackTimeStart;
private String feedbackTimeEnd;
public String getFeedbackTimeStart() {
return feedbackTimeStart;
}
public void setFeedbackTimeStart(String feedbackTimeStart) {
this.feedbackTimeStart = feedbackTimeStart;
}
public String getFeedbackTimeEnd() {
return feedbackTimeEnd;
}
public void setFeedbackTimeEnd(String feedbackTimeEnd) {
this.feedbackTimeEnd = feedbackTimeEnd;
}
public String getCreateTimeStart() {
return createTimeStart;
}
public void setCreateTimeStart(String createTimeStart) {
this.createTimeStart = createTimeStart;
}
public String getCreateTimeEnd() {
return createTimeEnd;
}
public void setCreateTimeEnd(String createTimeEnd) {
this.createTimeEnd = createTimeEnd;
}
public String getProdType() {
return prodType;
}
public void setProdType(String prodType) {
this.prodType = prodType;
}
public String getWorkorderCodeSap() {
return workorderCodeSap;
}
public void setWorkorderCodeSap(String workorderCodeSap) {
this.workorderCodeSap = workorderCodeSap;
}
public String getRouteCode() {
return routeCode;
}
public void setRouteCode(String routeCode) {
this.routeCode = routeCode;
}
public String getSac1() {
return sac1;
}
public void setSac1(String sac1) {
this.sac1 = sac1;
}
public String getSac2() {
return sac2;
}
public void setSac2(String sac2) {
this.sac2 = sac2;
}
public String getSac3() {
return sac3;
}
public void setSac3(String sac3) {
this.sac3 = sac3;
}
public String getSac4() {
return sac4;
}
public void setSac4(String sac4) {
this.sac4 = sac4;
}
public String getSac5() {
return sac5;
}
public void setSac5(String sac5) {
this.sac5 = sac5;
}
public String getSac6() {
return sac6;
}
public void setSac6(String sac6) {
this.sac6 = sac6;
}
public Date getUploadTime() {
return uploadTime;
}
public void setUploadTime(Date uploadTime) {
this.uploadTime = uploadTime;
}
public String getUploadStatus() {
return uploadStatus;
}
public void setUploadStatus(String uploadStatus) {
this.uploadStatus = uploadStatus;
}
public String getUploadMsg() {
return uploadMsg;
}
public void setUploadMsg(String uploadMsg) {
this.uploadMsg = uploadMsg;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public String getCarCode() {
return carCode;
}
public void setCarCode(String carCode) {
this.carCode = carCode;
}
public String getCarName() {
return carName;
}
public void setCarName(String carName) {
this.carName = carName;
}
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getProductDateStart() {
return productDateStart;
}
public void setProductDateStart(String productDateStart) {
this.productDateStart = productDateStart;
}
public String getProductDateEnd() {
return productDateEnd;
}
public void setProductDateEnd(String productDateEnd) {
this.productDateEnd = productDateEnd;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setReportType(String reportType) {
this.reportType = reportType;
}
public String getReportType() {
return reportType;
}
public void setReportCode(String reportCode) {
this.reportCode = reportCode;
}
public String getReportCode() {
return reportCode;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getSpec() {
return spec;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getUnit() {
return unit;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantityFeedback(BigDecimal quantityFeedback) {
this.quantityFeedback = quantityFeedback;
}
public BigDecimal getQuantityFeedback() {
return quantityFeedback;
}
public void setQuantityQualified(BigDecimal quantityQualified) {
this.quantityQualified = quantityQualified;
}
public BigDecimal getQuantityQualified() {
return quantityQualified;
}
public void setQuantityUnqualified(BigDecimal quantityUnqualified) {
this.quantityUnqualified = quantityUnqualified;
}
public BigDecimal getQuantityUnqualified() {
return quantityUnqualified;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserName() {
return userName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getNickName() {
return nickName;
}
public void setFeedbackChannel(String feedbackChannel) {
this.feedbackChannel = feedbackChannel;
}
public String getFeedbackChannel() {
return feedbackChannel;
}
public void setFeedbackTime(Date feedbackTime) {
this.feedbackTime = feedbackTime;
}
public Date getFeedbackTime() {
return feedbackTime;
}
public void setRecordUser(String recordUser) {
this.recordUser = recordUser;
}
public String getRecordUser() {
return recordUser;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setWorkTime(Long workTime) {
this.workTime = workTime;
}
public Long getWorkTime() {
return workTime;
}
public void setMachineCode(String machineCode) {
this.machineCode = machineCode;
}
public String getMachineCode() {
return machineCode;
}
public void setMachineName(String machineName) {
this.machineName = machineName;
}
public String getMachineName() {
return machineName;
}
public void setTeamCode(String teamCode) {
this.teamCode = teamCode;
}
public String getTeamCode() {
return teamCode;
}
public void setShiftCode(String shiftCode) {
this.shiftCode = shiftCode;
}
public String getShiftCode() {
return shiftCode;
}
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 String getProductDate() {
return productDate;
}
public void setProductDate(String productDate) {
this.productDate = productDate;
}
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getProductSpc() {
return productSpc;
}
public void setProductSpc(String productSpc) {
this.productSpc = productSpc;
}
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("reportType", getReportType())
.append("reportCode", getReportCode())
.append("workorderCode", getWorkorderCode())
.append("productCode", getProductCode())
.append("productName", getProductName())
.append("spec", getSpec())
.append("unit", getUnit())
.append("quantity", getQuantity())
.append("quantityFeedback", getQuantityFeedback())
.append("quantityQualified", getQuantityQualified())
.append("quantityUnqualified", getQuantityUnqualified())
.append("userName", getUserName())
.append("nickName", getNickName())
.append("feedbackChannel", getFeedbackChannel())
.append("feedbackTime", getFeedbackTime())
.append("recordUser", getRecordUser())
.append("status", getStatus())
.append("remark", getRemark())
.append("workTime", getWorkTime())
.append("machineCode", getMachineCode())
.append("machineName", getMachineName())
.append("teamCode", getTeamCode())
.append("shiftCode", getShiftCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -102,8 +102,27 @@ public class DevicePDAController {
/**
*
*/
// @GetMapping(value = "/{equipmentId}")
// public AjaxResult queryEquipment(@PathVariable("equipmentId") Long equipmentId) {
// return devicePDAService.selectBaseEquipmentByEquipmentId(equipmentId);
// }
@GetMapping(value = "/queryEquipment/{equipmentId}")
public AjaxResult queryEquipment(@PathVariable("equipmentId") Long equipmentId) {
return devicePDAService.selectEquEquipmentByEquEquipmentId(equipmentId);
}
/**
*
*/
@GetMapping(value = "/selectPdaRepairWorkOrderDetails/{workId}")
public AjaxResult selectPdaRepairWorkOrderDetails(@PathVariable("workId") String workId) {
return devicePDAService.selectPdaRepairWorkOrderDetails(workId);
}
/**
*
* @param equRepairWorkOrder
* @return
*/
@PutMapping("/updateMaintenanceRecords")
public AjaxResult updateMaintenanceRecords(@RequestBody EquRepairWorkOrder equRepairWorkOrder) {
return devicePDAService.updateMaintenanceRecords(equRepairWorkOrder);
}
}

@ -142,16 +142,26 @@ public class EquOrder extends BaseEntity {
private String orderInspect;
//报修单号
private String repairCode;
//维修单号
private String workCode;
public String getRepairCode() {
return repairCode;
}
public void setRepairCode(String repairCode) {
this.repairCode = repairCode;
}
public String getWorkCode() {
return workCode;
}
public void setWorkCode(String workCode) {
this.workCode = workCode;
}
public String getOrderInspect() {
return orderInspect;
}

@ -96,6 +96,9 @@ public class EquOrderStandard extends BaseEntity {
private String repairPicture;
//检查项检查方法
private String itemMethod;
public String getRepairPicture() {
return repairPicture;
}
@ -272,6 +275,14 @@ public class EquOrderStandard extends BaseEntity {
return delFlag;
}
//检查项检查方法
public void setItemMethod(String itemMethod) {
this.itemMethod = itemMethod;
}
public String getItemMethod() {
return itemMethod;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -209,7 +209,10 @@ public class EquRepairWorkOrder extends BaseEntity {
//手持
//用户id
private String userId;
//检查项列表
private List<EquOrderStandard> checkList;
//申领单列表
private List<EquSpareApply> applyList;
//报修
public void setOrderDesc(String orderDesc) {
@ -575,6 +578,20 @@ public class EquRepairWorkOrder extends BaseEntity {
return userId;
}
public List<EquOrderStandard> getCheckList() {
return checkList;
}
public void setCheckList(List<EquOrderStandard> checkList) {
this.checkList = checkList;
}
public List<EquSpareApply> getApplyList() {
return applyList;
}
public void setApplyList(List<EquSpareApply> applyList) {
this.applyList = applyList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -18,7 +18,7 @@ public interface EquEquipmentMapper {
* @param equipmentId
* @return
*/
public EquEquipment selectEquEquipmentByEquipmentId(Long equipmentId);
public EquEquipment selectEquEquipmentByEquEquipmentId(Long equipmentId);
/**
*

@ -3,6 +3,7 @@ package com.op.device.mapper;
import java.util.List;
import com.op.common.core.domain.BaseFileData;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquOrderStandard;
/**
@ -72,4 +73,11 @@ public interface EquOrderStandardMapper {
* @param files
*/
void insertBaseFileBatch(List<BaseFileData> files);
/**
*
* @param equOrder
* @return
*/
public List<EquOrderStandard> selectPdaEquOrderList(EquOrder equOrder);
}

@ -70,9 +70,23 @@ public interface IDevicePDAService {
public AjaxResult updateDowntime(EquRepairWorkOrder equRepairWorkOrder);
/**
*
*
* @param equipmentId
* @return
*/
public AjaxResult selectEquEquipmentByEquEquipmentId(Long equipmentId);
/**
*
* @param workId
* @return
*/
public AjaxResult selectPdaRepairWorkOrderDetails(String workId);
/**
*
* @param equRepairWorkOrder
* @return
*/
// AjaxResult selectBaseEquipmentByEquipmentId(Long equipmentId);
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder);
}

@ -14,6 +14,7 @@ import com.op.device.service.IDevicePDAService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -56,6 +57,10 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
@Autowired
private EquTeamMapper equTeamMapper;
@Autowired
private EquEquipmentMapper equEquipmentMapper;
@Autowired
private EquSpareApplyMapper equSpareApplyMapper;
/**
@ -345,4 +350,84 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
return error();
}
}
/**
*
*
* @param equipmentId
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult selectEquEquipmentByEquEquipmentId(Long equipmentId) {
try {
EquEquipment list = equEquipmentMapper.selectEquEquipmentByEquEquipmentId(equipmentId);
return success(list);
} catch (Exception e) {
return error();
}
}
/**
*
*
* @param workId
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult selectPdaRepairWorkOrderDetails(String workId) {
try {
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(workId);
//查询对应检查项信息
EquOrder equOrder = new EquOrder();
equOrder.setWorkCode(list.getWorkCode());
List<EquOrderStandard> checkLists = equOrderStandardMapper.selectPdaEquOrderList(equOrder);
list.setCheckList(checkLists);
//备件申领单
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
equRepairWorkOrder.setWorkCode(list.getWorkCode());
List<EquSpareApply> applyLists = equSpareApplyMapper.selectRepairSparePartsRecord(equRepairWorkOrder);
list.setApplyList(applyLists);
return success(list);
} catch (Exception e) {
return error();
}
}
/**
*
*
* @param equRepairWorkOrder
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
try {
//更新每一项点检/巡检检查项信息
List<EquOrderStandard> equOrderStandards = equRepairWorkOrder.getCheckList();
for(EquOrderStandard equOrderStandard:equOrderStandards){
equOrderStandard.setUpdateBy(SecurityUtils.getUsername());
equOrderStandard.setUpdateTime(DateUtils.getNowDate());
equOrderStandardMapper.updateEquOrderStandard(equOrderStandard);
}
//新建申领单 缺少code
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
for(EquSpareApply equSpareApply:equSpareApplies){
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
equSpareApply.setCreateBy(SecurityUtils.getUsername());
equSpareApply.setCreateTime(DateUtils.getNowDate());
equSpareApply.setApplyTime(DateUtils.getNowDate());
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
}
//维修人员名字????前端能够提供吗???
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder);
return success("提交成功,维修完成!");
} catch (Exception e) {
return error();
}
}
}

@ -138,6 +138,8 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
//不委外
equRepairWorkOrder.setWorkOutsource("0");
equRepairWorkOrder.setOutWorkCode("无");
//是否立即维修 1是 0 否
equRepairWorkOrder.setWorkHandle("0");
//计划维修时间
equRepairWorkOrder.setWorkPlanTime(equRepairOrder.getWorkPlanTime());
//是否停机维修 停机维修时间
@ -183,6 +185,9 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
equRepairOrder.setOrderStatus("审核通过");
}else if(equRepairOrder.getRepairDestination().equals("立即维修")){
//立即维修
//是否立即维修 1是 0 否
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
equRepairWorkOrder.setWorkHandle("0");
equRepairOrder.setOrderStatus("审核通过");
}
equRepairOrder.setUpdateTime(DateUtils.getNowDate());

@ -38,10 +38,11 @@
<result property="shutDown" column="shut_down" />
<result property="orderInspect" column="order_inspect" />
<result property="repairCode" column="repair_code" />
<result property="workCode" column="work_code" />
</resultMap>
<sql id="selectEquOrderVo">
select order_id, plan_id, plan_code, plan_type, order_code, plan_workshop, plan_prod_line, plan_loop, plan_loop_type, plan_loop_start, plan_loop_end, order_start, order_end, equipment_code, order_status, order_cost, plan_person, order_cost_time, order_sign_person, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,upkeep,calculation_rule,shut_down,order_inspect,repair_code from equ_order
select order_id, plan_id, plan_code, plan_type, order_code, plan_workshop, plan_prod_line, plan_loop, plan_loop_type, plan_loop_start, plan_loop_end, order_start, order_end, equipment_code, order_status, order_cost, plan_person, order_cost_time, order_sign_person, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,upkeep,calculation_rule,shut_down,order_inspect,repair_code,work_code from equ_order
</sql>
<select id="selectEquOrderList" parameterType="EquOrder" resultMap="EquOrderResult">
@ -79,6 +80,7 @@
<if test="shutDown != null "> and shut_down = #{shutDown}</if>
<if test="orderInspect != null "> and order_inspect = #{orderInspect}</if>
<if test="repairCode != null "> and repair_code = #{repairCode}</if>
<if test="workCode != null "> and work_code = #{workCode}</if>
and del_flag = '0'
</where>
</select>
@ -161,6 +163,8 @@
<if test="shutDown != null">shut_down,</if>
<if test="orderInspect != null">order_inspect,</if>
<if test="repairCode != null">repair_code,</if>
<if test="repairCode != null">repair_code,</if>
<if test="workCode != null">work_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
@ -196,6 +200,7 @@
<if test="shutDown != null">#{shutDown},</if>
<if test="orderInspect != null">#{orderInspect},</if>
<if test="repairCode != null">#{repairCode},</if>
<if test="workCode != null">#{workCode},</if>
</trim>
</insert>
@ -234,6 +239,7 @@
<if test="shutDown != null">shut_down = #{shutDown},</if>
<if test="orderInspect != null">order_inspect = #{orderInspect},</if>
<if test="repairCode != null">repair_code = #{repairCode},</if>
<if test="workCode != null">work_code = #{workCode},</if>
</trim>
where order_id = #{orderId}
</update>

@ -32,6 +32,9 @@
<result property="repairReach" column="repair_reach" />
<result property="repairValue" column="repair_value" />
<result property="repairPicture" column="repair_picture" />
<!-- 检查项检查方法-->
<result property="itemMethod" column="item_method" />
</resultMap>
<sql id="selectEquOrderStandardVo">
@ -197,4 +200,26 @@
#{id}
</foreach>
</delete>
<!--手持查询维修工单接口-->
<select id="selectPdaEquOrderList" parameterType="EquOrderStandard" resultMap="EquOrderStandardResult">
select
eos.id,
eos.order_code,
eos.standard_name,
eod.item_method,
eos.detail_up_limit,
eos.detail_down_limit,
eos.detail_unit,
eos.detail_reach,
eos.actual_value
from equ_order_standard eos
left join equ_order eo on eos.order_code = eo.order_code
left join equ_order_detail eod on eos.order_code = eod.order_code
<where>
<if test="workCode != null "> and eo.work_code = #{workCode}</if>
and eo.del_flag = '0'
and eos.error_flag = '1'
</where>
</select>
</mapper>

@ -169,8 +169,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRepairSparePartsRecord" parameterType="EquRepairWorkOrder" resultMap="EquSpareApplyResult">
<include refid="selectEquSpareApplyVo"/>
where del_flag = '0'
and work_code = #{workCode}
<where>
<if test="workCode != null and workCode != ''"> and work_code = #{workCode}</if>
and del_flag = '0'
</where>
ORDER BY apply_time DESC
</select>

@ -0,0 +1,41 @@
@echo off
echo --------------------------------自定义参数,启动前先修改--------------------------------------
set jarName=op-modules-job.jar
set profile=dev
set imageURI=192.168.202.36:30002/op-lanju/op-job
rem echo 获取当前日期字符串
for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c
rem echo 获取当前时间字符串
for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b
rem echo 如当前小时小于10将空格替换为0
set T=%T: =0%
rem echo 显示输出日期时间字符串
set imageVersion=%D%%T%
::输出发版信息
echo jar包名称:%jarName%
echo 启动环境:%profile%
echo 镜像库地址:%imageURI%
echo 镜像版本:%imageVersion%
echo --------------------------------mvn package...--------------------------------
::call mvn clean package -Dmaven.test.skip=true
cd .\target
SET df=Dockerfile
if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------创建Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile
dir
echo --------------------------------docker login...-------------------------------
docker login 192.168.202.36:30002 -u deploy -p Deploy@2023
echo --------------------------------docker build...-------------------------------
docker build -t %imageURI%:%imageVersion% .
echo --------------------------------docker push...--------------------------------
docker push %imageURI%:%imageVersion%
@pause

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile

@ -114,6 +114,11 @@ public class WCSInterfaceController extends BaseController {
if(StringUtils.isBlank(mesReportWork.getReportCode())){
return error("[reportCode] is null");
}
if(mesReportWork.getFactoryCode().indexOf("ds")<0){
mesReportWork.setFactoryCode("ds_"+mesReportWork.getFactoryCode());
}
return success(wCInterfaceService.reportWork(mesReportWork));
}

@ -412,7 +412,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
s.Shift_Desc shiftName
from pro_order_workorder pow
left join base_shifts_t s on pow.shift_id = s.Shift_Id
where pow.del_flag = '0' and pow.status != 'w3' and pow.end_flag ='1'
where pow.del_flag = '0' and pow.status = 'w2' and pow.end_flag ='1'
order by pow.product_date desc
<if test="workorderCode != null and workorderCode != ''">
and pow.workorder_code like concat('%', #{workorderCode}, '%')

@ -9,10 +9,10 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>op-modules-scada</artifactId>
<artifactId>op-modules-open</artifactId>
<description>
op-modules-scada系统模块
op-modules-open接口模块
</description>
<dependencies>

@ -0,0 +1,41 @@
@echo off
echo --------------------------------自定义参数,启动前先修改--------------------------------------
set jarName=op-modules-open.jar
set profile=dev
set imageURI=192.168.202.36:30002/op-lanju/op-open
rem echo 获取当前日期字符串
for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c
rem echo 获取当前时间字符串
for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b
rem echo 如当前小时小于10将空格替换为0
set T=%T: =0%
rem echo 显示输出日期时间字符串
set imageVersion=%D%%T%
::输出发版信息
echo jar包名称:%jarName%
echo 启动环境:%profile%
echo 镜像库地址:%imageURI%
echo 镜像版本:%imageVersion%
echo --------------------------------mvn package...--------------------------------
::call mvn clean package -Dmaven.test.skip=true
cd .\target
SET df=Dockerfile
if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------创建Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile
dir
echo --------------------------------docker login...-------------------------------
docker login 192.168.202.36:30002 -u deploy -p Deploy@2023
echo --------------------------------docker build...-------------------------------
docker build -t %imageURI%:%imageVersion% .
echo --------------------------------docker push...--------------------------------
docker push %imageURI%:%imageVersion%
@pause

@ -1,4 +1,4 @@
package com.op.wms;
package com.op.open;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -7,7 +7,7 @@ import com.op.common.security.annotation.EnableRyFeignClients;
import com.op.common.swagger.annotation.EnableCustomSwagger2;
/**
*
*
*
* @author OP
*/
@ -15,10 +15,10 @@ import com.op.common.swagger.annotation.EnableCustomSwagger2;
@EnableCustomSwagger2
@EnableRyFeignClients
@SpringBootApplication
public class ScadaApplication {
public class OpenApplication {
public static void main(String[] args) {
SpringApplication.run(ScadaApplication.class, args);
System.err.println("Scada服务启动成功\n"
SpringApplication.run(OpenApplication.class, args);
System.err.println("OPEN接口服务启动成功\n"
+ " | | \r\n"
+ " ___ _ __ ______ ___ _ _ ___| |_ ___ _ __ ___ \r\n"
+ " / _ \\| '_ \\______/ __| | | / __| __/ _ \\ '_ ` _ \\ \r\n"

@ -0,0 +1,51 @@
package com.op.open.config;
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty;
import com.op.common.core.domain.R;
import com.op.common.datasource.creator.DynamicDatasourceCreator;
import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
*
*
* @ClassName: DynamicDatasource
* @Description: TODO
* @author shichangzhou
* @date 2023419 1:01:30
*/
@Component
public class DynamicDatasource {
@Resource
private DynamicDatasourceCreator dynamicDatasourceCreator;
@Autowired
private RemoteUserService remoteUserService;
@PostConstruct
public void init() {
// 加载sf-cloud库的sys_datasource
SysUser sysUser = new SysUser();
sysUser.setUserId(1L);
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
List<Map<String, String>> dateSources = dateSources0.getData();
for (Map<String, String> dateSource : dateSources) {
DataSourceProperty sdp = new DataSourceProperty();
sdp.setUrl(dateSource.get("url"));
sdp.setUsername(dateSource.get("userName"));
sdp.setPassword(dateSource.get("password"));
sdp.setDriverClassName(dateSource.get("driveClassName"));
sdp.setPoolName(dateSource.get("poolName"));// 这是数据源的key
sdp.setLazy(false);
dynamicDatasourceCreator.createDynamicDataSource(sdp);
}
}
}

@ -0,0 +1,63 @@
package com.op.open.controller;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.open.service.OpenService;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* mes
*
* @author sf
* @date 2023-05-18
*/
@RestController
@RequestMapping("/openInterface")
public class OpenController extends BaseController {
@Autowired
private OpenService openService;
/**
*
* WCS MES
* AGV
* @param
* @return
*/
//"下一工序机台集合获取"
@PostMapping("/requestDestinationStations")
public WCSDTO requestDestinationStations(@RequestBody WCSDTO wcsdto) {
if(StringUtils.isBlank(wcsdto.getFactory())){
wcsdto.setCode("1");
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return openService.requestDestinationStations(wcsdto);
}
/**上位机报工**/
@PostMapping("/reportWork")
public AjaxResult reportWork(@RequestBody MesReportWorkDTO mesReportWork) {
if(StringUtils.isBlank(mesReportWork.getFactoryCode())){
return error("[factoryCode] is null");
}
if(StringUtils.isBlank(mesReportWork.getReportCode())){
return error("[reportCode] is null");
}
return success(openService.reportWork(mesReportWork));
}
public static void main(String args[]){
System.out.println(DateUtils.getDate());
}
}

@ -0,0 +1,42 @@
package com.op.open.mapper;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* rfidMapper
*
* @author Open Platform
* @date 2023-08-18
*/
@Mapper
public interface OpenMapper {
public ProRfidProcessDetail getRfidInfo(String rfidNo);
public String getStationType(String equipmentCode);
Integer getEquipNum(String machineCode);
String getEquipStatus(String machineCode);
String getEquipMode(String machineCode);
List<MesReportWorkDTO> getReportWorkList(MesReportWorkDTO mesReportWork);
void addSapLog(SysSapLog sysSapLog);
void updateSyncSapStatus(MesReportWorkDTO work);
MesReportWorkDTO getProdResult(MesReportWorkDTO work);
void updateWorkOrderStatus(MesReportWorkDTO work);
ProOrderWorkorderDTO getOrderByCode(String workorderCode);
}

@ -0,0 +1,18 @@
package com.op.open.service;
import com.op.common.core.domain.R;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
/**
* Service
*
* @author Open Platform
* @date 2023-07-13
*/
public interface OpenService {
WCSDTO requestDestinationStations(WCSDTO wcsdto);
R reportWork(MesReportWorkDTO mesReportWork);
}

@ -1,23 +1,35 @@
package com.op.scada.service.impl;
package com.op.open.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.bean.BeanUtils;
import com.op.scada.mapper.ScadaMapper;
import com.op.scada.service.ScadaService;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.open.mapper.OpenMapper;
import com.op.open.service.OpenService;
import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.system.api.domain.sap.SapRFW;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
@ -27,12 +39,13 @@ import java.util.stream.Collectors;
* @date 2023-07-13
*/
@Service
public class ScadaServiceImpl implements ScadaService {
public class OpenServiceImpl implements OpenService {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private ScadaMapper scadaMapper;
private OpenMapper openMapper;
@Autowired
private RemoteSapService remoteSapService;
/**
* JSON
@ -78,17 +91,17 @@ public class ScadaServiceImpl implements ScadaService {
try {
BeanUtils.copyBeanProp(dto, wcsdto);
//根据rfid跟工单绑定成型机跟工单绑定获取对应工艺。
ProRfidProcessDetail rfidInfo = scadaMapper.getRfidInfo(wcsdto.getRfidNo());
ProRfidProcessDetail rfidInfo = openMapper.getRfidInfo(wcsdto.getRfidNo());
//获取设备类型
if (rfidInfo != null && StringUtils.isNotBlank(rfidInfo.getMachineCode())) {
//设备-工艺路线的设备大范围
String[] machineCodes0 = rfidInfo.getMachineCode().split(",");
String stationType = scadaMapper.getStationType(machineCodes0[0]);
String stationType = openMapper.getStationType(machineCodes0[0]);
if (StringUtils.isNotBlank(stationType)) {
dto.setStationType(stationType);
}
//设备-根据工单获取实际规划设备路线
String machinecode = rfidInfo.getProdLineCode();//scadaMapper.getActuaEquips(rfidInfo);
String machinecode = rfidInfo.getProdLineCode();//openMapper.getActuaEquips(rfidInfo);
JSONArray codeArray = JSONArray.parseArray(machinecode);
List<String> list2 = new ArrayList<>();
for (int c1 = 0; c1 < codeArray.size(); c1++) {
@ -111,13 +124,13 @@ public class ScadaServiceImpl implements ScadaService {
wCSDataDTO = new WCSDataDTO();
if (StringUtils.isNotBlank(machineCode)) {
//设备是否正常
String status = scadaMapper.getEquipStatus(machineCode);
String status = openMapper.getEquipStatus(machineCode);
if(StringUtils.isNotBlank(status) && "1".equals(status)){//正常设备且没被删除
wCSDataDTO.setStationNo(machineCode);
if ("2".equals(stationType)) {
Integer qty = scadaMapper.getEquipNum(machineCode);
Integer qty = openMapper.getEquipNum(machineCode);
wCSDataDTO.setQty(qty == null ? 0 : qty);
String mode = scadaMapper.getEquipMode(machineCode);
String mode = openMapper.getEquipMode(machineCode);
wCSDataDTO.setFlag(mode);
}
stationNos.add(wCSDataDTO);
@ -137,6 +150,78 @@ public class ScadaServiceImpl implements ScadaService {
return dto;
}
@Override
public R reportWork(MesReportWorkDTO mesReportWork) {
DynamicDataSourceContextHolder.push("ds_"+mesReportWork.getFactoryCode());// 这是数据源的key
mesReportWork.setUploadStatus("1");//除了1报工成功的都需要报工
mesReportWork.setProdType("prod");
List<MesReportWorkDTO> reportWorks = openMapper.getReportWorkList(mesReportWork);
if(CollectionUtils.isEmpty(reportWorks)){
return R.fail("未查询到报工单");
}
MesReportWorkDTO work = reportWorks.get(0);
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量
SapRFW.lt_gs ltgs = sapRFW.new lt_gs();//生产订单报工工时修改
ltgs.setConf_activity1(work.getSac1());//人工
ltgs.setConf_activity2(work.getSac2());
ltgs.setConf_activity3(work.getSac3());//机器
ltgs.setConf_activity4(work.getSac4());
ltgs.setConf_activity5(work.getSac5());//折旧
ltgs.setConf_activity6(work.getSac6());
sapRFW.setLt_gs(ltgs);
SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改
lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO;
lthw.setMaterial(work.getProcessCode());
sapRFW.setLt_hw(lthw);
//添加调用sap日志
SysSapLog sysSapLog = new SysSapLog();
sysSapLog.setId(IdUtils.fastSimpleUUID());
sysSapLog.setMesssge(sapRFW.toString());
sysSapLog.setMethod("reportWork");
sysSapLog.setReqcode("请求");
sysSapLog.setCreateTime(DateUtils.getNowDate());
openMapper.addSapLog(sysSapLog);
R r = remoteSapService.sapRFWOrder(sapRFW);
//上传成功更改mes_report_work状态
if (r.getCode() == 200) {
work.setUploadStatus("1");
} else {
work.setUploadStatus("2");
work.setUploadMsg(r.getMsg());
}
work.setUploadTime(DateUtils.getNowDate());
openMapper.updateSyncSapStatus(work);
//工单完成数量>工单数量:关闭订单
MesReportWorkDTO proResult = openMapper.getProdResult(work);
ProOrderWorkorderDTO topOrder = this.getTopOrder(work.getWorkorderCode());
if(proResult.getQuantityFeedback().compareTo(new BigDecimal(topOrder.getQuantitySplit()))>=0){
//工单完成,关闭工单
remoteSapService.sapCloseOrder(work.getWorkorderCodeSap());
work.setStatus("w3");
work.setUpdateTime(DateUtils.getNowDate());
//pro_work_order status->w4报工
openMapper.updateWorkOrderStatus(work);
}
return R.ok();
}
//根据工单子单编码获取最顶级订单的母单
private ProOrderWorkorderDTO getTopOrder(String workorderCode) {
//pro_order_workorder
ProOrderWorkorderDTO topOrder = openMapper.getOrderByCode(workorderCode);
while (!"0".equals(topOrder.getParentOrder()) && StringUtils.isNotEmpty(topOrder.getParentOrder())) {
//pro_order_workorder
topOrder = openMapper.getOrderByCode(topOrder.getParentOrder());
}
return topOrder;
}
public static void main(String args[]){
DateTimeFormatter ymdhms = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate today = LocalDate.now();

@ -1,12 +1,12 @@
# Tomcat
server:
port: 9211
port: 9214
# Spring
spring:
application:
# 应用名称
name: op-scada
name: op-open
profiles:
# 环境配置
active: dev

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.open.mapper.OpenMapper">
<insert id="addSapLog">
insert into sys_sap_log
(id,messsge,create_time,reqcode,method,remark,status)
values(
#{id},#{messsge}, #{createTime}, #{reqcode},#{method},#{remark},#{status})
</insert>
<update id="updateSyncSapStatus">
update mes_report_work
<trim prefix="SET" suffixOverrides=",">
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
<if test="uploadStatus != null">upload_status = #{uploadStatus},</if>
<if test="uploadMsg != null">upload_msg = #{uploadMsg},</if>
</trim>
where 1=1
<if test="id != null">
and id = #{id}
</if>
<if test="reportCode != null">
and report_code = #{reportCode}
</if>
</update>
<update id="updateWorkOrderStatus">
update pro_order_workorder set status = #{status} where workorder_code = #{workorderCode}
</update>
<!--获取在邦rfid 工单的信息-->
<select id="getRfidInfo" resultType="com.op.system.api.domain.mes.ProRfidProcessDetail">
select
top 1
rfid.workorder_code workorderCode,
rfid.now_process_id nowProcessId,
rfid.next_process_id nextProcessId,
p.equipment machineCode,
bp.product_code productCode,
bp.product_model productModel,
w.prod_line_code prodLineCode
from pro_rfid_process_detail rfid
left join pro_process p on p.process_id = rfid.next_process_id
left join pro_order_workorder w on w.workorder_code = rfid.workorder_code
left join base_product bp on bp.product_code = w.product_code
where rfid.bind_status = '1'
and rfid.rfid = #{rfidNo}
order by rfid.create_time desc
</select>
<select id="getStationType" resultType="java.lang.String">
select
case when equipment_type_code ='equ_type_spj' then '3'
when equipment_type_code ='equ_type_hf' then '2'
else '' end
from base_equipment
where equipment_code = #{equipmentCode}
</select>
<select id="getEquipNum" resultType="java.lang.Integer">
select isvalue from base_equipment_attached
where property = 'dollyNumber'
and device_code = #{machineCode}
</select>
<select id="getEquipStatus" resultType="java.lang.String">
select status from base_equipment where equipment_code = #{machineCode} and del_flag = '0'
</select>
<select id="getEquipMode" resultType="java.lang.String">
select isvalue from base_equipment_attached
where property = 'Mode'
and device_code = #{machineCode}
</select>
<select id="getReportWorkList" resultType="com.op.system.api.domain.mes.MesReportWorkDTO">
select ow.order_code orderCode,
ow.workorder_code workorderCode,
ow.workorder_code_sap workorderCodeSap,
ow.route_code routeCode,
rte.tec_machine sac1,
rte.tec_man sac2,
rte.tec_depreciation sac3,
rte.tec_other sac4,
rte.tec_conf_acivity5 sac5,
rte.tec_conf_acivity6 sac6,
mrw.id,
mrw.quantity_feedback quantityFeedback,
mrw.product_code productCode,
mrw.product_name productName
from mes_report_work mrw
left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code
left join pro_route rte on rte.route_code = ow.route_code
where mrw.upload_status != #{uploadStatus} and mrw.prod_type = #{prodType}
<if test="reportCode != null ">
and mrw.report_code = #{reportCode}
</if>
order by mrw.create_time
</select>
<select id="getProdResult" resultType="com.op.system.api.domain.mes.MesReportWorkDTO">
select
mrw.workorder_code workorderCode,
sum(mrw.quantity_feedback) quantityFeedback
from mes_report_work mrw
where mrw.del_flag = '0' and mrw.workorder_code = #{workorderCode}
group by mrw.workorder_code
</select>
<select id="getOrderByCode" resultType="com.op.system.api.domain.mes.ProOrderWorkorderDTO">
select workorder_code workorderCode,
parent_order parentOrder,
quantity_split quantitySplit,
unit
from pro_order_workorder where workorder_code = #{workorderCode}
</select>
</mapper>

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile

@ -448,8 +448,14 @@ public class ProOrderServiceImpl implements IProOrderService {
public String syncImportFunc(List<ProOrder> newOrders){
String failOrder = "";
for (ProOrder proOrder:newOrders) {
proOrder.setProdType("white");//只有白坯有导入
failOrder += syncFunc(proOrder)+",";
//prodType->@Excel(name = "产品类型", readConverterExp = "white=白坯,prod=成品")
proOrder.setCreateBy(SecurityUtils.getUsername());
proOrder.setSyncUser("import");
proOrder.setPlanFactoryCode(proOrder.getFactoryCode());
String msg = syncFunc(proOrder);
if(StringUtils.isNotBlank(msg)){
failOrder += msg+",";
}
}
return failOrder;
}
@ -987,7 +993,7 @@ public class ProOrderServiceImpl implements IProOrderService {
// 循环遍历校验数据是否为空
for (ProOrder proOrder : orderList) {
// 计划工厂
if (proOrder.getPlanFactoryCode().isEmpty() || proOrder.getPlanFactoryCode() == null) {
if (proOrder.getFactoryCode().isEmpty() || proOrder.getFactoryCode() == null) {
return error(500, "计划工厂信息不能为空!信息导入失败!");
}
// 订单号
@ -1026,6 +1032,7 @@ public class ProOrderServiceImpl implements IProOrderService {
if (proOrder.getPlanComplete() == null || StringUtils.isNull(proOrder.getPlanComplete())) {
return error(500, "计划完成日期不能为空!信息导入失败!");
}
}
return success();
}

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -0,0 +1,72 @@
package com.op.quality.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
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.QcStaticTable;
import com.op.quality.service.IQcStaticTableService;
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 2023-11-08
*/
@RestController
@RequestMapping("/staticTable")
public class QcStaticTableController extends BaseController {
@Autowired
private IQcStaticTableService qcStaticTableService;
/**
*
*/
@RequiresPermissions("quality:qcTableIncome:list")
@GetMapping("/getIncomeTableList")
public TableDataInfo getIncomeTableList(QcStaticTable qcStaticTable) {
startPage();
List<QcStaticTable> list = qcStaticTableService.selectQcStaticTableList(qcStaticTable);
return getDataTable(list);
}
@RequiresPermissions("quality:qcTableIncome:list")
@Log(title = "质量系统报", businessType = BusinessType.EXPORT)
@PostMapping("/exportIncomeTableList")
public void exportIncomeTableList(HttpServletResponse response, QcStaticTable qcStaticTable) {
List<QcStaticTable> list = qcStaticTableService.selectQcStaticTableList(qcStaticTable);
ExcelUtil<QcStaticTable> util = new ExcelUtil<QcStaticTable>(QcStaticTable.class);
util.exportExcel(response, list, "质量系统报数据");
}
/**
*
*/
@RequiresPermissions("quality:gcTableProduce:list")
@GetMapping("/getProduceTableList")
public TableDataInfo getProduceList(QcStaticTable qcStaticTable) {
startPage();
List<QcStaticTable> list = qcStaticTableService.selectQcStaticTableList(qcStaticTable);
return getDataTable(list);
}
@RequiresPermissions("quality:gcTableProduce:list")
@Log(title = "质量系统报", businessType = BusinessType.EXPORT)
@PostMapping("/exportTableList")
public void exportTableList(HttpServletResponse response, QcStaticTable qcStaticTable) {
List<QcStaticTable> list = qcStaticTableService.selectQcStaticTableList(qcStaticTable);
ExcelUtil<QcStaticTable> util = new ExcelUtil<QcStaticTable>(QcStaticTable.class);
util.exportExcel(response, list, "质量系统报数据");
}
}

@ -0,0 +1,123 @@
package com.op.quality.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* qc_static_table
*
* @author Open Platform
* @date 2023-11-08
*/
public class QcStaticTable extends BaseEntity {
private static final long serialVersionUID = 1L;
/** ID */
private String id;
/** 文件名称 */
@Excel(name = "文件名称")
private String fileName;
/** 文件地址 */
@Excel(name = "文件地址")
private String fileAddress;
/** 版本号 */
@Excel(name = "版本号")
private String version;
/** 备用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;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileName() {
return fileName;
}
public void setFileAddress(String fileAddress) {
this.fileAddress = fileAddress;
}
public String getFileAddress() {
return fileAddress;
}
public void setVersion(String version) {
this.version = version;
}
public String getVersion() {
return version;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fileName", getFileName())
.append("fileAddress", getFileAddress())
.append("version", getVersion())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -0,0 +1,25 @@
package com.op.quality.mapper;
import java.util.List;
import com.op.quality.domain.QcStaticTable;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
* @author Open Platform
* @date 2023-11-08
*/
@Mapper
public interface QcStaticTableMapper {
/**
*
*
* @param qcStaticTable
* @return
*/
public List<QcStaticTable> selectQcStaticTableList(QcStaticTable qcStaticTable);
}

@ -0,0 +1,22 @@
package com.op.quality.service;
import java.util.List;
import com.op.quality.domain.QcStaticTable;
/**
* Service
*
* @author Open Platform
* @date 2023-11-08
*/
public interface IQcStaticTableService {
/**
*
*
* @param qcStaticTable
* @return
*/
public List<QcStaticTable> selectQcStaticTableList(QcStaticTable qcStaticTable);
}

@ -0,0 +1,36 @@
package com.op.quality.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.quality.mapper.QcStaticTableMapper;
import com.op.quality.domain.QcStaticTable;
import com.op.quality.service.IQcStaticTableService;
/**
* Service
*
* @author Open Platform
* @date 2023-11-08
*/
@Service
public class QcStaticTableServiceImpl implements IQcStaticTableService {
@Autowired
private QcStaticTableMapper qcStaticTableMapper;
/**
*
*
* @param qcStaticTable
* @return
*/
@Override
@DS("#header.poolName")
public List<QcStaticTable> selectQcStaticTableList(QcStaticTable qcStaticTable) {
return qcStaticTableMapper.selectQcStaticTableList(qcStaticTable);
}
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcStaticTableMapper">
<select id="selectQcStaticTableList" parameterType="QcStaticTable" resultType="QcStaticTable">
</select>
</mapper>

@ -1,27 +0,0 @@
package com.op.scada.mapper;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* rfidMapper
*
* @author Open Platform
* @date 2023-08-18
*/
@Mapper
public interface ScadaMapper {
public ProRfidProcessDetail getRfidInfo(String rfidNo);
public String getStationType(String equipmentCode);
Integer getEquipNum(String machineCode);
String getEquipStatus(String machineCode);
String getEquipMode(String machineCode);
}

@ -1,18 +0,0 @@
package com.op.scada.service;
import com.op.system.api.domain.dto.WCSDTO;
import java.util.List;
import java.util.Map;
/**
* Service
*
* @author Open Platform
* @date 2023-07-13
*/
public interface ScadaService {
WCSDTO requestDestinationStations(WCSDTO wcsdto);
}

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.scada.mapper.ScadaMapper">
<!--获取在邦rfid 工单的信息-->
<select id="getRfidInfo" resultType="com.op.system.api.domain.mes.ProRfidProcessDetail">
select
top 1
rfid.workorder_code workorderCode,
rfid.now_process_id nowProcessId,
rfid.next_process_id nextProcessId,
p.equipment machineCode,
bp.product_code productCode,
bp.product_model productModel,
w.prod_line_code prodLineCode
from pro_rfid_process_detail rfid
left join pro_process p on p.process_id = rfid.next_process_id
left join pro_order_workorder w on w.workorder_code = rfid.workorder_code
left join base_product bp on bp.product_code = w.product_code
where rfid.bind_status = '1'
and rfid.rfid = #{rfidNo}
order by rfid.create_time desc
</select>
<select id="getStationType" resultType="java.lang.String">
select
case when equipment_type_code ='equ_type_spj' then '3'
when equipment_type_code ='equ_type_hf' then '2'
else '' end
from base_equipment
where equipment_code = #{equipmentCode}
</select>
<select id="getEquipNum" resultType="java.lang.Integer">
select isvalue from base_equipment_attached
where property = 'dollyNumber'
and device_code = #{machineCode}
</select>
<select id="getEquipStatus" resultType="java.lang.String">
select status from base_equipment where equipment_code = #{machineCode} and del_flag = '0'
</select>
<select id="getEquipMode" resultType="java.lang.String">
select isvalue from base_equipment_attached
where property = 'Mode'
and device_code = #{machineCode}
</select>
</mapper>

@ -1,9 +1,8 @@
package com.op.scada.controller;
package com.op.security.controller;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.controller.BaseController;
import com.op.scada.service.ScadaService;
import com.op.system.api.domain.dto.WCSDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -21,9 +20,6 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/scadaInterface")
public class ScadaController extends BaseController {
@Autowired
private ScadaService scadaService;
/**
*
@ -40,7 +36,7 @@ public class ScadaController extends BaseController {
wcsdto.setMessage("factory is not null");
return wcsdto;
}
return scadaService.requestDestinationStations(wcsdto);
return null;
}

@ -0,0 +1,41 @@
@echo off
echo --------------------------------自定义参数,启动前先修改--------------------------------------
set jarName=op-modules-system.jar
set profile=dev
set imageURI=192.168.202.36:30002/op-lanju/op-system
rem echo 获取当前日期字符串
for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c
rem echo 获取当前时间字符串
for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b
rem echo 如当前小时小于10将空格替换为0
set T=%T: =0%
rem echo 显示输出日期时间字符串
set imageVersion=%D%%T%
::输出发版信息
echo jar包名称:%jarName%
echo 启动环境:%profile%
echo 镜像库地址:%imageURI%
echo 镜像版本:%imageVersion%
echo --------------------------------mvn package...--------------------------------
::call mvn clean package -Dmaven.test.skip=true
cd .\target
SET df=Dockerfile
if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------创建Dockerfile--------------------------------
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile
dir
echo --------------------------------docker login...-------------------------------
docker login 192.168.202.36:30002 -u deploy -p Deploy@2023
echo --------------------------------docker build...-------------------------------
docker build -t %imageURI%:%imageVersion% .
echo --------------------------------docker push...--------------------------------
docker push %imageURI%:%imageVersion%
@pause

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -26,7 +26,8 @@ if exist %df% (
del /f /s /q .\Dockerfile
)
echo --------------------------------´´½¨Dockerfile--------------------------------
echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile
echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile
echo COPY %jarName% /application.jar >> Dockerfile
echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile
echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile

@ -21,8 +21,8 @@
<module>op-device</module>
<module>op-energy</module>
<module>op-quality</module>
<module>op-scada</module>
<module>op-security</module>
<module>op-open</module>
</modules>
<artifactId>op-modules</artifactId>

Loading…
Cancel
Save