Merge remote-tracking branch 'origin/master'

highway
chj 2 years ago
commit 4b6bf5fa3c

@ -32,4 +32,7 @@ public interface RemoteMesService {
/**获取领料单**/
@PostMapping("/prepare/getMesPrepare")
public R getMesPrepare();
@PostMapping("/prepare/reportWorkTask")
public R reportWorkTask();
}

@ -31,4 +31,5 @@ public interface RemotePlanService {
@PostMapping("/order/syncSAPOrders")
public R syncSAPOrders();
}

@ -34,7 +34,7 @@ public class ProRfidProcessDetail extends BaseEntity {
/** 机台编码 */
@Excel(name = "机台编码")
private String machineCode;
private String prodLineCode;
/** 当前步 */
@Excel(name = "当前步")
private String nowProcessId;
@ -87,6 +87,14 @@ public class ProRfidProcessDetail extends BaseEntity {
private String productCode;
private String productModel;
public String getProdLineCode() {
return prodLineCode;
}
public void setProdLineCode(String prodLineCode) {
this.prodLineCode = prodLineCode;
}
public String getProductCode() {
return productCode;
}

@ -0,0 +1,279 @@
package com.op.system.api.domain.sap;
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;
/**
* base_supplier
*
* @author Open Platform
* @date 2023-07-18
*/
public class SapBaseSupplier extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键uuid */
private String supplierId;
/** 供应商代码 */
@Excel(name = "供应商代码")
private String supplierCode;
/** 中文描述 */
@Excel(name = "中文描述")
private String zhDesc;
/** 英文描述 */
@Excel(name = "英文描述")
private String enDesc;
/** 供应商类型 */
@Excel(name = "供应商类型")
private String supplierType;
/** 账号 */
@Excel(name = "账号")
private String accountNumber;
/** 证照编码 */
@Excel(name = "证照编码")
private String licenceNumber;
/** 经营范围 */
@Excel(name = "经营范围")
private String businessScope;
/** 省 */
@Excel(name = "省")
private String province;
/** 市 */
@Excel(name = "市")
private String city;
/** 区 */
@Excel(name = "区")
private String area;
/** 详细地址 */
@Excel(name = "详细地址")
private String address;
/** 邮编 */
@Excel(name = "邮编")
private String postcode;
/** 联系人 */
@Excel(name = "联系人")
private String contact;
/** 联系人电话 */
@Excel(name = "联系人电话")
private String contactPhone;
/** 联系人职务 */
@Excel(name = "联系人职务")
private String contactPosition;
/** 联系人电子邮件 */
@Excel(name = "联系人电子邮件")
private String contactEmail;
/** 激活标记 */
@Excel(name = "激活标记")
private String activeFlag;
/** 用户自定义1--国家 */
@Excel(name = "用户自定义1--国家")
private String userDefined1;
/** 用户自定义2--税号 */
@Excel(name = "用户自定义2--税号")
private String userDefined2;
/** 用户自定义3 */
@Excel(name = "用户自定义3")
private String userDefined3;
public void setSupplierId(String supplierId) {
this.supplierId = supplierId;
}
public String getSupplierId() {
return supplierId;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierCode() {
return supplierCode;
}
public void setZhDesc(String zhDesc) {
this.zhDesc = zhDesc;
}
public String getZhDesc() {
return zhDesc;
}
public void setEnDesc(String enDesc) {
this.enDesc = enDesc;
}
public String getEnDesc() {
return enDesc;
}
public void setSupplierType(String supplierType) {
this.supplierType = supplierType;
}
public String getSupplierType() {
return supplierType;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public String getAccountNumber() {
return accountNumber;
}
public void setLicenceNumber(String licenceNumber) {
this.licenceNumber = licenceNumber;
}
public String getLicenceNumber() {
return licenceNumber;
}
public void setBusinessScope(String businessScope) {
this.businessScope = businessScope;
}
public String getBusinessScope() {
return businessScope;
}
public void setProvince(String province) {
this.province = province;
}
public String getProvince() {
return province;
}
public void setCity(String city) {
this.city = city;
}
public String getCity() {
return city;
}
public void setArea(String area) {
this.area = area;
}
public String getArea() {
return area;
}
public void setAddress(String address) {
this.address = address;
}
public String getAddress() {
return address;
}
public void setPostcode(String postcode) {
this.postcode = postcode;
}
public String getPostcode() {
return postcode;
}
public void setContact(String contact) {
this.contact = contact;
}
public String getContact() {
return contact;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getContactPhone() {
return contactPhone;
}
public void setContactPosition(String contactPosition) {
this.contactPosition = contactPosition;
}
public String getContactPosition() {
return contactPosition;
}
public void setContactEmail(String contactEmail) {
this.contactEmail = contactEmail;
}
public String getContactEmail() {
return contactEmail;
}
public void setActiveFlag(String activeFlag) {
this.activeFlag = activeFlag;
}
public String getActiveFlag() {
return activeFlag;
}
public void setUserDefined1(String userDefined1) {
this.userDefined1 = userDefined1;
}
public String getUserDefined1() {
return userDefined1;
}
public void setUserDefined2(String userDefined2) {
this.userDefined2 = userDefined2;
}
public String getUserDefined2() {
return userDefined2;
}
public void setUserDefined3(String userDefined3) {
this.userDefined3 = userDefined3;
}
public String getUserDefined3() {
return userDefined3;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("supplierId", getSupplierId())
.append("supplierCode", getSupplierCode())
.append("zhDesc", getZhDesc())
.append("enDesc", getEnDesc())
.append("supplierType", getSupplierType())
.append("accountNumber", getAccountNumber())
.append("licenceNumber", getLicenceNumber())
.append("businessScope", getBusinessScope())
.append("province", getProvince())
.append("city", getCity())
.append("area", getArea())
.append("address", getAddress())
.append("postcode", getPostcode())
.append("contact", getContact())
.append("contactPhone", getContactPhone())
.append("contactPosition", getContactPosition())
.append("contactEmail", getContactEmail())
.append("activeFlag", getActiveFlag())
.append("userDefined1", getUserDefined1())
.append("userDefined2", getUserDefined2())
.append("userDefined3", getUserDefined3())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -40,6 +40,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
public R getMesPrepare() {
return R.fail("领料单获取失败:" + throwable.getMessage());
}
@Override
public R reportWorkTask() {
return R.fail("报工失败:" + throwable.getMessage());
}
};
}
}

@ -7,6 +7,8 @@ import com.op.system.api.RemoteMesService;
import com.op.system.api.RemotePlanService;
import com.op.system.api.RemoteSapService;
import com.op.system.api.model.SapProOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.op.common.core.utils.StringUtils;
@ -18,7 +20,7 @@ import com.op.common.core.utils.StringUtils;
*/
@Component("ryTask")
public class RyTask {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private RemoteMesService remoteMesService;
@ -51,14 +53,14 @@ public class RyTask {
* 0 00 22 * * ?
*/
public void getMesPrepareTask(){
System.out.println("++同步领料单+开始++getMesPrepareTask+++++");
logger.info("++同步领料单+开始++getMesPrepareTask+++++");
remoteMesService.getMesPrepare();
}
/**1
* 0 0 1 * * ?
*/
public void getRouteTask(){
System.out.println("++同步工艺+开始++getRouteTask+++++");
logger.info("++同步工艺+开始++getRouteTask+++++");
remoteSapService.sapRouterSync();
}
@ -66,7 +68,13 @@ public class RyTask {
* 0 00 21 * * ?
*/
public void getTOrderTask(){
System.out.println("++同步今日订单+开始++getTOrderTask+++++");
logger.info("++同步今日订单+开始++getTOrderTask+++++");
remotePlanService.syncSAPOrders();
}
/**每5分钟报工一次**/
public void reportWorkTask(){
logger.info("++报工接口+开始++reportWorkTask+++++");
remoteMesService.reportWorkTask();
}
}

@ -106,4 +106,10 @@ public class MesPrepareController extends BaseController {
return mesPrepareService.getMesPrepare();
}
@Log(title = "报工", businessType = BusinessType.SAP)
@PostMapping("/reportWorkTask")
public R reportWorkTask() {
return mesPrepareService.reportWorkTask();
}
}

@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.mes.domain.MesDailyReport;
import com.op.mes.domain.MesProcessReport;
import com.op.mes.domain.MesReportProduction;
import org.springframework.beans.factory.annotation.Autowired;
@ -146,6 +147,17 @@ public class MesReportWorkController extends BaseController {
ExcelUtil<MesReportProduction> util = new ExcelUtil<MesReportProduction>(MesReportProduction.class);
util.exportExcel(response, list, "工单各工序完成数据");
}
/**
*
*/
@RequiresPermissions("mes:production:list")
@GetMapping("/getDailyReport")
public TableDataInfo getDailyReport(MesDailyReport mesDailyReport) {
startPage();
List<MesDailyReport> list = mesReportWorkService.getDailyReport(mesDailyReport);
return getDataTable(list);
}
}

@ -0,0 +1,560 @@
package com.op.mes.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
* mes_report_work
*
* @author Open Platform
* @date 2023-08-24
*/
public class MesDailyReport extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 记录id */
private String id;
/** 报工类型报工类型SELF自行报工、UNI统一报工 */
@Excel(name = "报工类型报工类型SELF自行报工、UNI统一报工")
private String reportType;
/** 报工单编号 */
@Excel(name = "报工单编号")
private String reportCode;
/** 生产工单编码 */
@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;
/** 预留字段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 Date uploadTime;
private String uploadStatus;
private String uploadMsg;
private String workorderCodeSap;
private String routeCode;
private String sac1;
private String sac2;
private String sac3;
private String sac4;
private String sac5;
private String sac6;
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();
}
}

@ -140,6 +140,105 @@ public class MesReportWork extends BaseEntity {
private String factoryName;
private String carCode;
private String carName;
private Date uploadTime;
private String uploadStatus;
private String uploadMsg;
private String workorderCodeSap;
private String routeCode;
private String sac1;
private String sac2;
private String sac3;
private String sac4;
private String sac5;
private String sac6;
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;

@ -2,6 +2,7 @@ package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesDailyReport;
import com.op.mes.domain.MesProcessReport;
import com.op.mes.domain.MesReportProduction;
import com.op.mes.domain.MesReportWork;
@ -64,4 +65,10 @@ public interface MesReportWorkMapper {
public List<MesProcessReport> getProcessFinishList(MesProcessReport mesReportWork);
public List<MesReportProduction> getProductionList(MesReportProduction mesReportProduction);
public List<MesReportWork> getReportWorkList(MesReportWork mesReportWork);
public void updateSyncSapStatus(MesReportWork work);
public List<MesDailyReport> getDailyReport(MesDailyReport mesDailyReport);
}

@ -64,4 +64,6 @@ public interface ProRfidProcessDetailMapper {
public ProRfidProcessDetail getRfidInfo(String rfidNo);
public String getStationType(String equipmentCode);
String getActuaEquips(ProRfidProcessDetail rfidInfo);
}

@ -61,4 +61,6 @@ public interface IMesPrepareService {
public int deleteMesPrepareByPrepareId(String prepareId);
public R getMesPrepare();
public R reportWorkTask();
}

@ -2,6 +2,7 @@ package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesDailyReport;
import com.op.mes.domain.MesProcessReport;
import com.op.mes.domain.MesReportProduction;
import com.op.mes.domain.MesReportWork;
@ -64,4 +65,6 @@ public interface IMesReportWorkService {
public List<MesProcessReport> getProcessFinishList(MesProcessReport mesReportWork);
public List<MesReportProduction> getProductionList(MesReportProduction mesReportProduction);
public List<MesDailyReport> getDailyReport(MesDailyReport mesDailyReport);
}

@ -1,5 +1,6 @@
package com.op.mes.service.impl;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.bean.BeanUtils;
@ -20,7 +21,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* wcs
@ -83,17 +86,33 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
ProRfidProcessDetail rfidInfo = proRfidProcessDetailMapper.getRfidInfo(wcsdto.getRfidNo());
//获取设备类型
if(rfidInfo!=null && StringUtils.isNotBlank(rfidInfo.getMachineCode())){
String[] machineCodes = rfidInfo.getMachineCode().split(",");
String stationType = proRfidProcessDetailMapper.getStationType(machineCodes[0]);
//设备-工艺路线的设备大范围
String[] machineCodes0 = rfidInfo.getMachineCode().split(",");
String stationType = proRfidProcessDetailMapper.getStationType(machineCodes0[0]);
if(StringUtils.isNotBlank(stationType)){
dto.setStationType(stationType);
}
//设备-根据工单获取实际规划设备路线
String machinecode = rfidInfo.getProdLineCode();//proRfidProcessDetailMapper.getActuaEquips(rfidInfo);
JSONArray codeArray = JSONArray.parseArray(machinecode);
List<String> list2 = new ArrayList<>();
for(int c1=0;c1<codeArray.size();c1++){
String equipCode0 = codeArray.getJSONArray(c1).getString(1);
list2.add(equipCode0);
}
//取交集
List<String> list1 = Arrays.asList(machineCodes0);
List<String> machineArray = list1.stream()
.filter(u1-> list2.contains(u1))
.collect(Collectors.toList());
dto.setSku(rfidInfo.getProductCode());
dto.setSpec(rfidInfo.getProductModel());
dto.setProductionState(rfidInfo.getNowProcessId());
List<WCSDataDTO> stationNos = new ArrayList<>();
WCSDataDTO wCSDataDTO = null;
for(String machineCode:machineCodes){
for(String machineCode:machineArray){
wCSDataDTO = new WCSDataDTO();
if(StringUtils.isNotBlank(machineCode)){
wCSDataDTO.setStationNo(machineCode);
@ -104,5 +123,19 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
return dto;
}
public static void main(String args[]){
String machinecode1 = "[[\"GX01\",\"LG2\"],[\"GX01\",\"LG3\"],[\"GX02\",\"S1\"],[\"GX02\",\"S2\"],[\"GX03\",\"HF01\"],[\"GX04\",\"SPJ01\"]]";
JSONArray codeArray1 = JSONArray.parseArray(machinecode1);
String[] machineCodes1 = new String[codeArray1.size()];
for(int c1=0;c1<codeArray1.size();c1++){
machineCodes1[c1] = codeArray1.getJSONArray(c1).getString(1);
}
String[] machinecode0 = "LG1,LG2,LG3".split(",");
List<String> list1 = Arrays.asList(machinecode0);
List<String> list2 = Arrays.asList(machineCodes1);
List<String> machineArray = list2.stream()
.filter(u1-> list1.contains(u1))
.collect(Collectors.toList());
System.out.println(machineArray.toString());
}
}

@ -14,11 +14,14 @@ 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.mes.domain.MesPrepareDetail;
import com.op.mes.domain.MesReportWork;
import com.op.mes.mapper.MesPrepareDetailMapper;
import com.op.mes.mapper.MesReportWorkMapper;
import com.op.system.api.RemoteSapService;
import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.sap.SapMaterialPreparation;
import com.op.system.api.domain.sap.SapRFW;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -46,6 +49,8 @@ public class MesPrepareServiceImpl implements IMesPrepareService {
private RemoteUserService remoteUserService;
@Autowired
private MesPrepareDetailMapper mesPrepareDetailMapper;
@Autowired
private MesReportWorkMapper mesReportWorkMapper;
/**
*
@ -216,6 +221,64 @@ public class MesPrepareServiceImpl implements IMesPrepareService {
}
@Override
public R reportWorkTask() {
// 加载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();
ExecutorService executorService = new ThreadPoolExecutor(
dateSources.size(),
dateSources.size(),
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>());
try {
dateSources.forEach(dateSource -> {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++报工开始++++++++++");
Runnable run = () -> reportWorkByFactory(dateSource.get("poolName"));
executorService.execute(run);
});
} catch (Exception e) {
logger.error("service == deviceOfflineTimingTask == exception", e);
return R.fail("service == deviceOfflineTimingTask == exception");
} finally {
executorService.shutdown();
}
return R.ok(true);
}
//报工
public void reportWorkByFactory(String poolName) {
DynamicDataSourceContextHolder.push(poolName);// 这是数据源的key
MesReportWork mesReportWork = new MesReportWork();
mesReportWork.setUploadStatus("1");//除了1报工成功的都需要报工
List<MesReportWork> reportWorks = mesReportWorkMapper.getReportWorkList(mesReportWork);
for(MesReportWork work:reportWorks){
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量
SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改
ltgs.setConf_activity1(work.getSac1());
ltgs.setConf_activity2(work.getSac2());
ltgs.setConf_activity3(work.getSac3());
ltgs.setConf_activity4(work.getSac4());
ltgs.setConf_activity5(work.getSac5());
ltgs.setConf_activity6(work.getSac6());
SapRFW.lt_hw lthw = sapRFW.getLt_hw();//MES生产订单报工货物移动修改
lthw.setEntry_qnt(work.getQuantityFeedback().toString());
lthw.setMaterial(work.getProcessCode());
R r = remoteSapService.sapRFWOrder(sapRFW);
//上传成功更改mes_report_work状态
if(r.getCode() == 200){
work.setUploadStatus("1");
}else{
work.setUploadStatus("2");
work.setUploadMsg(r.getMsg());
}
work.setUploadTime(DateUtils.getNowDate());
mesReportWorkMapper.updateSyncSapStatus(work);
}
}
public static void main(String args[]) {
List<SapMaterialPreparation> list = new ArrayList<>();
SapMaterialPreparation p1 = new SapMaterialPreparation();

@ -6,6 +6,7 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.mes.domain.MesDailyReport;
import com.op.mes.domain.MesProcessReport;
import com.op.mes.domain.MesReportProduction;
import org.springframework.beans.factory.annotation.Autowired;
@ -166,4 +167,10 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
return mesReportWorkMapper.getProductionList(mesReportProduction);
}
@Override
@DS("#header.poolName")
public List<MesDailyReport> getDailyReport(MesDailyReport mesDailyReport) {
return mesReportWorkMapper.getDailyReport(mesDailyReport);
}
}

@ -156,8 +156,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productDateStart != null "> and CONVERT(varchar(10),mrw.feedback_time, 120) >= #{productDateStart}</if>
<if test="productDateEnd != null "> and #{productDateEnd} >= CONVERT(varchar(10),mrw.feedback_time, 120)</if>
</select>
<select id="getReportWorkList" resultType="com.op.mes.domain.MesReportWork">
select 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}
order by mrw.create_time
</select>
<select id="getDailyReport" resultType="com.op.mes.domain.MesDailyReport">
select
mrw.team_code,
tm.Team_Desc,
mrw.prod_type,
tm.team_leader_name,
mrw.product_code,
mrw.spec,
mrw.product_name,
mrw.unit,
mrw.quantity,
mrw.quantity_feedback,
bpa.iei,
bpa.man_standar,
mrw.use_man,
mrw.work_time
from pro_order_workorder ow
left join mes_report_work mrw on ow.workorder_code = mrw.workorder_code
left join base_team_t tm on mrw.team_code = tm.Team_Code
left join base_product_attached bpa on bpa.product_code = mrw.product_code
where ow.product_date = CONVERT(varchar(100), GETDATE(), 23)
and mrw.work_center = ''
order by
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
@ -263,6 +306,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<update id="updateSyncSapStatus">
update mes_report_work
<trim prefix="SET" suffixOverrides=",">
<if test="uploadTime != null and uploadTime != ''">upload_time = #{uploadTime},</if>
<if test="uploadStatus != null">upload_status = #{uploadStatus},</if>
<if test="uploadMsg != null">upload_msg = #{uploadMsg},</if>
</trim>
where id = #{id}
</update>

@ -70,7 +70,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
rfid.next_process_id nextProcessId,
p.equipment machineCode,
bp.product_code productCode,
bp.product_model productModel
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
@ -85,6 +86,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from base_equipment
where equipment_code = #{equipmentCode}
</select>
<select id="getActuaEquips" resultType="java.lang.String">
select prod_line_code
from pro_order_workorder
where workorder_code = #{workorderCode}
</select>
<insert id="insertProRfidProcessDetail" parameterType="ProRfidProcessDetail">
insert into pro_rfid_process_detail

@ -160,7 +160,7 @@ public class ProOrderServiceImpl implements IProOrderService {
setBatch(workBatch, splitOrderDTO.getFormFields(), workOrder.getWorkorderId(), conver);
// 如果存在子节点
if (proOrder.getChildren() != null) {
if (proOrder.getChildren() != null && proOrder.getChildren().size()>0) {
ProOrderDTO newProOrder = (ProOrderDTO) proOrder.getChildren().get(0);
// 更新换算值
conver = (newProOrder.getQuantity() / quantity);

@ -56,7 +56,7 @@ public class QuaController extends BaseController {
*
*/
@GetMapping(value = "getInfoByRfid/{rfid}")
@GetMapping(value = "getInfoByRfid")
public AjaxResult getInfo(QcProCheck qcProCheck) {
return success(qcProCheckService.getInfoByRfid(qcProCheck));
}

@ -1,72 +0,0 @@
package com.op.quality.mapper;
import com.op.common.core.domain.BaseFileData;
import com.op.quality.domain.BaseFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-07-10
*/
@Mapper
public interface BaseFileMapper {
/**
*
*
* @param fileId
* @return
*/
public BaseFile selectBaseFileByFileId(String fileId);
/**
*
*
* @param baseFile
* @return
*/
public List<BaseFile> selectBaseFileList(BaseFile baseFile);
/**
*
*
* @param baseFile
* @return
*/
public int insertBaseFile(BaseFile baseFile);
/**
*
*
* @param baseFile
* @return
*/
public int updateBaseFile(BaseFile baseFile);
/**
*
*
* @param fileId
* @return
*/
public int deleteBaseFileByFileId(String fileId);
/**
*
*
* @param fileIds
* @return
*/
public int deleteBaseFileByFileIds(String[] fileIds);
Boolean insertBaseFileBatch(@Param("baseFiles") List<BaseFileData> baseFiles);
List<BaseFile> getBaseFileBatch(String processId);
void deleteBaseFileBySourceId(String processId);
}

@ -1,8 +1,10 @@
package com.op.quality.mapper;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.domain.R;
import com.op.quality.domain.QcProCheck;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -26,4 +28,6 @@ public interface QcProCheckMapper {
List<QcProCheck> selectQcProCheckList(QcProCheck qcProCheck);
QcProCheck getInfoByRfid(QcProCheck qcProCheck);
void insertBaseFileBatch(@Param("baseFiles") List<BaseFileData> baseFiles);
}

@ -3,12 +3,11 @@ package com.op.quality.service.serviceImpl;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.domain.R;
//import com.op.quality.domain.BaseFile;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcProCheck;
import com.op.quality.mapper.BaseFileMapper;
import com.op.quality.mapper.QcProCheckMapper;
import com.op.quality.service.QcProCheckService;
import org.springframework.beans.factory.annotation.Autowired;
@ -29,8 +28,6 @@ import java.util.UUID;
public class QcProCheckServiceImpl implements QcProCheckService {
@Autowired
private QcProCheckMapper qcProCheckMapper;
@Autowired
private BaseFileMapper baseFileMapper;
@Override
public R<Boolean> saveQcProCheck(QcProCheck qcProCheck) {
@ -52,9 +49,10 @@ public class QcProCheckServiceImpl implements QcProCheckService {
file.setCreateTime(new Date());
files.add(file);
}
baseFileMapper.insertBaseFileBatch(files);
qcProCheckMapper.insertBaseFileBatch(files);
}
qcProCheck.setCreateBy(SecurityUtils.getUsername());
qcProCheck.setCreateTime(DateUtils.getNowDate());
qcProCheckMapper.insertQcProCheck(qcProCheck);
return R.ok();

@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectQuaVo">
select id,rfid,factory_id,factory_code,order_id,machine_id,bad_meg,product_id,isqua,isqua,file_id,attr1,attr2,
select id,rfid,factory_id,factory_code,order_id,machine_id,bad_meg,product_id,isqua,file_id,attr1,attr2,
attr3,attr4,create_by,create_time,update_by,update_time,order_code,machine_code,
workorder_id,workorder_code,workorder_name,product_code
from qc_pro_check
@ -45,13 +45,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectQcProCheckList" parameterType="QcProCheck" resultMap="QcProCheckResult">
select qpc.id,qpc.rfid,qpc.factory_code,qpc.machine_id,qpc.bad_meg,
qpc.product_id,qpc.isqua,qpc.isqua,qpc.file_id,qpc.attr1,qpc.attr2,
qpc.product_id,qpc.isqua,qpc.file_id,qpc.attr1,qpc.attr2,
qpc.attr3,qpc.attr4,qpc.create_by,qpc.create_time,qpc.update_by,
qpc.update_time,qpc.order_code,qpc.machine_code,qpc.machine_name,
qpc.workorder_id,qpc.workorder_code,qpc.workorder_name,qpc.product_code,
qpc.product_name,qpc.product_spc
from qc_pro_check qpc
left join
<where>
<if test="rfid != null and rfid != ''"> and qpc.id = #{id}</if>
<if test="createBy != null and createBy != ''"> and qpc.create_by = #{createBy}</if>
@ -59,8 +58,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by qpc.create_time desc
</select>
<insert id="insertQcProCheck" parameterType="QcProCheck" useGeneratedKeys="true" keyProperty="id">
insert into qc_pro_check
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -123,7 +120,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fileId != null">#{fileId},</if>
</trim>
</insert>
<insert id="insertBaseFileBatch">
INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time)
VALUES
<foreach collection="baseFiles" index="" item="baseFile" separator=",">
(
#{baseFile.fileId},
#{baseFile.fileName},
#{baseFile.fileAddress},
#{baseFile.sourceId},
#{baseFile.remark},
#{baseFile.createBy},
#{baseFile.createTime}
)
</foreach>
</insert>
<update id="updateQcProCheckById" parameterType="QcProCheck">
@ -177,7 +188,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
be.equipment_name machineName,
ow.product_code productCode,
ow.product_name productName,
ow.product_spc productSpc
ow.product_spc productSpc,
ow.order_code orderCode
from pro_rfid_process_detail rfid
left join base_equipment be on rfid.machine_code = be.equipment_code
left join pro_order_workorder ow on ow.workorder_code = rfid.workorder_code

@ -180,7 +180,8 @@ public class SysUserController extends BaseController {
}
@PostMapping("/mobileGetInfo")
public AjaxResult mobileGetInfo(@RequestBody SysUser user) {
public AjaxResult mobileGetInfo(@RequestBody SysUser sysUser) {
SysUser user = userService.selectUserByUserName(sysUser.getUserName());
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合

@ -11,6 +11,7 @@ import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.technology.domain.Bom;
import com.op.technology.domain.BomComponent;
import com.op.technology.domain.ProProcess;
import com.op.technology.domain.Equipment;
import com.op.technology.service.IProProcessService;
@ -153,11 +154,11 @@ public class ProProcessController extends BaseController {
/**
* BOM
*/
@RequiresPermissions("mes:pro:process:bomList")
@GetMapping("/bomList")
public TableDataInfo bomList(Bom bom) {
@RequiresPermissions("mes:pro:process:bomComponentList")
@GetMapping("/bomComponentList")
public TableDataInfo selectBaseBomComponentList(BomComponent bomComponent) {
startPage();
List<Bom> list = proProcessService.selectBomList(bom);
List<BomComponent> list = proProcessService.selectBaseBomComponentList(bomComponent);
return getDataTable(list);
}
}

@ -0,0 +1,279 @@
package com.op.technology.domain;
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.util.List;
/**
* BOM base_bom_component
*
* @author Open Platform
* @date 2023-08-04
*/
public class BomComponent extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String handle;
/** BOM单号 */
@Excel(name = "BOM单号")
private String bomCode;
private String bomName;
/** 工厂/站点 */
@Excel(name = "工厂/站点")
private String site;
/** 物料编码 */
@Excel(name = "物料编码")
private String productCode;
/** 组件上层物料编码 */
@Excel(name = "组件上层物料编码")
private String cumc;
/** 组件编码 */
@Excel(name = "组件编码")
private String component;
/** BOM层次 */
@Excel(name = "BOM层次")
private String bomHierarchy;
/** 项目编号 */
@Excel(name = "项目编号")
private String projectNo;
/** 标准用量 */
@Excel(name = "标准用量")
private Long standardDosage;
/** 损耗率 */
@Excel(name = "损耗率")
private Long lossRate;
/** 损耗额 */
@Excel(name = "损耗额")
private Long lossAmount;
/** 含损耗用量 */
@Excel(name = "含损耗用量")
private Long cilosses;
/** 组件数量单位 */
@Excel(name = "组件数量单位")
private String componentUnit;
/** 组件采购标志 */
@Excel(name = "组件采购标志")
private String componentProFlag;
/** 物料供应标识 */
@Excel(name = "物料供应标识")
private String msi;
/** 成本核算标识相关 */
@Excel(name = "成本核算标识相关")
private String sanka;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
// private List<BaseBomComponent> children;
//
// public List<BaseBomComponent> getChildren() {
// return children;
// }
//
// public void setChildren(List<BaseBomComponent> children) {
// this.children = children;
// }
public void setHandle(String handle) {
this.handle = handle;
}
public String getHandle() {
return handle;
}
public void setBomCode(String bomCode) {
this.bomCode = bomCode;
}
public String getBomCode() {
return bomCode;
}
public void setBomName(String bomName) {
this.bomName = bomName;
}
public String getBomName() {
return bomName;
}
public void setSite(String site) {
this.site = site;
}
public String getSite() {
return site;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setCumc(String cumc) {
this.cumc = cumc;
}
public String getCumc() {
return cumc;
}
public void setComponent(String component) {
this.component = component;
}
public String getComponent() {
return component;
}
public void setBomHierarchy(String bomHierarchy) {
this.bomHierarchy = bomHierarchy;
}
public String getBomHierarchy() {
return bomHierarchy;
}
public void setProjectNo(String projectNo) {
this.projectNo = projectNo;
}
public String getProjectNo() {
return projectNo;
}
public void setStandardDosage(Long standardDosage) {
this.standardDosage = standardDosage;
}
public Long getStandardDosage() {
return standardDosage;
}
public void setLossRate(Long lossRate) {
this.lossRate = lossRate;
}
public Long getLossRate() {
return lossRate;
}
public void setLossAmount(Long lossAmount) {
this.lossAmount = lossAmount;
}
public Long getLossAmount() {
return lossAmount;
}
public void setCilosses(Long cilosses) {
this.cilosses = cilosses;
}
public Long getCilosses() {
return cilosses;
}
public void setComponentUnit(String componentUnit) {
this.componentUnit = componentUnit;
}
public String getComponentUnit() {
return componentUnit;
}
public void setComponentProFlag(String componentProFlag) {
this.componentProFlag = componentProFlag;
}
public String getComponentProFlag() {
return componentProFlag;
}
public void setMsi(String msi) {
this.msi = msi;
}
public String getMsi() {
return msi;
}
public void setSanka(String sanka) {
this.sanka = sanka;
}
public String getSanka() {
return sanka;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("handle", getHandle())
.append("bomCode", getBomCode())
.append("bomName", getBomName())
.append("site", getSite())
.append("productCode", getProductCode())
.append("cumc", getCumc())
.append("component", getComponent())
.append("bomHierarchy", getBomHierarchy())
.append("projectNo", getProjectNo())
.append("standardDosage", getStandardDosage())
.append("lossRate", getLossRate())
.append("lossAmount", getLossAmount())
.append("cilosses", getCilosses())
.append("componentUnit", getComponentUnit())
.append("componentProFlag", getComponentProFlag())
.append("msi", getMsi())
.append("sanka", getSanka())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -1,6 +1,7 @@
package com.op.technology.mapper;
import com.op.technology.domain.Bom;
import com.op.technology.domain.BomComponent;
import com.op.technology.domain.Equipment;
import com.op.technology.domain.ProProcess;
import org.apache.ibatis.annotations.Mapper;
@ -71,5 +72,5 @@ public interface ProProcessMapper
List<Equipment> selectEquipmentList(Equipment equipment);
Equipment selectEquipmentByEquipmentId(Long equipmentId);
List<Bom> selectBomList(Bom bom);
List<BomComponent> selectBaseBomComponentList(BomComponent bomComponent);
}

@ -1,6 +1,7 @@
package com.op.technology.service;
import com.op.technology.domain.Bom;
import com.op.technology.domain.BomComponent;
import com.op.technology.domain.Equipment;
import com.op.technology.domain.ProProcess;
@ -72,5 +73,5 @@ public interface IProProcessService
public Equipment selectEquipmentByEquipmentId(Long equipmentId);
public List<Bom> selectBomList(Bom bom);
public List<BomComponent> selectBaseBomComponentList(BomComponent bomComponent);
}

@ -7,10 +7,7 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.technology.domain.BaseFile;
import com.op.technology.domain.Bom;
import com.op.technology.domain.Equipment;
import com.op.technology.domain.ProProcess;
import com.op.technology.domain.*;
import com.op.technology.mapper.BaseFileMapper;
import com.op.technology.mapper.ProProcessMapper;
import com.op.technology.service.IProProcessService;
@ -216,13 +213,13 @@ public class ProProcessServiceImpl implements IProProcessService {
/**
* BOM
*
* @param bom BOM
* @param bomComponent BOM
* @return BOM
*/
@Override
@DS("#header.poolName")
public List<Bom> selectBomList(Bom bom) {
return proProcessMapper.selectBomList(bom);
public List<BomComponent> selectBaseBomComponentList(BomComponent bomComponent) {
return proProcessMapper.selectBaseBomComponentList(bomComponent);
}
}

@ -1,7 +1,7 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.technology.mapper.ProProcessMapper">
<resultMap type="ProProcess" id="ProProcessResult">
@ -65,18 +65,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="hourlyUnitPrice" column="hourly_unit_price" />
</resultMap>
<resultMap type="Bom" id="BomResult">
<result property="factoryCode" column="factory_code" />
<result property="productionVersion" column="production_version" />
<resultMap type="BomComponent" id="BomComponentResult">
<result property="handle" column="handle" />
<result property="bomCode" column="bom_code" />
<result property="optionalBom" column="optional_bom" />
<result property="optionalBomText" column="optional_bom_text" />
<result property="pvvd" column="pvvd" />
<result property="pved" column="pved" />
<result property="bomCalculateNumber" column="bom_calculate_number" />
<result property="bomCalculateUnit" column="bom_calculate_unit" />
<result property="bomBaseNumber" column="bom_base_number" />
<result property="bomBaseUnit" column="bom_base_unit" />
<result property="bomName" column="product_desc_zh" />
<result property="site" column="site" />
<result property="productCode" column="product_code" />
<result property="cumc" column="cumc" />
<result property="component" column="component" />
<result property="bomHierarchy" column="bom_hierarchy" />
<result property="projectNo" column="project_no" />
<result property="standardDosage" column="standard_dosage" />
<result property="lossRate" column="loss_rate" />
<result property="lossAmount" column="loss_amount" />
<result property="cilosses" column="cilosses" />
<result property="componentUnit" column="component_unit" />
<result property="componentProFlag" column="component_pro_flag" />
<result property="msi" column="msi" />
@ -89,7 +91,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="currentVersion" column="current_version" />
</resultMap>
<sql id="selectBomVo">
@ -123,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where process_id = #{processId}
</select>
<select id="checkProcessCodeUnique" parameterType="ProProcess" resultMap="ProProcessResult">
<select id="checkProcessCodeUnique" parameterType="ProProcess" resultMap="ProProcessResult">
select top 1 process_id, process_code, process_name, attention, enable_flag,
remark, attr1, attr2, attr3, attr4, create_by, create_time,
update_by, update_time from pro_process
@ -170,7 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="param8 != null">param8,</if>
<if test="param9 != null">param9,</if>
<if test="param10 != null">param10,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{processId},
<if test="processCode != null and processCode != ''">#{processCode},</if>
@ -202,7 +203,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="param8 != null">#{param8},</if>
<if test="param9 != null">#{param9},</if>
<if test="param10 != null">#{param10},</if>
</trim>
</trim>
</insert>
<update id="updateProProcess" parameterType="ProProcess">
@ -267,29 +268,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectBomList" parameterType="Bom" resultMap="BomResult">
<include refid="selectBomVo"/>
<where>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="productionVersion != null and productionVersion != ''"> and production_version = #{productionVersion}</if>
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
<if test="optionalBom != null and optionalBom != ''"> and optional_bom = #{optionalBom}</if>
<if test="optionalBomText != null and optionalBomText != ''"> and optional_bom_text = #{optionalBomText}</if>
<if test="pvvd != null "> and pvvd = #{pvvd}</if>
<if test="pved != null "> and pved = #{pved}</if>
<if test="bomCalculateNumber != null "> and bom_calculate_number = #{bomCalculateNumber}</if>
<if test="bomCalculateUnit != null and bomCalculateUnit != ''"> and bom_calculate_unit = #{bomCalculateUnit}</if>
<if test="bomBaseNumber != null "> and bom_base_number = #{bomBaseNumber}</if>
<if test="bomBaseUnit != null and bomBaseUnit != ''"> and bom_base_unit = #{bomBaseUnit}</if>
<if test="componentUnit != null and componentUnit != ''"> and component_unit = #{componentUnit}</if>
<if test="componentProFlag != null and componentProFlag != ''"> and component_pro_flag = #{componentProFlag}</if>
<if test="msi != null and msi != ''"> and msi = #{msi}</if>
<if test="sanka != null and sanka != ''"> and sanka = #{sanka}</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="currentVersion != null and currentVersion != ''"> and current_version = #{currentVersion}</if>
</where>
</select>
<select id="selectBaseBomComponentList" parameterType="BomComponent" resultMap="BomComponentResult">
-- select bbc.bom_code,bpc1.product_desc_zh
-- from base_bom_component bbc,base_product_copy1 bpc1
-- left join base_product_copy1 bpc1 on bbc.product_code = (right(bpc1.product_code,11))
-- Where
<!-- <if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>-->
-- bbc.product_code = right(bpc1.product_code,11)
select distinct bbc.bom_code,bpc1.product_desc_zh,right(bpc1.product_code,11) as pc,bbc.product_code
from base_bom_component bbc,base_product_copy1 bpc1
Where
bbc.product_code = right(bpc1.product_code,11)
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
</select>
</mapper>

Loading…
Cancel
Save