sap调整

highway
zhaoxiaolin 1 year ago
parent dfe2805fd5
commit 2f221e1905

@ -248,40 +248,40 @@ public class MesPrepareServiceImpl implements IMesPrepareService {
//报工 //报工
public void reportWorkByFactory(String poolName) { public void reportWorkByFactory(String poolName) {
MesReportWork mesReportWork = new MesReportWork(); MesReportWork mesReportWork = new MesReportWork();
mesReportWork.setUploadStatus("1");//除了1报工成功的都需要报工 // mesReportWork.setUploadStatus("1");//除了1报工成功的都需要报工
mesReportWork.setProdType("prod"); // mesReportWork.setProdType("prod");
List<MesReportWork> reportWorks = mesReportWorkMapper.getReportWorkList(mesReportWork); // List<MesReportWork> reportWorks = mesReportWorkMapper.getReportWorkList(mesReportWork);
for(MesReportWork work:reportWorks) { // for(MesReportWork work:reportWorks) {
SapRFW sapRFW = new SapRFW(); // SapRFW sapRFW = new SapRFW();
sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号 // sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号
sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量 // sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量
SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改 // SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改
ltgs.setConf_activity1(work.getSac1());//人工 // ltgs.setConf_activity1(work.getSac1());//人工
ltgs.setConf_activity2(work.getSac2()); // ltgs.setConf_activity2(work.getSac2());
ltgs.setConf_activity3(work.getSac3()); // ltgs.setConf_activity3(work.getSac3());
ltgs.setConf_activity4(work.getSac4()); // ltgs.setConf_activity4(work.getSac4());
ltgs.setConf_activity5(work.getSac5()); // ltgs.setConf_activity5(work.getSac5());
ltgs.setConf_activity6(work.getSac6()); // ltgs.setConf_activity6(work.getSac6());
SapRFW.lt_hw lthw = sapRFW.getLt_hw();//MES生产订单报工货物移动修改 // SapRFW.lt_hw lthw = sapRFW.getLt_hw();//MES生产订单报工货物移动修改
lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO; // lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO;
lthw.setMaterial(work.getProcessCode()); // lthw.setMaterial(work.getProcessCode());
R r = remoteSapService.sapRFWOrder(sapRFW); // R r = remoteSapService.sapRFWOrder(sapRFW);
//上传成功更改mes_report_work状态 // //上传成功更改mes_report_work状态
if (r.getCode() == 200) { // if (r.getCode() == 200) {
work.setUploadStatus("1"); // work.setUploadStatus("1");
} else { // } else {
work.setUploadStatus("2"); // work.setUploadStatus("2");
work.setUploadMsg(r.getMsg()); // work.setUploadMsg(r.getMsg());
} // }
work.setUploadTime(DateUtils.getNowDate()); // work.setUploadTime(DateUtils.getNowDate());
mesReportWorkMapper.updateSyncSapStatus(work); // mesReportWorkMapper.updateSyncSapStatus(work);
//关闭订单 // //关闭订单
remoteSapService.sapCloseOrder(work.getOrderCode()); // remoteSapService.sapCloseOrder(work.getOrderCode());
//pro_work_order status->w4报工 // //pro_work_order status->w4报工
work.setStatus("w4"); // work.setStatus("w4");
work.setUpdateTime(DateUtils.getNowDate()); // work.setUpdateTime(DateUtils.getNowDate());
mesReportWorkMapper.updateWorkOrderStatus(work); // mesReportWorkMapper.updateWorkOrderStatus(work);
} // }
} }
public static void main(String args[]) { public static void main(String args[]) {
List<SapMaterialPreparation> list = new ArrayList<>(); List<SapMaterialPreparation> list = new ArrayList<>();

@ -445,7 +445,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="getSapWorkOrder" resultType="java.lang.String"> <select id="getSapWorkOrder" resultType="java.lang.String">
select workorder_code_sap from pro_order_workorder select workorder_code_sap from pro_order_workorder
where belong_work_order = #{workorderCode} and del_flag = '0' where belong_work_order = #{workorderCode} and del_flag = '0' and parent_order = '0'
</select> </select>
<insert id="insertMesReportWork" parameterType="MesReportWork"> <insert id="insertMesReportWork" parameterType="MesReportWork">

@ -205,7 +205,7 @@ public class OpenServiceImpl implements OpenService {
){ ){
logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap()); logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap());
//工单完成,关闭工单 //工单完成,关闭工单
List<String> sapWorkOrders = openMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单 List<String> sapWorkOrders = openMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单
for(String sapWorkOrder:sapWorkOrders){ for(String sapWorkOrder:sapWorkOrders){
R rclose = remoteSapService.sapCloseOrder(sapWorkOrder); R rclose = remoteSapService.sapCloseOrder(sapWorkOrder);

@ -124,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="getSapWorkOrder" resultType="java.lang.String"> <select id="getSapWorkOrder" resultType="java.lang.String">
select workorder_code_sap from pro_order_workorder select workorder_code_sap from pro_order_workorder
where belong_work_order = #{workorderCode} and del_flag = '0' where belong_work_order = #{workorderCode} and del_flag = '0' and parent_order = '0'
</select> </select>
</mapper> </mapper>

@ -522,9 +522,6 @@ public class ProOrderServiceImpl implements IProOrderService {
failOrder = proOrder.getOrderCode(); failOrder = proOrder.getOrderCode();
logger.info("=======订单"+failOrder+"同步失败"); logger.info("=======订单"+failOrder+"同步失败");
} }
// else {//关闭订单
// remoteSapService.sapCloseOrder(proOrder.getOrderCode());
// }
} }
return failOrder; return failOrder;
} }

