Merge remote-tracking branch 'origin/master'

master
mengjiao 1 year ago
commit 0636acc210

@ -4,10 +4,7 @@ import com.op.common.core.constant.ServiceNameConstants;
import com.op.common.core.web.domain.AjaxResult;
import com.op.system.api.factory.RemoteOpenFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@ -24,6 +21,10 @@ public interface RemoteOpenService {
/**获取流程信息**/
@GetMapping("/openInterface/GetOaNodeInfo")
public AjaxResult GetOaNodeInfo(@RequestParam("requestId") String requestId);
@GetMapping("/openInterface/GetOaNodeInfo/{requestid}")
public AjaxResult GetOaNodeInfo(@PathVariable("requestid") String requestId);
/**获取HR人员信息**/
@GetMapping("/openInterface/GetHrUserInfo")
public AjaxResult GetHrUserInfo(@PathVariable("dateTime") String dateTime);
}

@ -0,0 +1,300 @@
package com.op.system.api.domain.quality;
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.util.Date;
/**
* oa
*
* @author Open Platform
* @date 2023-10-31
*/
public class OAInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
//请求id
private String REQUESTID;
//工作流id
private String WORKFLOWID;
//操作节点id
private String NODEID;
//签字类型 0批准 <br>1保存 <br>2提交 <br>3退回 <br>4重新打开 <br>5删除 <br>6激活 <br>7转发 <br>9批注 <br>
// a意见征询 <br>b意见征询回复 <br>e强制归档 <br>h转办 <br>i干预 <br>j转办反馈 <br>s督办 <br>t抄送
private String LOGTYPE;
//操作日期
private String OPERATEDATE;
//操作时间
private String OPERATETIME;
//操作者
private String OPERATOR;
//意见
private String REMARK1;
//客户端ip
private String CLIENTIP;
//操作者类型1人力资源2客户
private String OPERATORTYPE;
//下一节点id
private String DESTNODEID;
//接收人
private String RECEIVEDPERSONS_1;
//显示顺序
private String SHOWORDER;
//代理人
private String AGENTORBYAGENTID;
//代理类型
private String AGENTTYPE;
//日志id
private String LOGID;
//签字信息
private String REMARK;
//相关附件
private String ANNEXDOCIDS;
//日志id
private String REQUESTLOGID;
//操作者部门
private String OPERATORDEPT;
//相关文档
private String SIGNDOCIDS;
//相关流程
private String SIGNWORKFLOWIDS;
//接收者名称
private String RECEIVEDPERSONS;
//是否为手机版本
private String ISMOBILE;
// 手写签批
private String HANDWRITTENSIGN;
//语音附件
private String SPEECHATTACHMENT;
//接收人id
private String RECEIVEDPERSONIDS;
//意见位置
private String REMARKLOCATION;
public String getREQUESTID() {
return REQUESTID;
}
public void setREQUESTID(String REQUESTID) {
this.REQUESTID = REQUESTID;
}
public String getWORKFLOWID() {
return WORKFLOWID;
}
public void setWORKFLOWID(String WORKFLOWID) {
this.WORKFLOWID = WORKFLOWID;
}
public String getNODEID() {
return NODEID;
}
public void setNODEID(String NODEID) {
this.NODEID = NODEID;
}
public String getLOGTYPE() {
return LOGTYPE;
}
public void setLOGTYPE(String LOGTYPE) {
this.LOGTYPE = LOGTYPE;
}
public String getOPERATEDATE() {
return OPERATEDATE;
}
public void setOPERATEDATE(String OPERATEDATE) {
this.OPERATEDATE = OPERATEDATE;
}
public String getOPERATETIME() {
return OPERATETIME;
}
public void setOPERATETIME(String OPERATETIME) {
this.OPERATETIME = OPERATETIME;
}
public String getOPERATOR() {
return OPERATOR;
}
public void setOPERATOR(String OPERATOR) {
this.OPERATOR = OPERATOR;
}
public String getREMARK1() {
return REMARK1;
}
public void setREMARK1(String REMARK1) {
this.REMARK1 = REMARK1;
}
public String getCLIENTIP() {
return CLIENTIP;
}
public void setCLIENTIP(String CLIENTIP) {
this.CLIENTIP = CLIENTIP;
}
public String getOPERATORTYPE() {
return OPERATORTYPE;
}
public void setOPERATORTYPE(String OPERATORTYPE) {
this.OPERATORTYPE = OPERATORTYPE;
}
public String getDESTNODEID() {
return DESTNODEID;
}
public void setDESTNODEID(String DESTNODEID) {
this.DESTNODEID = DESTNODEID;
}
public String getRECEIVEDPERSONS_1() {
return RECEIVEDPERSONS_1;
}
public void setRECEIVEDPERSONS_1(String RECEIVEDPERSONS_1) {
this.RECEIVEDPERSONS_1 = RECEIVEDPERSONS_1;
}
public String getSHOWORDER() {
return SHOWORDER;
}
public void setSHOWORDER(String SHOWORDER) {
this.SHOWORDER = SHOWORDER;
}
public String getAGENTORBYAGENTID() {
return AGENTORBYAGENTID;
}
public void setAGENTORBYAGENTID(String AGENTORBYAGENTID) {
this.AGENTORBYAGENTID = AGENTORBYAGENTID;
}
public String getAGENTTYPE() {
return AGENTTYPE;
}
public void setAGENTTYPE(String AGENTTYPE) {
this.AGENTTYPE = AGENTTYPE;
}
public String getLOGID() {
return LOGID;
}
public void setLOGID(String LOGID) {
this.LOGID = LOGID;
}
public String getREMARK() {
return REMARK;
}
public void setREMARK(String REMARK) {
this.REMARK = REMARK;
}
public String getANNEXDOCIDS() {
return ANNEXDOCIDS;
}
public void setANNEXDOCIDS(String ANNEXDOCIDS) {
this.ANNEXDOCIDS = ANNEXDOCIDS;
}
public String getREQUESTLOGID() {
return REQUESTLOGID;
}
public void setREQUESTLOGID(String REQUESTLOGID) {
this.REQUESTLOGID = REQUESTLOGID;
}
public String getOPERATORDEPT() {
return OPERATORDEPT;
}
public void setOPERATORDEPT(String OPERATORDEPT) {
this.OPERATORDEPT = OPERATORDEPT;
}
public String getSIGNDOCIDS() {
return SIGNDOCIDS;
}
public void setSIGNDOCIDS(String SIGNDOCIDS) {
this.SIGNDOCIDS = SIGNDOCIDS;
}
public String getSIGNWORKFLOWIDS() {
return SIGNWORKFLOWIDS;
}
public void setSIGNWORKFLOWIDS(String SIGNWORKFLOWIDS) {
this.SIGNWORKFLOWIDS = SIGNWORKFLOWIDS;
}
public String getRECEIVEDPERSONS() {
return RECEIVEDPERSONS;
}
public void setRECEIVEDPERSONS(String RECEIVEDPERSONS) {
this.RECEIVEDPERSONS = RECEIVEDPERSONS;
}
public String getISMOBILE() {
return ISMOBILE;
}
public void setISMOBILE(String ISMOBILE) {
this.ISMOBILE = ISMOBILE;
}
public String getHANDWRITTENSIGN() {
return HANDWRITTENSIGN;
}
public void setHANDWRITTENSIGN(String HANDWRITTENSIGN) {
this.HANDWRITTENSIGN = HANDWRITTENSIGN;
}
public String getSPEECHATTACHMENT() {
return SPEECHATTACHMENT;
}
public void setSPEECHATTACHMENT(String SPEECHATTACHMENT) {
this.SPEECHATTACHMENT = SPEECHATTACHMENT;
}
public String getRECEIVEDPERSONIDS() {
return RECEIVEDPERSONIDS;
}
public void setRECEIVEDPERSONIDS(String RECEIVEDPERSONIDS) {
this.RECEIVEDPERSONIDS = RECEIVEDPERSONIDS;
}
public String getREMARKLOCATION() {
return REMARKLOCATION;
}
public void setREMARKLOCATION(String REMARKLOCATION) {
this.REMARKLOCATION = REMARKLOCATION;
}
}

@ -7,6 +7,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
@ -25,9 +26,14 @@ public class RemoteOpenFallbackFactory implements FallbackFactory<RemoteOpenServ
}
@Override
public AjaxResult GetOaNodeInfo(@RequestParam("requestId") String requestId) {
public AjaxResult GetOaNodeInfo(String requestid) {
return AjaxResult.error("获取流程失败"+throwable.getMessage());
}
@Override
public AjaxResult GetHrUserInfo(String dateTime) {
return AjaxResult.error("获取HR信息失败"+throwable.getMessage());
}
};
}
}

@ -153,4 +153,11 @@ public class MesReportWorkConsumeController extends BaseController {
public AjaxResult submitReportInfo(@RequestBody MesReportWork mesReportWork) {
return toAjax(mesReportWorkConsumeService.submitReportInfo(mesReportWork));
}
/**获取母子BOM**/
@GetMapping("/getBomList")
public List getBomList(MesReportWorkConsume mesReportWorkConsume) {
List<MesReportWorkConsume> rlist = mesReportWorkConsumeService.getBomList(mesReportWorkConsume);
return rlist;
}
}

@ -70,7 +70,6 @@ public class MesReportWorkController extends BaseController {
List<MesReportWork> hzlist = mesReportWorkService.getReportWorkHzList(mesReportWork);
return getDataTable(hzlist);
}
/**
*
*/
@ -88,6 +87,15 @@ public class MesReportWorkController extends BaseController {
// mesReportWork.setCreateTimeEnd(dateEndStr);//end
// }
List<MesReportWork> list = mesReportWorkService.selectMesReportWorkList_S(mesReportWork);
for(MesReportWork dto:list){
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");
}
}
ExcelUtil<MesReportWork> util = new ExcelUtil<MesReportWork>(MesReportWork.class);
util.exportExcel(response, list, "报工报表数据");
}

@ -0,0 +1,33 @@
package com.op.mes.controller;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesReportWork;
import com.op.mes.service.IMesReportWorksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.op.common.core.utils.PageUtils.startPage;
@RestController
@RequestMapping("/reportWorks")
public class MesReportWorksController extends BaseController {
@Autowired
private IMesReportWorksService mesReportWorksService;
/**
* 线
*/
@RequiresPermissions("mes:reportWork:lists")
@GetMapping("/lists")
public TableDataInfo lists(MesReportWork mesReportWork) {
startPage();
List<MesReportWork> hzlist = mesReportWorksService.getReportWorksList(mesReportWork);
return getDataTable(hzlist);
}
}

@ -0,0 +1,10 @@
package com.op.mes.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/unitPriceReport")
public class MesUnitPriceReportController {
}

