Merge remote-tracking branch 'origin/master'

master
mengjiao 1 year ago
commit fbf5dfe27e

@ -136,6 +136,15 @@ public class QcCheckTaskIncomeDTO extends BaseEntity {
private BigDecimal bNoOkquality;
private BigDecimal cNoOkquality;
private String orderType;
private String orderTypeDesc;
public String getOrderTypeDesc() {
return orderTypeDesc;
}
public void setOrderTypeDesc(String orderTypeDesc) {
this.orderTypeDesc = orderTypeDesc;
}
public String getOrderType() {
return orderType;

@ -0,0 +1,109 @@
package com.op.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.nacos.shaded.com.google.protobuf.Internal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesLine;
import com.op.mes.service.IMesLineService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* 线Controller
*
* @author Open Platform
* @date 2024-04-02
*/
@RestController
@RequestMapping("/mesLine")
public class MesLineController extends BaseController {
@Autowired
private IMesLineService mesLineService;
/**
* 线
*/
@RequiresPermissions("mes:mesLine:list")
@GetMapping("/list")
public TableDataInfo list(MesLine mesLine) {
startPage();
List<MesLine> list = mesLineService.selectMesLineList(mesLine);
return getDataTable(list);
}
/**
* 线
*/
@RequiresPermissions("mes:mesLine:export")
@Log(title = "线体管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesLine mesLine) {
List<MesLine> list = mesLineService.selectMesLineList(mesLine);
ExcelUtil<MesLine> util = new ExcelUtil<MesLine>(MesLine. class);
util.exportExcel(response, list, "线体管理数据");
}
/**
* 线
*/
@RequiresPermissions("mes:mesLine:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return success(mesLineService.selectMesLineById(id));
}
/**
* 线
*/
@RequiresPermissions("mes:mesLine:add")
@Log(title = "线体管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesLine mesLine) {
return toAjax(mesLineService.insertMesLine(mesLine));
}
/**
* 线
*/
@RequiresPermissions("mes:mesLine:edit")
@Log(title = "线体管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesLine mesLine) {
return toAjax(mesLineService.updateMesLine(mesLine));
}
/**
* 线
*/
@RequiresPermissions("mes:mesLine:remove")
@Log(title = "线体管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(mesLineService.deleteMesLineByIds(ids));
}
/**
* 线
*/
@GetMapping("/selectLineBody")
public TableDataInfo selectLineBody(MesLine mesLine) {
startPage();
List<MesLine> list = mesLineService.selectLineBody(mesLine);
return getDataTable(list);
}
}

@ -0,0 +1,202 @@
package com.op.mes.domain;
import java.math.BigDecimal;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* 线 mes_line
*
* @author Open Platform
* @date 2024-04-02
*/
public class MesLine extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 线
*/
@Excel(name = "线体编码")
private String lineCode;
/**
* 线
*/
@Excel(name = "线体名称")
private String lineName;
/**
*
*/
@Excel(name = "标准用人")
private Long useMan;
/**
*
*/
@Excel(name = "标准效率")
private BigDecimal efficiency;
/**
*
*/
@Excel(name = "检验工具")
private String attr1;
/**
* $column.columnComment
*/
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String attr2;
/**
* $column.columnComment
*/
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String attr3;
/**
* 1
*/
@Excel(name = "预留字段1")
private String attr4;
/**
*
*/
@Excel(name = "工厂编码")
private String factoryCode;
/**
* 10
*/
private String delFlag;
private List<String> processList;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setLineCode(String lineCode) {
this.lineCode = lineCode;
}
public String getLineCode() {
return lineCode;
}
public void setLineName(String lineName) {
this.lineName = lineName;
}
public String getLineName() {
return lineName;
}
public void setUseMan(Long useMan) {
this.useMan = useMan;
}
public Long getUseMan() {
return useMan;
}
public void setEfficiency(BigDecimal efficiency) {
this.efficiency = efficiency;
}
public BigDecimal getEfficiency() {
return efficiency;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public List<String> getProcessList() {
return processList;
}
public void setProcessList(List<String> processList) {
this.processList = processList;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("lineCode", getLineCode())
.append("lineName", getLineName())
.append("useMan", getUseMan())
.append("efficiency", getEfficiency())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -0,0 +1,182 @@
package com.op.mes.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* 线 mes_line_process
*
* @author Open Platform
* @date 2024-04-07
*/
public class MesLineProcess extends BaseEntity {
private static final long serialVersionUID=1L;
/** id */
private String id;
/** 父级id */
@Excel(name = "父级id")
private String belongTo;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String processCode;
/** 工艺名称 */
@Excel(name = "工艺名称")
private String processName;
/** 数量 */
@Excel(name = "数量")
private BigDecimal quality;
/** 检验工具 */
@Excel(name = "检验工具")
private String attr1;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String attr2;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String attr3;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr4;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
/** 删除标识1删除0正常 */
private String delFlag;
/** 所属线体编码 */
@Excel(name = "所属线体编码")
private String lineCode;
/** 所属线体名称 */
@Excel(name = "所属线体名称")
private String lineName;
public void setId(String id){
this.id = id;
}
public String getId(){
return id;
}
public void setBelongTo(String belongTo){
this.belongTo = belongTo;
}
public String getBelongTo(){
return belongTo;
}
public void setProcessCode(String processCode){
this.processCode = processCode;
}
public String getProcessCode(){
return processCode;
}
public void setProcessName(String processName){
this.processName = processName;
}
public String getProcessName(){
return processName;
}
public void setQuality(BigDecimal quality){
this.quality = quality;
}
public BigDecimal getQuality(){
return quality;
}
public void setAttr1(String attr1){
this.attr1 = attr1;
}
public String getAttr1(){
return attr1;
}
public void setAttr2(String attr2){
this.attr2 = attr2;
}
public String getAttr2(){
return attr2;
}
public void setAttr3(String attr3){
this.attr3 = attr3;
}
public String getAttr3(){
return attr3;
}
public void setAttr4(String attr4){
this.attr4 = attr4;
}
public String getAttr4(){
return attr4;
}
public void setFactoryCode(String factoryCode){
this.factoryCode = factoryCode;
}
public String getFactoryCode(){
return factoryCode;
}
public void setDelFlag(String delFlag){
this.delFlag = delFlag;
}
public String getDelFlag(){
return delFlag;
}
public void setLineCode(String lineCode){
this.lineCode = lineCode;
}
public String getLineCode(){
return lineCode;
}
public void setLineName(String lineName){
this.lineName = lineName;
}
public String getLineName(){
return lineName;
}
@Override
public String toString(){
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id",getId())
.append("belongTo",getBelongTo())
.append("processCode",getProcessCode())
.append("processName",getProcessName())
.append("quality",getQuality())
.append("attr1",getAttr1())
.append("attr2",getAttr2())
.append("attr3",getAttr3())
.append("attr4",getAttr4())
.append("createBy",getCreateBy())
.append("createTime",getCreateTime())
.append("updateBy",getUpdateBy())
.append("updateTime",getUpdateTime())
.append("factoryCode",getFactoryCode())
.append("delFlag",getDelFlag())
.append("lineCode",getLineCode())
.append("lineName",getLineName())
.toString();
}
}

@ -0,0 +1,67 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesLine;
import org.apache.ibatis.annotations.Mapper;
/**
* 线Mapper
*
* @author Open Platform
* @date 2024-04-02
*/
@Mapper
public interface MesLineMapper {
/**
* 线
*
* @param id 线
* @return 线
*/
public MesLine selectMesLineById(String id);
/**
* 线
*
* @param mesLine 线
* @return 线
*/
public List<MesLine> selectMesLineList(MesLine mesLine);
/**
* 线
*
* @param mesLine 线
* @return
*/
public int insertMesLine(MesLine mesLine);
/**
* 线
*
* @param mesLine 线
* @return
*/
public int updateMesLine(MesLine mesLine);
/**
* 线
*
* @param id 线
* @return
*/
public int deleteMesLineById(String id);
/**
* 线
*
* @param ids
* @return
*/
public int deleteMesLineByIds(String[] ids);
/**
* 线
*/
public List<MesLine> selectLineBody(MesLine mesLine);
}

@ -0,0 +1,67 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesLineProcess;
import org.apache.ibatis.annotations.Mapper;
/**
* 线Mapper
*
* @author Open Platform
* @date 2024-04-07
*/
@Mapper
public interface MesLineProcessMapper {
/**
* 线
*
* @param id 线
* @return 线
*/
public MesLineProcess selectMesLineProcessById(String id);
public List<MesLineProcess> selectMesLineProcessByBelongTo(String belongTo);
/**
* 线
*
* @param mesLineProcess 线
* @return 线
*/
public List<MesLineProcess> selectMesLineProcessList(MesLineProcess mesLineProcess);
/**
* 线
*
* @param mesLineProcess 线
* @return
*/
public int insertMesLineProcess(MesLineProcess mesLineProcess);
/**
* 线
*
* @param mesLineProcess 线
* @return
*/
public int updateMesLineProcess(MesLineProcess mesLineProcess);
/**
* 线
*
* @param id 线
* @return
*/
public int deleteMesLineProcessById(String id);
/**
* 线
*
* @param ids
* @return
*/
public int deleteMesLineProcessByIds(String[] ids);
public int deleteMesLineProcessByBelongTo(String belongTo);
}

@ -1,5 +1,6 @@
package com.op.mes.mapper;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -144,4 +145,6 @@ public interface MesReportWorkMapper {
int updateAttr2(MesReportWork workorder);
void updateReportRemark(@Param("list") List<MesReportWork> mesReportWork);
BigDecimal getReportRate(String productCode);
}

@ -0,0 +1,64 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesLineProcess;
/**
* 线Service
*
* @author Open Platform
* @date 2024-04-07
*/
public interface IMesLineProcessService {
/**
* 线
*
* @param id 线
* @return 线
*/
public MesLineProcess selectMesLineProcessById(String id);
public List<MesLineProcess> selectMesLineProcessByBelongTo(String belongTo);
/**
* 线
*
* @param mesLineProcess 线
* @return 线
*/
public List<MesLineProcess> selectMesLineProcessList(MesLineProcess mesLineProcess);
/**
* 线
*
* @param mesLineProcess 线
* @return
*/
public int insertMesLineProcess(MesLineProcess mesLineProcess);
/**
* 线
*
* @param mesLineProcess 线
* @return
*/
public int updateMesLineProcess(MesLineProcess mesLineProcess);
/**
* 线
*
* @param ids 线
* @return
*/
public int deleteMesLineProcessByIds(String[] ids);
/**
* 线
*
* @param id 线
* @return
*/
public int deleteMesLineProcessById(String id);
public int deleteMesLineProcessByBelongTo(String belongTo);
}

@ -0,0 +1,66 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesLine;
/**
* 线Service
*
* @author Open Platform
* @date 2024-04-02
*/
public interface IMesLineService {
/**
* 线
*
* @param id 线
* @return 线
*/
public MesLine selectMesLineById(String id);
/**
* 线
*
* @param mesLine 线
* @return 线
*/
public List<MesLine> selectMesLineList(MesLine mesLine);
/**
* 线
*
* @param mesLine 线
* @return
*/
public int insertMesLine(MesLine mesLine);
/**
* 线
*
* @param mesLine 线
* @return
*/
public int updateMesLine(MesLine mesLine);
/**
* 线
*
* @param ids 线
* @return
*/
public int deleteMesLineByIds(String[] ids);
/**
* 线
*
* @param id 线
* @return
*/
public int deleteMesLineById(String id);
/**
* 线
*/
public List<MesLine> selectLineBody(MesLine mesLine);
}

@ -37,6 +37,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
@ -372,6 +373,13 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
if(sHzWorks==null){
return R.fail("未查询到子报工单");
}
//查询base_product的report_rate//箱子-大盒-小盒
BigDecimal reportRate = mesReportWorkMapper.getReportRate(workOrders.get(0).getProductCode());
if(reportRate != null){
BigDecimal newQuantity = sHzWorks.getQuantityFeedback().divide(reportRate,2, RoundingMode.HALF_UP);
sHzWorks.setQuantityFeedback(newQuantity);
}
//子工单报工
logger.info("==========================子工单报工开始");
sapRson = this.reportHzToSap(sHzWorks);
@ -398,7 +406,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
}else if(workOrders.size()>=3){
MesReportWork hzWorks = null;
BigDecimal gamng = null;
for(int n=0;n<workOrders.size();n++){
MesReportWork workOrder = workOrders.get(n);
@ -409,12 +417,15 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
if (sHzWorks == null) {
return R.fail(workOrder.getWorkorderCode()+"未查询到报工单");
}
if(n==0){
hzWorks = sHzWorks;
if(n == (workOrders.size()-2)){
gamng = sHzWorks.getQuantityFeedback();
}
if(n == (workOrders.size()-1)){
sHzWorks.setQuantityFeedback(gamng);
}
//三层以上工单报工
logger.info("==========================三层(第"+n+"层)以上工单("+sHzWorks.getWorkorderCodeSap()+")报工开始");
sHzWorks.setQuantityFeedback(hzWorks.getQuantityFeedback());
sapRson = this.reportHzToSap(sHzWorks);
logger.info("==========================三层(第"+n+"层)以上工单("+sHzWorks.getWorkorderCodeSap()+")报工结束:"
+ JSONObject.toJSONString(sapRson));

@ -0,0 +1,110 @@
package com.op.mes.service.impl;
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.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesLineProcessMapper;
import com.op.mes.domain.MesLineProcess;
import com.op.mes.service.IMesLineProcessService;
/**
* 线Service
*
* @author Open Platform
* @date 2024-04-07
*/
@Service
public class MesLineProcessServiceImpl implements IMesLineProcessService {
@Autowired
private MesLineProcessMapper mesLineProcessMapper;
/**
* 线
*
* @param id 线
* @return 线
*/
@Override
@DS("#header.poolName")
public MesLineProcess selectMesLineProcessById(String id) {
return mesLineProcessMapper.selectMesLineProcessById(id);
}
@Override
public List<MesLineProcess> selectMesLineProcessByBelongTo(String belongTo) {
return mesLineProcessMapper.selectMesLineProcessByBelongTo(belongTo);
}
/**
* 线
*
* @param mesLineProcess 线
* @return 线
*/
@Override
@DS("#header.poolName")
public List<MesLineProcess> selectMesLineProcessList(MesLineProcess mesLineProcess) {
return mesLineProcessMapper.selectMesLineProcessList(mesLineProcess);
}
/**
* 线
*
* @param mesLineProcess 线
* @return
*/
@Override
@DS("#header.poolName")
public int insertMesLineProcess(MesLineProcess mesLineProcess) {
mesLineProcess.setId(IdUtils.fastSimpleUUID());
mesLineProcess.setCreateTime(DateUtils.getNowDate());
mesLineProcess.setCreateBy(SecurityUtils.getUsername());
return mesLineProcessMapper.insertMesLineProcess(mesLineProcess);
}
/**
* 线
*
* @param mesLineProcess 线
* @return
*/
@Override
@DS("#header.poolName")
public int updateMesLineProcess(MesLineProcess mesLineProcess) {
mesLineProcess.setUpdateTime(DateUtils.getNowDate());
return mesLineProcessMapper.updateMesLineProcess(mesLineProcess);
}
/**
* 线
*
* @param ids 线
* @return
*/
@Override
public int deleteMesLineProcessByIds(String[] ids) {
return mesLineProcessMapper.deleteMesLineProcessByIds(ids);
}
/**
* 线
*
* @param id 线
* @return
*/
@Override
public int deleteMesLineProcessById(String id) {
return mesLineProcessMapper.deleteMesLineProcessById(id);
}
@Override
@DS("#header.poolName")
public int deleteMesLineProcessByBelongTo(String belongTo) {
return mesLineProcessMapper.deleteMesLineProcessByBelongTo(belongTo);
}
}

@ -0,0 +1,164 @@
package com.op.mes.service.impl;
import java.util.List;
import java.util.stream.Collectors;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.mes.domain.MesLineProcess;
import com.op.mes.service.IMesLineProcessService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesLineMapper;
import com.op.mes.domain.MesLine;
import com.op.mes.service.IMesLineService;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* 线Service
*
* @author Open Platform
* @date 2024-04-02
*/
@Service
public class MesLineServiceImpl implements IMesLineService {
@Autowired
private MesLineMapper mesLineMapper;
@Autowired
private IMesLineProcessService mesLineProcessService;
/**
* 线
*
* @param id 线
* @return 线
*/
@Override
@DS("#header.poolName")
public MesLine selectMesLineById(String id) {
//查询时回显线体工艺数据
List<MesLineProcess> mesList = mesLineProcessService.selectMesLineProcessByBelongTo(id);
List<String> processList = mesList.stream().map(MesLineProcess::getProcessName).collect(Collectors.toList());
MesLine mesLine = mesLineMapper.selectMesLineById(id);
//设置线体数据
if (!CollectionUtils.isEmpty(processList)) {
mesLine.setProcessList(processList);
}
return mesLine;
}
/**
* 线
*
* @param mesLine 线
* @return 线
*/
@Override
@DS("#header.poolName")
public List<MesLine> selectMesLineList(MesLine mesLine) {
return mesLineMapper.selectMesLineList(mesLine);
}
/**
* 线
*
* @param mesLine 线
* @return
*/
@Override
@DS("#header.poolName")
public int insertMesLine(MesLine mesLine) {
mesLine.setCreateTime(DateUtils.getNowDate());
mesLine.setCreateBy(SecurityUtils.getUsername());
mesLine.setId(IdUtils.fastSimpleUUID());
// 获取工厂编码
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_", "");
mesLine.setFactoryCode(factoryCode);
return mesLineMapper.insertMesLine(mesLine);
}
/**
* 线
*
* @param mesLine 线
* @return
*/
@Override
@DS("#header.poolName")
@Transactional(propagation = Propagation.REQUIRED)
public int updateMesLine(MesLine mesLine) {
mesLine.setUpdateTime(DateUtils.getNowDate());
mesLine.setUpdateBy(SecurityUtils.getUsername());
List<String> processList = mesLine.getProcessList();
int flag = 0;
if (!CollectionUtils.isEmpty(processList)) {
//删除旧的工艺项
mesLineProcessService.deleteMesLineProcessByBelongTo(mesLine.getId());
String belongTo = mesLine.getId();
String lineCode = mesLine.getLineCode();
String lineName = mesLine.getLineName();
// 获取工厂编码
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_", "");
for (String processName : processList ) {
MesLineProcess mesLineProcess = new MesLineProcess();
mesLineProcess.setBelongTo(belongTo);
mesLineProcess.setProcessName(processName);
mesLineProcess.setLineCode(lineCode);
mesLineProcess.setLineName(lineName);
mesLineProcess.setFactoryCode(factoryCode);
flag += mesLineProcessService.insertMesLineProcess(mesLineProcess);
}
}else {
return 0;
}
if (flag > 0){
return mesLineMapper.updateMesLine(mesLine);
}else {
return 0;
}
}
/**
* 线
*
* @param ids 线
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesLineByIds(String[] ids) {
return mesLineMapper.deleteMesLineByIds(ids);
}
/**
* 线
*
* @param id 线
* @return
*/
@Override
public int deleteMesLineById(String id) {
return mesLineMapper.deleteMesLineById(id);
}
@Override
@DS("#header.poolName")
public List<MesLine> selectLineBody(MesLine mesLine) {
return mesLineMapper.selectLineBody(mesLine);
}
}

@ -273,8 +273,14 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
@DS("#header.poolName")
public int reportSapCancel(MesReportWork mesReportWork) {
mesReportWork.setFactoryCode(ServletUtils.getRequest().getHeader("PoolName"));
int m = mesReportWorkMapper.reportSapCancel(mesReportWork);
return m;
mesReportWorkMapper.reportSapCancel(mesReportWork);
ProOrderWorkorder son = mesReportWorkMapper.getSonWorkOrder(mesReportWork.getWorkorderCode());
while(son != null){
mesReportWork.setWorkorderCode(son.getWorkorderCode());
mesReportWorkMapper.reportSapCancel(mesReportWork);
son = mesReportWorkMapper.getSonWorkOrder(son.getWorkorderCode());
}
return 1;
}
@Override

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.mes.mapper.MesLineMapper">
<resultMap type="MesLine" id="MesLineResult">
<result property="id" column="id"/>
<result property="lineCode" column="line_code"/>
<result property="lineName" column="line_name"/>
<result property="useMan" column="use_man"/>
<result property="efficiency" column="efficiency"/>
<result property="attr1" column="attr1"/>
<result property="attr2" column="attr2"/>
<result property="attr3" column="attr3"/>
<result property="attr4" column="attr4"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="factoryCode" column="factory_code"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<sql id="selectMesLineVo">
select id, line_code, line_name, use_man, efficiency, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag from mes_line
</sql>
<select id="selectMesLineList" parameterType="MesLine" resultMap="MesLineResult">
<include refid="selectMesLineVo"/>
<where>
<if test="lineCode != null and lineCode != ''">
and line_code = #{lineCode}
</if>
<if test="lineName != null and lineName != ''">
and line_name like concat('%', #{lineName}, '%')
</if>
<if test="useMan != null ">
and use_man = #{useMan}
</if>
<if test="efficiency != null ">
and efficiency = #{efficiency}
</if>
<if test="attr1 != null and attr1 != ''">
and attr1 = #{attr1}
</if>
<if test="attr2 != null and attr2 != ''">
and attr2 = #{attr2}
</if>
<if test="attr3 != null and attr3 != ''">
and attr3 = #{attr3}
</if>
<if test="attr4 != null and attr4 != ''">
and attr4 = #{attr4}
</if>
<if test="factoryCode != null and factoryCode != ''">
and factory_code = #{factoryCode}
</if>
and del_flag = '0'
</where>
</select>
<select id="selectMesLineById" parameterType="String"
resultMap="MesLineResult">
<include refid="selectMesLineVo"/>
where id = #{id}
</select>
<insert id="insertMesLine" parameterType="MesLine">
insert into mes_line
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="lineCode != null">line_code,</if>
<if test="lineName != null">line_name,</if>
<if test="useMan != null">use_man,</if>
<if test="efficiency != null">efficiency,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="lineCode != null">#{lineCode},</if>
<if test="lineName != null">#{lineName},</if>
<if test="useMan != null">#{useMan},</if>
<if test="efficiency != null">#{efficiency},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateMesLine" parameterType="MesLine">
update mes_line
<trim prefix="SET" suffixOverrides=",">
<if test="lineCode != null">line_code = #{lineCode},</if>
<if test="lineName != null">line_name = #{lineName},</if>
<if test="useMan != null">use_man = #{useMan},</if>
<if test="efficiency != null">efficiency = #{efficiency},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="delFlag != null">del_flag =#{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMesLineById" parameterType="String">
update mes_line set del_flag = '1' where id = #{id}
</delete>
<delete id="deleteMesLineByIds" parameterType="String">
update mes_line set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectLineBody" parameterType="MesLine" resultMap="MesLineResult" >
select equipment_code line_code,
equipment_name line_name
from base_equipment
where del_flag = '0'
<if test="lineCode != null and lineCode != ''">
and equipment_code = #{lineCode}
</if>
<if test="lineName != null and lineName != ''">
and equipment_name like concat('%', #{lineName}, '%')
</if>
</select>
</mapper>

@ -0,0 +1,226 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.mes.mapper.MesLineProcessMapper">
<resultMap type="MesLineProcess" id="MesLineProcessResult">
<result property="id" column="id"/>
<result property="belongTo" column="belong_to"/>
<result property="processCode" column="process_code"/>
<result property="processName" column="process_name"/>
<result property="quality" column="quality"/>
<result property="attr1" column="attr1"/>
<result property="attr2" column="attr2"/>
<result property="attr3" column="attr3"/>
<result property="attr4" column="attr4"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="factoryCode" column="factory_code"/>
<result property="delFlag" column="del_flag"/>
<result property="lineCode" column="line_code"/>
<result property="lineName" column="line_name"/>
</resultMap>
<sql id="selectMesLineProcessVo">
select id, belong_to, process_code, process_name, quality, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag, line_code, line_name from mes_line_process
</sql>
<select id="selectMesLineProcessList" parameterType="MesLineProcess" resultMap="MesLineProcessResult">
<include refid="selectMesLineProcessVo"/>
<where>
<if test="belongTo != null and belongTo != ''">
and belong_to = #{belongTo}
</if>
<if test="processCode != null and processCode != ''">
and process_code = #{processCode}
</if>
<if test="processName != null and processName != ''">
and process_name like concat('%', #{processName}, '%')
</if>
<if test="quality != null ">
and quality = #{quality}
</if>
<if test="attr1 != null and attr1 != ''">
and attr1 = #{attr1}
</if>
<if test="attr2 != null and attr2 != ''">
and attr2 = #{attr2}
</if>
<if test="attr3 != null and attr3 != ''">
and attr3 = #{attr3}
</if>
<if test="attr4 != null and attr4 != ''">
and attr4 = #{attr4}
</if>
<if test="factoryCode != null and factoryCode != ''">
and factory_code = #{factoryCode}
</if>
<if test="lineCode != null and lineCode != ''">
and line_code = #{lineCode}
</if>
<if test="lineName != null and lineName != ''">
and line_name like concat('%', #{lineName}, '%')
</if>
</where>
</select>
<select id="selectMesLineProcessById" parameterType="String"
resultMap="MesLineProcessResult">
<include refid="selectMesLineProcessVo"/>
where id = #{id}
</select>
<select id="selectMesLineProcessByBelongTo" parameterType="String"
resultMap="MesLineProcessResult">
<include refid="selectMesLineProcessVo"/>
where belong_to = #{belongTo}
</select>
<insert id="insertMesLineProcess" parameterType="MesLineProcess">
insert into mes_line_process
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,
</if>
<if test="belongTo != null">belong_to,
</if>
<if test="processCode != null">process_code,
</if>
<if test="processName != null">process_name,
</if>
<if test="quality != null">quality,
</if>
<if test="attr1 != null">attr1,
</if>
<if test="attr2 != null">attr2,
</if>
<if test="attr3 != null">attr3,
</if>
<if test="attr4 != null">attr4,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="factoryCode != null">factory_code,
</if>
<if test="delFlag != null">del_flag,
</if>
<if test="lineCode != null">line_code,
</if>
<if test="lineName != null">line_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},
</if>
<if test="belongTo != null">#{belongTo},
</if>
<if test="processCode != null">#{processCode},
</if>
<if test="processName != null">#{processName},
</if>
<if test="quality != null">#{quality},
</if>
<if test="attr1 != null">#{attr1},
</if>
<if test="attr2 != null">#{attr2},
</if>
<if test="attr3 != null">#{attr3},
</if>
<if test="attr4 != null">#{attr4},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="factoryCode != null">#{factoryCode},
</if>
<if test="delFlag != null">#{delFlag},
</if>
<if test="lineCode != null">#{lineCode},
</if>
<if test="lineName != null">#{lineName},
</if>
</trim>
</insert>
<update id="updateMesLineProcess" parameterType="MesLineProcess">
update mes_line_process
<trim prefix="SET" suffixOverrides=",">
<if test="belongTo != null">belong_to =
#{belongTo},
</if>
<if test="processCode != null">process_code =
#{processCode},
</if>
<if test="processName != null">process_name =
#{processName},
</if>
<if test="quality != null">quality =
#{quality},
</if>
<if test="attr1 != null">attr1 =
#{attr1},
</if>
<if test="attr2 != null">attr2 =
#{attr2},
</if>
<if test="attr3 != null">attr3 =
#{attr3},
</if>
<if test="attr4 != null">attr4 =
#{attr4},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="factoryCode != null">factory_code =
#{factoryCode},
</if>
<if test="delFlag != null">del_flag =
#{delFlag},
</if>
<if test="lineCode != null">line_code =
#{lineCode},
</if>
<if test="lineName != null">line_name =
#{lineName},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMesLineProcessById" parameterType="String">
delete from mes_line_process where id = #{id}
</delete>
<delete id="deleteMesLineProcessByIds" parameterType="String">
delete from mes_line_process where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteMesLineProcessByBelongTo" parameterType="String">
delete from mes_line_process where belong_to = #{belongTo}
</delete>
</mapper>

@ -473,7 +473,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getSapWorkOrder" resultType="com.op.mes.domain.MesReportWork">
select workorder_code_sap workorderCodeSap,
workorder_code workorderCode,
factory_code factoryCode
factory_code factoryCode,
product_code productCode
from pro_order_workorder
where belong_work_order = #{workorderCode} and del_flag = '0' <!--and status = 'w2'-->
order by order_code
@ -520,9 +521,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
pow.del_flag = '0'
<if test="keywords != null and keywords != ''">
and pow.order_code like concat('%', #{keywords}, '%') or
pow.workorder_code_sap like concat('%', #{keywords}, '%') or
mrw.productCode like concat('%', #{keywords}, '%')
and (
pow.order_code like concat('%', #{keywords}, '%') or
pow.workorder_code_sap like concat('%', #{keywords}, '%') or
mrw.productCode like concat('%', #{keywords}, '%')
)
</if>
<if test="feedbackTimeStart != null "> and pow.product_date >= #{feedbackTimeStart}</if>
<if test="feedbackTimeEnd != null "> and #{feedbackTimeEnd} >= pow.product_date</if>
@ -692,6 +695,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where mrwc.attr1 = '1' and mrwc.del_flag = '0' and mrwc.attr2 = '0'
and mrwc.parent_order = #{workorderCode}
</select>
<select id="getReportRate" resultType="java.math.BigDecimal">
select report_rate from base_product
where product_code = #{productCode}
and del_flag = '0'
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work

@ -168,6 +168,7 @@ public class QcCheckTaskIncome extends BaseEntity {
*/
private String delFlag;
private String orderType;
private String orderTypeDesc;
private String incomeTimeStart;
private String incomeTimeEnd;
private String checkTimeStart;
@ -193,6 +194,33 @@ public class QcCheckTaskIncome extends BaseEntity {
private String noOkQualityNames;
private String noOkQualityVals;
private String materialType;//来料类别
private String materialFrom;//物料来源
public String getOrderTypeDesc() {
return orderTypeDesc;
}
public void setOrderTypeDesc(String orderTypeDesc) {
this.orderTypeDesc = orderTypeDesc;
}
public String getMaterialType() {
return materialType;
}
public void setMaterialType(String materialType) {
this.materialType = materialType;
}
public String getMaterialFrom() {
return materialFrom;
}
public void setMaterialFrom(String materialFrom) {
this.materialFrom = materialFrom;
}
public String getCheckLocName() {
return checkLocName;
}

@ -256,7 +256,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
}
}
qcCheckTaskIncome.setNoOkQuality(noOkQuality);
/**qc_check_task**/
/**qc_check_task**///------------------zxl
qcCheckTaskIncomeMapper.insertQcCheckTaskIncome(qcCheckTaskIncome);
/**qc_check_task_detail**/

@ -201,6 +201,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
String[] userNames = qcUserMaterial.getUserNames();
String materialCode = qcUserMaterial.getMaterialCode();
String materialName = qcUserMaterial.getMaterialName();
String attr1 = qcUserMaterial.getAttr1();
String user = SecurityUtils.getUsername();
//插入数据
for (int i = 0; i < userCodes.length; i++) {
@ -212,6 +213,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
qcUserMaterialDto.setUserName(userNames[i]);
qcUserMaterialDto.setMaterialCode(materialCode);
qcUserMaterialDto.setMaterialName(materialName);
qcUserMaterialDto.setAttr1(attr1);
qcUserMaterialDto.setFactoryCode(factoryCode);
count += qcUserMaterialMapper.insertQcUserMaterial(qcUserMaterialDto);
}

@ -36,13 +36,17 @@
<result property="delFlag" column="del_flag"/>
<result property="checkType" column="check_type"/>
<result property="sampleQuality" column="sample_quality"/>
<result property="orderType" column="order_type"/>
<result property="orderTypeDesc" column="order_type_desc"/>
</resultMap>
<sql id="selectQcCheckTaskIncomeVo">
select record_id, check_no, income_batch_no, order_no, material_code, material_name, quality, unit,
supplier_code, supplier_name, income_time, check_loc, check_status, check_man_code,
check_man_name, check_time, check_result, status, attr1, attr2, attr3, attr4, create_by,
create_time, update_by, update_time, factory_code, del_flag , check_type,sample_quality, noOk_quality
create_time, update_by, update_time, factory_code, del_flag , check_type,sample_quality, noOk_quality,
order_type,order_type_desc
from qc_check_task
</sql>
@ -52,7 +56,7 @@
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
qct.check_man_code, qct.check_man_name,qct.check_time, qct.check_result, qct.status,
qct.create_by,qct.create_time, qct.update_by, qct.update_time,qct.check_type,qct.noOk_quality,
qct.sample_quality, qct.type_code
qct.sample_quality, qct.type_code, qct.order_type
from qc_check_task qct
<where>
<if test="checkNo != null and checkNo != ''">and qct.check_no = #{checkNo}</if>
@ -83,6 +87,7 @@
<if test="checkTimeEnd != null ">and #{checkTimeEnd} > CONVERT(varchar(30),qct.check_time, 120)</if>
<if test="checkType != null ">and qct.check_type = #{checkType}</if>
<if test="typeCode != null ">and qct.type_code = #{typeCode}</if>
<if test="orderType != null ">and qct.order_type = #{orderType}</if>
</where>
order by qct.create_time DESC
</select>
@ -208,6 +213,7 @@
<if test="typeCode != null">type_code,</if>
<if test="sampleQuality != null">sample_quality,</if>
<if test="orderType != null">order_type,</if>
<if test="orderTypeDesc != null">order_type_desc,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -243,6 +249,7 @@
<if test="typeCode != null">#{typeCode},</if>
<if test="sampleQuality != null">#{sampleQuality},</if>
<if test="orderType != null">#{orderType},</if>
<if test="orderTypeDesc != null">#{orderTypeDesc},</if>
</trim>
</insert>

@ -412,7 +412,10 @@ public class SapItemSyncImpl implements SapItemSyncService {
qcCheckTaskIncomeDTO.setRecordId(IdUtils.fastSimpleUUID());
qcCheckTaskIncomeDTO.setCheckType("checkTypeLL");
qcCheckTaskIncomeDTO.setTypeCode("material");
qcCheckTaskIncomeDTO.setOrderType("bc");//包材
/**8010 8020 8030 8040 8050 8060
8061 8062 8070 广8090 **/
qcCheckTaskIncomeDTO.setOrderType(maraTable.getString("MTART"));//物料类型
qcCheckTaskIncomeDTO.setOrderTypeDesc(maraTable.getString("MTBEZ"));//物料类型描述
qcCheckTaskIncomeDTO.setOrderNo(maraTable.getString("EBELN"));//采购订单
qcCheckTaskIncomeDTO.setSupplierCode(maraTable.getString("LIFNR"));
qcCheckTaskIncomeDTO.setSupplierName(maraTable.getString("LIFNR_NM"));

@ -242,7 +242,7 @@ public class SapOrderServiceImpl implements SapOrderService {
for (String orderCode : sapCloseOrderQuery.getOrderCodes()) {
jCoParameterList.setValue("P_AUFNR", orderCode);
func.execute(dest);//执行调用函数
String L_MSG1 = func.getExportParameterList().getString("L_MSG");
String L_MSG1 = func.getExportParameterList().getString("MSG");
Msg.append(orderCode + "-" + L_MSG1 + ";");
}

Loading…
Cancel
Save