@ -294,6 +294,8 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
//顺序母子 //顺序母子
Collections.reverse(wids); Collections.reverse(wids);
Collections.reverse(wcodes); Collections.reverse(wcodes);
Collections.reverse(ordercodes);
sapList = new ArrayList<>(); sapList = new ArrayList<>();
SapCreateOrder sap = new SapCreateOrder(); SapCreateOrder sap = new SapCreateOrder();
sap.setWerks(whiteOrder.getFactoryCode());//工厂编码 sap.setWerks(whiteOrder.getFactoryCode());//工厂编码
@ -346,11 +348,11 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
//获取领料单 //获取领料单
this.getMesPrepare(returnCodes,wcodes); this.getMesPrepare(returnCodes,wcodes);
//关闭订单//订单的订单编码 //关闭订单子订单会自动关闭//订单的订单编码
for(String orderCode:ordercodes){ //for(String orderCode:ordercodes){
R closeR= remoteSapService.sapCloseOrder(orderCode); R closeR= remoteSapService.sapCloseOrder(ordercodes.get(0));
logger.info(workorderId+"下发工单后关闭母订单"+orderCode+":"+closeR.getMsg()); logger.info(workorderId+"下发工单后关闭母订单"+ordercodes.get(0)+":"+closeR.getMsg());
} //}
//下达工单 //下达工单
String[] idsArrayAll = (String[])wids.toArray(new String[wids.size()]); String[] idsArrayAll = (String[])wids.toArray(new String[wids.size()]);
proOrderWorkorderMapper.downWorkorders(idsArrayAll); proOrderWorkorderMapper.downWorkorders(idsArrayAll);