@ -220,6 +220,15 @@ public class MesReportWork extends BaseEntity {
private Long workTimes;
private String workCenter;
private String shiftId;
private String keywords;
public String getKeywords() {
return keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
private List<MesReportWorkConsume> consumesInfos;

@ -72,6 +72,79 @@ public class MesReportWorkConsume extends BaseEntity {
private String parentOrder;
private String batch;
private String recoil;
private String standardDosage;
private String lossRate;
private String lossAmount;
private String cilosses;
private String sanka;
private String productGroup;
private String productGroupName;
//上级物料
private String pMaterialCode;
public String getpMaterialCode() {
return pMaterialCode;
}
public void setpMaterialCode(String pMaterialCode) {
this.pMaterialCode = pMaterialCode;
}
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;
}
public String getStandardDosage() {
return standardDosage;
}
public void setStandardDosage(String standardDosage) {
this.standardDosage = standardDosage;
}
public String getLossRate() {
return lossRate;
}
public void setLossRate(String lossRate) {
this.lossRate = lossRate;
}
public String getLossAmount() {
return lossAmount;
}
public void setLossAmount(String lossAmount) {
this.lossAmount = lossAmount;
}
public String getCilosses() {
return cilosses;
}
public void setCilosses(String cilosses) {
this.cilosses = cilosses;
}
public String getSanka() {
return sanka;
}
public void setSanka(String sanka) {
this.sanka = sanka;
}
public String getRecoil() {
return recoil;

@ -77,4 +77,6 @@ public interface MesReportWorkConsumeMapper {
int addConsumePS(@Param("list")List<MesReportWorkConsume> rconsumes);
List<MesReportWorkConsume> getSonConsumeList(MesReportWorkConsume mesReportWorkConsume);
List<MesReportWorkConsume> getBomList(MesReportWorkConsume mesReportWorkConsume);
}

@ -0,0 +1,15 @@
package com.op.mes.mapper;
import com.op.mes.domain.MesReportWork;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface MesReportWorksMapper {
List<MesReportWork> getReportWorkList(MesReportWork mesReportWork);
}

@ -21,6 +21,8 @@ public interface MesUnitPriceMapper {
*/
public MesUnitPrice selectMesUnitPriceByPicId(String picId);
public MesUnitPrice selectMesUnitPriceByProCode(MesUnitPrice mesUnitPrice);
/**
* unitPrice
*

@ -82,4 +82,6 @@ public interface IMesReportWorkConsumeService {
int submitConsumePS(List<MesReportWorkConsume> mesReportWorkConsume);
int submitReportInfo(MesReportWork mesReportWork);
List<MesReportWorkConsume> getBomList(MesReportWorkConsume mesReportWorkConsume);
}

@ -0,0 +1,11 @@
package com.op.mes.service;
import com.op.mes.domain.MesReportWork;
import java.util.List;
public interface IMesReportWorksService {
List<MesReportWork> getReportWorksList(MesReportWork mesReportWork);
}

@ -380,6 +380,7 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
List<SapRFW.lt_hw> lt_hwList =new ArrayList<>();
MesReportWorkConsume consumeqo = new MesReportWorkConsume();
consumeqo.setWorkorderCode(workOrder.getWorkorderCode());
consumeqo.setRecoil("X");
List<MesReportWorkConsume> consumes = mesReportWorkConsumeMapper.selectMesReportWorkConsumeList(consumeqo);
if(!CollectionUtils.isEmpty(consumes)){
for(MesReportWorkConsume consume:consumes){

@ -252,4 +252,11 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer
}
return rconsumes;
}
@Override
@DS("#header.poolName")
public List<MesReportWorkConsume> getBomList(MesReportWorkConsume mesReportWorkConsume) {
List<MesReportWorkConsume> dtos = mesReportWorkConsumeMapper.getBomList(mesReportWorkConsume);
return dtos;
}
}

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

@ -0,0 +1,24 @@
package com.op.mes.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.mes.domain.MesReportWork;
import com.op.mes.mapper.MesReportWorksMapper;
import com.op.mes.service.IMesReportWorksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class MesReportWorksServiceImpl implements IMesReportWorksService {
@Autowired
private MesReportWorksMapper mesReportWorksMapper;
@Override
@DS("#header.poolName")
public List<MesReportWork> getReportWorksList(MesReportWork mesReportWork) {
return mesReportWorksMapper.getReportWorkList(mesReportWork);
}
}

@ -6,6 +6,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.exception.ServiceException;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.bean.BeanValidators;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.mes.domain.MesUnitPrice;
import com.op.mes.mapper.MesUnitPriceMapper;
@ -15,6 +16,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.validation.Validator;
/**
* unitPriceService
@ -30,6 +33,9 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
@Autowired
private MesUnitPriceMapper mesUnitPriceMapper;
@Autowired
protected Validator validator;
/**
* unitPrice
@ -38,6 +44,7 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
* @return unitPrice
*/
@Override
@DS("#header.poolName")
public MesUnitPrice selectMesUnitPriceByPicId(String picId) {
return mesUnitPriceMapper.selectMesUnitPriceByPicId(picId);
}
@ -73,6 +80,7 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
* @return
*/
@Override
@DS("#header.poolName")
public int updateMesUnitPrice(MesUnitPrice mesUnitPrice) {
mesUnitPrice.setUpdateTime(DateUtils.getNowDate());
return mesUnitPriceMapper.updateMesUnitPrice(mesUnitPrice);
@ -104,7 +112,7 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
@DS("#header.poolName")
public String importMesUnitPrice(List<MesUnitPrice> UnitPriceList, Boolean updateSupport, String operName) {
if (StringUtils.isNull(UnitPriceList) || UnitPriceList.size() == 0) {
throw new ServiceException("导入数据不能为空!");
throw new ServiceException("导入用户数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
@ -112,15 +120,22 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
StringBuilder failureMsg = new StringBuilder();
for (MesUnitPrice mesUnitPrice : UnitPriceList) {
try {
// 验证是否存在这个产线产品
mesUnitPrice.setPicId(IdUtils.simpleUUID());
mesUnitPriceMapper.insertMesUnitPrice(mesUnitPrice);
successNum++;
successMsg.append("导入成功");
// 验证是否存在这个产品的单价信息
MesUnitPrice u=mesUnitPriceMapper.selectMesUnitPriceByProCode(mesUnitPrice);
if (StringUtils.isNull(u)) {
BeanValidators.validateWithException(validator, mesUnitPrice);
mesUnitPrice.setPicId(IdUtils.simpleUUID());
mesUnitPriceMapper.insertMesUnitPrice(mesUnitPrice);
successNum++;
successMsg.append("<br/>" + successNum + mesUnitPrice.getProductName()+"-"+mesUnitPrice.getChildprocessName() + " 导入成功");
}
else {
failureNum++;
failureMsg.append("<br/>" + failureNum + "、产品 " + mesUnitPrice.getProductName() + " 已存在");
}
} catch (Exception e) {
failureNum++;
String msg = "导入失败:";
String msg = "<br/>" + failureNum + "、产品 " + mesUnitPrice.getProductName() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
@ -132,5 +147,34 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService {
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
// if (StringUtils.isNull(UnitPriceList) || UnitPriceList.size() == 0) {
// throw new ServiceException("导入数据不能为空!");
// }
// int successNum = 0;
// int failureNum = 0;
// StringBuilder successMsg = new StringBuilder();
// StringBuilder failureMsg = new StringBuilder();
// for (MesUnitPrice mesUnitPrice : UnitPriceList) {
// try {
// // 验证是否存在这个产线产品
// mesUnitPrice.setPicId(IdUtils.simpleUUID());
// mesUnitPriceMapper.insertMesUnitPrice(mesUnitPrice);
// successNum++;
// successMsg.append("导入成功");
//
// } catch (Exception e) {
// failureNum++;
// String msg = "导入失败:";
// failureMsg.append(msg + e.getMessage());
// log.error(msg, e);
// }
// }
// if (failureNum > 0) {
// failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
// throw new ServiceException(failureMsg.toString());
// } else {
// successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
// }
// return successMsg.toString();
}
}

@ -0,0 +1,97 @@
<?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.MesReportWorksMapper">
<resultMap type="MesReportWork" id="MesReportWorkResult">
<result property="id" column="id" />
<result property="reportType" column="report_type" />
<result property="reportCode" column="report_code" />
<result property="workorderCode" column="workorder_code" />
<result property="workorderCodeSap" column="workorder_code_sap" />
<result property="productCode" column="product_code" />
<result property="productName" column="product_name" />
<result property="spec" column="spec" />
<result property="unit" column="unit" />
<result property="quantity" column="quantity" />
<result property="quantityFeedback" column="quantity_feedback" />
<result property="quantityQualified" column="quantity_qualified" />
<result property="quantityUnqualified" column="quantity_unqualified" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="feedbackChannel" column="feedback_channel" />
<result property="feedbackTime" column="feedback_time" />
<result property="recordUser" column="record_user" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<result property="workTime" column="work_time" />
<result property="useMan" column="use_man" />
<result property="machineCode" column="machine_code" />
<result property="machineName" column="machine_name" />
<result property="teamCode" column="team_code" />
<result property="shiftCode" column="shift_code" />
<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="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" />
<result property="batch" column="batch" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="materialNameUnit" column="material_name_unit" />
</resultMap>
<resultMap type="com.op.system.api.domain.mes.ProOrderWorkorderDTO" id="ProOrderWorkorderDTOResult">
<result property="workorderId" column="workorder_id" />
<result property="workorderCode" column="workorder_code" />
<result property="workorderName" column="workorder_name" />
<result property="orderId" column="order_id" />
<result property="orderCode" column="order_code" />
<result property="productId" column="product_id" />
<result property="productCode" column="product_code" />
<result property="productName" column="product_name" />
<result property="productSpc" column="product_spc" />
<result property="unit" column="unit" />
<result property="quantityProduced" column="quantity_produced" />
<result property="quantitySplit" column="quantity_split" />
<result property="routeCode" column="route_code" />
<result property="prodLineCode" column="prod_line_code" />
<result property="productDate" column="product_date" />
<result property="shiftId" column="shift_id" />
<result property="parentOrder" column="parent_order" />
<result property="ancestors" column="ancestors" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<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="prodType" column="prod_type" />
<result property="factoryCode" column="factory_code" />
<result property="endFlag" column="end_flag" />
<result property="carNum" column="car_num" />
<result property="sortNo" column="sort_no" />
<result property="workorderCodes" column="workorderCodes" />
<result property="productCodes" column="productCodes" />
<result property="productNames" column="productNames" />
<result property="quantitySplits" column="quantitySplits" />
<result property="units" column="units" />
</resultMap>
<select id="getReportWorkList" resultMap="MesReportWorkResult" parameterType="MesReportWork">
</select>
</mapper>

@ -47,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="recoil != null and recoil != ''"> and recoil = #{recoil}</if>
and del_flag = '0'
</where>
</select>
@ -109,6 +110,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where mrwc.del_flag = '0' and pow.del_flag = '0'
and pow.parent_order = #{workorderCode}
</select>
<select id="getBomList" resultType="com.op.mes.domain.MesReportWorkConsume">
select bbc.component materialCode,
bbc.standard_dosage standardDosage,
bbc.loss_rate lossRate,
bbc.loss_amount lossAmount,
bbc.cilosses,
bbc.component_unit,
bbc.sanka,
bbc.cumc pMaterialCode,
bp.product_desc_zh materialName,
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
left join mes_report_work mrw on SUBSTRING(mrw.product_code, 8, 12) = bbc.product_code
where <if test= 'parentOrder=="0"'>mrw.workorder_code = #{workorderCode}</if>
<if test= 'parentOrder!="0"'>mrw.parent_order = #{workorderCode}</if>
</select>
<insert id="insertMesReportWorkConsume" parameterType="MesReportWorkConsume">
insert into mes_report_work_consume

@ -493,13 +493,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
shift_code shiftCode,
sum(quantity_feedback) quantityFeedback,
sum(work_time) workTime,
sum(use_man) useMan,
use_man useMan,
upload_status uploadStatus,
upload_time uploadTime,
upload_msg uploadMsg,
unit
from mes_report_work
where del_flag = '0' and parent_order = '0'
<if test="keywords != null and keywords != ''"> and workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
@ -507,12 +508,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
<if test="uploadStatus != null and uploadStatus != ''"> and upload_status = #{uploadStatus}</if>
group by workorder_code, product_code,product_name,machine_code,machine_name,shift_code
,upload_status,unit
,upload_status,unit,use_man
,upload_time,upload_msg
) mrw
left join pro_order_workorder pow on mrw.workorderCode = pow.workorder_code
<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}, '%')
</if>
<if test="feedbackTimeStart != null "> and pow.product_date >= #{feedbackTimeStart}</if>
<if test="feedbackTimeEnd != null "> and #{feedbackTimeEnd} >= pow.product_date</if>
<if test="orderCode != null and orderCode != ''"> and pow.order_code like concat('%', #{orderCode}, '%')</if>
@ -818,7 +824,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
upload_time = null,
upload_status = '0',
upload_msg = null
where workorder_code = #{workorderCode}
where workorder_code = #{workorderCode} or parent_order = #{workorderCode}
</update>
<delete id="deleteMesReportWorkById" parameterType="String">

@ -52,6 +52,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMesUnitPriceVo"/>
where pic_id = #{picId}
</select>
<select id="selectMesUnitPriceByProCode" parameterType="MesUnitPrice" resultMap="MesUnitPriceResult">
<include refid="selectMesUnitPriceVo"/>
where product_code = #{productCode} and childprocess_code = #{childprocessCode}
</select>
<insert id="insertMesUnitPrice" parameterType="MesUnitPrice">
insert into mes_unit_price

@ -1,14 +1,12 @@
package com.op.open.controller;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.StringUtils;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.open.service.OpenService;
import com.op.system.api.RemoteQualityService;
import com.op.system.api.domain.device.EquRepairOrderDTO;
import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.quality.QcCheckTaskDTO;
import com.op.system.api.domain.quality.QcCheckTaskProduceDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -90,23 +88,18 @@ public class OpenController extends BaseController {
if(StringUtils.isBlank(qcCheckTaskProduce.getOrderNo())){
return error("[orderNo]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskProduce.getMaterialName())){
return error("[materialName]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskProduce.getMaterialCode())){
return error("[materialCode]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskProduce.getCheckType())){
return error("[checkType]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskProduce.getFactoryCode())){
return error("[factoryCode]不能为空");
}
//添加检测任务
return toAjax(openService.insertQcCheckTaskProduce(qcCheckTaskProduce));
}
@ -147,15 +140,24 @@ public class OpenController extends BaseController {
/**
*
* @param requestId
* @param requestid
* @return
*/
@GetMapping("/GetOaNodeInfo")
public AjaxResult GetOaNodeInfo(@RequestParam("requestId") String requestId) {
return openService.GetOaNodeInfo(requestId);
@GetMapping("/GetOaNodeInfo/{requestid}")
public AjaxResult GetOaNodeInfo(@PathVariable("requestid") String requestid) {
return openService.GetOaNodeInfo(requestid);
}
/**
* HR
* dateTime :"2024-01-05"
* @param dateTime
* @return
*/
@GetMapping("/GetHrUserInfo")
public AjaxResult GetHrUserInfo(@RequestParam("dateTime") String dateTime) {
return openService.GetHrUserInfo(dateTime);
}
}

@ -32,4 +32,6 @@ public interface OpenService {
AjaxResult OAInspection(Map<String, Object> paramMap);
AjaxResult GetOaNodeInfo(String requestId);
AjaxResult GetHrUserInfo(String dateTime);
}

@ -75,6 +75,9 @@ public class OpenServiceImpl implements OpenService {
@Value("${OA.getnodeInfo}")
private String getnodeInfo;
@Value("${HR.url}")
private String hr_url;
@Autowired
private OpenMapper openMapper;
@ -359,6 +362,7 @@ public class OpenServiceImpl implements OpenService {
user.setCreateTime(nowDate);
}
}
/**qc_check_task_user**/
int m = openMapper.addCheckUsers(users);
logger.info("检查人新增" + m + "成功");
@ -389,6 +393,8 @@ public class OpenServiceImpl implements OpenService {
qcCheckTaskProduce.setIncomeTime(qcCheckTaskProduce.getProduceDate());
qcCheckTaskProduce.setSupplierCode(qcCheckTaskProduce.getCarCode());
qcCheckTaskProduce.setSupplierName(qcCheckTaskProduce.getCarName());
qcCheckTaskProduce.setCheckManName(null);
qcCheckTaskProduce.setCheckManCode(null);
openMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
/**qc_check_task_detail**/
for (QcCheckTaskDetailDTO item : items) {
@ -411,7 +417,7 @@ public class OpenServiceImpl implements OpenService {
String requestName = paramMap.get("requestName").toString();
String workflowId = paramMap.get("workflowId").toString();
String mainObject = paramMap.get("mainObject").toString();
String details = paramMap.get("details").toString();
// Building the postData string using StringBuilder
StringBuilder postDataBuilder = new StringBuilder();
@ -421,11 +427,12 @@ public class OpenServiceImpl implements OpenService {
.append("&workflowId=").append(workflowId)
.append("&mainObject=").append(URLEncoder.encode(mainObject, StandardCharsets.UTF_8.toString()));
if (Constants.WORKFLOWID_ZL0020.equals(workflowId)) {
String details = paramMap.get("details").toString();
postDataBuilder.append("&details=").append(URLEncoder.encode(details, StandardCharsets.UTF_8.toString()));
}
String postData = postDataBuilder.toString();
String result = HttpUtils.sendPostOA(oa_url, postData);
System.out.println(result);
logger.info(result);
//返回示例{"result":"0","info":"成功","requestid":"2193799"}
Map resultMap=JSONObject.parseObject(result);
if (resultMap.get("result").equals(Constants.LOGIN_SUCCESS_STATUS)){
@ -454,4 +461,16 @@ public class OpenServiceImpl implements OpenService {
}
}
@Override
public AjaxResult GetHrUserInfo(String dateTime) {
try {
StringBuilder postDataBuilder = new StringBuilder();
postDataBuilder.append("createTime=").append("dateTime");
String result = HttpUtils.sendPost(hr_url,postDataBuilder.toString());
return success(result);
} catch (Exception e) {
e.printStackTrace();
return error(e.getMessage());
}
}
}

@ -13,17 +13,17 @@ spring:
cloud:
nacos:
discovery:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
config:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
#命名空间
#group: local
# 配置中心地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -133,7 +133,7 @@ public interface ProOrderWorkorderMapper {
List<ProOrderWorkorder> selectProOrderWorkerderByWorkerIds(String[] ids);
public void updateWorkOrderCodeSap(ProOrderWorkorder oworkSap);
public int updateWorkOrderCodeSap(ProOrderWorkorder oworkSap);
/**
* code

@ -288,7 +288,7 @@ public class ProOrderServiceImpl implements IProOrderService {
BigDecimal newSapQuantityNum = new BigDecimal(proOrder.getQuantity())
.subtract(new BigDecimal(proOrder.getQuantitySplit()));
sapChange.setQuantity(newSapQuantityNum.toString());//母订单新数量
logger.info("母订单"+proOrder.getOrderCode()+
logger.info("【成品订单拆分】母订单"+proOrder.getOrderCode()+
"订单数量变更:修改前"+proOrder.getQuantity()+","+
",已拆数量"+proOrder.getQuantitySplit()+","+
"给sap汇报数量"+newSapQuantityNum.toString());
@ -302,7 +302,7 @@ public class ProOrderServiceImpl implements IProOrderService {
workOrder.setBelongWorkOrder(belongWorkOrder);
workOrder.setProdType("LJ01");
// 将工单信息更新至数据库
// 将工单信息更新至数据库/**pro_order_workorder**/
proOrderWorkorderMapper.insertProOrderWorkorder(workOrder);
// 生成批次表信息并更新至数据库
setBatch(workBatch, splitOrderDTO.getFormFields(), workOrder.getWorkorderId(), conver);
@ -940,7 +940,7 @@ public class ProOrderServiceImpl implements IProOrderService {
// 拆分中
proOrder.setStatus("o1");
}
// 更新订单表
// 更新订单表/**pro_order**/
proOrderMapper.updateOrder(proOrder);
// 生成对应的工单表
// 生成id

@ -320,8 +320,10 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
R<List<Map<String, String>>> r = remoteSapService.SapCreateOrder(sapList);
logger.info("sap工单回传" + r.getMsg());
if (500 == r.getCode()) {
logger.error("sap工单回传(sap订单创建)" + r.getMsg());
logger.error("工单派发sap工单回传(sap订单创建失败)" + r.getMsg());
return 0;
}else{
logger.info("工单派发sap工单回传(sap订单创建成功)" + JSONObject.toJSONString(r));
}
List<Map<String, String>> returnMaps = r.getData();
List<String> returnCodes = new ArrayList<>();
@ -339,27 +341,23 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
oworkSap.setWorkorderId(wcodes.get(m));//工单编码
oworkSap.setUpdateTime(updateTime);
/**pro_order_workorder**/
proOrderWorkorderMapper.updateWorkOrderCodeSap(oworkSap);
int n = proOrderWorkorderMapper.updateWorkOrderCodeSap(oworkSap);
logger.info("工单派发pro_order_workorder"+n);
}
}
//测试
// List<String> returnCodes = new ArrayList<>();
// returnCodes.add("000100305879");
// returnCodes.add("000100305878");
//获取领料单
this.getMesPrepare(returnCodes,wcodes);
//关闭母子订单//订单的订单编码
SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery();
sapCloseOrderQuery.setLeadOrder(ordercodes.get(0));
sapCloseOrderQuery.setOrder(ordercodes.get(1));
R closeR= remoteSapService.sapCloseOrder(sapCloseOrderQuery);
logger.info(whiteOrder.getWorkorderCode()+"下发工单后关闭母订单"+sapCloseOrderQuery.getLeadOrder()+":"+
sapCloseOrderQuery.getOrder()+":"+
closeR.getCode()+","+
closeR.getMsg()+","+
closeR.getData());
// //关闭母子订单//订单的订单编码(关闭订单暂时隐藏)
// SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery();
// sapCloseOrderQuery.setLeadOrder(ordercodes.get(0));
// sapCloseOrderQuery.setOrder(ordercodes.get(1));
// R closeR= remoteSapService.sapCloseOrder(sapCloseOrderQuery);
// logger.info(whiteOrder.getWorkorderCode()+"下发工单后关闭母订单"+sapCloseOrderQuery.getLeadOrder()+":"+
// sapCloseOrderQuery.getOrder()+":"+
// closeR.getCode()+","+
// closeR.getMsg()+","+
// closeR.getData());
//下达工单
String[] idsArrayAll = (String[])wids.toArray(new String[wids.size()]);
proOrderWorkorderMapper.downWorkorders(idsArrayAll);

@ -68,8 +68,8 @@
<if test="workorderName != null and workorderName != ''"> and pow.workorder_name like concat('%', #{workorderName}, '%')</if>
<if test="orderId != null and orderId != ''"> and pow.order_id = #{orderId}</if>
<if test="orderCode != null and orderCode != ''"> and pow.order_code like concat('%', #{orderCode}, '%')</if>
<if test="productCode != null and productCode != ''"> and pow.product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and pow.product_name like concat('%', #{productName}, '%')</if>
<if test="productCode != null and productCode != ''"> and ppow.product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and ppow.product_name like concat('%', #{productName}, '%')</if>
<if test="productDate != null "> and pow.product_date = #{productDate}</if>
<if test="shiftId != null and shiftId != ''"> and pow.shift_id = #{shiftId}</if>
<if test="parentOrder != null and parentOrder != ''"> and pow.parent_order = #{parentOrder}</if>

@ -39,7 +39,7 @@ public class QcCheckReportInventoryController extends BaseController {
/**
*
*/
@RequiresPermissions("quality:incomeReport:list")
@RequiresPermissions("quality:inventoryReport:list")
@GetMapping("/list")
public TableDataInfo list(QcCheckReportIncome qcCheckReportIncome) {
@ -66,7 +66,7 @@ public class QcCheckReportInventoryController extends BaseController {
/**
*
*/
@RequiresPermissions("quality:incomeReport:export")
@RequiresPermissions("quality:inventoryReport:export")
@Log(title = "来料检验", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) {
@ -94,7 +94,7 @@ public class QcCheckReportInventoryController extends BaseController {
/**
*
*/
@RequiresPermissions("quality:incomeReport:query")
@RequiresPermissions("quality:inventoryReport:query")
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
return success(qcCheckReportInventoryService.selectQcCheckReportIncomeByRecordId(recordId));
@ -103,7 +103,6 @@ public class QcCheckReportInventoryController extends BaseController {
/**
*
*/
@RequiresPermissions("quality:incomeReport:add")
@Log(title = "来料检验", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
@ -117,7 +116,6 @@ public class QcCheckReportInventoryController extends BaseController {
/**
*
*/
@RequiresPermissions("quality:incomeReport:edit")
@Log(title = "来料检验", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
@ -127,7 +125,6 @@ public class QcCheckReportInventoryController extends BaseController {
/**
*
*/
@RequiresPermissions("quality:incomeReport:remove")
@Log(title = "来料检验", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public AjaxResult remove(@PathVariable String[] recordIds) {

@ -40,15 +40,15 @@ public class QcCheckReportProduceController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(QcCheckReportIncome qcCheckReportIncome) {
//默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
qcCheckReportIncome.setCheckTimeStart(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";
qcCheckReportIncome.setCheckTimeEnd(dateEndStr);//end
}
// //默认时间范围T 00:00:00~T+1 00:00:00
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
// qcCheckReportIncome.setCheckTimeStart(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";
// qcCheckReportIncome.setCheckTimeEnd(dateEndStr);//end
// }
startPage();
List<QcCheckReportIncome> list = qcCheckReportProduceService.selectQcCheckReportIncomeList(qcCheckReportIncome);
@ -63,15 +63,15 @@ public class QcCheckReportProduceController extends BaseController {
@PostMapping("/export")
public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) {
//默认时间范围T 00:00:00~T+1 00:00:00
if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){
qcCheckReportIncome.setIncomeTimeStart(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";
qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end
}
// //默认时间范围T 00:00:00~T+1 00:00:00
// if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){
// qcCheckReportIncome.setIncomeTimeStart(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";
// qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end
// }
// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){
// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start
@ -181,4 +181,15 @@ public class QcCheckReportProduceController extends BaseController {
QcCheckTaskProduce dto = qcCheckReportProduceService.getProduceReportXJ(qcCheckTaskProduce);
return dto;
}
// 生产过程报告任务详情
@PostMapping("/getTaskInfo")
public QcCheckReportIncome getTaskInfo(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
QcCheckReportIncome dto = qcCheckReportProduceService.getTaskInfo(qcCheckReportIncome);
return dto;
}
@PostMapping("/submitConfirm")
public AjaxResult submitConfirm(@RequestBody QcCheckReportIncome qcCheckReportIncome) {
return toAjax(qcCheckReportProduceService.submitConfirm(qcCheckReportIncome));
}
}

@ -135,6 +135,34 @@ public class QcCheckTaskIncomeController extends BaseController {
public AjaxResult createIncomeTask(@RequestBody QcCheckTaskIncomeDTO qcCheckTaskIncome0) {
QcCheckTaskIncome qcCheckTaskIncome = new QcCheckTaskIncome();
BeanUtils.copyProperties(qcCheckTaskIncome0,qcCheckTaskIncome);
if(StringUtils.isBlank(qcCheckTaskIncome.getOrderNo())){
return error("[orderNo]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskIncome.getMaterialName())){
return error("[materialName]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskIncome.getMaterialCode())){
return error("[materialCode]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskIncome.getCheckType())){
return error("[checkType]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskIncome.getFactoryCode())){
return error("[factoryCode]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskIncome.getSupplierCode())){
return error("[supplierCode]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskIncome.getSupplierName())){
return error("[supplierName]不能为空");
}
if(qcCheckTaskIncome.getIncomeTime()==null){
return error("[incomeTime]不能为空");
}
logger.info("来料检验任务生成开始================================");
logger.info("来料检验任务生成参数:"+ JSONObject.toJSONString(qcCheckTaskIncome));
int r = qcCheckTaskIncomeService.insertQcCheckTaskIncome(qcCheckTaskIncome);
if(r>0){
return toAjax(r);
@ -237,7 +265,7 @@ public class QcCheckTaskIncomeController extends BaseController {
public AjaxResult commitCheckResult(@RequestBody QcCheckTaskIncome qcCheckTaskIncome) {
qcCheckTaskIncome.setUpdateBy(SecurityUtils.getUsername());
qcCheckTaskIncome.setUpdateTime(DateUtils.getNowDate());
return toAjax(qcCheckTaskIncomeService.commitCheckResult(qcCheckTaskIncome));
return toAjax(qcCheckTaskIncomeService.commitCheckResults(qcCheckTaskIncome));
}
/**不良类型**/
@ -273,4 +301,16 @@ public class QcCheckTaskIncomeController extends BaseController {
public List<QcCheckTaskIncome> getBatchList(@RequestBody QcCheckTaskIncome qcCheckTaskIncome) {
return qcCheckTaskIncomeService.getBatchList(qcCheckTaskIncome);
}
/**
*
* @param
* @return
*/
@GetMapping("/getCkeckProjectXJList")
public TableDataInfo getCkeckProjectXJList(QcCheckTaskIncome qcCheckTaskIncome) {
startPage();
List<QcCheckTaskIncome> list = qcCheckTaskIncomeService.getCkeckProjectXJList(qcCheckTaskIncome);
return getDataTable(list);
}
}

@ -1,12 +1,9 @@
package com.op.quality.controller;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.common.core.utils.DateUtils;
import org.apache.commons.lang.StringUtils;
import com.op.system.api.domain.quality.OAInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -120,4 +117,14 @@ public class QcCheckUnqualifiedController extends BaseController {
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(qcCheckUnqualifiedService.deleteQcCheckUnqualifiedByIds(ids));
}
/**
* oa
*/
@RequiresPermissions("quality:unqualified:list")
@GetMapping("/getOAInfoList")
public List<OAInfo> getOAInfoList(QcCheckUnqualified qcCheckUnqualified) {
List<OAInfo> list = qcCheckUnqualifiedService.getOAInfoList(qcCheckUnqualified);
return list;
}
}

@ -23,7 +23,7 @@ import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
*
* @author materialGroup
* @date 2023-10-16
*/
@ -36,7 +36,7 @@ public class QcMaterialGroupController extends BaseController {
/**
*
*/
@RequiresPermissions("quality:materialGroup:list")
//@RequiresPermissions("quality:materialGroup:list")
@GetMapping("/list")
public TableDataInfo list(QcMaterialGroup qcMaterialGroup) {
startPage();
@ -55,7 +55,7 @@ public class QcMaterialGroupController extends BaseController {
/**
*
*/
@RequiresPermissions("quality:materialGroup:export")
//@RequiresPermissions("quality:materialGroup:export")
@Log(title = "物料组", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcMaterialGroup qcMaterialGroup) {
@ -67,7 +67,7 @@ public class QcMaterialGroupController extends BaseController {
/**
*
*/
@RequiresPermissions("quality:materialGroup:query")
//@RequiresPermissions("quality:materialGroup:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return success(qcMaterialGroupService.selectQcMaterialGroupById(id));
@ -86,7 +86,7 @@ public class QcMaterialGroupController extends BaseController {
/**
*
*/
@RequiresPermissions("quality:materialGroup:edit")
//@RequiresPermissions("quality:materialGroup:edit")
@Log(title = "物料组", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody QcMaterialGroup qcMaterialGroup) {

@ -313,4 +313,13 @@ public class QcStaticTableController extends BaseController {
util.exportExcel(response, list, "质检不良统计");
}
/**定量值分析--表头--产品名称**/
@GetMapping("/getDLTableAvgInfo")
public QcStaticTable getDLTableAvgInfo(QcStaticTable qcStaticTable) {
return qcStaticTableService.getDLTableAvgInfo(qcStaticTable);
}
@GetMapping("/getDLDetailList")
public List<QcStaticTable> getDLDetailList(QcStaticTable qcStaticTable) {
return qcStaticTableService.getDLDetailList(qcStaticTable);
}
}

@ -126,6 +126,97 @@ public class QcCheckReportIncome extends BaseEntity {
private String checkType;//小类
private String checkName;
private String createTimeStr;
private List<BaseFile> files;
private List<String> fileUrls;
private String reason;
private String productType;
private String confirm;
private String confirmManCode;
private String confirmManName;
private String confirmRemark;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date confirmTime;
private Boolean myself;
public Boolean getMyself() {
return myself;
}
public void setMyself(Boolean myself) {
this.myself = myself;
}
public Date getConfirmTime() {
return confirmTime;
}
public void setConfirmTime(Date confirmTime) {
this.confirmTime = confirmTime;
}
public String getConfirmRemark() {
return confirmRemark;
}
public void setConfirmRemark(String confirmRemark) {
this.confirmRemark = confirmRemark;
}
public String getConfirm() {
return confirm;
}
public void setConfirm(String confirm) {
this.confirm = confirm;
}
public String getConfirmManCode() {
return confirmManCode;
}
public void setConfirmManCode(String confirmManCode) {
this.confirmManCode = confirmManCode;
}
public String getConfirmManName() {
return confirmManName;
}
public void setConfirmManName(String confirmManName) {
this.confirmManName = confirmManName;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getProductType() {
return productType;
}
public void setProductType(String productType) {
this.productType = productType;
}
public List<String> getFileUrls() {
return fileUrls;
}
public void setFileUrls(List<String> fileUrls) {
this.fileUrls = fileUrls;
}
public List<BaseFile> getFiles() {
return files;
}
public void setFiles(List<BaseFile> files) {
this.files = files;
}
public String getCreateTimeStr() {
return createTimeStr;

@ -98,6 +98,15 @@ public class QcCheckTaskDetail extends BaseEntity {
private String checkType;
private String fileListStr;
private List<BaseFile> files;
private List<String> fileUrls;
public List<String> getFileUrls() {
return fileUrls;
}
public void setFileUrls(List<String> fileUrls) {
this.fileUrls = fileUrls;
}
@Override
public String getRemark() {

@ -142,6 +142,24 @@ public class QcCheckTaskIncome extends BaseEntity {
private String remark;
private String belongTo;
private String oldBelongTo;
private String noOkQualityNames;
private String noOkQualityVals;
public String getNoOkQualityNames() {
return noOkQualityNames;
}
public void setNoOkQualityNames(String noOkQualityNames) {
this.noOkQualityNames = noOkQualityNames;
}
public String getNoOkQualityVals() {
return noOkQualityVals;
}
public void setNoOkQualityVals(String noOkQualityVals) {
this.noOkQualityVals = noOkQualityVals;
}
public String getOldBelongTo() {
return oldBelongTo;

@ -150,6 +150,42 @@ public class QcCheckTaskProduce extends BaseEntity {
private String checkName;
private List<QcStaticTable> checkInfos;
private List<QcCheckTaskDefect> defects;
private String reason;
private String productType;
private String confirmManCode;
private String confirmManName;
public String getConfirmManCode() {
return confirmManCode;
}
public void setConfirmManCode(String confirmManCode) {
this.confirmManCode = confirmManCode;
}
public String getConfirmManName() {
return confirmManName;
}
public void setConfirmManName(String confirmManName) {
this.confirmManName = confirmManName;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getProductType() {
return productType;
}
public void setProductType(String productType) {
this.productType = productType;
}
public List<QcCheckTaskDefect> getDefects() {
return defects;

@ -125,6 +125,33 @@ public class QcCheckTaskWarehousing extends BaseEntity {
private String orderType;
private BigDecimal noOkQuality;
private BigDecimal sampleQuality;
private BigDecimal aNoOkquality;
private BigDecimal bNoOkquality;
private BigDecimal cNoOkquality;
public BigDecimal getaNoOkquality() {
return aNoOkquality;
}
public void setaNoOkquality(BigDecimal aNoOkquality) {
this.aNoOkquality = aNoOkquality;
}
public BigDecimal getbNoOkquality() {
return bNoOkquality;
}
public void setbNoOkquality(BigDecimal bNoOkquality) {
this.bNoOkquality = bNoOkquality;
}
public BigDecimal getcNoOkquality() {
return cNoOkquality;
}
public void setcNoOkquality(BigDecimal cNoOkquality) {
this.cNoOkquality = cNoOkquality;
}
public List<QcCheckTaskDefect> getDefects() {
return defects;

@ -8,6 +8,7 @@ import com.op.system.api.domain.quality.ChartSeriesDTO;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
@ -99,6 +100,42 @@ public class QcStaticTable extends BaseEntity {
private String startDateStr;
private String endDateStr;
private String checkType;
private List<String> titleCol1;
private List<String> titleCol2;
private List<HashMap> dxData;
private List<HashMap> details;
public List<HashMap> getDetails() {
return details;
}
public void setDetails(List<HashMap> details) {
this.details = details;
}
public List<String> getTitleCol1() {
return titleCol1;
}
public void setTitleCol1(List<String> titleCol1) {
this.titleCol1 = titleCol1;
}
public List<String> getTitleCol2() {
return titleCol2;
}
public void setTitleCol2(List<String> titleCol2) {
this.titleCol2 = titleCol2;
}
public List<HashMap> getDxData() {
return dxData;
}
public void setDxData(List<HashMap> dxData) {
this.dxData = dxData;
}
public String getCheckType() {
return checkType;

@ -73,4 +73,13 @@ public interface QcCheckReportIncomeMapper {
List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail);
QcCheckTaskProduce getTopInfo(QcCheckTaskProduce qcCheckTaskProduce);
QcCheckReportIncome getTaskInfo(QcCheckReportIncome qcCheckReportIncome);
int submitConfirm(QcCheckReportIncome qcCheckReportIncome);
QcCheckReportIncome getXJTaskInfo(QcCheckReportIncome qcCheckReportIncome);
QcCheckReportIncome getLastXJTaskInfo(QcCheckReportIncome qcCheckReportIncome);
QcCheckTaskProduce getLastProductTypeInfo(QcCheckTaskProduce qcCheckTaskProduce);
}

@ -98,4 +98,8 @@ public interface QcCheckTaskIncomeMapper {
List<QcCheckTaskDefect> getDefectType(QcCheckTaskDetail qcCheckTaskDetail);
QcCheckTaskIncome getTaskInfo(String recordId);
int deleteQcCheckTaskDefects(String belongId);
List<QcCheckTaskIncome> getCkeckTaskXJList(QcCheckTaskIncome qcCheckTaskIncome);
}

@ -2,12 +2,13 @@ package com.op.quality.mapper;
import java.util.List;
import com.op.quality.domain.QcCheckTaskIncome;
import com.op.quality.domain.QcSampleRule;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper
*
*
* @author Open Platform
* @date 2023-12-28
*/
@ -15,7 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
public interface QcSampleRuleMapper {
/**
*
*
*
* @param id
* @return
*/
@ -23,7 +24,7 @@ public interface QcSampleRuleMapper {
/**
*
*
*
* @param qcSampleRule
* @return
*/
@ -31,7 +32,7 @@ public interface QcSampleRuleMapper {
/**
*
*
*
* @param qcSampleRule
* @return
*/
@ -39,7 +40,7 @@ public interface QcSampleRuleMapper {
/**
*
*
*
* @param qcSampleRule
* @return
*/
@ -47,7 +48,7 @@ public interface QcSampleRuleMapper {
/**
*
*
*
* @param id
* @return
*/
@ -55,9 +56,11 @@ public interface QcSampleRuleMapper {
/**
*
*
*
* @param ids
* @return
*/
public int deleteQcSampleRuleByIds(String[] ids);
String getSampNum(QcCheckTaskIncome qcCheckTaskIncome);
}

@ -62,4 +62,8 @@ public interface QcStaticTableMapper {
List<QcStaticTable> getLocList();
List<QcStaticTable> getWorkcenter();
@MapKey("recordId")
Map<String, QcStaticTable> picsMap(QcStaticTable qcStaticTable);
List<QcStaticTable> getDLTableTitle(QcStaticTable qcStaticTable);
}

@ -71,4 +71,8 @@ public interface IQcCheckReportProduceService {
List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail);
QcCheckTaskProduce getProduceReportXJ(QcCheckTaskProduce qcCheckTaskProduce);
QcCheckReportIncome getTaskInfo(QcCheckReportIncome qcCheckReportIncome);
int submitConfirm(QcCheckReportIncome qcCheckReportIncome);
}

@ -87,4 +87,6 @@ public interface IQcCheckTaskIncomeService {
List<QcCheckTaskIncome> getBatchList(QcCheckTaskIncome qcCheckTaskIncome);
List<QcCheckTaskIncome> getProductWorkOrder(QcCheckTaskIncome qcCheckTaskIncome);
List<QcCheckTaskIncome> getCkeckProjectXJList(QcCheckTaskIncome qcCheckTaskIncome);
}

@ -1,18 +1,20 @@
package com.op.quality.service;
import java.util.List;
import com.op.system.api.domain.quality.OAInfo;
import com.op.quality.domain.QcCheckUnqualified;
/**
* Service
*
*
* @author Open Platform
* @date 2023-10-31
*/
public interface IQcCheckUnqualifiedService {
/**
*
*
*
* @param id
* @return
*/
@ -20,7 +22,7 @@ public interface IQcCheckUnqualifiedService {
/**
*
*
*
* @param qcCheckUnqualified
* @return
*/
@ -28,7 +30,7 @@ public interface IQcCheckUnqualifiedService {
/**
*
*
*
* @param qcCheckUnqualified
* @return
*/
@ -36,7 +38,7 @@ public interface IQcCheckUnqualifiedService {
/**
*
*
*
* @param qcCheckUnqualified
* @return
*/
@ -44,7 +46,7 @@ public interface IQcCheckUnqualifiedService {
/**
*
*
*
* @param ids
* @return
*/
@ -52,9 +54,11 @@ public interface IQcCheckUnqualifiedService {
/**
*
*
*
* @param id
* @return
*/
public int deleteQcCheckUnqualifiedById(String id);
List<OAInfo> getOAInfoList(QcCheckUnqualified qcCheckUnqualified);
}

@ -43,4 +43,8 @@ public interface IQcStaticTableService {
List<QcCheckType> getCheckTypeList(String typeCode);
List<QcStaticTable> getSupplierList(String typeCode);
QcStaticTable getDLTableAvgInfo(QcStaticTable qcStaticTable);
List<QcStaticTable> getDLDetailList(QcStaticTable qcStaticTable);
}

@ -39,7 +39,8 @@ public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeServi
@Autowired
private QcCheckTaskDetailMapper qcCheckTaskDetailMapper;
@Autowired
private QMSFileMapper qmsFileMapper;
/**
*
*
@ -192,7 +193,15 @@ public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeServi
@Override
@DS("#header.poolName")
public List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
return qcCheckReportIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
List<QcCheckTaskDetail> dtos = qcCheckReportIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
for(QcCheckTaskDetail dto:dtos){
List<BaseFile> files = qmsFileMapper.getBaseFileBatch(dto.getRecordId());
if (!CollectionUtils.isEmpty(files)) {
dto.setFiles(files);
}
}
return dtos;
}
@Override

@ -9,6 +9,8 @@ import com.op.quality.mapper.*;
import com.op.quality.service.IQcCheckReportProduceService;
import com.op.quality.service.IQcStaticTableService;
import com.op.system.api.domain.SysUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -27,6 +29,7 @@ import java.util.List;
*/
@Service
public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceService {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private QcCheckReportIncomeMapper qcCheckReportIncomeMapper;
@Autowired
@ -51,7 +54,8 @@ public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceSer
@Override
@DS("#header.poolName")
public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) {
return qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId);
QcCheckReportIncome dto= qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId);
return dto;
}
/**
@ -205,7 +209,62 @@ public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceSer
qcStaticTable.setOrderNo(qcCheckTaskProduce.getOrderNo());
List<QcStaticTable> checkInfos = qcStaticTableService.getXJCheckTableDetail(qcStaticTable);
produce.setCheckInfos(checkInfos);
QcCheckTaskProduce lastProduce = qcCheckReportIncomeMapper.getLastProductTypeInfo(qcCheckTaskProduce);
if(lastProduce != null ){
produce.setProductType(lastProduce.getProductType());
produce.setCheckManCode(lastProduce.getCheckManCode());
produce.setCheckManName(lastProduce.getCheckManName());
produce.setConfirmManCode(lastProduce.getConfirmManCode());
produce.setConfirmManName(lastProduce.getConfirmManName());
}
return produce;
}
@Override
@DS("#header.poolName")
public QcCheckReportIncome getTaskInfo(QcCheckReportIncome qcCheckReportIncome) {
QcCheckReportIncome taskInfo = null;
if("checkTypeSC".equals(qcCheckReportIncome.getCheckType())){
taskInfo = qcCheckReportIncomeMapper.getTaskInfo(qcCheckReportIncome);
}else if("checkTypeSCXJ".equals(qcCheckReportIncome.getCheckType())){
taskInfo = qcCheckReportIncomeMapper.getXJTaskInfo(qcCheckReportIncome);
//最后一条巡检记录得确认人当最终确认人
QcCheckReportIncome lastData = qcCheckReportIncomeMapper.getLastXJTaskInfo(qcCheckReportIncome);
if(lastData!=null ){
taskInfo.setProductType(lastData.getProductType());
taskInfo.setConfirmManCode(lastData.getConfirmManCode());
taskInfo.setConfirmManName(lastData.getConfirmManName());
taskInfo.setConfirm(lastData.getConfirm());
taskInfo.setConfirmTime(lastData.getConfirmTime());
taskInfo.setConfirmRemark(lastData.getConfirmRemark());
}
if(SecurityUtils.getUsername().equals(taskInfo.getConfirmManCode())){
taskInfo.setMyself(true);
}else{
taskInfo.setMyself(false);
}
}
return taskInfo;
}
@Override
@DS("#header.poolName")
public int submitConfirm(QcCheckReportIncome qcCheckReportIncome) {
Date nowTime = DateUtils.getNowDate();
String nowManCode = SecurityUtils.getUsername();
String nowManName = SecurityUtils.getLoginUser().getSysUser().getNickName();
if("checkTypeSC".equals(qcCheckReportIncome.getCheckType())||"checkTypeSCXJ".equals(qcCheckReportIncome.getCheckType())){
qcCheckReportIncome.setConfirmManCode(nowManCode);
qcCheckReportIncome.setConfirmManName(nowManName);
qcCheckReportIncome.setConfirmTime(nowTime);
/**qc_check_task**/
int n = qcCheckReportIncomeMapper.submitConfirm(qcCheckReportIncome);
logger.info("qc_check_task【二次确认】"+qcCheckReportIncome.getCheckType()+":"+n);
return n;
}
return 0;
}
}

@ -106,11 +106,13 @@ public class QcCheckTaskDefectServiceImpl implements IQcCheckTaskDefectService {
}
@Override
@DS("#header.poolName")
public int deleteQcCheckTaskDefectByBelongTo(String belongTo) {
return qcCheckTaskDefectMapper.deleteQcCheckTaskDefectByBelongTo(belongTo);
}
@Override
@DS("#header.poolName")
public List<QcCheckTaskDefect> selectDefectByBelongTo(String belongTo) {
return qcCheckTaskDefectMapper.selectDefectByBelongTo(belongTo);
}

@ -2,6 +2,8 @@ package com.op.quality.service.impl;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.annotation.DS;
@ -77,6 +79,12 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
@Autowired
private IQcCheckTaskDefectService qcCheckTaskDefectService;
@Autowired
private QcSampleRuleMapper qcSampleRuleMapper;
@Autowired
private QcCheckTaskDefectMapper qcCheckTaskDefectMapper;
/**
*
*
@ -230,7 +238,12 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
}
}
qcCheckTaskIncome.setNoOkQuality(noOkQuality);
/**qc_sample_rule**/
String sampNum = qcSampleRuleMapper.getSampNum(qcCheckTaskIncome);
if(StringUtils.isNotBlank(sampNum)){
qcCheckTaskIncome.setSampleQuality(new BigDecimal(sampNum));
}
/**qc_check_task**/
qcCheckTaskIncomeMapper.insertQcCheckTaskIncome(qcCheckTaskIncome);
/**qc_check_task_detail**/
@ -343,7 +356,16 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
@Override
@DS("#header.poolName")
public List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) {
return qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
List<QcCheckTaskDetail> dtos = qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
for(QcCheckTaskDetail detail:dtos){
List<BaseFile> files = qmsFileMapper.getBaseFileBatch(detail.getRecordId());
if (!CollectionUtils.isEmpty(files)) {
List<String> urls = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList());
detail.setFiles(files);
detail.setFileUrls(urls);
}
}
return dtos;
}
@Override
@ -476,15 +498,15 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
@DS("#header.poolName")
public List<QcCheckTaskIncome> getWorkOrder(QcCheckTaskIncome qcCheckTaskIncome) {
List<QcCheckTaskIncome> dtos = qcCheckUnqualifiedMapper.getWorkOrder(qcCheckTaskIncome);
for(QcCheckTaskIncome dto:dtos){
String statusName = "";
if("w5".equals(dto.getStatus())){
statusName = "质检完成";
}else{
statusName = "质检未完成";
}
dto.setStatus(statusName);
}
// for(QcCheckTaskIncome dto:dtos){
// String statusName = "";
// if("w5".equals(dto.getStatus())){
// statusName = "质检完成";
// }else{
// statusName = "质检未完成";
// }
// dto.setStatus(statusName);
// }
return dtos;
}
@ -510,6 +532,41 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
return dtos;
}
@Override
@DS("#header.poolName")
public List<QcCheckTaskIncome> getCkeckProjectXJList(QcCheckTaskIncome qcCheckTaskIncome) {
List<QcCheckTaskIncome> dtos = qcCheckTaskIncomeMapper.getCkeckTaskXJList(qcCheckTaskIncome);
for(QcCheckTaskIncome dto:dtos){
//不良分类
QcCheckTaskDefect defectqo = new QcCheckTaskDefect();
defectqo.setBelongTo(dto.getRecordId());
List<QcCheckTaskDefect> defects = qcCheckTaskDefectMapper.selectQcCheckTaskDefectList(defectqo);
if(!CollectionUtils.isEmpty(defects)){
List<String> names = defects.stream().map(QcCheckTaskDefect::getDefectSubclass).collect(Collectors.toList());
dto.setNoOkQualityNames(names.toString());
List<BigDecimal> vals = defects.stream().map(QcCheckTaskDefect::getNoOkQuality).collect(Collectors.toList());
dto.setNoOkQualityVals(vals.toString());
}
//检测项列表
QcCheckTaskDetail detailqo = new QcCheckTaskDetail();
detailqo.setBelongTo(dto.getRecordId());
List<QcCheckTaskDetail> qcCheckTaskDetails = qcCheckTaskDetailMapper.selectQcCheckTaskDetailList(detailqo);
if(!CollectionUtils.isEmpty(qcCheckTaskDetails)){
for(QcCheckTaskDetail qcCheckTaskDetail:qcCheckTaskDetails){
List<BaseFile> files = qmsFileMapper.getBaseFileBatch(qcCheckTaskDetail.getRecordId());
if (!CollectionUtils.isEmpty(files)) {
List<String> urls = files.stream().map(BaseFile::getFileAddress).collect(Collectors.toList());
qcCheckTaskDetail.setFiles(files);
qcCheckTaskDetail.setFileUrls(urls);
}
}
dto.setQcCheckTaskDetails(qcCheckTaskDetails);
}
}
return dtos;
}
@Override
@Transactional(rollbackFor = Exception.class)
public int commitCheckResults(QcCheckTaskIncome qcCheckTaskIncome) {
@ -583,6 +640,8 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
logger.info("更新qc_check_task_detail:"+n);
/**qc_check_task_defect**/
n=qcCheckTaskIncomeMapper.deleteQcCheckTaskDefects(belongId);
logger.info("清理qc_check_task_defect:"+n);
n= qcCheckTaskIncomeMapper.addQcCheckTaskDefects(defects);
logger.info("qc_check_task_defect:"+n);

@ -1,16 +1,14 @@
package com.op.quality.service.impl;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcCheckProject;
import com.op.system.api.domain.quality.OAInfo;
import com.op.quality.domain.QcCheckTaskIncome;
import com.op.quality.mapper.QcCheckTaskIncomeMapper;
import com.op.system.api.RemoteOpenService;
@ -100,6 +98,7 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
oaR = this.createLLOA(taskIfo);
}else if("produce".equals(taskIfo.getTypeCode())){
//ZL0030-品质异常流程
oaR = this.createProduceOA(taskIfo);
}else if("product".equals(taskIfo.getTypeCode())) {
//ZL0020-成品检验控制流程
oaR = this.createProductOA(taskIfo);
@ -109,10 +108,13 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
/**qc_check_unqualified**/
qcCheckUnqualified.setRequestid(oaR.get("data").toString());
qcCheckUnqualified.setStartOaStatus("1");
qcCheckUnqualified.setStatus("1");
qcCheckUnqualified.setStartTime(nowTime);
int m = qcCheckUnqualifiedMapper.updateQcCheckUnqualified(qcCheckUnqualified);
return m;
}else{
qcCheckUnqualified.setStartOaStatus("2");
qcCheckUnqualified.setStartTime(nowTime);
qcCheckUnqualified.setStartOaMsg(oaR.get("msg").toString());
qcCheckUnqualifiedMapper.updateQcCheckUnqualified(qcCheckUnqualified);
return 0;
@ -146,6 +148,20 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
return qcCheckUnqualifiedMapper.deleteQcCheckUnqualifiedById(id);
}
@Override
@DS("#header.poolName")
public List<OAInfo> getOAInfoList(QcCheckUnqualified qcCheckUnqualified) {
logger.info("查看流程Id"+ qcCheckUnqualified.getTaskId());
AjaxResult oaR = remoteOpenService.GetOaNodeInfo(qcCheckUnqualified.getTaskId());
logger.info("流程Id 26235:"+ JSONObject.toJSONString(oaR));
List<OAInfo> infoList = new ArrayList<>();
if((int)oaR.get("code")==200){
infoList=JSONArray.parseArray(oaR.get("msg").toString(),OAInfo.class);
}
return infoList;
}
/*OA
* CQ OEMCM LLLB 01MATNR MAKTX suppliernum
* supplier CHARG comeQty testDate JYBH
@ -199,14 +215,14 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
//发起来料检验OA流程
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("user","999999");//提交人工号qcCheckTaskIncome.getUpdateBy()
paramMap.put("user",SecurityUtils.getUsername());//提交人工号qcCheckTaskIncome.getUpdateBy()
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0020-成品检验控制流程");//流程名称
paramMap.put("workflowId",26234);//该流程对应的唯- workFlowld
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
mainObject.append("\"SSCJ\":"+detailInfo.getSupplierName());//所属车间
mainObject.append("\"SSCJ\":"+"\""+detailInfo.getSupplierName()+"\"");//所属车间
mainObject.append(",\"ZRPSN\":"+"\""+SecurityUtils.getUsername()+"\"");//报检人
mainObject.append(",\"OEM\":"+"\""+detailInfo.getFactoryCode()+"\"");//OEM厂名
mainObject.append(",\"DH\":"+"\""+detailInfo.getOrderNo()+"\"");//单号
@ -223,19 +239,90 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
detailObject.append("{\"PRONAME\":\""+detailInfo.getMaterialName()+"\"},");//产品名称
detailObject.append("{\"SCCODE\":\""+detailInfo.getIncomeBatchNo()+"\"},");//批次号
detailObject.append("{\"SCTOTAL\":\""+detailInfo.getQuality()+"\"},");//数量
detailObject.append("{\"BJDATE\":\""+detailInfo.getCreateTime()+"\"},");//报检日期
detailObject.append("{\"BJDATE\":\""+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getCreateTime())+"\"},");//报检日期
detailObject.append("{\"JYCODE\":\""+detailInfo.getCheckNo()+"\"},");// 检验编号
detailObject.append("{\"JYDATE\":\""+detailInfo.getCheckTime()+"\"},");// 检验日期
detailObject.append("{\"JYDATE\":\""+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getCheckTime())+"\"},");// 检验日期
detailObject.append("{\"JYRESULT\":\""+(detailInfo.getCheckResult().equals("Y")?"0":"2")+"\"},");//检验结果0合格 2不合格
detailObject.append("{\"CPCYS\":\""+detailInfo.getQuality()+"\"},");// 产品抽样数PC
detailObject.append("{\"JYBHGMS\":\""+task.getRemark()+"\"}");// 不合格情况描述
detailObject.append("]}");
paramMap.put("mainObject",detailObject.toString());
paramMap.put("details",detailObject.toString());
logger.info("流程Id 26234:"+ JSONObject.toJSONString(paramMap));
AjaxResult oaR = remoteOpenService.OAInspection(paramMap);
logger.info("流程Id 26234:"+ JSONObject.toJSONString(oaR));
return oaR;
}
/**
{
"user": "999999",
"requestLevel": "0", 0
"requestName": "ZL0030-品质异常流程-智能制造-2024-01-17产品名称:榄菊高级型蚊香(60装)",
"workflowId": "26256",
"mainObject": "{
"CPMC":"榄菊高级型蚊香(60装)", *
"CPBM":"10101000115", *
"SQBM":"0", * 0
"SQR":"15930", *: 15930
"SQSJ":"2024-01-17", *:
"SCCJ":"162", * 162
"SCPH":"240555a", *
"SCSL":500, *
"FXDD":"测试地点", *
"FXRQ":"2024-01-17", *:
"BH":"202401170002", * +
"YCFW":"1", * 1
"PZYCMS":"测试异常描述", *
"Notes":"测试备注",
"SFXYZG":"1", * 1 0
"PGZG":"", QCSFXYZG"是",QC
"PGZR":"660", * 660
"SFGYSWT":"1" * 1 0
}"
}
* @param task
* @return
*/
private AjaxResult createProduceOA(QcCheckUnqualified task){
QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
//发起来料检验OA流程
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("user",SecurityUtils.getUsername());//提交人工号
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0030-品质异常流程-智能制造-"+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getIncomeTime())+"(产品名称:"+detailInfo.getMaterialName()+"");//流程名称
paramMap.put("workflowId",26256);//该流程对应的唯- workFlowld
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
mainObject.append("\"CPMC\":"+detailInfo.getMaterialName());//产品名称
mainObject.append(",\"CPBM\":"+detailInfo.getMaterialCode());//产品编码
//mainObject.append(",\"SQBM\":"+"\"0\"");//0品质保障部
mainObject.append(",\"SQR\":"+"\""+SecurityUtils.getUsername()+"\"");//申请人:默认当前用户
mainObject.append(",\"SQSJ\":"+"\""+detailInfo.getSupplierCode()+"\"");//申请时间
mainObject.append(",\"SCCJ\":"+"\""+detailInfo.getSupplierName()+"\"");//所属车间
mainObject.append(",\"SCPH\":"+"\""+detailInfo.getIncomeBatchNo()+"\"");//生产批号
mainObject.append(",\"SCSL\":"+"\""+detailInfo.getQuality()+"\"");//生产数量
mainObject.append(",\"FXDD\":"+"\""+detailInfo.getCheckLoc()+"\"");//发现地点
mainObject.append(",\"FXRQ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getCheckTime())+"\"");//发现日期
mainObject.append(",\"BH\":"+"\""+detailInfo.getCheckNo()+"\"");//编号:流水号 年月日+四位流水号
mainObject.append(",\"YCFW\":"+"\"1\"");//*异常范围:下拉框榄菊所有工厂 1代表小榄工厂
mainObject.append(",\"PZYCMS\":"+"\""+detailInfo.getRemark()+"\"");//品质异常描述
mainObject.append(",\"Notes\":"+"\"\"");//测试备注
mainObject.append(",\"SFXYZG\":"+"\"1\"");//*是否需要主管审核 1否 0是
mainObject.append(",\"SFXYZG\":"+"\"1\"");//*是否需要主管审核 1否 0是
mainObject.append(",\"PGZG\":"+"\""+detailInfo.getRemark()+"\"");//QC主管SFXYZG字段为"是",则此项选择QC主管信息
mainObject.append(",\"PGZR\":"+"\"660\"");//质量主管 660朱继新
mainObject.append(",\"SFGYSWT\":"+"\"1\"");//*是否供应商问题 1非供应商问题 0是供应商问题
mainObject.append("}");
paramMap.put("mainObject",mainObject.toString());
logger.info("流程Id 26256:"+ JSONObject.toJSONString(paramMap));
AjaxResult oaR = remoteOpenService.OAInspection(paramMap);
logger.info("流程Id 26256:"+ JSONObject.toJSONString(oaR));
return oaR;
}
}

@ -113,6 +113,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
}
@Override
@DS("#header.poolName")
public boolean validationGroupDetailData(String materialCode) {
return qcMaterialGroupDetailMapper.validationGroupDetailData(materialCode).size() > 0;
}

@ -8,7 +8,10 @@ import java.util.*;
import java.util.stream.Collectors;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.StringUtils;
import com.op.quality.domain.BaseFile;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckType;
import com.op.quality.mapper.QMSFileMapper;
import com.op.system.api.domain.quality.ChartDTO;
import com.op.system.api.domain.quality.ChartSeriesDTO;
import com.op.system.api.domain.quality.FactoryDto;
@ -29,7 +32,8 @@ import org.springframework.util.CollectionUtils;
public class QcStaticTableServiceImpl implements IQcStaticTableService {
@Autowired
private QcStaticTableMapper qcStaticTableMapper;
@Autowired
private QMSFileMapper qmsFileMapper;
/**
*
*
@ -162,106 +166,202 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
public List<QcStaticTable> getXJCheckTableDetail(QcStaticTable qcStaticTable) {
List<QcStaticTable> projects = qcStaticTableMapper.getXJProjects(qcStaticTable);
Map<String,QcStaticTable> detailMap = qcStaticTableMapper.getProjectDetail(qcStaticTable);
Map<String,QcStaticTable> picsMap = qcStaticTableMapper.picsMap(qcStaticTable);
for(QcStaticTable project:projects){
this.getDataFromMap(detailMap,project);
this.getDataFromMap(detailMap,project,picsMap);
}
return projects;
}
private void getDataFromMap(Map<String,QcStaticTable> detailMap,QcStaticTable project){
private void getDataFromMap(Map<String,QcStaticTable> detailMap,QcStaticTable project,Map<String,QcStaticTable> picsMap){
String keystr = project.getProjectId()+"08";
QcStaticTable detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn080090(detail.getStatus());
if(detail!=null) {
if (StringUtils.isNotBlank(detail.getRemark())) {
project.setColumn080090(detail.getRemark());
} else if (detail != null && StringUtils.isNotBlank(detail.getStatus())) {
project.setColumn080090(detail.getStatus().equals("Y") ? "✓" : "✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn080090(project.getColumn080090()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn080090("-");
}
keystr = project.getProjectId()+"09";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn090100(detail.getStatus());
if(detail!=null){
if(StringUtils.isNotBlank(detail.getRemark())){
project.setColumn090100(detail.getRemark());
}else if(detail!=null&&StringUtils.isNotBlank(detail.getStatus())){
project.setColumn090100(detail.getStatus().equals("Y")?"✓":"✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn090100(project.getColumn090100()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn090100("-");
}
keystr = project.getProjectId()+"10";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn100110(detail.getStatus());
if(detail!=null){
if(StringUtils.isNotBlank(detail.getRemark())){
project.setColumn100110(detail.getRemark());
}else if(detail!=null&&StringUtils.isNotBlank(detail.getStatus())){
project.setColumn100110(detail.getStatus().equals("Y")?"✓":"✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn100110(project.getColumn100110()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn100110("-");
}
keystr = project.getProjectId()+"11";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn110120(detail.getStatus());
if(detail!=null){
if(StringUtils.isNotBlank(detail.getRemark())){
project.setColumn110120(detail.getRemark());
}else if(detail!=null&&detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn110120(detail.getStatus().equals("Y")?"✓":"✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn110120(project.getColumn110120()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn110120("-");
}
keystr = project.getProjectId()+"12";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn123133(detail.getStatus());
if(detail!=null) {
if (StringUtils.isNotBlank(detail.getRemark())) {
project.setColumn123133(detail.getRemark());
} else if (detail != null && StringUtils.isNotBlank(detail.getStatus())) {
project.setColumn123133(detail.getStatus().equals("Y") ? "✓" : "✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn123133(project.getColumn123133()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn123133("-");
}
keystr = project.getProjectId()+"13";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn133143(detail.getStatus());
if(detail!=null){
if(StringUtils.isNotBlank(detail.getRemark())){
project.setColumn133143(detail.getRemark());
}else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn133143(detail.getStatus().equals("Y")?"✓":"✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn133143(project.getColumn133143()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn133143("-");
}
keystr = project.getProjectId()+"14";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn143153(detail.getStatus());
if(detail!=null) {
if (StringUtils.isNotBlank(detail.getRemark())) {
project.setColumn143153(detail.getRemark());
} else if (detail != null && StringUtils.isNotBlank(detail.getStatus())) {
project.setColumn143153(detail.getStatus().equals("Y") ? "✓" : "✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn143153(project.getColumn143153()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn143153("-");
}
keystr = project.getProjectId()+"15";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn153163(detail.getStatus());
if(detail!=null) {
if (StringUtils.isNotBlank(detail.getRemark())) {
project.setColumn153163(detail.getRemark());
} else if (detail != null && StringUtils.isNotBlank(detail.getStatus())) {
project.setColumn153163(detail.getStatus().equals("Y") ? "✓" : "✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn153163(project.getColumn153163()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn153163("-");
}
keystr = project.getProjectId()+"16";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn163173(detail.getStatus());
if(detail!=null) {
if(StringUtils.isNotBlank(detail.getRemark())){
project.setColumn163173(detail.getRemark());
}else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn163173(detail.getStatus().equals("Y")?"✓":"✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn163173(project.getColumn163173()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn163173("-");
}
keystr = project.getProjectId()+"18";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn180190(detail.getStatus());
if(detail!=null) {
if(StringUtils.isNotBlank(detail.getRemark())){
project.setColumn180190(detail.getRemark());
}else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn180190(detail.getStatus().equals("Y")?"✓":"✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn180190(project.getColumn180190()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn180190("-");
}
keystr = project.getProjectId()+"19";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn190200(detail.getStatus());
if(detail!=null) {
if(StringUtils.isNotBlank(detail.getRemark())){
project.setColumn190200(detail.getRemark());
}else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn190200(detail.getStatus().equals("Y")?"✓":"✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn190200(project.getColumn190200()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn190200("-");
}
keystr = project.getProjectId()+"20";
detail = detailMap.get(keystr);
if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn200210(detail.getStatus());
if(detail!=null) {
if(StringUtils.isNotBlank(detail.getRemark())){
project.setColumn200210(detail.getRemark());
}else if(detail!=null && StringUtils.isNotBlank(detail.getStatus())){
project.setColumn200210(detail.getStatus().equals("Y")?"✓":"✘");
}
QcStaticTable urlDTO = picsMap.get(detail.getRecordId());
if(urlDTO!=null){
project.setColumn200210(project.getColumn200210()+","+urlDTO.getProjectId().replace("&amp;","&"));//projectId存的照片路径
}
}else{
project.setColumn200210("-");
}
@ -371,6 +471,71 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
return dtos;
}
@Override
@DS("#header.poolName")
public QcStaticTable getDLTableAvgInfo(QcStaticTable qcStaticTable) {
QcStaticTable dto = new QcStaticTable();
//第一列日期
List<String> days = this.getDays(qcStaticTable.getYmArrayStart(),
qcStaticTable.getYmArrayEnd(),"ymd");
qcStaticTable.setDataType("ymd");
List<QcStaticTable> titleList = qcStaticTableMapper.getDLTableTitle(qcStaticTable);
Map<String, QcStaticTable> titleMap = titleList.stream().collect(Collectors.toMap(QcStaticTable::getYearMonth, (a) -> a));
//表头:第一行
List<String> colName1 = titleList.stream().map(QcStaticTable::getMaterialName).distinct().collect(Collectors.toList());
List<String> colCode1 = titleList.stream().map(QcStaticTable::getMaterialCode).distinct().collect(Collectors.toList());
dto.setTitleCol1(colName1);
//表头:第二行
List<String> colName2 = titleList.stream().map(QcStaticTable::getRuleName).distinct().collect(Collectors.toList());
List<String> colCode2 = titleList.stream().map(QcStaticTable::getProjectNo).distinct().collect(Collectors.toList());
dto.setTitleCol2(colName2);
//均值列表
List<HashMap> dxData = new ArrayList<>();
for(String day:days){
HashMap result = new HashMap();
List<HashMap> detailsData = new ArrayList<>();
HashMap detailResult = new HashMap();
result.put("ymdms",day+"均值");
int i=0,j=0;
for(int m=0;m<colCode1.size();m++){
for(int n=0;n<colCode2.size();n++){
String key = colCode1.get(m)+"-"+colCode2.get(n)+"-"+day;
QcStaticTable avgdto = titleMap.get(key);
if(avgdto!=null){
String avgArrayStr = avgdto.getQuality().replace("[","")
.replace("]","")
.replace("\"","");
List<String> avgArray = Arrays.asList(avgArrayStr.split(","));
BigDecimal addVal = new BigDecimal("0.00");
for(String avgVal:avgArray){
addVal = addVal.add(new BigDecimal(avgVal));
}
BigDecimal avg = addVal.divide(new BigDecimal(avgArray.size()),2,BigDecimal.ROUND_HALF_UP);
result.put("mcode"+m+"Pcode"+n,avg);
detailResult.put("mcode"+m+"Pcode"+n+"Detail",avgArrayStr.replace(",","\n"));
}else{
result.put("mcode"+m+"Pcode"+n,"0.00");
detailResult.put("mcode"+m+"Pcode"+n+"Detail","");
}
}
}
detailsData.add(detailResult);
result.put("details",detailsData);
dxData.add(result);
}
dto.setDxData(dxData);
return dto;
}
@Override
@DS("#header.poolName")
public List<QcStaticTable> getDLDetailList(QcStaticTable qcStaticTable) {
return null;
}
private List<String> getHourProductionTitle(QcStaticTable qcStaticTable) {
// 返回的日期集合
@ -401,6 +566,50 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
return dayHours;
}
public List<String> getDays(String startMonth,String endMonth,String type){
// 返回的日期集合
List<String> days = new ArrayList<String>();
DateFormat dateFormat = null;
try {
Calendar tempStart = null;
Calendar tempEnd = null;
if("ymd".equals(type)){
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date start = dateFormat.parse(startMonth);//开始
Date end = dateFormat.parse(endMonth);//结束
tempStart = Calendar.getInstance();
tempStart.setTime(start);
tempEnd = Calendar.getInstance();
tempEnd.setTime(end);
tempEnd.add(Calendar.DAY_OF_MONTH, 1);
}else{
dateFormat = new SimpleDateFormat("yyyy-MM");
Date start = dateFormat.parse(startMonth);//开始
Date end = dateFormat.parse(endMonth);//结束
tempStart = Calendar.getInstance();
tempStart.setTime(start);
tempEnd = Calendar.getInstance();
tempEnd.setTime(end);
tempEnd.add(Calendar.MONTH, 1);
}
while (tempStart.before(tempEnd)) {
days.add(dateFormat.format(tempStart.getTime()));
if("ymd".equals(type)) {
tempStart.add(Calendar.DAY_OF_MONTH, 1);
}else{
tempStart.add(Calendar.MONTH, 1);
}
}
} catch (ParseException e) {
e.printStackTrace();
}
return days;
}
}

@ -36,14 +36,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="sampleQuality" column="sample_quality" />
<result property="checkName" column="check_name" />
<result property="checkType" column="check_type"/>
<result property="reason" column="reason" />
<result property="productType" column="product_type"/>
</resultMap>
<sql id="selectQcCheckReportIncomeVo">
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,sample_quality,
check_time, check_result, status, check_type, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time,
factory_code, del_flag from qc_check_task
factory_code, del_flag,reason,product_type
from qc_check_task
</sql>
<select id="selectQcCheckReportIncomeList" parameterType="QcCheckReportIncome" resultMap="QcCheckReportIncomeResult">
@ -164,9 +166,72 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) t
left join pro_order_workorder pow on pow.workorder_code = t.orderNo
left join base_equipment be on be.equipment_code = pow.workorder_name
where pow.del_flag = '0' and be.del_flag ='0'
</select>
<insert id="insertQcCheckReportIncome" parameterType="QcCheckReportIncome">
<select id="getTaskInfo" resultType="com.op.quality.domain.QcCheckReportIncome">
select record_id recordId, check_no checkNo, income_batch_no incomeBatchNo,
order_no orderNo, material_code materialCode, material_name materialName,
quality, unit, supplier_code supplierCode, supplier_name supplierName,
income_time incomeTime, check_loc checkLoc, check_status checkStatus,
check_man_code checkManCode, check_man_name checkManName, check_time checkTime,
check_result checkResult,create_by createBy, create_time createTime,
check_type checkType,sample_quality sampleQuality,noOk_quality noOkQuality,
reason,product_type productType,
confirm,
confirm_man_code confirmManCode,
confirm_man_name confirmManName,
confirm_remark confirmRemark,
confirm_time confirmTime
from qc_check_task where record_id = #{recordId}
</select>
<select id="getXJTaskInfo" resultType="com.op.quality.domain.QcCheckReportIncome">
SELECT
c.check_type checkType,
c.quality,
c.unit,
c.order_no orderNo,
c.supplier_name supplierName,
c.supplier_code supplierCode,
c.material_name materialName,
c.material_code materialCode,
c.income_time incomeTime
FROM
qc_check_task c
where c.check_type='checkTypeSCXJ' and c.order_no = #{orderNo}
GROUP BY
c.order_no,c.supplier_name,c.supplier_code,c.material_name,
c.material_code,c.income_time,
c.check_type,
c.quality,c.unit
</select>
<select id="getLastXJTaskInfo" resultType="com.op.quality.domain.QcCheckReportIncome">
SELECT
top 1
c.confirm,
c.product_type productType,
c.confirm_man_code confirmManCode,
c.confirm_man_name confirmManName,
c.confirm_remark confirmRemark,
c.confirm_time confirmTime
FROM
qc_check_task c
where c.check_type='checkTypeSCXJ' and c.order_no = #{orderNo}
order by c.create_time desc
</select>
<select id="getLastProductTypeInfo" resultType="com.op.quality.domain.QcCheckTaskProduce">
SELECT
top 1
c.product_type productType,
c.check_man_code checkManCode,
c.check_man_name checkManName,
c.confirm_man_code confirmManCode,
c.confirm_man_name confirmManName
FROM
qc_check_task c
where c.check_type='checkTypeSCXJ' and c.order_no = #{orderNo}
order by c.create_time desc
</select>
<insert id="insertQcCheckReportIncome" parameterType="QcCheckReportIncome">
insert into qc_check_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">record_id,</if>
@ -263,8 +328,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where record_id = #{recordId}
</update>
<update id="submitConfirm">
update qc_check_task
set confirm = #{confirm},
confirm_man_code = #{confirmManCode},
confirm_man_name = #{confirmManName},
confirm_remark = #{confirmRemark},
confirm_time = #{confirmTime}
<where>
<if test="recordId != null">
and record_id = #{recordId}
</if>
<if test="orderNo != null">
and order_no = #{orderNo}
</if>
</where>
</update>
<delete id="deleteQcCheckReportIncomeByRecordId" parameterType="String">
<delete id="deleteQcCheckReportIncomeByRecordId" parameterType="String">
delete from qc_check_task where record_id = #{recordId}
</delete>

@ -54,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>

@ -311,6 +311,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{recordId}
</foreach>
</delete>
<delete id="deleteQcCheckTaskDefects">
delete from qc_check_task_defect where belong_to = #{belongId}
</delete>
<select id="selectQcCheckTaskCheckNoByRecordIds" parameterType="String" resultMap="QcCheckTaskIncomeResult">
select check_no from qc_check_task where record_id in
@ -357,13 +360,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.create_time createTime,
qct.check_no checkNo,
qct.check_time checkTime,
qct.check_result checkResult
qct.check_result checkResult,
qct.income_time incomeTime,
qct.check_loc checkLoc
from qc_check_task qct
left join pro_order_workorder pow on pow.workorder_code = qct.order_no
where qct.record_id = #{recordId}
</select>
<select id="getCkeckTaskXJList" resultType="com.op.quality.domain.QcCheckTaskIncome">
select
record_id recordId,
check_no checkNo,
income_batch_no incomeBatchNo,
check_status checkStatus,
check_man_code checkManCode,
check_man_name checkManName,
check_time checkTime,
check_result checkResult,
create_time createTime,
check_loc checkLoc,
sample_quality sampleQuality
from qc_check_task
where del_flag = '0' and check_type = 'checkTypeSCXJ' and order_no = #{orderNo}
</select>
<insert id="addCheckUsers">
<insert id="addCheckUsers">
insert into qc_check_task_user(
record_id,belong_to,check_no,
check_man_code,check_man_name,

@ -37,7 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="checkName" column="check_name" />
<result property="checkType" column="check_type"/>
<result property="noOkQuality" column="noOk_quality"/>
<result property="reason" column="reason" />
<result property="productType" column="product_type" />
</resultMap>
<resultMap type="QcCheckReportIncome" id="QcCheckReportIncomeResult">
@ -73,6 +74,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="checkName" column="check_name" />
<result property="checkType" column="check_type"/>
<result property="createTimeStr" column="createTimeStr" />
<result property="confirm" column="confirm" />
<result property="confirmManCode" column="confirm_man_code" />
<result property="confirmManName" column="confirm_man_name" />
<result property="confirmManName" column="confirm_remark" />
</resultMap>
<sql id="selectQcCheckTaskProduceVo">
@ -81,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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,
aNoOkquality,bNoOkquality,cNoOkquality
aNoOkquality,bNoOkquality,cNoOkquality,reason,product_type
from qc_check_task
</sql>
@ -119,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="checkType != null "> and qct.check_type = #{checkType} </if>
<if test="typeCode != null "> and q.type_code = #{typeCode} </if>
</where>
order by qct.create_time desc
</select>
<select id="selectQcCheckTaskProduceByRecordId" parameterType="String" resultMap="QcCheckTaskProduceResult">
@ -155,7 +161,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.supplier_name supplierName,
qct.income_time incomeTime,
max(qct.create_time) createTime,
qct.check_loc checkLoc
qct.check_loc checkLoc,
qct.product_type productType,
qct.confirm_man_code confirmManCode,
qct.confirm_man_name confirmManName
from qc_check_task qct
left join pro_order_workorder pow on qct.order_no = pow.workorder_code
where check_type = 'checkTypeSCXJ'
@ -164,7 +173,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by qct.factory_code,
qct.order_no,qct.material_code,qct.material_name,
qct.quality,qct.unit,qct.supplier_code,qct.supplier_name,
qct.income_time,qct.check_loc
qct.income_time,qct.check_loc,
qct.product_type,qct.confirm_man_code,qct.confirm_man_name
</select>
<insert id="insertQcCheckTaskProduce" parameterType="QcCheckTaskProduce">
@ -205,6 +215,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">del_flag,</if>
<if test="checkType != null">check_type,</if>
<if test="typeCode != null">type_code,</if>
<if test="reason != null">reason,</if>
<if test="productType != null">product_type,</if>
<if test="confirmManCode != null">confirm_man_code,</if>
<if test="confirmManName != null">confirm_man_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recordId != null">#{recordId},</if>
@ -242,6 +256,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">#{delFlag},</if>
<if test="checkType != null">#{checkType},</if>
<if test="typeCode != null">#{typeCode},</if>
<if test="reason != null">#{reason},</if>
<if test="productType != null">#{productType},</if>
<if test="confirmManCode != null">#{confirmManCode},</if>
<if test="confirmManName != null">#{confirmManName},</if>
</trim>
</insert>
@ -280,6 +298,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="reason != null">reason = #{reason},</if>
<if test="productType != null">product_type = #{productType},</if>
<if test="confirmManCode != null">confirm_man_code = #{confirmManCode},</if>
<if test="confirmManName != null">confirm_man_name = #{confirmManName},</if>
</trim>
where record_id = #{recordId}
</update>
@ -307,7 +329,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
qct.check_time, qct.check_result, qct.check_type,'首件检验' check_name,
CONVERT(varchar(10),qct.create_time, 120) createTimeStr
CONVERT(varchar(10),qct.create_time, 120) createTimeStr,
qct.confirm,qct.confirm_man_name
from qc_check_task qct
<where>
<if test="checkNo != null and checkNo != ''"> and qct.check_no = #{checkNo}</if>
@ -333,7 +356,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
'','','',
qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
qct.supplier_code, qct.supplier_name, qct.income_time,'','',
'','', qct.check_type,'巡检检验' check_name,CONVERT(varchar(10),qct.create_time, 120) createTimeStr
null,'', qct.check_type,'巡检检验' check_name,CONVERT(varchar(10),qct.create_time, 120) createTimeStr,
qct.confirm,qct.confirm_man_name
from qc_check_task qct
<where>
<if test="checkNo != null and checkNo != ''"> and qct.check_no = #{checkNo}</if>
@ -355,7 +379,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and qct.check_type = 'checkTypeSCXJ'
</where>
GROUP BY qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit,
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_type,CONVERT(varchar(10),qct.create_time, 120)
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_type,CONVERT(varchar(10),qct.create_time, 120),
qct.confirm,qct.confirm_man_name
) t
where 1=1
<if test="checkType != null ">

@ -31,8 +31,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectQcCheckUnqualifiedList" parameterType="QcCheckUnqualified" resultType="com.op.quality.domain.QcCheckUnqualified">
select qcu.id,qcu.task_id taskId,qcu.status,qcu.next_node_code nextNodeCode,qcu.next_node_name nextNodeName,qcu.remark,
qcu.create_time createTime,
qct.check_type checkType,qtn.check_name checkName,qct.check_no checkNo,qct.income_batch_no incomeBatchNo,qct.order_no orderNo,
qcu.create_time createTime,qcu.start_oa_status startOaStatus,qcu.start_oa_msg startOaMsg,qcu.requestid requestid,
qcu.start_time startTime,
qct.check_type checkType,qtn.check_name checkName,qct.check_no checkNo,qct.income_batch_no incomeBatchNo,qct.order_no orderNo,
qct.material_code materialCode,qct.material_name materialName,qct.quality,qct.unit,qct.supplier_code supplierCode,
qct.supplier_name supplierName,qct.income_time incomeTime,qct.check_loc checkLoc,qct.check_status checkStatus,
qct.check_man_code checkManCode,qct.sample_quality sampleQuality,qct.noOk_quality noOkQuality,
@ -190,7 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
check_type,noOk_quality,sample_quality,type_code,order_type
)
select
#{recordId},check_no,income_batch_no ,order_no ,
#{recordId},concat(check_no,FORMAT(GETDATE(),'HHmmss')),income_batch_no ,order_no ,
material_code,material_name,quality ,unit ,
supplier_code,supplier_name,income_time,
'0',
@ -261,7 +262,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="updateBy != null">start_man_code = #{startManCode},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="requestid != null">requestid = #{requestid},</if>
<if test="startOaStatus != null">start_oa_status = #{startOaStatus},</if>
<if test="startOaMsg != null">start_oa_msg = #{startOaMsg},</if>
@ -275,7 +275,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where order_no = #{orderNo}
</update>
<update id="updateWorkOrderBatchStatus">
update pro_order_workorder_batch set qc_status = #{status} where batch_code = #{incomeBatchNo}
update pro_order_workorder_batch set qc_status = #{status} where batch_code = #{incomeBatchNo} and check_type = #{checkType}
</update>
<update id="updatePutStatus">
update wms_product_put set check_status = #{status} where batch_number = #{incomeBatchNo}

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.quality.mapper.QcSampleRuleMapper">
<resultMap type="QcSampleRule" id="QcSampleRuleResult">
<result property="id" column="id" />
<result property="startValue" column="start_value" />
@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectQcSampleRuleList" parameterType="QcSampleRule" resultMap="QcSampleRuleResult">
<include refid="selectQcSampleRuleVo"/>
<where>
<where>
<if test="startValue != null "> and start_value = #{startValue}</if>
<if test="endValue != null "> and end_value = #{endValue}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
@ -36,13 +36,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeCode != null and typeCode != ''"> and type_code = #{typeCode}</if>
</where>
</select>
<select id="selectQcSampleRuleById" parameterType="String" resultMap="QcSampleRuleResult">
<include refid="selectQcSampleRuleVo"/>
where id = #{id}
</select>
<insert id="insertQcSampleRule" parameterType="QcSampleRule">
<select id="getSampNum" resultType="java.lang.String">
select sample_quality
from qc_sample_rule
where end_value>= #{quality} and #{quality}>=start_value and del_flag = '0'
and check_type = #{checkType}
</select>
<insert id="insertQcSampleRule" parameterType="QcSampleRule">
insert into qc_sample_rule
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
@ -100,9 +106,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteQcSampleRuleByIds" parameterType="String">
delete from qc_sample_rule where id in
delete from qc_sample_rule where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
</mapper>

@ -82,23 +82,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getProduceChartDataYM" resultType="com.op.quality.domain.QcStaticTable">
select
concat(qct.material_code,CONVERT(varchar(7),qct.income_time, 120)) materailDate,
<if test='dataType=="ymd" '>
concat(qct.material_code,CONVERT(varchar(10),qct.income_time, 120)) materailDate,
</if>
<if test='dataType=="ym" '>
concat(qct.material_code,CONVERT(varchar(7),qct.income_time, 120)) materailDate,
</if>
qct.material_code materialCode,
qct.material_name materialName,
sum(qct.sample_quality) sampleQuality,
sum(qct.aNoOkquality) aNoOkquality,
sum(qct.bNoOkquality) bNoOkquality,
sum(qct.cNoOkquality) cNoOkquality,
CONVERT(varchar(7),qct.income_time, 120) incomeTime
CONVERT(varchar(7),qct.income_time, 120)
from qc_check_task qct
where qct.del_flag = '0' and qct.type_code = 'produce'
<if test="materialCode != null "> and qct.material_code in (${materialCode})</if>
<if test="workCenter != null "> and qct.supplier_code = #{workCenter}</if>
<if test="ymArrayStart != null "> and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>
<if test="ymArrayEnd != null "> and #{ymArrayEnd}>= CONVERT(varchar(10),qct.income_time, 120)</if>
<if test='ymArrayStart != null and dataType=="ym" '> and CONVERT(varchar(7),qct.income_time, 120) >= #{ymArrayStart}</if>
<if test='ymArrayEnd != null and dataType=="ym"'> and #{ymArrayEnd}>= CONVERT(varchar(7),qct.income_time, 120)</if>
<if test='ymArrayStart != null and dataType=="ymd" '> and CONVERT(varchar(10),qct.income_time, 120) >= #{ymArrayStart}</if>
<if test='ymArrayEnd != null and dataType=="ymd"'> and #{ymArrayEnd}>= CONVERT(varchar(10),qct.income_time, 120)</if>
group by qct.material_code ,
qct.material_name ,
CONVERT(varchar(7),qct.income_time, 120)
qct.material_name
<if test='dataType=="ymd" '>
,CONVERT(varchar(10),qct.income_time, 120)
</if>
<if test='dataType=="ym" '>
,CONVERT(varchar(7),qct.income_time, 120)
</if>
</select>
<select id="getWorkcenterList" resultType="com.op.system.api.domain.quality.FactoryDto">
select factory_name factoryName,
@ -130,8 +142,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by qctp.sort
</select>
<select id="getProjectDetail" resultType="com.op.quality.domain.QcStaticTable">
select qctd.project_id projectId,
select qctd.record_id recordId,
qctd.project_id projectId,
qctd.status,
qctd.remark,
CONVERT(VARCHAR(5),qctd.create_time, 108),
concat(qctd.project_id,
case when '09:00'>= CONVERT(VARCHAR(5),qctd.create_time, 108) and CONVERT(VARCHAR(5),qctd.create_time, 108)> '08:00' then '08'
@ -228,4 +242,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
factory_code supplierCode
from sys_factory where f_type = 'c'
</select>
<select id="picsMap" resultType="com.op.quality.domain.QcStaticTable">
SELECT
t.source_id recordId,
STUFF(
(SELECT ',' + file_address
FROM (
select file_address,source_id from base_file where source_id in(
select record_id from qc_check_task_detail where beLong_to in (
select record_id from qc_check_task
where order_no = #{orderNo} and check_type = 'checkTypeSCXJ')
)
) t0
WHERE t.source_id = t0.source_id
FOR xml path('')
),1,1,''
) projectId
FROM (
select file_address,source_id from base_file where source_id in(
select record_id from qc_check_task_detail where beLong_to in (
select record_id from qc_check_task
where order_no = #{orderNo} and check_type = 'checkTypeSCXJ')
)
) t
GROUP by t.source_id
</select>
<select id="getDLTableTitle" resultType="com.op.quality.domain.QcStaticTable">
SELECT
concat(q.material_code,'-',q.project_no,'-',CONVERT(varchar(10),q.ymdms, 120)) yearMonth,
material_code materialCode,
material_name materialName,
ymdms,rule_name ruleName,
project_no projectNo,
STUFF(
(SELECT ',' + t.actual_value
FROM (select
qct.material_code,qct.material_name,
CONVERT(varchar(10),qct.income_time, 120) ymdms,
qctd.rule_name, qctd.project_no,qctd.actual_value
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
where qct.check_type = 'checkTypeLL' and qctd.property_code = '1' and qct.check_time is not null
<if test="ymArrayStart != null "> and CONVERT(varchar(10),qct.income_time, 120) >= CONVERT(varchar(10),#{ymArrayStart}, 120)</if>
<if test="ymArrayEnd != null "> and CONVERT(varchar(10),#{ymArrayEnd}, 120)>=CONVERT(varchar(10),qct.income_time, 120)</if>
) t
WHERE t.material_code = q.material_code and t.project_no = q.project_no and t.ymdms=q.ymdms
FOR xml path('')
),1,1,''
) quality
FROM (
select
qct.material_code,qct.material_name,
CONVERT(varchar(10),qct.income_time, 120) ymdms,
qctd.rule_name,qctd.project_no,qctd.actual_value
from qc_check_task qct
left join qc_check_task_detail qctd on qct.record_id = qctd.belong_to
where qct.check_type = 'checkTypeLL' and qctd.property_code = '1' and qct.check_time is not null
<if test="ymArrayStart != null "> and CONVERT(varchar(10),qct.income_time, 120) >= CONVERT(varchar(10),#{ymArrayStart}, 120)</if>
<if test="ymArrayEnd != null "> and CONVERT(varchar(10),#{ymArrayEnd}, 120)>=CONVERT(varchar(10),qct.income_time, 120)</if>
) q
GROUP BY q.material_code,q.material_name, q.ymdms,q.rule_name,q.project_no
</select>
</mapper>

@ -76,7 +76,7 @@ public class SapController extends BaseController {
if(!"ds_999".equals(dateSource.get("poolName"))){
logger.info("++++++++++++" + dateSource.get("poolName") + "++++product同步开始++++++++++");
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
/**base_product**/
Date maxTime0 = sapBomMapper.getProductMaxTime();
if(maxTime0 != null){
Calendar calendar = Calendar.getInstance();
@ -115,7 +115,7 @@ public class SapController extends BaseController {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++bom同步开始++++++++++");
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
Date maxTime0 = sapBomMapper.getProductMaxTime();
Date maxTime0 = sapBomMapper.getBomMaxTime();
if (maxTime0 != null) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(maxTime0);

@ -47,4 +47,6 @@ public interface SapBomMapper {
Date getProductMaxTime();
Date getRouteMaxTime();
Date getBomMaxTime();
}

@ -187,13 +187,7 @@ public class SapOrderServiceImpl implements SapOrderService {
JCoParameterList J= func.getExportParameterList();
System.out.println(func.getExportParameterList());
L_MSG= func.getExportParameterList().getString("L_MSG");
// String RETCODE = func.getExportParameterList().getString("RETCODE");
//String LV_ORDER_NUMBER= func.getExportParameterList().getString("LV_ORDER_NUMBER");
// if (RETCODE.equals(Constants.FAIL)){
// return R.fail(LV_ORDER_NUM_List,L_MSG);
// }
JCoTable LT_ZGD=func.getTableParameterList().getTable("LT_ZGD");
for (int i = 0; i <LT_ZGD.getNumRows(); i++) {
LT_ZGD.setRow(i);
Map map=new HashMap();
@ -203,10 +197,8 @@ public class SapOrderServiceImpl implements SapOrderService {
map.put("AUFNR",AUFNR);
LV_ORDER_NUM_List.add(map);
}
}
log.info("订单创建结果----"+L_MSG+"|"+JSONObject.toJSONString(LV_ORDER_NUM_List));
return R.ok(LV_ORDER_NUM_List,L_MSG);
}else {
log.error("接收的数据为空");

@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select factory_id from sys_factory where factory_code = #{factoryCode}
</select>
<select id="getProductMaxTime" resultType="java.util.Date">
select max(create_time) from sys_factory where create_by = 'job'
select max(create_time) from base_product where create_by = 'job'
</select>
<insert id="insertBaseBom" parameterType="com.op.system.api.domain.sap.SapBom">
@ -288,6 +288,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getRouteMaxTime" resultType="java.util.Date">
select max(create_time) from pro_route where attr1 = 'job'
</select>
<select id="getBomMaxTime" resultType="java.util.Date">
select max(create_time) from base_bom
</select>
<!--批量更新供应商建模表-->
<update id="updateSupplierBatchs">

@ -13,15 +13,15 @@ spring:
cloud:
nacos:
discovery:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
config:
namespace: lanju-op
group: zxl
namespace: lanju-op-test
group: test
# 服务注册地址
server-addr: 175.27.215.92:8848
server-addr: 192.168.202.20:8848
# 配置文件格式
file-extension: yml
# 共享配置

@ -55,6 +55,16 @@ public class BaseEquipmentController extends BaseController {
return getDataTable(list);
}
/**
*
*/
@GetMapping("/getEquipmentListByCategory")
public TableDataInfo selectBaseEquipmentListByCategory(BaseEquipment baseEquipment) {
startPage();
List<BaseEquipment> list = baseEquipmentService.selectEquipmentListByCategory(baseEquipment);
return getDataTable(list);
}
/**
*
*/
@ -267,5 +277,4 @@ public class BaseEquipmentController extends BaseController {
List<BaseEquipment> list = baseEquipmentService.selectBYRecordsList(baseEquipment);
return getDataTable(list);
}
}

@ -67,6 +67,15 @@ public class BaseProductController extends BaseController {
return success(baseProductService.selectBaseProductByProductId(productId));
}
/**
*
*/
@RequiresPermissions("wms:product:query")
@GetMapping(value = "/code/{productCode}")
public AjaxResult selectBaseProductByProductCode(@PathVariable("productCode") String productCode) {
return success(baseProductService.selectBaseProductByProductCode(productCode));
}
/**
*
*/

@ -102,11 +102,8 @@ public class SysFactoryController extends BaseController {
}
// 查询工作中心
// @RequiresPermissions("wms:factory:getWorkCenterList")
@GetMapping("/getWorkCenterList")
public TableDataInfo getWorkCenterList(SysFactory sysFactory) {
startPage();
List<SysFactory> list = sysFactoryService.getWorkCenterList(sysFactory);
return getDataTable(list);
public AjaxResult getWorkCenterList(SysFactory sysFactory) {
return sysFactoryService.getWorkCenterList(sysFactory);
}
}

@ -126,4 +126,7 @@ public interface BaseEquipmentMapper {
//查询保养记录
List<BaseEquipment> selectBYRecordsList(BaseEquipment baseEquipment);
//查询辅助设备
List<BaseEquipment> selectEquipmentListByCategory(BaseEquipment baseEquipment);
}

@ -6,14 +6,14 @@ import com.op.wms.domain.BaseProduct;
/**
* Mapper
*
*
* @author Open Platform
* @date 2023-07-18
*/
public interface BaseProductMapper {
/**
*
*
*
* @param productId
* @return
*/
@ -21,7 +21,7 @@ public interface BaseProductMapper {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -29,7 +29,7 @@ public interface BaseProductMapper {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -37,7 +37,7 @@ public interface BaseProductMapper {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -45,7 +45,7 @@ public interface BaseProductMapper {
/**
*
*
*
* @param productId
* @return
*/
@ -53,7 +53,7 @@ public interface BaseProductMapper {
/**
*
*
*
* @param productIds
* @return
*/
@ -61,4 +61,6 @@ public interface BaseProductMapper {
String checkNameUnique(BaseProduct baseProduct);
String checkCodeUnique(BaseProduct baseProduct);
BaseProduct selectBaseProductByProductCode(String productCode);
}

@ -89,4 +89,7 @@ public interface IBaseEquipmentService {
//查看保养记录
List<BaseEquipment> selectBYRecordsList(BaseEquipment baseEquipment);
//辅助设备列表
List<BaseEquipment> selectEquipmentListByCategory(BaseEquipment baseEquipment);
}

@ -5,14 +5,14 @@ import com.op.wms.domain.BaseProduct;
/**
* Service
*
*
* @author Open Platform
* @date 2023-07-18
*/
public interface IBaseProductService {
/**
*
*
*
* @param productId
* @return
*/
@ -20,7 +20,7 @@ public interface IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -28,7 +28,7 @@ public interface IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -36,7 +36,7 @@ public interface IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -44,7 +44,7 @@ public interface IBaseProductService {
/**
*
*
*
* @param productIds
* @return
*/
@ -52,7 +52,7 @@ public interface IBaseProductService {
/**
*
*
*
* @param productId
* @return
*/
@ -60,4 +60,6 @@ public interface IBaseProductService {
boolean checkCodeUnique(BaseProduct baseProduct);
boolean checkNameUnique(BaseProduct baseProduct);
public BaseProduct selectBaseProductByProductCode(String productCode);
}

@ -1,6 +1,8 @@
package com.op.wms.service;
import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.wms.domain.SysFactory;
/**
@ -58,8 +60,8 @@ public interface ISysFactoryService {
*/
public int deleteSysFactoryByFactoryId(Long factoryId);
//
List<SysFactory> getWorkCenterList(SysFactory sysFactory);
//查询工作中心
AjaxResult getWorkCenterList(SysFactory sysFactory);
//新增 判断逻辑
boolean checkFactoryCodeUnique(SysFactory sysFactory);

@ -130,6 +130,18 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
return baseEquipmentMapper.selectBaseEquipmentList(baseEquipment);
}
/**
*
*
* @param baseEquipment
* @return
*/
@Override
@DS("#header.poolName")
public List<BaseEquipment> selectEquipmentListByCategory(BaseEquipment baseEquipment) {
return baseEquipmentMapper.selectEquipmentListByCategory(baseEquipment);
}
/**
*
*
@ -347,7 +359,6 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
baseEquipmentMapper.bindAuxiliaryEquipment(equBindAuxiliaryEquipment);
}
}
return list;
}
@ -360,6 +371,13 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
@Override
@DS("#header.poolName")
public int deleteBaseEquipmentByEquipmentIds(Long[] equipmentIds) {
for(long equipmentId:equipmentIds){
BaseEquipment list = baseEquipmentMapper.selectBaseEquipmentByEquipmentId(equipmentId);
//删除备件信息
baseEquipmentMapper.deleteEquSpareEquipmentByCode(list.getEquipmentCode());
//删除辅助设备
baseEquipmentMapper.deleteAuxiliaryEquipmentByCode(list.getEquipmentCode());
}
return baseEquipmentMapper.deleteBaseEquipmentByEquipmentIds(equipmentIds);
}
@ -372,6 +390,11 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService {
@Override
@DS("#header.poolName")
public int deleteBaseEquipmentByEquipmentId(Long equipmentId) {
BaseEquipment list = baseEquipmentMapper.selectBaseEquipmentByEquipmentId(equipmentId);
//删除备件信息
baseEquipmentMapper.deleteEquSpareEquipmentByCode(list.getEquipmentCode());
//删除辅助设备
baseEquipmentMapper.deleteAuxiliaryEquipmentByCode(list.getEquipmentCode());
return baseEquipmentMapper.deleteBaseEquipmentByEquipmentId(equipmentId);
}

@ -14,7 +14,7 @@ import com.op.wms.service.IBaseProductService;
/**
* Service
*
*
* @author Open Platform
* @date 2023-07-18
*/
@ -25,7 +25,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param productId
* @return
*/
@ -37,7 +37,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -49,7 +49,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -63,7 +63,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param baseProduct
* @return
*/
@ -77,7 +77,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param productIds
* @return
*/
@ -89,7 +89,7 @@ public class BaseProductServiceImpl implements IBaseProductService {
/**
*
*
*
* @param productId
* @return
*/
@ -130,4 +130,10 @@ public class BaseProductServiceImpl implements IBaseProductService {
return true;
}
}
@Override
@DS("#header.poolName")
public BaseProduct selectBaseProductByProductCode(String productCode) {
return baseProductMapper.selectBaseProductByProductCode(productCode);
}
}

@ -4,12 +4,14 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.wms.mapper.SysFactoryMapper;
import com.op.wms.domain.SysFactory;
import com.op.wms.service.ISysFactoryService;
import static com.op.common.core.web.domain.AjaxResult.success;
/**
* Service
@ -99,15 +101,16 @@ public class SysFactoryServiceImpl implements ISysFactoryService {
}
/**
*
*
*
* @param sysFactory
* @return
*/
@Override
@DS("#header.poolName")
public List<SysFactory> getWorkCenterList(SysFactory sysFactory) {
return sysFactoryMapper.getWorkCenterList(sysFactory);
public AjaxResult getWorkCenterList(SysFactory sysFactory) {
List<SysFactory> list= sysFactoryMapper.getWorkCenterList(sysFactory);
return success(list);
}
/**

@ -228,6 +228,13 @@
</where>
</select>
<select id="selectEquipmentListByCategory" parameterType="BaseEquipment" resultMap="BaseEquipmentResult">
<include refid="selectBaseEquipmentVo"/>
where equipment_code != #{equipmentCode}
and equipment_category = #{equipmentCategory}
and del_flag ='0'
</select>
<select id="selectBaseEquipmentByEquipmentId" parameterType="Long" resultMap="BaseEquipmentResult">
<include refid="selectBaseEquipmentVo"/>
where equipment_id = #{equipmentId}

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.wms.mapper.BaseProductMapper">
<resultMap type="BaseProduct" id="BaseProductResult">
<result property="productId" column="product_id" />
<result property="productCode" column="product_code" />
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBaseProductList" parameterType="BaseProduct" resultMap="BaseProductResult">
<include refid="selectBaseProductVo"/>
<where>
<where>
<if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
<if test="productDescZh != null and productDescZh != ''"> and product_desc_zh like concat('%', #{productDescZh}, '%')</if>
<if test="productModel != null and productModel != ''"> and product_model = #{productModel}</if>
@ -113,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0'
</where>
</select>
<select id="selectBaseProductByProductId" parameterType="String" resultMap="BaseProductResult">
select
bp.product_id,
@ -180,7 +180,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where product_id = #{productId}
and del_flag = '0'
</select>
<insert id="insertBaseProduct" parameterType="BaseProduct">
insert into base_product
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -351,5 +353,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where product_code = #{productCode}
and del_flag ='0'
</select>
<select id="selectBaseProductByProductCode" parameterType="String" resultMap="BaseProductResult">
select
bp.product_id,
bp.product_code,
bp.product_desc_zh,
bp.product_model,
bp.product_desc_en,
bp.rule_code,
bp.old_product_code,
bp.parts_product_code,
bp.sku_barcode,
bp.length,
bp.width,
bp.height,
bp.gross_weight,
bp.net_weight,
bp.tare_weight,
bp.volume,
bp.unit_price,
bp.product_group,
bp.product_group_name,
bp.user_defined1,
bp.user_defined2,
bp.user_defined3,
bp.user_defined4,
bp.user_defined5,
bp.user_defined6,
bp.create_by,
bp.create_time,
bp.update_by,
bp.update_time,
bp.factory_code,
bp.active_flag,
bp.sync_flag,
bp.primary_uom,
bp.del_flag,
bp.bstme,
bp.basic_order,
bp.conv_order,
bp.ausme,
bp.basic_issue,
bp.conv_issue,
bp.append_flag,
bp.append_percent,
bp.mtart,
bpa.category,
bpa.pc,
bpa.iei,
bpa.man_standar,
bpa.spray_way,
bpa.blank_diameter,
bpa.blank_no,
bpa.spray_volume,
bpa.liquid_no,
bpa.endometrial_dosage,
bpa.outer_film_dosage,
bpa.support,
bpa.support_no,
bpa.pvc,
bpa.support_plate,
bpa.other
from base_product bp
left join base_product_attached bpa on bpa.product_code = right(bp.product_code,11)
where bp.product_code like concat('%', #{productCode}, '%')
and del_flag = '0'
</select>
</mapper>
</mapper>

Loading…
Cancel
Save