diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/MesPrepareDetailDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/MesPrepareDetailDTO.java
index 6f566e3c..01d2da62 100644
--- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/MesPrepareDetailDTO.java
+++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/MesPrepareDetailDTO.java
@@ -84,6 +84,26 @@ public class MesPrepareDetailDTO extends BaseEntity {
private String recoil;
private String buyFlag;
private String parentWorkOrder;
+ //以输入单位计的数量
+ private String erfmg;
+ //条目单位
+ private String erfme;
+
+ public String getErfmg() {
+ return erfmg;
+ }
+
+ public void setErfmg(String erfmg) {
+ this.erfmg = erfmg;
+ }
+
+ public String getErfme() {
+ return erfme;
+ }
+
+ public void setErfme(String erfme) {
+ this.erfme = erfme;
+ }
public String getParentWorkOrder() {
return parentWorkOrder;
diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialPreparation.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialPreparation.java
index c9aef40b..be0a7734 100644
--- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialPreparation.java
+++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapMaterialPreparation.java
@@ -29,6 +29,26 @@ public class SapMaterialPreparation {
private String RGEKZ;
//直接采购标识
private String DBSKZ;
+ //以输入单位计的数量
+ private String ERFMG;
+ //条目单位
+ private String ERFME;
+
+ public String getERFMG() {
+ return ERFMG;
+ }
+
+ public void setERFMG(String ERFMG) {
+ this.ERFMG = ERFMG;
+ }
+
+ public String getERFME() {
+ return ERFME;
+ }
+
+ public void setERFME(String ERFME) {
+ this.ERFME = ERFME;
+ }
public String getAUFNR() {
return AUFNR;
diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java
index 921c8ee1..622a2c88 100644
--- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java
+++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java
@@ -193,10 +193,19 @@ public class wmsReportWork extends BaseEntity {
private String createTimeEnd;
private String feedbackTimeStart;
private String feedbackTimeEnd;
- private String batch;
+ private String batch;//生产批次
+ private String batchSK;//RK批次
private String endReport;
private String whCode;
+ public String getBatchSK() {
+ return batchSK;
+ }
+
+ public void setBatchSK(String batchSK) {
+ this.batchSK = batchSK;
+ }
+
public String getWhCode() {
return whCode;
}
diff --git a/op-common/op-common-core/src/main/java/com/op/common/core/utils/StringUtils.java b/op-common/op-common-core/src/main/java/com/op/common/core/utils/StringUtils.java
index c6b43806..f3e7defa 100644
--- a/op-common/op-common-core/src/main/java/com/op/common/core/utils/StringUtils.java
+++ b/op-common/op-common-core/src/main/java/com/op/common/core/utils/StringUtils.java
@@ -475,7 +475,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
*
* @param factoryCode 工厂代码
* @param lineCode 产线编码
- * @param productDate 生产日期
+ * @param productDate 生产日期 生产日期减一天位有效期
* @param version 订单生产版本号最后一位
* @param productStatus 产出状态:正常是A
* @param content 内容物 (根据产品,一般为0)
diff --git a/op-common/op-common-core/src/main/java/com/op/common/core/utils/http/HttpUtils.java b/op-common/op-common-core/src/main/java/com/op/common/core/utils/http/HttpUtils.java
index bb3e5a57..a9716114 100644
--- a/op-common/op-common-core/src/main/java/com/op/common/core/utils/http/HttpUtils.java
+++ b/op-common/op-common-core/src/main/java/com/op/common/core/utils/http/HttpUtils.java
@@ -162,13 +162,13 @@ public class HttpUtils {
conn.setRequestProperty("user-agent" , "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("Accept-Charset" , "utf-8");
// conn.setRequestProperty("contentType" , "utf-8");
- conn.setRequestProperty("content-Type", "application/json; charset=utf-8");
+ conn.setRequestProperty("content-Type", "application/json; charset=GBK");
conn.setDoOutput(true);
conn.setDoInput(true);
out = new PrintWriter(conn.getOutputStream());
out.print(param);
out.flush();
- in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
+ in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "GBK"));
String line;
while ((line = in.readLine()) != null) {
result.append(line);
diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java
index b64a4807..eb415717 100644
--- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java
+++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java
@@ -5,6 +5,7 @@ import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
+import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
@@ -340,9 +341,11 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
order.setOutsourceCode("BW" + orderCode);
}
- //查询组线
- String lineName = equOrderMapper.getGroupLine(plan.getEquipmentCode());
- order.setPlanProdLine(lineName);
+ if(StringUtils.isNotEmpty(plan.getEquipmentCode())){
+ //查询组线
+ String lineName = equOrderMapper.getGroupLine(plan.getEquipmentCode());
+ order.setPlanProdLine(lineName);
+ }
/**equ_order**/
sce = equOrderMapper.insertEquOrder(order);
diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml
index d20a4aaf..27598cf6 100644
--- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml
+++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml
@@ -518,7 +518,7 @@
@@ -763,14 +764,15 @@
INSERT INTO mes_prepare_detail (
record_id,prepare_id,material_code,material_name,unit,
quantity,create_by,create_time,factory_code,status,
- locator,need_date,recoil,fund_quanlity,buy_flag,parent_work_order,attr1
+ locator,need_date,recoil,fund_quanlity,buy_flag,parent_work_order,attr1,
+ erfmg,erfme
)VALUES
(
#{d.recordId},#{d.prepareId},#{d.materialCode},#{d.materailName},#{d.unit},
#{d.quantity},#{d.createBy},#{d.createTime},#{d.factoryCode},#{d.status},
#{d.locator},#{d.needDate},#{d.recoil},#{d.fundQuanlity},#{d.buyFlag},#{d.parentWorkOrder},
- #{d.attr1}
+ #{d.attr1},#{d.erfmg},#{d.erfme}
)
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java
index 1506d925..27284088 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcMaterialGroupController.java
@@ -109,14 +109,14 @@ public class QcMaterialGroupController extends BaseController {
public AjaxResult remove(@PathVariable String id) {
QcMaterialGroup parent = new QcMaterialGroup();
parent.setId(id);
- List children = qcMaterialGroupService.getMaterialChildrenList(parent);
- boolean hasRule = qcMaterialGroupService.validationData(id);
- if (!children.isEmpty()) {
- return AjaxResult.error("此节点下含有子节点,请先删除子节点");
- } else if (hasRule) {
- return AjaxResult.error("此节点含有检验规则,请先删除检验规则");
- } else {
+// List children = qcMaterialGroupService.getMaterialChildrenList(parent);
+// boolean hasRule = qcMaterialGroupService.validationData(id);
+// if (!children.isEmpty()) {
+// return AjaxResult.error("此节点下含有子节点,请先删除子节点");
+// } else if (hasRule) {
+// return AjaxResult.error("此节点含有检验规则,请先删除检验规则");
+// } else {
return toAjax(qcMaterialGroupService.deleteQcMaterialGroupById(id));
- }
+// }
}
}
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java
index 9b7f1462..4d678ccc 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java
@@ -214,6 +214,15 @@ public class QcCheckTaskIncome extends BaseEntity {
private String pgzg;//QC主管:SFXYZG字段为"是",则此项选择QC主管信息
private String pgzr;//质量主管
private String oaFactoryF;//异常范围
+ private String sccj;
+
+ public String getSccj() {
+ return sccj;
+ }
+
+ public void setSccj(String sccj) {
+ this.sccj = sccj;
+ }
public String getOaFactoryF() {
return oaFactoryF;
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java
index 971a2d15..01fd5968 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java
@@ -132,6 +132,15 @@ public class QcCheckUnqualified extends BaseEntity {
private String pgzg;//QC主管:SFXYZG字段为"是",则此项选择QC主管信息
private String pgzr;//质量主管
private String oaFactoryF;
+ private String sccj;//所属车间
+
+ public String getSccj() {
+ return sccj;
+ }
+
+ public void setSccj(String sccj) {
+ this.sccj = sccj;
+ }
public String getOaFactoryF() {
return oaFactoryF;
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java
index 112a74f9..40c3e5e1 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcMaterialGroupMapper.java
@@ -68,4 +68,6 @@ public interface QcMaterialGroupMapper {
public List validationData(String id);
String selectGroupIdByName(String groupName);
+
+ void deleteGroupDetailById(String id);
}
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java
index bacb239e..8b14ef83 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcMaterialGroupService.java
@@ -23,7 +23,7 @@ public interface IQcMaterialGroupService {
public QcMaterialGroup selectQcMaterialGroupById(String id);
/**
- * 获得原始物料分组
+ * 获得检验标准
* @param qcMaterialGroup
* @return
*/
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java
index 41b62061..d490b307 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java
@@ -140,7 +140,7 @@ public class QcCheckTaskIncomeServiceImpl implements
/**
* 新增来料检验
- *
+ * 来料检验要根据检验标准进行
* @param qcCheckTaskIncome 来料检验
* @return 结果
*/
@@ -640,7 +640,7 @@ public class QcCheckTaskIncomeServiceImpl implements
}
@Override
- @Transactional(rollbackFor = Exception.class)
+ //@Transactional(rollbackFor = Exception.class)
public int commitCheckResults(QcCheckTaskIncome qcCheckTaskIncome) {
logger.info("质检提交参数:"+JSONObject.toJSONString(qcCheckTaskIncome));
List details = qcCheckTaskIncome.getQcCheckTaskDetails();
@@ -815,25 +815,28 @@ public class QcCheckTaskIncomeServiceImpl implements
if("produce".equals(qcCheckTaskIncome.getTypeCode())){
unqualified.setTypeCode(qcCheckTaskIncome.getTypeCode());
unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt());
-
+ unqualified.setUser(qcCheckTaskIncome.getUpdateBy());
//申请人-
- unqualified.setSqr(qcCheckTaskIncome.getSqr());
+ unqualified.setSqr("MSL#"+qcCheckTaskIncome.getSqr());
//申请部门
unqualified.setSqbm(qcCheckTaskIncome.getSqbm());
+ //所属车间
+ unqualified.setSccj("MSD#"+qcCheckTaskIncome.getSccj());
//实际生产数量
unqualified.setQuality(qcCheckTaskIncome.getQuality().toString());
//发现地点
unqualified.setCheckLoc(qcCheckTaskIncome.getCheckLoc());
//是否需要主管审核
- unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt());
- if(qcCheckTaskIncome.getSfgyswt().equals("0")){//是
+ unqualified.setSfxyzg(qcCheckTaskIncome.getSfxyzg());
+ if(qcCheckTaskIncome.getSfxyzg().equals("0")){//是
//qc主管
- unqualified.setPgzg(qcCheckTaskIncome.getPgzg());
+ unqualified.setPgzg("MSL#"+qcCheckTaskIncome.getPgzg());
//质量主管
- unqualified.setPgzr(qcCheckTaskIncome.getPgzr());
+ unqualified.setPgzr("MSL#"+qcCheckTaskIncome.getPgzr());
}
//是否供应商问题
unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt());
+ unqualified.setOaFactoryF(qcCheckTaskIncome.getOaFactoryF());
}else if("material".equals(qcCheckTaskIncome.getTypeCode())){
unqualified.setTypeCode(qcCheckTaskIncome.getTypeCode());
@@ -859,19 +862,20 @@ public class QcCheckTaskIncomeServiceImpl implements
//来料数量
unqualified.setQuality(qcCheckTaskIncome.getQuality().toString());
//来料单位
- unqualified.setUnit(qcCheckTaskIncome.getUnit());
+ //CAR:0 PC:1 其它:2 吨:3 千克:4
+ unqualified.setUnit(getConvertUnit(qcCheckTaskIncome.getUnit()));
//检验编号
unqualified.setCheckNo(qcCheckTaskIncome.getCheckNo());
//仓储报检人-李爱娟
- unqualified.setCzbjr(qcCheckTaskIncome.getCzbjr());
+ unqualified.setCzbjr("MSL#"+qcCheckTaskIncome.getCzbjr());
//物料类别
unqualified.setMaterialType(qcCheckTaskIncome.getMaterialType());
//物料来源
unqualified.setMaterialFrom(qcCheckTaskIncome.getMaterialFrom());
//QC主管-朱继新
- unqualified.setQczg(qcCheckTaskIncome.getQczg());
+ unqualified.setQczg("MSL#"+qcCheckTaskIncome.getQczg());
//申请人-
- unqualified.setSqr(qcCheckTaskIncome.getSqr());
+ unqualified.setSqr("MSL#"+qcCheckTaskIncome.getSqr());
unqualified.setUser(qcCheckTaskIncome.getUpdateBy());
//转出方
unqualified.setZcf(qcCheckTaskIncome.getZcf());
@@ -911,6 +915,8 @@ public class QcCheckTaskIncomeServiceImpl implements
.replace("${quality}", qcCheckTaskIncome.getQuality()+"\n");
if(StringUtils.isNotBlank(qcCheckTaskIncome.getIncomeBatchNo())){
contentInfo = contentInfo.replace("${incomeBatchNo}", qcCheckTaskIncome.getIncomeBatchNo()+"\n");
+ }else{
+ contentInfo = contentInfo.replace("${incomeBatchNo}", "无"+"\n");
}
if(StringUtils.isNotBlank(qcCheckTaskIncome.getOrderNo())){
contentInfo = contentInfo.replace("${orderNo}", qcCheckTaskIncome.getOrderNo()+"\n");
@@ -931,6 +937,15 @@ public class QcCheckTaskIncomeServiceImpl implements
//发企业微信--------------------结束
}
}
+ //CAR:0 PC:1 其它:2 吨:3 千克:4
+ protected String getConvertUnit(String unit){
+ String unitOa= "";
+ switch (unit) {
+ case "ST": unitOa="1";
+ default: unitOa="1";
+ }
+ return unitOa;
+ }
protected String getSampleQua(QcCheckTaskIncome qcCheckTaskIncome){
String sampleQuaStr = "";
@@ -993,4 +1008,9 @@ public class QcCheckTaskIncomeServiceImpl implements
public SysUser getOaUserId(SysUser getUserIdList) {
return qcCheckTaskIncomeMapper.getOaUserId(getUserIdList);
}
+
+ public static void main(String args[]){
+ QcCheckTaskIncomeServiceImpl impl = new QcCheckTaskIncomeServiceImpl();
+ System.out.println(impl.getConvertUnit("ST"));
+ }
}
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java
index 0aba0dd8..9a4c1882 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java
@@ -145,6 +145,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
* 新增生产过程检验任务
*
* @param qcCheckTaskProduce 生产过程检验任务
+ * 巡检 首检
* @return 结果
*/
@Override
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java
index e851b40a..16b45793 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTypeProjectServiceImpl.java
@@ -247,7 +247,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService
return failOrder;
}
- @Transactional(rollbackFor = Exception.class)
+ //@Transactional(rollbackFor = Exception.class)
public String syncFunc(QcMaterialGroupDetail materialGroupDetail){
String failOrder = "";
Date nowDate = DateUtils.getNowDate();
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java
index 39466663..8f681429 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java
@@ -177,14 +177,13 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
* \"supplier\":\"广东高顺印刷包装有限公司\",\"CHARG\":\"null\",\"comeQty\":\"1117\",
* \"DW\":\"ST\",\"JYBH\":\"202404180042\",\"BJY\":\"202404180042\",\"WLLY\":\"2\",
* \"memo\":\"不合格\",\"PZGLBZG\":\"不合格\"}","user":"999999","requestLevel":0,"workflowId":113454}
-
*/
private AjaxResult createLLOA(QcCheckUnqualified task){
//QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
//发起来料检验OA流程
Map paramMap = new HashMap<>();
- paramMap.put("user",task.getSqr());//提交人工号
+ paramMap.put("user",task.getUser());//提交人工号
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0010-来料检验不合格控制流程");//流程名称
paramMap.put("workflowId",113454);//该流程对应的唯- workFlowld
@@ -195,7 +194,7 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
- mainObject.append("\"SQR\":"+"\""+task.getSqr()+"");//申请人--
+ mainObject.append("\"SQR\":"+"\""+task.getSqr()+"\"");//申请人--
mainObject.append(",\"CQ\":"+task.getOaFactory());//厂区--
mainObject.append(",\"LLLB\":"+task.getMaterialType());//来料类别【0、1】
mainObject.append(",\"MATNR\":"+"\""+task.getMaterialCode()+"\"");//物料编码
@@ -306,6 +305,29 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
"SFGYSWT":"1" *是否供应商问题 1非供应商问题 0是供应商问题
}"
}
+
+ http://oa.lanju.cn/lanju/oa/submitOa.jsp?
+ user=9999999&requestLevel=0&
+ requestName=品质异常流程测试&
+ workflowId=113455&
+ mainObject={"CPMC":"榄菊加大盘野菊花蚊香塑料筒装(18装)(36单圈)",
+ "CPBM":"000000010101046600",
+ "SQBM":"0",
+ "SQR":"MSL#999999", \"SQR\":\"MSL#002007\",
+ "SQSJ":"2024-07-18",
+ "SCCJ":"MSD#10000769", \"SCCJ\":\"MSD#10000152\",
+ "SCPH":"LJ20240705ABACEQ",
+ "SCSL":100,
+ "FXDD":"测试发现地点",
+ "FXRQ":"2024-07-18 16:26:45",
+ "BH":"202407040001",
+ "YCFW":"1",
+ "PZYCMS":"zxl测试不合格发起oa",
+ "Notes":"",
+ "SFXYZG":"0",
+ "PGZG":"MSL%23001539",
+ "PGZR":"MSL%23001539",
+ "SFGYSWT":"0"}
* @param task
* @return
*/
@@ -314,31 +336,31 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService
QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
//发起来料检验OA流程
Map paramMap = new HashMap<>();
- paramMap.put("user",task.getSqr());//提交人工号
+ paramMap.put("user",task.getUser());//提交人工号
paramMap.put("requestLevel",0);//流程紧急度
paramMap.put("requestName","ZL0030-品质异常流程-智能制造-"+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getIncomeTime())+"(产品名称:"+detailInfo.getMaterialName()+")");//流程名称
paramMap.put("workflowId",113455);//该流程对应的唯- workFlowld
StringBuffer mainObject = new StringBuffer();
mainObject.append("{");
- mainObject.append("\"CPMC\":"+detailInfo.getMaterialName());//产品名称
- mainObject.append(",\"CPBM\":"+detailInfo.getMaterialCode());//产品编码
- mainObject.append(",\"SQBM\":"+task.getSqbm());//0品质保障部
+ mainObject.append("\"CPMC\":"+"\""+detailInfo.getMaterialName()+"\"");//产品名称
+ mainObject.append(",\"CPBM\":"+"\""+detailInfo.getMaterialCode()+"\"");//产品编码
+ mainObject.append(",\"SQBM\":"+"\""+task.getSqbm()+"\"");//0品质保障部
mainObject.append(",\"SQR\":"+"\""+task.getSqr()+"\"");//申请人:默认当前用户
mainObject.append(",\"SQSJ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",detailInfo.getCheckTime())+"\"");//申请时间
- mainObject.append(",\"SCCJ\":"+"\"162\"");//所属车间
+ mainObject.append(",\"SCCJ\":"+"\""+task.getSccj()+"\"");//所属车间
mainObject.append(",\"SCPH\":"+"\""+detailInfo.getIncomeBatchNo()+"\"");//生产批号
- mainObject.append(",\"SCSL\":"+"\""+task.getQuality()+"\"");//生产数量
+ mainObject.append(",\"SCSL\":"+task.getQuality());//生产数量
mainObject.append(",\"FXDD\":"+"\""+task.getCheckLoc()+"\"");//发现地点
- mainObject.append(",\"FXRQ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getCheckTime())+"\"");//发现日期
+ mainObject.append(",\"FXRQ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",detailInfo.getCheckTime())+"\"");//发现日期
mainObject.append(",\"BH\":"+"\""+detailInfo.getCheckNo()+"\"");//编号:流水号 年月日+四位流水号
- mainObject.append(",\"YCFW\":"+task.getOaFactoryF()+"\"");//*异常范围:下拉框榄菊所有工厂 1代表小榄工厂
+ mainObject.append(",\"YCFW\":"+"\""+task.getOaFactoryF()+"\"");//*异常范围:下拉框榄菊所有工厂 1代表小榄工厂
mainObject.append(",\"PZYCMS\":"+"\""+detailInfo.getRemark()+"\"");//品质异常描述
mainObject.append(",\"Notes\":"+"\"\"");//测试备注
mainObject.append(",\"SFXYZG\":"+"\""+task.getSfxyzg()+"\"");//*是否需要主管审核 1否 0是
mainObject.append(",\"PGZG\":"+"\""+task.getPgzg()+"\"");//QC主管:SFXYZG字段为"是",则此项选择QC主管信息
mainObject.append(",\"PGZR\":"+"\""+task.getPgzr()+"\"");//质量主管 660:朱继新
- mainObject.append(",\"SFGYSWT\":"+task.getSfgyswt()+"\"");//*是否供应商问题 1非供应商问题 0是供应商问题
+ mainObject.append(",\"SFGYSWT\":"+"\""+task.getSfgyswt()+"\"");//*是否供应商问题 1非供应商问题 0是供应商问题
mainObject.append("}");
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcGoalServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcGoalServiceImpl.java
index f3aa0a00..44af3945 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcGoalServiceImpl.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcGoalServiceImpl.java
@@ -1,22 +1,35 @@
package com.op.quality.service.impl;
import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import java.util.stream.Collectors;
+import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
+import com.op.common.core.utils.StringUtils;
+import com.op.common.core.web.domain.AjaxResult;
import com.op.common.security.utils.SecurityUtils;
+import com.op.quality.domain.QcCheckTaskIncome;
+import com.op.quality.domain.QcCheckUnqualified;
import com.op.quality.domain.vo.TreeSelect;
+import com.op.quality.mapper.QcCheckTaskIncomeMapper;
+import com.op.system.api.RemoteOpenService;
+import com.op.system.api.RemoteQualityService;
+import com.op.system.api.domain.SysNoticeGroup;
+import com.op.system.api.domain.dto.WechartDTO;
+import com.op.system.api.domain.quality.QcCheckTaskIncomeDTO;
import com.sun.xml.bind.v2.TODO;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.quality.mapper.QcGoalMapper;
import com.op.quality.domain.QcGoal;
import com.op.quality.service.IQcGoalService;
+import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -31,8 +44,24 @@ import javax.servlet.http.HttpServletRequest;
*/
@Service
public class QcGoalServiceImpl implements IQcGoalService {
+ protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private QcGoalMapper qcGoalMapper;
+// @Autowired
+// private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper;
+// @Autowired
+// private RemoteOpenService remoteOpenService;
+//
+// private static Pattern p2= Pattern.compile("<[^>]+>");
+
+ @Autowired
+ private RemoteOpenService remoteOpenService;
+ @Autowired
+ private RemoteQualityService remoteQualityService;
+
+ @Autowired
+ private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper;
+
/**
* 查询质量目标
@@ -59,9 +88,147 @@ public class QcGoalServiceImpl implements IQcGoalService {
for (QcGoal item : qcGoals) {
item.setHasChildren(true);
}
+// QcCheckUnqualified task = new QcCheckUnqualified();
+// task.setUser("002007");//9999999
+// task.setSqr("660");
+// task.setOaFactory("0");
+// task.setMaterialType("0");
+// task.setMaterialCode("000000040000015128");
+// task.setMaterialName("榄菊蚊香加大盘Ф137.5mm×H100mm36圈内增高塑料筒(有字盖)2201");
+// task.setSupplierCode("0000100330");
+// task.setSupplierName("中山市荣星塑料包装有限公司");
+// task.setQuality("15296");
+// task.setUnit("ST");
+// task.setCheckNo("202407130047");
+// task.setCzbjr("284");
+// task.setMaterialFrom("2");
+// task.setZcf("0");
+// task.setZcoemcm("转出工厂");
+// task.setRemark("zxl测试不合格发起oa");
+// task.setQczg("660");
+// this.createLLOA(task);
+
+// //手持来料质检触发
+// QcCheckTaskIncomeDTO qcCheckTaskIncomeDTO = new QcCheckTaskIncomeDTO();
+// qcCheckTaskIncomeDTO.setPoolName("ds_1000" );
+// qcCheckTaskIncomeDTO.setCheckLoc("mjtest");
+// qcCheckTaskIncomeDTO.setCheckType("checkTypeLL");
+//// qcCheckTaskIncomeDTO.setCheckManCode("mobile");
+//// qcCheckTaskIncomeDTO.setCheckManName("手持测试用户");
+// qcCheckTaskIncomeDTO.setSupplierCode("0000102272");
+// qcCheckTaskIncomeDTO.setFactoryCode("1000");
+// qcCheckTaskIncomeDTO.setSupplierName("广州市彩晴包装印刷有限公司");
+// qcCheckTaskIncomeDTO.setOrderType("8040");//包材固定码
+// qcCheckTaskIncomeDTO.setUnit("KG");
+// qcCheckTaskIncomeDTO.setQuality(new BigDecimal("10"));
+// qcCheckTaskIncomeDTO.setMaterialCode("000000040000011094");
+// qcCheckTaskIncomeDTO.setMaterialName("LANJU 出口封口胶(1000米/卷)(1901)");
+// qcCheckTaskIncomeDTO.setIncomeBatchNo("202312250001");
+// qcCheckTaskIncomeDTO.setOrderNo("4500297568");
+// qcCheckTaskIncomeDTO.setIncomeTime(new Date());
+// remoteQualityService.createIncomeTask(qcCheckTaskIncomeDTO);
+
+// 品质检验
+// QcCheckUnqualified task = new QcCheckUnqualified();
+// task.setTaskId("3ffb199037ba46a48e39cb148d7ad9e0");
+// task.setUser("002007");
+// task.setSqbm("0");
+// task.setSqr("MSL#002007");
+// task.setSccj("MSD#10000152");
+// task.setQuality("100");
+// task.setCheckLoc("测试发现地点");
+// task.setOaFactoryF("0");
+// task.setSfxyzg("0");
+// task.setPgzg("MSL#019184");
+// task.setPgzr("MSL#019184");
+// task.setSfgyswt("0");
+// this.createProduceOA(task);
return qcGoals;
}
+ private AjaxResult createLLOA(QcCheckUnqualified task){
+
+ //QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
+ //发起来料检验OA流程
+ Map paramMap = new HashMap<>();
+ paramMap.put("user",task.getUser());//提交人工号
+ paramMap.put("requestLevel",0);//流程紧急度
+ paramMap.put("requestName","ZL0010-来料检验不合格控制流程");//流程名称
+ paramMap.put("workflowId",113454);//该流程对应的唯- workFlowld
+
+ if(StringUtils.isEmpty(task.getIncomeBatchNo())){
+ task.setIncomeBatchNo(DateUtils.parseDateToStr("yyyyMMdd",new Date()));
+ }
+
+ StringBuffer mainObject = new StringBuffer();
+ mainObject.append("{");
+ mainObject.append("\"SQR\":"+"\""+task.getSqr()+"\"");//申请人--
+ mainObject.append(",\"CQ\":"+task.getOaFactory());//厂区--
+ mainObject.append(",\"LLLB\":"+task.getMaterialType());//来料类别【0、1】
+ mainObject.append(",\"MATNR\":"+"\""+task.getMaterialCode()+"\"");//物料编码
+ mainObject.append(",\"MAKTX\":"+"\""+task.getMaterialName()+"\"");//物料名称
+ mainObject.append(",\"suppliernum\":"+"\""+task.getSupplierCode()+"\"");//供应商编码
+ mainObject.append(",\"supplier\":"+"\""+task.getSupplierName()+"\"");//供应商名称
+ mainObject.append(",\"CHARG\":"+"\""+task.getIncomeBatchNo()+"\"");//生产批号
+ mainObject.append(",\"comeQty\":"+"\""+task.getQuality()+"\"");//来料数量
+ mainObject.append(",\"DW\":"+"\""+task.getUnit()+"\"");//来料单位
+ mainObject.append(",\"testDate\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",new Date())+"\"");//检验日期
+ mainObject.append(",\"JYBH\":"+"\""+task.getCheckNo()+"\"");//检验编码
+ mainObject.append(",\"BJY\":"+"\""+task.getCzbjr()+"\"");//仓储报检人--
+ mainObject.append(",\"WLLY\":"+"\""+task.getMaterialFrom()+"\"");//物料来源
+ mainObject.append(",\"ZCF\":"+"\""+task.getZcf()+"\"");//转出方
+ mainObject.append(",\"ZCOEMCM\":"+"\""+task.getZcoemcm()+"\"");//转出OEM厂名
+ mainObject.append(",\"memo\":"+"\""+task.getRemark()+"\"");//不合格描述
+ mainObject.append(",\"PZGLBZG\":"+"\""+task.getQczg()+"\"");//qc主管--
+ mainObject.append("}");
+
+ paramMap.put("mainObject",mainObject.toString());
+ logger.info("流程Id 113454:"+ JSONObject.toJSONString(paramMap));
+ AjaxResult oaR = remoteOpenService.OAInspection(paramMap);
+ logger.info("流程Id 113454:"+ JSONObject.toJSONString(oaR));
+ return oaR;
+ }
+
+ private AjaxResult createProduceOA(QcCheckUnqualified task){
+
+ QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId());
+ //发起来料检验OA流程
+ Map paramMap = new HashMap<>();
+ paramMap.put("user",task.getUser());//提交人工号
+ paramMap.put("requestLevel",0);//流程紧急度
+ paramMap.put("requestName","ZL0030-品质异常流程-智能制造-"+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getIncomeTime())+"(产品名称:"+detailInfo.getMaterialName()+")");//流程名称
+ paramMap.put("workflowId",113455);//该流程对应的唯- workFlowld
+
+ StringBuffer mainObject = new StringBuffer();
+ mainObject.append("{");
+ mainObject.append("\"CPMC\":"+"\""+detailInfo.getMaterialName()+"\"");//产品名称
+ mainObject.append(",\"CPBM\":"+"\""+detailInfo.getMaterialCode()+"\"");//产品编码
+ mainObject.append(",\"SQBM\":"+"\""+task.getSqbm()+"\"");//0品质保障部
+ mainObject.append(",\"SQR\":"+"\""+task.getSqr()+"\"");//申请人:默认当前用户
+ mainObject.append(",\"SQSJ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",detailInfo.getCheckTime())+"\"");//申请时间
+ mainObject.append(",\"SCCJ\":"+"\""+task.getSccj()+"\"");//所属车间
+ mainObject.append(",\"SCPH\":"+"\""+detailInfo.getIncomeBatchNo()+"\"");//生产批号
+ mainObject.append(",\"SCSL\":"+task.getQuality());//生产数量
+ mainObject.append(",\"FXDD\":"+"\""+task.getCheckLoc()+"\"");//发现地点
+ mainObject.append(",\"FXRQ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",detailInfo.getCheckTime())+"\"");//发现日期
+ mainObject.append(",\"BH\":"+"\""+detailInfo.getCheckNo()+"\"");//编号:流水号 年月日+四位流水号
+ mainObject.append(",\"YCFW\":"+"\""+task.getOaFactoryF()+"\"");//*异常范围:下拉框榄菊所有工厂 1代表小榄工厂
+ mainObject.append(",\"PZYCMS\":"+"\""+detailInfo.getRemark()+"\"");//品质异常描述
+ mainObject.append(",\"Notes\":"+"\"\"");//测试备注
+ mainObject.append(",\"SFXYZG\":"+"\""+task.getSfxyzg()+"\"");//*是否需要主管审核 1否 0是
+ mainObject.append(",\"PGZG\":"+"\""+task.getPgzg()+"\"");//QC主管:SFXYZG字段为"是",则此项选择QC主管信息
+ mainObject.append(",\"PGZR\":"+"\""+task.getPgzr()+"\"");//质量主管 660:朱继新
+ mainObject.append(",\"SFGYSWT\":"+"\""+task.getSfgyswt()+"\"");//*是否供应商问题 1非供应商问题 0是供应商问题
+
+ mainObject.append("}");
+
+ paramMap.put("mainObject",mainObject.toString());
+ logger.info("流程Id 113455:"+ JSONObject.toJSONString(paramMap));
+ AjaxResult oaR = remoteOpenService.OAInspection(paramMap);
+ logger.info("流程Id 113455:"+ JSONObject.toJSONString(oaR));
+ return oaR;
+ }
+
@Override
@DS("#header.poolName")
public List selectChildrenByParent(QcGoal goal) {
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java
index b4ac41c6..8ab5580a 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcMaterialGroupServiceImpl.java
@@ -54,7 +54,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
}
/**
- * 获取原始物料分组
+ * 获取检验标准
* @param qcMaterialGroup
* @return
*/
@@ -191,6 +191,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
@Override
@DS("#header.poolName")
public int deleteQcMaterialGroupById(String id) {
+ qcMaterialGroupMapper.deleteGroupDetailById(id);
return qcMaterialGroupMapper.deleteQcMaterialGroupById(id);
}
diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java
index 48bc40b8..b4314e0d 100644
--- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java
+++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java
@@ -632,9 +632,20 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
public static double calculateCpk(double[] data, double USL, double LSL) {
double mean = calculateMean(data);
double stdDev = calculateStandardDeviation(data);
- double cpkUpper = (USL - mean) / (3 * stdDev);
- double cpkLower = (mean - LSL) / (3 * stdDev);
- return Math.min(cpkUpper, cpkLower);
+ if(new BigDecimal(USL).compareTo(BigDecimal.ZERO)>0 && new BigDecimal(LSL).compareTo(BigDecimal.ZERO)>0){
+ double cpkUpper = (USL - mean) / (3 * stdDev);
+ double cpkLower = (mean - LSL) / (3 * stdDev);
+ return Math.min(cpkUpper, cpkLower);
+ }else if(new BigDecimal(USL).compareTo(BigDecimal.ZERO)==0 && new BigDecimal(LSL).compareTo(BigDecimal.ZERO)>0){
+ //无上限
+ double cpkLower = (mean - LSL) / (3 * stdDev);
+ return cpkLower;
+ }else if(new BigDecimal(USL).compareTo(BigDecimal.ZERO)>0 && new BigDecimal(LSL).compareTo(BigDecimal.ZERO)==0){
+ //无下限
+ double cpkUpper = (USL - mean) / (3 * stdDev);
+ return cpkUpper;
+ }
+ return 0;
}
// 计算均值
public static double calculateMean(double[] data) {
@@ -736,5 +747,8 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
return days;
}
-
+ public static void main(String args[]){
+ double a = 0.01;
+ System.out.println(new BigDecimal(a).compareTo(BigDecimal.ZERO));
+ }
}
diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml
index a02a26d8..3e5cbec5 100644
--- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml
+++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml
@@ -574,7 +574,7 @@
where del_flag='0' and sample_code like concat(#{sampleCode},'%')
diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml
index f26e1a89..57a272af 100644
--- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml
+++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml
@@ -307,13 +307,20 @@
where del_flag = '0'