@ -2,18 +2,18 @@ package com.op.quality.controller;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.R; 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.StringUtils;
import com.op.common.core.web.controller.BaseController; import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult; import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo; import com.op.common.core.web.page.TableDataInfo;
import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.*; import com.op.quality.domain.*;
import com.op.quality.service.IQcCheckTaskProduceService; import com.op.quality.service.*;
import com.op.quality.service.IQcCheckTaskWarehousingService;
import com.op.quality.service.IQcCheckTypeService;
import com.op.quality.service.QcProCheckService;
import com.op.system.api.RemoteMesService; import com.op.system.api.RemoteMesService;
import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@ -40,6 +40,9 @@ public class QuaController extends BaseController {
@Autowired @Autowired
private IQcCheckTypeService qcCheckTypeService; private IQcCheckTypeService qcCheckTypeService;
@Autowired
private IQcCheckTaskIncomeService qcCheckTaskIncomeService;
@PostMapping("/saveQcProCheck") @PostMapping("/saveQcProCheck")
public R<Boolean> saveQcProCheck(@RequestBody QcProCheck qcProCheck) { public R<Boolean> saveQcProCheck(@RequestBody QcProCheck qcProCheck) {
DynamicDataSourceContextHolder.push("ds_"+qcProCheck.getFactoryCode()); DynamicDataSourceContextHolder.push("ds_"+qcProCheck.getFactoryCode());
@ -177,10 +180,37 @@ public class QuaController extends BaseController {
*/ */
@GetMapping(value = "getCheckTaskList") @GetMapping(value = "getCheckTaskList")
public AjaxResult getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome) { public AjaxResult getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome) {
// if(StringUtils.isBlank(qcCheckType.getFactoryCode())){ if(StringUtils.isBlank(qcCheckTaskIncome.getFactoryCode())){
// return error("[factoryCode]不能为空"); return error("[factoryCode]不能为空");
// } }
// return success(qcCheckTypeService.getCheckType(qcCheckType)); if(StringUtils.isBlank(qcCheckTaskIncome.getCheckType())){
return null; return error("[checkType]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskIncome.getCheckManCode())){
return error("[checkManCode]不能为空");
}
return success(qcProCheckService.getCheckTaskList(qcCheckTaskIncome));
}
/**
*
*/
@GetMapping(value = "getCheckTaskDetailList")
public AjaxResult getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail) {
if(StringUtils.isBlank(qcCheckTaskDetail.getFactoryCode())){
return error("[factoryCode]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskDetail.getBelongTo())){
return error("[belongTo]不能为空");
}
return success(qcProCheckService.getCheckTaskDetailList(qcCheckTaskDetail));
}
/**检测结果提交**/
@PostMapping("/commitCheckResults")
public AjaxResult commitCheckResults(@RequestBody List<QcCheckTaskDetail> details) {
if(CollectionUtils.isEmpty(details)){
return error("[List<QcCheckTaskDetail>]不能为空");
}
return toAjax(qcCheckTaskIncomeService.commitCheckResults(details));
} }
} }

@ -25,7 +25,7 @@ public class QcCheckTaskIncome extends BaseEntity {
private String checkNo; private String checkNo;
/** 来料批次号 */ /** 来料批次号 */
@Excel(name = "来料批次号") @Excel(name = "批次号")
private String incomeBatchNo; private String incomeBatchNo;
/** 订单号 */ /** 订单号 */

@ -58,7 +58,7 @@ public class QcCheckTaskWarehousing extends BaseEntity {
/** 来料时间 */ /** 来料时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "来料时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date incomeTime; private Date incomeTime;
/** 检测地点 */ /** 检测地点 */

@ -8,6 +8,7 @@ import com.op.quality.domain.QcCheckTaskIncome;
import com.op.quality.domain.QcSupplier; import com.op.quality.domain.QcSupplier;
import com.op.system.api.domain.SysUser; import com.op.system.api.domain.SysUser;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* Mapper * Mapper
@ -74,4 +75,8 @@ public interface QcCheckTaskIncomeMapper {
int getTodayMaxNum(QcCheckTaskIncome qcCheckTaskIncome); int getTodayMaxNum(QcCheckTaskIncome qcCheckTaskIncome);
List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail); List<QcCheckTaskDetail> getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail);
int updateQcCheckTask(QcCheckTaskIncome qcCheckTask);
int updateQcCheckTaskDetails(@Param("list") List<QcCheckTaskDetail> details);
} }

@ -2,6 +2,7 @@ package com.op.quality.mapper;
import com.op.common.core.domain.BaseFileData; import com.op.common.core.domain.BaseFileData;
import com.op.common.core.domain.R; import com.op.common.core.domain.R;
import com.op.quality.domain.QcCheckTaskIncome;
import com.op.quality.domain.QcProCheck; import com.op.quality.domain.QcProCheck;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -34,4 +35,6 @@ public interface QcProCheckMapper {
List<QcProCheck> getEquipmentList(QcProCheck qcProCheck); List<QcProCheck> getEquipmentList(QcProCheck qcProCheck);
List<QcProCheck> getDictList(QcProCheck qcProCheck); List<QcProCheck> getDictList(QcProCheck qcProCheck);
List<QcCheckTaskIncome> getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome);
} }

