管理系统报工

highway
zhaoxiaolin 1 year ago
parent 7f67bc9b15
commit c7bfb41867

@ -96,6 +96,61 @@ public class BaseBomDTO extends BaseEntity {
@Excel(name = "是否在用")
private String currentVersion;
private String component;
private String componentName;
private String unit;
private String productGroup;
private String productGroupName;
private String productCode;
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getComponent() {
return component;
}
public void setComponent(String component) {
this.component = component;
}
public String getComponentName() {
return componentName;
}
public void setComponentName(String componentName) {
this.componentName = componentName;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getProductGroup() {
return productGroup;
}
public void setProductGroup(String productGroup) {
this.productGroup = productGroup;
}
public String getProductGroupName() {
return productGroupName;
}
public void setProductGroupName(String productGroupName) {
this.productGroupName = productGroupName;
}
private List<BaseBomComponentDTO> children;
public List<BaseBomComponentDTO> getChildren() {

@ -0,0 +1,687 @@
package com.op.system.api.domain.mes;
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;
/**
* base_product
*
* @author JGY
* @date 2023-07-18
*/
public class BaseProductDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键ID */
private String productId;
/** 物料编码 */
@Excel(name = "物料编码")
private String productCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String productDescZh;
/** 物料名称 */
@Excel(name = "物料型号")
private String productModel;
/** 英文描述 */
@Excel(name = "英文描述")
private String productDescEn;
/** 序列号规则代码 */
@Excel(name = "序列号规则代码")
private String ruleCode;
/** 旧物料号 */
@Excel(name = "旧物料号")
private String oldProductCode;
/** 散件物料号 */
@Excel(name = "散件物料号")
private String partsProductCode;
/** 69码 */
@Excel(name = "69码")
private String skuBarcode;
/** 长 */
@Excel(name = "长")
private BigDecimal length;
/** 宽 */
@Excel(name = "宽")
private BigDecimal width;
/** 高 */
@Excel(name = "高")
private BigDecimal height;
/** 毛重 */
@Excel(name = "毛重")
private BigDecimal grossWeight;
/** 净重 */
@Excel(name = "净重")
private BigDecimal netWeight;
/** 皮重 */
@Excel(name = "皮重")
private BigDecimal tareWeight;
/** 体积 */
@Excel(name = "体积")
private BigDecimal volume;
/** 单价 */
@Excel(name = "单价")
private BigDecimal unitPrice;
/** 物料组 */
@Excel(name = "物料类别组")
private String productGroup;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String productGroupName;
/** 用户自定义1 */
@Excel(name = "用户自定义1")
private String userDefined1;
/** 用户自定义2 */
@Excel(name = "用户自定义2")
private String userDefined2;
/** 用户自定义3 */
@Excel(name = "用户自定义3")
private String userDefined3;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String userDefined4;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String userDefined5;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String userDefined6;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
/** 激活标记 */
@Excel(name = "激活标记")
private String activeFlag;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String syncFlag;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String primaryUom;
/** $column.columnComment */
private String delFlag;
/** 订单单位 */
@Excel(name = "订单单位")
private String bstme;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal basicOrder;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal convOrder;
/** 发货单位 */
@Excel(name = "发货单位")
private String ausme;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal basicIssue;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal convIssue;
/** 是否补料0否 */
@Excel(name = "是否补料", readConverterExp = "是否补料0否")
private String appendFlag;
/** 补料比例 */
@Excel(name = "补料比例")
private String appendPercent;
/** 物料类型 */
@Excel(name = "物料类型")
private String mtart;
/** 品类 */
@Excel(name = "品类")
private String category;
/** 每PC单圈 */
@Excel(name = "每PC单圈")
private String pc;
/** 标准效率 */
@Excel(name = "标准效率")
private BigDecimal iei;
/** 标准用人 */
@Excel(name = "标准用人")
private BigDecimal manStandar;
/** 喷药方式 */
@Excel(name = "喷药方式")
private String sprayWay;
/** 白坯直径 */
@Excel(name = "白坯直径")
private BigDecimal blankDiameter;
/** 白坯物料号 */
@Excel(name = "白坯物料号")
private String blankNo;
/** 标准喷药量KG/PC */
@Excel(name = "标准喷药量", readConverterExp = "K=G/PC")
private BigDecimal sprayVolume;
/** 药液料号 */
@Excel(name = "药液料号")
private String liquidNo;
/** 标准内膜用量KG/PC */
@Excel(name = "标准内膜用量", readConverterExp = "K=G/PC")
private BigDecimal endometrialDosage;
/** 标准外模用量(KG/PC) */
@Excel(name = "标准外模用量(KG/PC)")
private BigDecimal outerFilmDosage;
/** 支架 */
@Excel(name = "支架")
private Long support;
/** 支架物料号 */
@Excel(name = "支架物料号")
private String supportNo;
/** 吸塑 */
@Excel(name = "吸塑")
private Long pvc;
/** 支架盘 */
@Excel(name = "支架盘")
private Long supportPlate;
/** 其它 */
@Excel(name = "其它")
private String other;
public void setCategory(String category) {
this.category = category;
}
public String getCategory() {
return category;
}
public void setPc(String pc) {
this.pc = pc;
}
public String getPc() {
return pc;
}
public void setIei(BigDecimal iei) {
this.iei = iei;
}
public BigDecimal getIei() {
return iei;
}
public void setManStandar(BigDecimal manStandar) {
this.manStandar = manStandar;
}
public BigDecimal getManStandar() {
return manStandar;
}
public void setSprayWay(String sprayWay) {
this.sprayWay = sprayWay;
}
public String getSprayWay() {
return sprayWay;
}
public void setBlankDiameter(BigDecimal blankDiameter) {
this.blankDiameter = blankDiameter;
}
public BigDecimal getBlankDiameter() {
return blankDiameter;
}
public void setBlankNo(String blankNo) {
this.blankNo = blankNo;
}
public String getBlankNo() {
return blankNo;
}
public void setSprayVolume(BigDecimal sprayVolume) {
this.sprayVolume = sprayVolume;
}
public BigDecimal getSprayVolume() {
return sprayVolume;
}
public void setLiquidNo(String liquidNo) {
this.liquidNo = liquidNo;
}
public String getLiquidNo() {
return liquidNo;
}
public void setEndometrialDosage(BigDecimal endometrialDosage) {
this.endometrialDosage = endometrialDosage;
}
public BigDecimal getEndometrialDosage() {
return endometrialDosage;
}
public void setOuterFilmDosage(BigDecimal outerFilmDosage) {
this.outerFilmDosage = outerFilmDosage;
}
public BigDecimal getOuterFilmDosage() {
return outerFilmDosage;
}
public void setSupport(Long support) {
this.support = support;
}
public Long getSupport() {
return support;
}
public void setSupportNo(String supportNo) {
this.supportNo = supportNo;
}
public String getSupportNo() {
return supportNo;
}
public void setPvc(Long pvc) {
this.pvc = pvc;
}
public Long getPvc() {
return pvc;
}
public void setSupportPlate(Long supportPlate) {
this.supportPlate = supportPlate;
}
public Long getSupportPlate() {
return supportPlate;
}
public void setOther(String other) {
this.other = other;
}
public String getOther() {
return other;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getProductId() {
return productId;}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductDescZh(String productDescZh) {
this.productDescZh = productDescZh;
}
public String getProductDescZh() {
return productDescZh;
}
public void setProductModel(String productModel) {
this.productModel = productModel;
}
public String getProductModel() {
return productModel;
}
public void setProductDescEn(String productDescEn) {
this.productDescEn = productDescEn;
}
public String getProductDescEn() {
return productDescEn;
}
public void setRuleCode(String ruleCode) {
this.ruleCode = ruleCode;
}
public String getRuleCode() {
return ruleCode;
}
public void setOldProductCode(String oldProductCode) {
this.oldProductCode = oldProductCode;
}
public String getOldProductCode() {
return oldProductCode;
}
public void setPartsProductCode(String partsProductCode) {
this.partsProductCode = partsProductCode;
}
public String getPartsProductCode() {
return partsProductCode;
}
public void setSkuBarcode(String skuBarcode) {
this.skuBarcode = skuBarcode;
}
public String getSkuBarcode() {
return skuBarcode;
}
public void setLength(BigDecimal length) {
this.length = length;
}
public BigDecimal getLength() {
return length;
}
public void setWidth(BigDecimal width) {
this.width = width;
}
public BigDecimal getWidth() {
return width;
}
public void setHeight(BigDecimal height) {
this.height = height;
}
public BigDecimal getHeight() {
return height;
}
public void setGrossWeight(BigDecimal grossWeight) {
this.grossWeight = grossWeight;
}
public BigDecimal getGrossWeight() {
return grossWeight;
}
public void setNetWeight(BigDecimal netWeight) {
this.netWeight = netWeight;
}
public BigDecimal getNetWeight() {
return netWeight;
}
public void setTareWeight(BigDecimal tareWeight) {
this.tareWeight = tareWeight;
}
public BigDecimal getTareWeight() {
return tareWeight;
}
public void setVolume(BigDecimal volume) {
this.volume = volume;
}
public BigDecimal getVolume() {
return volume;
}
public void setUnitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice;
}
public BigDecimal getUnitPrice() {
return unitPrice;
}
public void setProductGroup(String productGroup) {
this.productGroup = productGroup;
}
public String getProductGroup() {
return productGroup;
}
public void setProductGroupName(String productGroupName) {
this.productGroupName = productGroupName;
}
public String getProductGroupName() {
return productGroupName;
}
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;
}
public void setUserDefined4(String userDefined4) {
this.userDefined4 = userDefined4;
}
public String getUserDefined4() {
return userDefined4;
}
public void setUserDefined5(String userDefined5) {
this.userDefined5 = userDefined5;
}
public String getUserDefined5() {
return userDefined5;
}
public void setUserDefined6(String userDefined6) {
this.userDefined6 = userDefined6;
}
public String getUserDefined6() {
return userDefined6;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setActiveFlag(String activeFlag) {
this.activeFlag = activeFlag;
}
public String getActiveFlag() {
return activeFlag;
}
public void setSyncFlag(String syncFlag) {
this.syncFlag = syncFlag;
}
public String getSyncFlag() {
return syncFlag;
}
public void setPrimaryUom(String primaryUom) {
this.primaryUom = primaryUom;
}
public String getPrimaryUom() {
return primaryUom;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public void setBstme(String bstme) {
this.bstme = bstme;
}
public String getBstme() {
return bstme;
}
public void setBasicOrder(BigDecimal basicOrder) {
this.basicOrder = basicOrder;
}
public BigDecimal getBasicOrder() {
return basicOrder;
}
public void setConvOrder(BigDecimal convOrder) {
this.convOrder = convOrder;
}
public BigDecimal getConvOrder() {
return convOrder;
}
public void setAusme(String ausme) {
this.ausme = ausme;
}
public String getAusme() {
return ausme;
}
public void setBasicIssue(BigDecimal basicIssue) {
this.basicIssue = basicIssue;
}
public BigDecimal getBasicIssue() {
return basicIssue;
}
public void setConvIssue(BigDecimal convIssue) {
this.convIssue = convIssue;
}
public BigDecimal getConvIssue() {
return convIssue;
}
public void setAppendFlag(String appendFlag) {
this.appendFlag = appendFlag;
}
public String getAppendFlag() {
return appendFlag;
}
public void setAppendPercent(String appendPercent) {
this.appendPercent = appendPercent;
}
public String getAppendPercent() {
return appendPercent;
}
public void setMtart(String mtart) {
this.mtart = mtart;
}
public String getMtart() {
return mtart;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("productId", getProductId())
.append("productCode", getProductCode())
.append("productDescZh", getProductDescZh())
.append("productDescEn", getProductDescEn())
.append("ruleCode", getRuleCode())
.append("oldProductCode", getOldProductCode())
.append("partsProductCode", getPartsProductCode())
.append("skuBarcode", getSkuBarcode())
.append("length", getLength())
.append("width", getWidth())
.append("height", getHeight())
.append("grossWeight", getGrossWeight())
.append("netWeight", getNetWeight())
.append("tareWeight", getTareWeight())
.append("volume", getVolume())
.append("unitPrice", getUnitPrice())
.append("productGroup", getProductGroup())
.append("productGroupName", getProductGroupName())
.append("userDefined1", getUserDefined1())
.append("userDefined2", getUserDefined2())
.append("userDefined3", getUserDefined3())
.append("userDefined4", getUserDefined4())
.append("userDefined5", getUserDefined5())
.append("userDefined6", getUserDefined6())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.append("activeFlag", getActiveFlag())
.append("syncFlag", getSyncFlag())
.append("primaryUom", getPrimaryUom())
.append("delFlag", getDelFlag())
.append("bstme", getBstme())
.append("basicOrder", getBasicOrder())
.append("convOrder", getConvOrder())
.append("ausme", getAusme())
.append("basicIssue", getBasicIssue())
.append("convIssue", getConvIssue())
.append("appendFlag", getAppendFlag())
.append("appendPercent", getAppendPercent())
.append("mtart", getMtart())
.append("category", getCategory())
.append("pc", getPc())
.append("iei", getIei())
.append("manStandar", getManStandar())
.append("sprayWay", getSprayWay())
.append("blankDiameter", getBlankDiameter())
.append("blankNo", getBlankNo())
.append("sprayVolume", getSprayVolume())
.append("liquidNo", getLiquidNo())
.append("endometrialDosage", getEndometrialDosage())
.append("outerFilmDosage", getOuterFilmDosage())
.append("support", getSupport())
.append("supportNo", getSupportNo())
.append("pvc", getPvc())
.append("supportPlate", getSupportPlate())
.append("other", getOther())
.toString();
}
}

@ -42,7 +42,7 @@ public class SapRFW {
}
public static class lt_gs
public class lt_gs
{
String conf_activity1;
String conf_activity2;
@ -112,7 +112,7 @@ public class SapRFW {
}
}
public static class lt_hw{
public class lt_hw{
String material;
String entry_qnt;

@ -4,6 +4,8 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.system.api.domain.dto.BaseBomDTO;
import com.op.system.api.domain.mes.BaseProductDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -38,7 +40,7 @@ public class MesReportWorkConsumeController extends BaseController {
/**
*
*/
@RequiresPermissions("mes:reportWorkConsume:list")
//@RequiresPermissions("mes:reportWorkConsume:list")
@GetMapping("/list")
public TableDataInfo list(MesReportWorkConsume mesReportWorkConsume) {
startPage();
@ -49,7 +51,7 @@ public class MesReportWorkConsumeController extends BaseController {
/**
*
*/
@RequiresPermissions("mes:reportWorkConsume:export")
//@RequiresPermissions("mes:reportWorkConsume:export")
@Log(title = "生产报工物料消耗", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesReportWorkConsume mesReportWorkConsume) {
@ -61,7 +63,7 @@ public class MesReportWorkConsumeController extends BaseController {
/**
*
*/
@RequiresPermissions("mes:reportWorkConsume:query")
//@RequiresPermissions("mes:reportWorkConsume:query")
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
return success(mesReportWorkConsumeService.selectMesReportWorkConsumeByRecordId(recordId));
@ -70,18 +72,17 @@ public class MesReportWorkConsumeController extends BaseController {
/**
*
*/
@RequiresPermissions("mes:reportWorkConsume:add")
//@RequiresPermissions("mes:reportWorkConsume:add")
@Log(title = "生产报工物料消耗", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesReportWorkConsume mesReportWorkConsume) {
mesReportWorkConsume.setRecordId(IdUtils.fastSimpleUUID());
return toAjax(mesReportWorkConsumeService.insertMesReportWorkConsume(mesReportWorkConsume));
}
/**
*
*/
@RequiresPermissions("mes:reportWorkConsume:edit")
//@RequiresPermissions("mes:reportWorkConsume:edit")
@Log(title = "生产报工物料消耗", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesReportWorkConsume mesReportWorkConsume) {
@ -91,7 +92,7 @@ public class MesReportWorkConsumeController extends BaseController {
/**
*
*/
@RequiresPermissions("mes:reportWorkConsume:remove")
//@RequiresPermissions("mes:reportWorkConsume:remove")
@Log(title = "生产报工物料消耗", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public AjaxResult remove(@PathVariable String[] recordIds) {
@ -108,4 +109,14 @@ public class MesReportWorkConsumeController extends BaseController {
List<MesReportWorkConsume> list = mesReportWorkConsumeService.selectMesReportWorkConsumeList(mesReportWorkConsume);
return getDataTable(list);
}
/**
* BOM
*/
@GetMapping("/getMesListBom")
public TableDataInfo getMesListBom(BaseBomDTO dto) {
startPage();
List<BaseBomDTO> list = mesReportWorkConsumeService.getMesListBom(dto);
return getDataTable(list);
}
}

@ -9,6 +9,7 @@ import java.util.*;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.domain.ExcelCol;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.poi.ExcelMapUtil;
import com.op.common.core.utils.uuid.IdUtils;
@ -16,6 +17,7 @@ import com.op.mes.domain.*;
import com.op.mes.domain.dto.LineChartDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.device.EquEquipmentDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
@ -55,6 +57,15 @@ public class MesReportWorkController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(MesReportWork mesReportWork) {
startPage();
//默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){
mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
mesReportWork.setCreateTimeEnd(dateEndStr);//end
}
List<MesReportWork> list = mesReportWorkService.selectMesReportWorkList(mesReportWork);
return getDataTable(list);
}
@ -66,6 +77,15 @@ public class MesReportWorkController extends BaseController {
//@Log(title = "报工报表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesReportWork mesReportWork) {
//默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(mesReportWork.getCreateTimeStart())){
mesReportWork.setCreateTimeStart(DateUtils.getDate()+" 00:00:00");//start
LocalDate date = LocalDate.now();
LocalDate dateEnd = date.plusDays(1);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String dateEndStr = dtf.format(dateEnd)+" 00:00:00";
mesReportWork.setCreateTimeEnd(dateEndStr);//end
}
List<MesReportWork> list = mesReportWorkService.selectMesReportWorkList(mesReportWork);
ExcelUtil<MesReportWork> util = new ExcelUtil<MesReportWork>(MesReportWork.class);
util.exportExcel(response, list, "报工报表数据");
@ -101,6 +121,15 @@ public class MesReportWorkController extends BaseController {
return toAjax(mesReportWorkService.updateMesReportWork(mesReportWork));
}
/**
*
*/
@RequiresPermissions("mes:reportWork:edit")
@PutMapping("/reportSap")
public R reportSap(@RequestBody MesReportWork mesReportWork) {
return mesReportWorkService.reportSap(mesReportWork);
}
/**
*
*/
@ -316,7 +345,7 @@ public class MesReportWorkController extends BaseController {
}
/**
*
*
*/
@GetMapping("/getMesListWorkOrder")
public TableDataInfo getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO) {
@ -325,6 +354,17 @@ public class MesReportWorkController extends BaseController {
return getDataTable(list);
}
/**
* 线
*/
@GetMapping("/getMesListEquip")
public TableDataInfo getMesListEquip(EquEquipmentDTO equEquipmentDTO) {
startPage();
List<EquEquipmentDTO> list = mesReportWorkService.getMesListEquip(equEquipmentDTO);
return getDataTable(list);
}
public static void main(String args[]){
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
try {

@ -20,14 +20,14 @@ public class MesReportWork extends BaseEntity {
/** 记录id */
private String id;
/** 报工类型报工类型SELF自行报工、UNI统一报工 */
@Excel(name = "报工类型报工类型SELF自行报工、UNI统一报工")
private String reportType;
/** 报工单编号 */
@Excel(name = "报工单编号")
private String reportCode;
/** 报工类型报工类型SELF自行报工、UNI统一报工 */
@Excel(name = "报工类型报工类型SELF上位机报工、UNI系统报工")
private String reportType;
/** 生产工单编码 */
@Excel(name = "生产工单编码")
private String workorderCode;
@ -57,11 +57,11 @@ public class MesReportWork extends BaseEntity {
private BigDecimal quantityFeedback;
/** 合格数量 */
@Excel(name = "合格数量")
//@Excel(name = "合格数量")
private BigDecimal quantityQualified;
/** 不合格数量 */
@Excel(name = "不合格数量")
//@Excel(name = "不合格数量")
private BigDecimal quantityUnqualified;
/** 报工人员 */
@ -73,7 +73,7 @@ public class MesReportWork extends BaseEntity {
private String nickName;
/** 报工途径PAD、MOBILE、PC */
@Excel(name = "报工途径PAD、MOBILE、PC")
//@Excel(name = "报工途径PAD、MOBILE、PC")
private String feedbackChannel;
/** 报工时间 */
@ -109,20 +109,27 @@ public class MesReportWork extends BaseEntity {
@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")
//@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
//@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
//@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
//@Excel(name = "预留字段4")
private String attr4;
@Excel(name = "计划生产日期")
private String productDate;
@ -140,9 +147,6 @@ 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;
@ -152,6 +156,42 @@ public class MesReportWork extends BaseEntity {
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;

@ -3,6 +3,7 @@ package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesReportWorkConsume;
import com.op.system.api.domain.dto.BaseBomDTO;
/**
* Mapper
@ -60,4 +61,6 @@ public interface MesReportWorkConsumeMapper {
public int deleteMesReportWorkConsumeByRecordIds(String[] recordIds);
List<MesReportWorkConsume> selectMesReportWorkConsumeListById(MesReportWorkConsume mesReportWorkConsume);
List<BaseBomDTO> getMesListBom(BaseBomDTO dto);
}

@ -104,4 +104,6 @@ public interface MesReportWorkMapper {
List<ProOrderWorkorderDTO> getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO);
@MapKey("equipmentCode")
Map<String, EquEquipmentDTO> getEquipInfoByCodes(String substring);
List<EquEquipmentDTO> getMesListEquip(EquEquipmentDTO qo);
}

@ -2,6 +2,8 @@ package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesReportWorkConsume;
import com.op.system.api.domain.dto.BaseBomDTO;
import com.op.system.api.domain.mes.BaseProductDTO;
/**
* Service
@ -65,4 +67,6 @@ public interface IMesReportWorkConsumeService {
* @return
*/
public int deleteMesReportWorkConsumeByRecordId(String recordId);
public List<BaseBomDTO> getMesListBom(BaseBomDTO dto);
}

@ -3,10 +3,12 @@ package com.op.mes.service;
import java.util.HashMap;
import java.util.List;
import com.op.common.core.domain.R;
import com.op.mes.domain.*;
import com.op.mes.domain.dto.LineChartDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.device.EquEquipmentDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
/**
@ -83,4 +85,7 @@ public interface IMesReportWorkService {
List<SysUser> getMesListUser(SysUser sysUser);
List<ProOrderWorkorderDTO> getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO);
List<EquEquipmentDTO> getMesListEquip(EquEquipmentDTO equEquipmentDTO);
R reportSap(MesReportWork mesReportWork);
}

@ -271,29 +271,33 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
@Override
public R reportWork(MesReportWork mesReportWork) {
DynamicDataSourceContextHolder.push("ds_"+mesReportWork.getFactoryCode());// 这是数据源的key
if(StringUtils.isNotBlank(mesReportWork.getFactoryCode())){//已经加上ds_
DynamicDataSourceContextHolder.push(mesReportWork.getFactoryCode());// 这是数据源的key
}
mesReportWork.setUploadStatus("1");//除了1报工成功的都需要报工
mesReportWork.setProdType("prod");
List<MesReportWork> reportWorks = mesReportWorkMapper.getReportWorkList(mesReportWork);
if(CollectionUtils.isEmpty(reportWorks)){
return R.fail("未查询报工单");
return R.fail("未查询报工单");
}
MesReportWork work = reportWorks.get(0);
SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量
SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改
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.lt_hw lthw = sapRFW.getLt_hw();//MES生产订单报工货物移动修改
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());
@ -318,8 +322,8 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
ProOrderWorkorder topOrder = this.getTopOrder(work.getWorkorderCode());
if(proResult.getQuantityFeedback().compareTo(new BigDecimal(topOrder.getQuantitySplit()))>=0){
//工单完成,关闭工单
remoteSapService.sapCloseOrder(work.getOrderCode());
work.setStatus("w4");
remoteSapService.sapCloseOrder(work.getWorkorderCodeSap());
work.setStatus("w3");
work.setUpdateTime(DateUtils.getNowDate());
//pro_work_order status->w4报工
mesReportWorkMapper.updateWorkOrderStatus(work);

@ -4,6 +4,9 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.system.api.domain.dto.BaseBomDTO;
import com.op.system.api.domain.mes.BaseProductDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesReportWorkConsumeMapper;
@ -66,6 +69,7 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer
@Override
@DS("#header.poolName")
public int insertMesReportWorkConsume(MesReportWorkConsume mesReportWorkConsume) {
mesReportWorkConsume.setRecordId(IdUtils.fastSimpleUUID());
mesReportWorkConsume.setCreateTime(DateUtils.getNowDate());
return mesReportWorkConsumeMapper.insertMesReportWorkConsume(mesReportWorkConsume);
}
@ -106,4 +110,12 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer
public int deleteMesReportWorkConsumeByRecordId(String recordId) {
return mesReportWorkConsumeMapper.deleteMesReportWorkConsumeByRecordId(recordId);
}
@Override
@DS("#header.poolName")
public List<BaseBomDTO> getMesListBom(BaseBomDTO dto) {
return mesReportWorkConsumeMapper.getMesListBom(dto);
}
}

@ -8,8 +8,10 @@ import java.util.*;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.constant.SecurityConstants;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.ServletUtils;
import com.op.mes.domain.*;
import com.op.mes.domain.dto.LineChartDto;
import com.op.mes.domain.dto.LineChartSeriesDto;
@ -18,6 +20,7 @@ import com.op.mes.service.IWCSInterfaceService;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.device.EquEquipmentDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesReportWorkMapper;
@ -58,7 +61,32 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
@Override
@DS("#header.poolName")
public List<MesReportWork> selectMesReportWorkList(MesReportWork mesReportWork) {
return mesReportWorkMapper.selectMesReportWorkList(mesReportWork);
List<MesReportWork> dtos = mesReportWorkMapper.selectMesReportWorkList(mesReportWork);
for(MesReportWork dto:dtos){
ProOrderWorkorder topOrder = this.getTopOrder(dto.getWorkorderCode());
dto.setQuantity(new BigDecimal(topOrder.getQuantitySplit()));
dto.setUnit(topOrder.getUnit());
if("1".equals(dto.getUploadStatus())){
dto.setUploadStatus("sap报工成功");
}else if("2".equals(dto.getUploadStatus())){
dto.setUploadStatus("sap报工失败");
}else if("0".equals(dto.getUploadStatus())){
dto.setUploadStatus("待报工sap");
}
}
return dtos;
}
//根据工单子单编码获取最顶级订单的母单
private ProOrderWorkorder getTopOrder(String workorderCode) {
//pro_order_workorder
ProOrderWorkorder topOrder = mesReportWorkMapper.getOrderByCode(workorderCode);
while (!"0".equals(topOrder.getParentOrder()) && StringUtils.isNotEmpty(topOrder.getParentOrder())) {
//pro_order_workorder
topOrder = mesReportWorkMapper.getOrderByCode(topOrder.getParentOrder());
}
return topOrder;
}
/**
@ -71,13 +99,27 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
@DS("#header.poolName")
public int insertMesReportWork(MesReportWork mesReportWork) {
mesReportWork.setCreateTime(DateUtils.getNowDate());
R s = iWCSInterfaceService.reportWork(mesReportWork);
System.out.println("管理系统报工:"+s.getCode()+",message:"+s.getMsg());
String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, mesReportWork.getFeedbackTime());
int liushuiNum = mesReportWorkMapper.getTodayMaxNum(mesReportWork);
String liushuiStr = String.format("%04d", liushuiNum);
mesReportWork.setReportCode(bpDD+liushuiStr);
return mesReportWorkMapper.insertMesReportWork(mesReportWork);
mesReportWork.setProdType("prod");
mesReportWorkMapper.insertMesReportWork(mesReportWork);
//新增的时候直接报工
// mesReportWork.setFactoryCode(ServletUtils.getRequest().getHeader("PoolName"));
// R s = iWCSInterfaceService.reportWork(mesReportWork);
// System.out.println("管理系统报工:"+s.getCode()+",message:"+s.getMsg());
return 1;
}
@Override
@DS("#header.poolName")
public R reportSap(MesReportWork mesReportWork) {
mesReportWork.setFactoryCode(ServletUtils.getRequest().getHeader("PoolName"));
R s = iWCSInterfaceService.reportWork(mesReportWork);
//System.out.println("管理系统报工:"+s.getCode()+",message:"+s.getMsg());
return s;
}
/**
@ -319,6 +361,12 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
return mesReportWorkMapper.getMesListUser(sysUser);
}
@Override
@DS("#header.poolName")
public List<EquEquipmentDTO> getMesListEquip(EquEquipmentDTO qo) {
return mesReportWorkMapper.getMesListEquip(qo);
}
@Override
@DS("#header.poolName")
public List<ProOrderWorkorderDTO> getMesListWorkOrder(ProOrderWorkorderDTO proOrderWorkorderDTO) {
@ -338,11 +386,15 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
prodLineName.append(equipMap.get(equipCode).getEquipmentName()+ ",");
}
dto.setProdLineCode(prodLineName.toString());
//把母单的排产数量搞出来
ProOrderWorkorder topOrder = this.getTopOrder(dto.getWorkorderCode());
dto.setQuantitySplit(topOrder.getQuantitySplit());
dto.setUnit(topOrder.getUnit());
}
return dtos;
}
public static void main(String[] args) {
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();

@ -60,6 +60,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMesReportWorkConsumeVo"/>
where record_id = #{recordId}
</select>
<select id="getMesListBom" resultType="com.op.system.api.domain.dto.BaseBomDTO">
select bbc.component,
bbc.component_unit unit,
bp.product_desc_zh componentName,
bp.product_group productGroup,
bp.product_group_name productGroupName
from base_bom_component bbc
left join base_product bp on SUBSTRING(bp.product_code, 8, 12) = bbc.component
where bbc.product_code = SUBSTRING(#{productCode}, 8, 12)
and bp.del_flag = '0'
<if test="component != null and component != ''"> and bbc.component like concat('%', #{component}, '%')</if>
<if test="componentName != null and componentName != ''"> bp.product_desc_zh like concat('%', #{componentName}, '%')</if>
<if test="productGroup != null and productGroup != ''"> and bp.product_group like concat('%', #{productGroup}, '%')</if>
<if test="productGroupName != null and productGroupName != ''"> and bp.product_group_name like concat('%', #{productGroupName}, '%')</if>
</select>
<insert id="insertMesReportWorkConsume" parameterType="MesReportWorkConsume">
insert into mes_report_work_consume

@ -37,6 +37,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="uploadTime" column="upload_time" />
<result property="uploadStatus" column="upload_status" />
<result property="uploadMsg" column="upload_msg" />
<result property="orderCode" column="order_code" />
</resultMap>
<resultMap type="com.op.system.api.domain.mes.ProOrderWorkorderDTO" id="ProOrderWorkorderDTOResult">
<result property="workorderId" column="workorder_id" />
@ -79,40 +83,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
quantity_unqualified, user_name, nick_name, feedback_channel,
feedback_time, record_user, status, remark, work_time, machine_code,
machine_name, team_code, shift_code, attr1, attr2, attr3, attr4, create_by,
create_time, update_time, update_by
create_time, update_time, update_by,
upload_time,upload_status,upload_msg
from mes_report_work
</sql>
<select id="selectMesReportWorkList" parameterType="MesReportWork" resultMap="MesReportWorkResult">
<include refid="selectMesReportWorkVo"/>
select mrw.id, mrw.report_type, mrw.report_code, mrw.workorder_code, mrw.product_code,
mrw.product_name, mrw.spec, mrw.unit, mrw.quantity, mrw.quantity_feedback,
mrw.user_name, mrw.nick_name, mrw.feedback_channel,
mrw.feedback_time, mrw.record_user, mrw.status, mrw.remark, mrw.work_time, mrw.machine_code,
mrw.machine_name, mrw.team_code, mrw.shift_code, mrw.create_by,
mrw.create_time,mrw.upload_time,mrw.upload_status,mrw.upload_msg,
pow.order_code
from mes_report_work mrw
left join pro_order_workorder pow on mrw.workorder_code = pow.workorder_code
<where>
<if test="reportType != null and reportType != ''"> and report_type = #{reportType}</if>
<if test="reportCode != null and reportCode != ''"> and report_code = #{reportCode}</if>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="spec != null and spec != ''"> and spec = #{spec}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="quantityFeedback != null "> and quantity_feedback = #{quantityFeedback}</if>
<if test="quantityQualified != null "> and quantity_qualified = #{quantityQualified}</if>
<if test="quantityUnqualified != null "> and quantity_unqualified = #{quantityUnqualified}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="feedbackChannel != null and feedbackChannel != ''"> and feedback_channel = #{feedbackChannel}</if>
<if test="feedbackTime != null "> and feedback_time = #{feedbackTime}</if>
<if test="recordUser != null and recordUser != ''"> and record_user = #{recordUser}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="workTime != null "> and work_time = #{workTime}</if>
<if test="machineCode != null and machineCode != ''"> and machine_code = #{machineCode}</if>
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
<if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if>
<if test="shiftCode != null and shiftCode != ''"> and shift_code = #{shiftCode}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
and mrw.del_flag = '0'
<if test="reportCode != null and reportCode != ''"> and mrw.report_code like concat('%', #{reportCode}, '%')</if>
<if test="workorderCode != null and workorderCode != ''"> and mrw.workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="productCode != null and productCode != ''"> and mrw.product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and mrw.product_name like concat('%', #{productName}, '%')</if>
<if test="userName != null and userName != ''"> and mrw.user_name like concat('%', #{userName}, '%')</if>
<if test="nickName != null and nickName != ''"> and mrw.nick_name like concat('%', #{nickName}, '%')</if>
<if test="feedbackTime != null "> and mrw.feedback_time = #{feedbackTime}</if>
<if test="machineCode != null and machineCode != ''"> and mrw.machine_code = #{machineCode}</if>
<if test="machineName != null and machineName != ''"> and mrw.machine_name like concat('%', #{machineName}, '%')</if>
<if test="teamCode != null and teamCode != ''"> and mrw.team_code = #{teamCode}</if>
<if test="shiftCode != null and shiftCode != ''"> and mrw.shift_code = #{shiftCode}</if>
<if test="createTimeStart != null "> and CONVERT(varchar(30),mrw.create_time, 120) >= #{createTimeStart}</if>
<if test="createTimeEnd != null "> and #{createTimeEnd} > CONVERT(varchar(30),mrw.create_time, 120)</if>
<if test="feedbackTimeStart != null "> and CONVERT(varchar(10),mrw.feedback_time, 120) >= #{feedbackTimeStart}</if>
<if test="feedbackTimeEnd != null "> and #{feedbackTimeEnd} >= CONVERT(varchar(10),mrw.feedback_time, 120)</if>
<if test="orderCode != null and orderCode != ''"> and pow.order_code like concat('%', #{orderCode}, '%')</if>
<if test="uploadStatus != null and uploadStatus != ''"> and mrw.upload_status = #{uploadStatus}</if>
</where>
order by mrw.workorder_code,mrw.create_time
</select>
<select id="selectMesReportWorkById" parameterType="String" resultMap="MesReportWorkResult">
@ -223,8 +229,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code
left join pro_route rte on rte.route_code = ow.route_code
where mrw.upload_status != #{uploadStatus} and mrw.prod_type = #{prodType}
<if test="productDateEnd != null ">
and ow.order_code = #{orderCode}
<if test="reportCode != null ">
and mrw.report_code = #{reportCode}
</if>
order by mrw.create_time
</select>
@ -369,17 +375,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getProdResult" resultType="com.op.mes.domain.MesReportWork">
select
mrw.workorder_code,
mrw.workorder_code workorderCode,
sum(mrw.quantity_feedback) quantityFeedback
from mes_report_work mrw
where mrw.del_flag = '0' and mrw.workorder_code = #{workorderode}
where mrw.del_flag = '0' and mrw.workorder_code = #{workorderCode}
group by mrw.workorder_code
</select>
<select id="getOrderByCode" resultType="com.op.mes.domain.ProOrderWorkorder">
select workorder_code workorderCode,
parent_order parentOrder,
quantity_split quantitySplit
quantity_split quantitySplit,
unit
from pro_order_workorder where workorder_code = #{workorderCode}
</select>
<select id="getMesListUser" resultType="com.op.system.api.domain.SysUser">
@ -415,6 +422,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select equipment_code equipmentCode,equipment_name equipmentName from base_equipment where equipment_code in
('${equipCodes}')
</select>
<select id="getMesListEquip" resultType="com.op.system.api.domain.device.EquEquipmentDTO">
select
equipment_code equipmentCode,
equipment_name equipmentName
from base_equipment
where equipment_type_code = 'equ_type_bzx' and del_flag = '0'
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work
@ -451,6 +465,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="prodType != null and prodType != ''">prod_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -485,6 +500,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="prodType != null and prodType != ''">#{prodType},</if>
</trim>
</insert>
@ -528,22 +544,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateSyncSapStatus">
update mes_report_work
<trim prefix="SET" suffixOverrides=",">
<if test="uploadTime != null and uploadTime != ''">upload_time = #{uploadTime},</if>
<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 id = #{id}
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>
<delete id="deleteMesReportWorkById" parameterType="String">
delete from mes_report_work where id = #{id}
update mes_report_work set del_flag = '1' where id = #{id}
</delete>
<delete id="deleteMesReportWorkByIds" parameterType="String">
delete from mes_report_work where id in
update mes_report_work set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

@ -89,6 +89,8 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
for (ProOrderWorkorder workorder : workorderList) {
String prodLineName = "";
String equipCods = "'";
System.out.println("workorder_id:"+workorder.getWorkorderId());
System.out.println("prodLineCode:"+workorder.getProdLineCode());
JSONArray codeArray = JSONArray.parseArray(workorder.getProdLineCode());
for (int c = 0; c < codeArray.size(); c++) {
equipCods += codeArray.getJSONArray(c).getString(1) + "','";

@ -118,24 +118,6 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
proOrder.setProdDesc("");
proWhiteOrderMapper.insertProOrder(proOrder);
// System.out.println("源code---->"+proOrder.getProdCode());
// System.out.println("源desc---->"+proOrder.getProdDesc());
//
// System.out.println("code---------->");
// for (String code : prodCodes) {
// System.out.println(code);
// }
// System.out.println("desc----------->");
// for (String desc : prodDescs) {
// System.out.println(desc);
// }
//
// System.out.println("这里是母订单信息");
// System.out.println("母订单code"+proOrder.getOrderCode());
//
//
// System.out.println("这里是子订单信息");
// 设置子订单信息
for (int i = 0; i< prodCodes.length; i++){
@ -161,9 +143,6 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
childProOrder.setUpdateTime(DateUtils.getNowDate());
// 将子订单插入数据库
proWhiteOrderMapper.insertProOrder(childProOrder);
// System.out.println("子订单code"+i+childProOrder.getOrderCode());
// System.out.println("子订单parentCode"+i+childProOrder.getParentOrder());
}
return 1;

@ -75,4 +75,6 @@ public interface SysDatasourceMapper
int deleteUserRoleInfos(@Param("datasourceId") String datasourceId, @Param("userIds") Long[] userIds);
List<SysDatasource> selectDBListByDept(SysDatasource qo);
void deletUserDB(String userCode);
}

@ -249,6 +249,10 @@ public class SysUserServiceImpl implements ISysUserService {
// 新增用户与园区数据源
SysDatasource qo = new SysDatasource();
qo.setDeptId(user.getDeptId());//
//先删掉
sysDatasourceMapper.deletUserDB(user.getUserId().toString());
//再添加
List<SysDatasource> dbs = sysDatasourceMapper.selectDBListByDept(qo);
List<SysDatasource> list = new ArrayList<SysDatasource>();
for (SysDatasource db : dbs) {

@ -188,4 +188,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{userId}
</foreach>
</delete>
<delete id="deletUserDB">
delete from sys_user_datasource where user_id =#{userCode}
</delete>
</mapper>

Loading…
Cancel
Save