@ -76,5 +76,8 @@ public interface IQcCheckTaskIncomeService {
int commitCheckResult(QcCheckTaskIncome qcCheckTaskIncome); int commitCheckResult(QcCheckTaskIncome qcCheckTaskIncome);
int commitCheckResults(List<QcCheckTaskDetail> details);
List<QcDefectType> getDefectList(QcDefectType qcDefectType); List<QcDefectType> getDefectList(QcDefectType qcDefectType);
} }

@ -1,6 +1,8 @@
package com.op.quality.service; package com.op.quality.service;
import java.util.List; import java.util.List;
import com.op.quality.domain.QcCheckTaskIncome;
import com.op.quality.domain.QcCheckType; import com.op.quality.domain.QcCheckType;
/** /**
@ -61,4 +63,6 @@ public interface IQcCheckTypeService {
List<QcCheckType> getCheckType(QcCheckType qcCheckType); List<QcCheckType> getCheckType(QcCheckType qcCheckType);
List<QcCheckType> getTopTaskInfo(QcCheckType qcCheckType); List<QcCheckType> getTopTaskInfo(QcCheckType qcCheckType);
} }

@ -3,6 +3,7 @@ package com.op.quality.service;
import com.op.common.core.domain.R; import com.op.common.core.domain.R;
//import com.op.quality.domain.BaseFile; //import com.op.quality.domain.BaseFile;
import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckTaskIncome;
import com.op.quality.domain.QcCheckTypeProject; import com.op.quality.domain.QcCheckTypeProject;
import com.op.quality.domain.QcProCheck; import com.op.quality.domain.QcProCheck;
@ -30,4 +31,7 @@ public interface QcProCheckService {
List<QcProCheck> getDictList(QcProCheck qcProCheck); List<QcProCheck> getDictList(QcProCheck qcProCheck);
List<QcCheckTaskIncome> getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome);
List<QcCheckTaskDetail > getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail);
} }

@ -6,6 +6,7 @@ import java.util.List;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
@ -13,6 +14,8 @@ import com.op.quality.domain.*;
import com.op.quality.mapper.*; import com.op.quality.mapper.*;
import com.op.quality.service.IQcCheckTaskProduceService; import com.op.quality.service.IQcCheckTaskProduceService;
import com.op.system.api.domain.SysUser; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.op.quality.service.IQcCheckTaskIncomeService; import com.op.quality.service.IQcCheckTaskIncomeService;
@ -31,6 +34,7 @@ import javax.servlet.http.HttpServletRequest;
*/ */
@Service @Service
public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService { public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired @Autowired
private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper; private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper;
@ -190,8 +194,8 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
return qcCheckTaskIncomeMapper.getQcListSupplier(qcSupplier); return qcCheckTaskIncomeMapper.getQcListSupplier(qcSupplier);
} }
//在公共库里不需要切库
@Override @Override
@DS("master")
public List<SysUser> getQcListUser(SysUser sysUser) { public List<SysUser> getQcListUser(SysUser sysUser) {
return qcCheckTaskIncomeMapper.getQcListUser(sysUser); return qcCheckTaskIncomeMapper.getQcListUser(sysUser);
} }
@ -285,4 +289,54 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
return qcCheckUnqualifiedMapper.getDefectList(qcDefectType); return qcCheckUnqualifiedMapper.getDefectList(qcDefectType);
} }
@Override
public int commitCheckResults(List<QcCheckTaskDetail> details) {
DynamicDataSourceContextHolder.push("ds_"+details.get(0).getFactoryCode());
Date nowTime = DateUtils.getNowDate();
String factoryCode = details.get(0).getFactoryCode();
String updateBy = details.get(0).getUpdateBy();
String belongId = details.get(0).getBelongTo();
//默认合格
String result = "Y";
for(QcCheckTaskDetail detail:details){
if("N".equals(detail.getStatus())){
result = "N";//不合格
break;
}
}
int n = 0;
QcCheckTaskIncome qcCheckTask = new QcCheckTaskIncome();
qcCheckTask.setUpdateBy(updateBy);
qcCheckTask.setRecordId(belongId);
qcCheckTask.setCheckResult("2");//检测状态0待检测1检测中2检测完成
qcCheckTask.setUpdateTime(nowTime);
qcCheckTask.setCheckResult(result);//检验结果Y合格 N不合格
/**qc_check_task**/
n = qcCheckTaskIncomeMapper.updateQcCheckTask(qcCheckTask);
logger.info("qc_check_task:"+n);
/**更新qc_check_task_detail**/
for(QcCheckTaskDetail detail:details){
}
n= qcCheckTaskIncomeMapper.updateQcCheckTaskDetails(details);;
logger.info("更新qc_check_task_detail:"+n);
//不合格处理
if("N".equals(result)){
// QcCheckUnqualified unqualified = new QcCheckUnqualified();
// unqualified.setId(IdUtils.fastSimpleUUID());
// unqualified.setTaskId(qcCheckTaskIncome.getRecordId());
// unqualified.setCreateTime(DateUtils.getNowDate());
// unqualified.setCreateBy(qcCheckTaskIncome.getUpdateBy());
// unqualified.setFactoryCode(factoryCode);
// unqualified.setType(qcCheckTaskIncome.getCheckType());
// /**qc_check_unqualified**/
// qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified);
}
return n ;
}
} }

@ -2,6 +2,7 @@ package com.op.quality.service.serviceImpl;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
@ -176,8 +177,8 @@ public class QcCheckReportIncomeServiceImpl implements IQcCheckReportIncomeServi
return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier); return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier);
} }
//在公共库里不需要切库
@Override @Override
@DS("master")
public List<SysUser> getQcListUser(SysUser sysUser) { public List<SysUser> getQcListUser(SysUser sysUser) {
return qcCheckReportIncomeMapper.getQcListUser(sysUser); return qcCheckReportIncomeMapper.getQcListUser(sysUser);
} }

@ -178,7 +178,7 @@ public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceSer
return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier); return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier);
} }
//在公共库里不需要切库 @DS("master")
@Override @Override
public List<SysUser> getQcListUser(SysUser sysUser) { public List<SysUser> getQcListUser(SysUser sysUser) {
return qcCheckReportIncomeMapper.getQcListUser(sysUser); return qcCheckReportIncomeMapper.getQcListUser(sysUser);

@ -178,7 +178,7 @@ public class QcCheckReportProductServiceImpl implements IQcCheckReportProductSer
return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier); return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier);
} }
//在公共库里不需要切库 @DS("master")
@Override @Override
public List<SysUser> getQcListUser(SysUser sysUser) { public List<SysUser> getQcListUser(SysUser sysUser) {
return qcCheckReportIncomeMapper.getQcListUser(sysUser); return qcCheckReportIncomeMapper.getQcListUser(sysUser);

@ -8,6 +8,7 @@ import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckTaskIncome;
import com.op.quality.domain.QcCheckTypeProject; import com.op.quality.domain.QcCheckTypeProject;
import com.op.quality.domain.QcProCheck; import com.op.quality.domain.QcProCheck;
import com.op.quality.mapper.QcCheckTaskIncomeMapper; import com.op.quality.mapper.QcCheckTaskIncomeMapper;
@ -114,4 +115,16 @@ public class QcProCheckServiceImpl implements QcProCheckService {
return qcProCheckMapper.getDictList(qcProCheck); return qcProCheckMapper.getDictList(qcProCheck);
} }
@Override
public List<QcCheckTaskIncome> getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome) {
DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskIncome.getFactoryCode());
return qcProCheckMapper.getCheckTaskList(qcCheckTaskIncome);
}
@Override
public List<QcCheckTaskDetail> getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail) {
DynamicDataSourceContextHolder.push("ds_"+qcCheckTaskDetail.getFactoryCode());
return qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
}
} }

@ -131,12 +131,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
td.create_time createTime, td.create_time createTime,
td.update_by updateBy, td.update_by updateBy,
td.update_time updateTime, td.update_time updateTime,
td.update_time updateTime,
td.belong_to belongTo,
qctp.upper_diff upperDiff, qctp.upper_diff upperDiff,
qctp.down_diff downDiff, qctp.down_diff downDiff,
qctp.sample qctp.sample
from qc_check_task_detail td from qc_check_task_detail td
left join qc_check_type_project qctp on td.type_project_id = qctp.id left join qc_check_type_project qctp on td.type_project_id = qctp.id
where td.belong_to = #{belongTo} where td.belong_to = #{belongTo} and td.del_flag='0' and qctp.del_flag = '0'
</select> </select>
<insert id="insertQcCheckTaskIncome" parameterType="QcCheckTaskIncome"> <insert id="insertQcCheckTaskIncome" parameterType="QcCheckTaskIncome">
@ -242,6 +244,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
where record_id = #{recordId} where record_id = #{recordId}
</update> </update>
<update id="updateQcCheckTask">
update qc_check_task
set
check_status = #{checkStatus},
<if test="checkTime != null">check_time = #{checkTime},</if>
check_result = #{checkResult},
update_by = #{updateBy},
update_time = #{updateTime}
where record_id = #{recordId}
</update>
<update id="updateQcCheckTaskDetails">
<foreach collection="list" item="item" separator=";">
update qc_check_task_detail
set
zh_desc = #{item.name1},
contact_phone = #{item.telf1},
address = #{item.stras},
factory_code = #{item.bukrs},
create_time= #{item.erdat},
update_time = #{item.erdat}
where
supplier_code = #{item.lifnr}
</foreach>
</update>
<delete id="deleteQcCheckTaskIncomeByRecordId" parameterType="String"> <delete id="deleteQcCheckTaskIncomeByRecordId" parameterType="String">
delete from qc_check_task where record_id = #{recordId} delete from qc_check_task where record_id = #{recordId}

@ -35,7 +35,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<collection property="fileList" column="id" select="queryImg"></collection> <collection property="fileList" column="id" select="queryImg"></collection>
</resultMap> </resultMap>
<resultMap type="QcCheckTaskIncome" id="QcCheckTaskIncomeResult">
<result property="recordId" column="record_id" />
<result property="checkNo" column="check_no" />
<result property="incomeBatchNo" column="income_batch_no" />
<result property="orderNo" column="order_no" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="quality" column="quality" />
<result property="noOkQuality" column="noOk_quality" />
<result property="unit" column="unit" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="incomeTime" column="income_time" />
<result property="checkLoc" column="check_loc" />
<result property="checkStatus" column="check_status" />
<result property="checkManCode" column="check_man_code" />
<result property="checkManName" column="check_man_name" />
<result property="checkTime" column="check_time" />
<result property="checkResult" column="check_result" />
<result property="status" column="status" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
<result property="delFlag" column="del_flag" />
<result property="checkType" column="check_type" />
</resultMap>
<sql id="selectQuaVo"> <sql id="selectQuaVo">
select id,rfid,factory_id,factory_code,order_id,machine_id,bad_meg,product_id,isqua,file_id,attr1,attr2, select id,rfid,factory_id,factory_code,order_id,machine_id,bad_meg,product_id,isqua,file_id,attr1,attr2,
attr3,attr4,create_by,create_time,update_by,update_time,order_code,machine_code, attr3,attr4,create_by,create_time,update_by,update_time,order_code,machine_code,
@ -212,4 +243,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sys_dict_data from sys_dict_data
where dict_type = #{equipmentTypeCode} where dict_type = #{equipmentTypeCode}
</select> </select>
<select id="getCheckTaskList" resultMap="QcCheckTaskIncomeResult">
select qct.record_id, qct.check_no, qct.income_batch_no, 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_man_code,qct.check_man_name, qct.check_time, qct.check_result,
qct.status,qct.create_by,qct.create_time
from qc_check_task qct
<where>
and qct.del_flag = '0'
<if test="checkType != null and checkType != ''"> and qct.check_type = #{checkType}</if>
<if test="checkManCode != null and checkManCode != ''"> and qct.check_man_code = #{checkManCode}</if>
</where>
order by qct.create_time desc
</select>
</mapper> </mapper>

Loading…
Cancel
Save