Merge remote-tracking branch 'origin/master'

highway
Yangwl 1 year ago
commit e24b2f8a6d

@ -40,7 +40,7 @@ public interface RemoteSapService {
/**关闭订单**/ /**关闭订单**/
@PostMapping("/sap/sapCloseOrder") @PostMapping("/sap/sapCloseOrder")
public R sapCloseOrder(@RequestParam("shopOrder") String shopOrder); public R sapCloseOrder(@RequestBody SapCloseOrderQuery sapCloseOrderQuery);
/**报工**/ /**报工**/
@PostMapping("/sap/sapRFWOrder") @PostMapping("/sap/sapRFWOrder")

@ -0,0 +1,197 @@
package com.op.system.api.domain.mes;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* mes_report_work_consume
*
* @author Open Platform
* @date 2023-08-24
*/
public class MesReportWorkConsumeDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** id */
private String recordId;
/** 工单编码 */
@Excel(name = "工单编码")
private String workorderCode;
/** 物料编号 */
@Excel(name = "物料编号")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料规格型号 */
@Excel(name = "物料规格型号")
private String materialSpc;
/** 数量 */
@Excel(name = "数量")
private Long quantity;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 预留字段1 */
@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
@Excel(name = "预留字段4")
private String attr4;
/** 工厂编码 */
@Excel(name = "工厂编码")
private String factoryCode;
/** 工厂编码 */
@Excel(name = "报工编码")
private String reportCode;
//虚拟字段
private String id;
public void setRecordId(String recordId) {
this.recordId = recordId;
}
public String getRecordId() {
return recordId;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setReportCode(String reportCode) {
this.reportCode = reportCode;
}
public String getReportCode() {
return reportCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialSpc(String materialSpc) {
this.materialSpc = materialSpc;
}
public String getMaterialSpc() {
return materialSpc;
}
public void setQuantity(Long quantity) {
this.quantity = quantity;
}
public Long getQuantity() {
return quantity;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getUnit() {
return unit;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
//虚拟字段
public void setId(String factoryCode) {
this.id = id;
}
public String getId() {
return id;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("recordId", getRecordId())
.append("id", getId())
.append("reportCode", getReportCode())
.append("workorderCode", getWorkorderCode())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("materialSpc", getMaterialSpc())
.append("quantity", getQuantity())
.append("unit", getUnit())
.append("remark", getRemark())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.toString();
}
}

@ -1,4 +1,4 @@
package com.op.sap.domain.vo; package com.op.system.api.domain.sap;
public class SapCloseOrderQuery { public class SapCloseOrderQuery {

@ -40,7 +40,7 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
} }
@Override @Override
public R sapCloseOrder(String shopOrder) { public R sapCloseOrder(SapCloseOrderQuery sapCloseOrderQuery) {
return R.fail("关闭订单失败:" + throwable.getMessage()); return R.fail("关闭订单失败:" + throwable.getMessage());
} }

@ -71,4 +71,14 @@ public class DeviceInterfaceController {
public AjaxResult getEquipmentIntactRate(EquOperationRecord equOperationRecord) { public AjaxResult getEquipmentIntactRate(EquOperationRecord equOperationRecord) {
return deviceInterfaceService.getEquipmentIntactRate(equOperationRecord); return deviceInterfaceService.getEquipmentIntactRate(equOperationRecord);
} }
/**
*
*
*/
@GetMapping("/getDeviceRefreshTime")
public AjaxResult getDeviceRefreshTime(EquOperationRecord equOperationRecord) {
return deviceInterfaceService.getDeviceRefreshTime(equOperationRecord);
}
} }

@ -82,6 +82,26 @@ public class EquPlanDetail extends BaseEntity {
private String itemTools; private String itemTools;
private String itemLoopType;
private int itemLoop;
public String getItemLoopType() {
return itemLoopType;
}
public void setItemLoopType(String itemLoopType) {
this.itemLoopType = itemLoopType;
}
public int getItemLoop() {
return itemLoop;
}
public void setItemLoop(int itemLoop) {
this.itemLoop = itemLoop;
}
public String getItemTools() { public String getItemTools() {
return itemTools; return itemTools;
} }

@ -66,6 +66,26 @@ public class EquPlanEqu extends BaseEntity {
private String spareOnList; private String spareOnList;
private int itemLoop;
private String itemLoopType;
public int getItemLoop() {
return itemLoop;
}
public void setItemLoop(int itemLoop) {
this.itemLoop = itemLoop;
}
public String getItemLoopType() {
return itemLoopType;
}
public void setItemLoopType(String itemLoopType) {
this.itemLoopType = itemLoopType;
}
public String getSpareOnList() { public String getSpareOnList() {
return spareOnList; return spareOnList;
} }

@ -82,6 +82,26 @@ public class EquPlanStandard extends BaseEntity {
private String itemTools; private String itemTools;
private int itemLoop;
private String itemLoopType;
public int getItemLoop() {
return itemLoop;
}
public void setItemLoop(int itemLoop) {
this.itemLoop = itemLoop;
}
public String getItemLoopType() {
return itemLoopType;
}
public void setItemLoopType(String itemLoopType) {
this.itemLoopType = itemLoopType;
}
public String getItemMethod() { public String getItemMethod() {
return itemMethod; return itemMethod;
} }

@ -37,4 +37,10 @@ public interface DeviceInterfaceMapper {
MesReportWork selectReportWorkByEquipmentCode(String equipmentCode); MesReportWork selectReportWorkByEquipmentCode(String equipmentCode);
List<EquRepairWorkOrder> selectRepairRecordByEquipmentCode(String equipmentCode); List<EquRepairWorkOrder> selectRepairRecordByEquipmentCode(String equipmentCode);
/**
*
* 5
*/
String getDeviceRefreshTime(EquOperationRecord equOperationRecord);
} }

@ -39,4 +39,10 @@ public interface IDeviceInterfaceService {
* @return * @return
*/ */
AjaxResult getEquipmentIntactRate(EquOperationRecord equOperationRecord); AjaxResult getEquipmentIntactRate(EquOperationRecord equOperationRecord);
/**
*
* 5
*/
public AjaxResult getDeviceRefreshTime(EquOperationRecord equOperationRecord);
} }

@ -206,4 +206,15 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
EquOperationRecord equipmentIntactRate = equOperationRecordMapper.getEquipmentIntactRate(equOperationRecord); EquOperationRecord equipmentIntactRate = equOperationRecordMapper.getEquipmentIntactRate(equOperationRecord);
return success(equipmentIntactRate); return success(equipmentIntactRate);
} }
/**
*
*/
@Override
@DS("master")
public AjaxResult getDeviceRefreshTime(EquOperationRecord equOperationRecord) {
String refreshTime = deviceInterfaceMapper.getDeviceRefreshTime(equOperationRecord);
int time = Integer.parseInt(refreshTime);
return success(time);
}
} }

@ -264,26 +264,29 @@ public class EquPlanServiceImpl implements IEquPlanService {
if (equCheckItemList.size() > 0) { if (equCheckItemList.size() > 0) {
List<EquPlanDetail> detailList = new ArrayList<>(); List<EquPlanDetail> detailList = new ArrayList<>();
for (EquCheckItem checkItem : equCheckItemList) { for (EquCheckItem checkItem : equCheckItemList) {
EquPlanDetail detail = new EquPlanDetail(); // 只需要循环周期一致的检查项
BeanUtils.copyProperties(checkItem,detail); if(checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType())) {
EquPlanDetail detail = new EquPlanDetail();
if (!detail.getItemCode().isEmpty()) { BeanUtils.copyProperties(checkItem,detail);
itemTempName.append(detail.getItemName()).append(",");
// 获取检查项详情list if (!detail.getItemCode().isEmpty()) {
List<EquCheckItemDetail> equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode()); itemTempName.append(detail.getItemName()).append(",");
if (equCheckItemList.size() > 0) { // 获取检查项详情list
List<EquPlanStandard> standardList = new ArrayList<>(); List<EquCheckItemDetail> equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode());
for (EquCheckItemDetail standardTemp : equCheckItemDetailList) { if (equCheckItemList.size() > 0) {
EquPlanStandard standard = new EquPlanStandard(); List<EquPlanStandard> standardList = new ArrayList<>();
BeanUtils.copyProperties(standardTemp,standard); for (EquCheckItemDetail standardTemp : equCheckItemDetailList) {
EquPlanStandard standard = new EquPlanStandard();
standard.setShowFlag(true); BeanUtils.copyProperties(standardTemp,standard);
standardList.add(standard);
standard.setShowFlag(true);
standardList.add(standard);
}
detail.setEquPlanStandardList(standardList);
} }
detail.setEquPlanStandardList(standardList);
} }
detailList.add(detail);
} }
detailList.add(detail);
} }
data.setEquPlanDetailList(detailList); data.setEquPlanDetailList(detailList);
data.setItemTempName(itemTempName.toString()); data.setItemTempName(itemTempName.toString());
@ -365,6 +368,8 @@ public class EquPlanServiceImpl implements IEquPlanService {
List<EquPlanStandard> standardList = equPlanStandardMapper.selectEquPlanStandardListByParentCode(detail.getId()); List<EquPlanStandard> standardList = equPlanStandardMapper.selectEquPlanStandardListByParentCode(detail.getId());
for (EquPlanStandard standard : standardList) { for (EquPlanStandard standard : standardList) {
standard.setShowFlag(true); standard.setShowFlag(true);
standard.setItemLoop(detail.getItemLoop());
standard.setItemLoopType(detail.getItemLoopType());
} }
// 置入标准 // 置入标准

@ -46,26 +46,29 @@ public class EquSpotCheckServiceImpl implements IEquSpotCheckService {
if (equCheckItemList.size() > 0) { if (equCheckItemList.size() > 0) {
List<EquPlanDetail> detailList = new ArrayList<>(); List<EquPlanDetail> detailList = new ArrayList<>();
for (EquCheckItem checkItem : equCheckItemList) { for (EquCheckItem checkItem : equCheckItemList) {
EquPlanDetail detail = new EquPlanDetail(); // 只需要循环周期一致的检查项
BeanUtils.copyProperties(checkItem,detail); if(checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType())) {
EquPlanDetail detail = new EquPlanDetail();
if (!detail.getItemCode().isEmpty()) { BeanUtils.copyProperties(checkItem,detail);
itemTempName.append(detail.getItemName()).append(",");
// 获取检查项详情list if (!detail.getItemCode().isEmpty()) {
List<EquCheckItemDetail> equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode()); itemTempName.append(detail.getItemName()).append(",");
if (equCheckItemList.size() > 0) { // 获取检查项详情list
List<EquPlanStandard> standardList = new ArrayList<>(); List<EquCheckItemDetail> equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode());
for (EquCheckItemDetail standardTemp : equCheckItemDetailList) { if (equCheckItemList.size() > 0) {
EquPlanStandard standard = new EquPlanStandard(); List<EquPlanStandard> standardList = new ArrayList<>();
BeanUtils.copyProperties(standardTemp,standard); for (EquCheckItemDetail standardTemp : equCheckItemDetailList) {
EquPlanStandard standard = new EquPlanStandard();
standard.setShowFlag(true); BeanUtils.copyProperties(standardTemp,standard);
standardList.add(standard);
standard.setShowFlag(true);
standardList.add(standard);
}
detail.setEquPlanStandardList(standardList);
} }
detail.setEquPlanStandardList(standardList);
} }
detailList.add(detail);
} }
detailList.add(detail);
} }
data.setEquPlanDetailList(detailList); data.setEquPlanDetailList(detailList);
data.setItemTempName(itemTempName.toString()); data.setItemTempName(itemTempName.toString());

@ -182,26 +182,29 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
if (equCheckItemList.size() > 0) { if (equCheckItemList.size() > 0) {
List<EquPlanDetail> detailList = new ArrayList<>(); List<EquPlanDetail> detailList = new ArrayList<>();
for (EquCheckItem checkItem : equCheckItemList) { for (EquCheckItem checkItem : equCheckItemList) {
EquPlanDetail detail = new EquPlanDetail(); // 只需要循环周期一致的检查项
BeanUtils.copyProperties(checkItem,detail); if(checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType())) {
EquPlanDetail detail = new EquPlanDetail();
if (!detail.getItemCode().isEmpty()) { BeanUtils.copyProperties(checkItem,detail);
itemTempName.append(detail.getItemName()).append(",");
// 获取检查项详情list if (!detail.getItemCode().isEmpty()) {
List<EquCheckItemDetail> equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode()); itemTempName.append(detail.getItemName()).append(",");
if (equCheckItemList.size() > 0) { // 获取检查项详情list
List<EquPlanStandard> standardList = new ArrayList<>(); List<EquCheckItemDetail> equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode());
for (EquCheckItemDetail standardTemp : equCheckItemDetailList) { if (equCheckItemList.size() > 0) {
EquPlanStandard standard = new EquPlanStandard(); List<EquPlanStandard> standardList = new ArrayList<>();
BeanUtils.copyProperties(standardTemp,standard); for (EquCheckItemDetail standardTemp : equCheckItemDetailList) {
EquPlanStandard standard = new EquPlanStandard();
standard.setShowFlag(true); BeanUtils.copyProperties(standardTemp,standard);
standardList.add(standard);
standard.setShowFlag(true);
standardList.add(standard);
}
detail.setEquPlanStandardList(standardList);
} }
detail.setEquPlanStandardList(standardList);
} }
detailList.add(detail);
} }
detailList.add(detail);
} }
data.setEquPlanDetailList(detailList); data.setEquPlanDetailList(detailList);
data.setItemTempName(itemTempName.toString()); data.setItemTempName(itemTempName.toString());

@ -21,7 +21,7 @@
</select> </select>
<select id="selectEquipmentList" resultType="com.op.device.domain.vo.IEquipmentVO"> <select id="selectEquipmentList" resultType="com.op.device.domain.vo.IEquipmentVO">
select be.equipment_code AS 'equipmentCode', be.equipment_name AS 'equipmentName' select be.equipment_code AS 'equipmentCode', be.equipment_name AS 'equipmentName',be.equipment_status AS 'equipmentStatus'
from base_equipment be from base_equipment be
where be.equipment_code in (select wo.equipment_code where be.equipment_code in (select wo.equipment_code
from equ_repair_work_order wo from equ_repair_work_order wo
@ -58,4 +58,10 @@
and wo.work_status = '1' and wo.work_status = '1'
</select> </select>
<select id="getDeviceRefreshTime" resultType="java.lang.String">
select dict_value
from sys_dict_data
where dict_label = 'device_refresh_time'
</select>
</mapper> </mapper>

@ -9,13 +9,11 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.bean.BeanUtils; import com.op.common.core.utils.bean.BeanUtils;
import com.op.common.core.utils.http.HttpUtils; import com.op.common.core.utils.http.HttpUtils;
import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.utils.uuid.IdUtils;
import com.op.mes.domain.BufferInfoParam; import com.op.mes.domain.*;
import com.op.mes.domain.MesReportWork;
import com.op.mes.domain.MesShift;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.domain.buffer.JsonRootBean; import com.op.mes.domain.buffer.JsonRootBean;
import com.op.mes.domain.dto.LGInfoDto; import com.op.mes.domain.dto.LGInfoDto;
import com.op.mes.mapper.MesMapper; import com.op.mes.mapper.MesMapper;
import com.op.mes.mapper.MesReportWorkConsumeMapper;
import com.op.mes.mapper.MesReportWorkMapper; import com.op.mes.mapper.MesReportWorkMapper;
import com.op.mes.mapper.ProRfidProcessDetailMapper; import com.op.mes.mapper.ProRfidProcessDetailMapper;
import com.op.mes.service.IWCSInterfaceService; import com.op.mes.service.IWCSInterfaceService;
@ -28,6 +26,7 @@ import com.op.system.api.domain.dto.BoardDTO;
import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataDTO; import com.op.system.api.domain.dto.WCSDataDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail; import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapRFW; import com.op.system.api.domain.sap.SapRFW;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -69,6 +68,9 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
@Autowired @Autowired
private RemoteSapService remoteSapService; private RemoteSapService remoteSapService;
@Autowired
private MesReportWorkConsumeMapper mesReportWorkConsumeMapper;
/** /**
* JSON * JSON
* { * {
@ -305,21 +307,27 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
ltgs.setConf_activity6(work.getSac6()); ltgs.setConf_activity6(work.getSac6());
sapRFW.setLt_gs(ltgs); sapRFW.setLt_gs(ltgs);
List<SapRFW.lt_hw> lt_hwList =new ArrayList<>(); List<SapRFW.lt_hw> lt_hwList =new ArrayList<>();
SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改 logger.info(work.getWorkorderCodeSap()+"母sap工单报工报工数量"+sapRFW.getGamng());
lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO; MesReportWorkConsume consumeqo = new MesReportWorkConsume();
lthw.setMaterial(work.getProcessCode()); consumeqo.setWorkorderCode(work.getWorkorderCode());
lt_hwList.add(lthw); List<MesReportWorkConsume> consumes = mesReportWorkConsumeMapper.selectMesReportWorkConsumeList(consumeqo);
if(!CollectionUtils.isEmpty(consumes)){
for(MesReportWorkConsume consume:consumes){
logger.info(work.getWorkorderCodeSap()+"母sap工单报工【原料损耗】"+
consume.getMaterialCode()+"|"+consume.getQuantity());
SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改
lthw.setEntry_qnt(consume.getQuantity()+"");//数量
lthw.setMaterial(consume.getMaterialCode());//物料编码
lt_hwList.add(lthw);
}
}else{
logger.info(work.getWorkorderCodeSap()+"母sap工单报工工单"+work.getWorkorderCode()+"mes_report_work_consume没有数据");
return R.fail("mes_report_work_consume没有数据");
}
sapRFW.setLt_hwList(lt_hwList); sapRFW.setLt_hwList(lt_hwList);
//添加调用sap日志
SysSapLog sysSapLog = new SysSapLog();
sysSapLog.setId(IdUtils.fastSimpleUUID());
sysSapLog.setMesssge(sapRFW.toString());
sysSapLog.setMethod("reportWork");
sysSapLog.setReqcode("请求");
sysSapLog.setCreateTime(DateUtils.getNowDate());
mesMapper.addSapLog(sysSapLog);
R r = remoteSapService.sapRFWOrder(sapRFW); R r = remoteSapService.sapRFWOrder(sapRFW);
logger.info(work.getWorkorderCodeSap()+"母sap工单报工结果"+r.getCode()+","+r.getData()+","+r.getMsg());
//上传成功更改mes_report_work状态 //上传成功更改mes_report_work状态
if (r.getCode() == 200) { if (r.getCode() == 200) {
work.setUploadStatus("1"); work.setUploadStatus("1");
@ -339,10 +347,16 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap()); logger.info("工单请求关闭调用remoteSapService.sapCloseOrder,参数:"+work.getWorkorderCodeSap());
//工单完成,关闭工单 //工单完成,关闭工单
List<String> sapWorkOrders = mesReportWorkMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单 List<String> sapWorkOrders = mesReportWorkMapper.getSapWorkOrder(work.getWorkorderCode());//根据belong_work_order找到所有要关闭的虚拟工单
for(String sapWorkOrder:sapWorkOrders){ //关闭母子订单//订单的订单编码
R r2= remoteSapService.sapCloseOrder(sapWorkOrder); SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery();
logger.info("工单"+work.getWorkorderCode()+",sapworkorder:"+sapWorkOrder+",sap关闭"+r.getCode()+",返回信息:"+r.getMsg()); sapCloseOrderQuery.setLeadOrder(sapWorkOrders.get(0));
} sapCloseOrderQuery.setOrder(sapWorkOrders.get(1));
R closeR = remoteSapService.sapCloseOrder(sapCloseOrderQuery);
logger.info(work.getWorkorderCodeSap()+"报工后关闭母子工单"+sapCloseOrderQuery.getLeadOrder()+":"+
sapCloseOrderQuery.getOrder()+":"+
closeR.getCode()+","+
closeR.getMsg()+","+
closeR.getData());
work.setStatus("w3"); work.setStatus("w3");
work.setUpdateTime(DateUtils.getNowDate()); work.setUpdateTime(DateUtils.getNowDate());

@ -275,18 +275,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sys_factory where f_type = 'c' from sys_factory where f_type = 'c'
</select> </select>
<select id="getLineChartsDatas" resultType="com.op.mes.domain.MesReportProduction"> <select id="getLineChartsDatas" resultType="com.op.mes.domain.MesReportProduction">
select select mrw.nameDate,
mrw.product_name+CONVERT(varchar(10),mrw.feedback_time, 120) nameDate, mrw.productCode,
mrw.product_code productCode, mrw.productName,
mrw.product_name productName, mrw.feedbackTime,
CONVERT(varchar(10),mrw.feedback_time, 120) feedbackTime, sum(mrw.quantity) quantity
sum(mrw.quantity_feedback) quantity from(
from mes_report_work mrw select
where product_name+CONVERT(varchar(10),feedback_time, 120) nameDate,
CONVERT(varchar(10),mrw.feedback_time, 120) >= #{productDateStart} product_code productCode,
and #{productDateEnd} >= CONVERT(varchar(10),mrw.feedback_time, 120) product_name productName,
group by mrw.product_code,mrw.product_name,mrw.feedback_time CONVERT(varchar(10),feedback_time, 120) feedbackTime,
order by mrw.feedback_time quantity_feedback quantity
from mes_report_work
where
CONVERT(varchar(10),feedback_time, 120) >= #{productDateStart}
and #{productDateEnd} >= CONVERT(varchar(10),feedback_time, 120)
)mrw
group by mrw.nameDate,mrw.productCode,mrw.productName,mrw.feedbackTime
</select> </select>
<select id="getLineChartsNames" resultType="java.lang.String"> <select id="getLineChartsNames" resultType="java.lang.String">
select select
@ -445,7 +451,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' and parent_order = '0' where belong_work_order = #{workorderCode} and del_flag = '0'
</select> </select>
<insert id="insertMesReportWork" parameterType="MesReportWork"> <insert id="insertMesReportWork" parameterType="MesReportWork">

@ -2,6 +2,7 @@ package com.op.open.mapper;
import com.op.system.api.domain.SysSapLog; import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.mes.MesReportWorkConsumeDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO; import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail; import com.op.system.api.domain.mes.ProRfidProcessDetail;
@ -43,5 +44,7 @@ public interface OpenMapper {
List<WCSDTO> getLGInfo(WCSDTO wcsDTO); List<WCSDTO> getLGInfo(WCSDTO wcsDTO);
List<String> getSapWorkOrder(String workorderCode); List<String> getSapWorkOrder(String workorderCode);
List<MesReportWorkConsumeDTO> selectMesReportWorkConsumeList(MesReportWorkConsumeDTO consumeqo);
} }

@ -1,6 +1,7 @@
package com.op.open.service.impl; package com.op.open.service.impl;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
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.DateUtils;
@ -12,9 +13,11 @@ import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.SysSapLog; import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.WCSDTO; import com.op.system.api.domain.dto.WCSDTO;
import com.op.system.api.domain.dto.WCSDataDTO; import com.op.system.api.domain.dto.WCSDataDTO;
import com.op.system.api.domain.mes.MesReportWorkConsumeDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO; import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail; import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapRFW; import com.op.system.api.domain.sap.SapRFW;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -173,20 +176,28 @@ public class OpenServiceImpl implements OpenService {
ltgs.setConf_activity5(work.getSac5());//折旧 ltgs.setConf_activity5(work.getSac5());//折旧
ltgs.setConf_activity6(work.getSac6()); ltgs.setConf_activity6(work.getSac6());
sapRFW.setLt_gs(ltgs); sapRFW.setLt_gs(ltgs);
SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改 List<SapRFW.lt_hw> lt_hwList =new ArrayList<>();
lthw.setEntry_qnt(work.getQuantityFeedback().toString());//TODO; logger.info(work.getWorkorderCodeSap()+"母sap工单报工报工数量"+sapRFW.getGamng());
lthw.setMaterial(work.getProcessCode()); MesReportWorkConsumeDTO consumeqo = new MesReportWorkConsumeDTO();
sapRFW.setLt_hw(lthw); consumeqo.setWorkorderCode(work.getWorkorderCode());
//添加调用sap日志 List<MesReportWorkConsumeDTO> consumes = openMapper.selectMesReportWorkConsumeList(consumeqo);
SysSapLog sysSapLog = new SysSapLog(); if(!CollectionUtils.isEmpty(consumes)){
sysSapLog.setId(IdUtils.fastSimpleUUID()); for(MesReportWorkConsumeDTO consume:consumes){
sysSapLog.setMesssge(sapRFW.toString()); logger.info(work.getWorkorderCodeSap()+"母sap工单报工【原料损耗】"+
sysSapLog.setMethod("reportWork"); consume.getMaterialCode()+"|"+consume.getQuantity());
sysSapLog.setReqcode("请求"); SapRFW.lt_hw lthw = sapRFW.new lt_hw();//MES生产订单报工货物移动修改
sysSapLog.setCreateTime(DateUtils.getNowDate()); lthw.setEntry_qnt(consume.getQuantity()+"");//数量
openMapper.addSapLog(sysSapLog); lthw.setMaterial(consume.getMaterialCode());//物料编码
lt_hwList.add(lthw);
}
}else{
logger.info(work.getWorkorderCodeSap()+"母sap工单报工工单"+work.getWorkorderCode()+"==mes_report_work_consume没有数据");
//return R.fail("mes_report_work_consume没有数据");
}
sapRFW.setLt_hwList(lt_hwList);
logger.info(work.getWorkorderCodeSap()+"母sap工单报工请求"+ JSONObject.toJSONString(sapRFW));
R r = remoteSapService.sapRFWOrder(sapRFW); R r = remoteSapService.sapRFWOrder(sapRFW);
logger.info(work.getWorkorderCodeSap()+"母sap工单报工结果"+r.getCode()+","+r.getData()+","+r.getMsg());
//上传成功更改mes_report_work状态 //上传成功更改mes_report_work状态
if (r.getCode() == 200) { if (r.getCode() == 200) {
work.setUploadStatus("1"); work.setUploadStatus("1");
@ -199,18 +210,21 @@ public class OpenServiceImpl implements OpenService {
//工单完成数量>工单数量:关闭订单 //工单完成数量>工单数量:关闭订单
MesReportWorkDTO proResult = openMapper.getProdResult(work); MesReportWorkDTO proResult = openMapper.getProdResult(work);
//ProOrderWorkorderDTO topOrder = this.getTopOrder(work.getWorkorderCode()); //ProOrderWorkorderDTO topOrder = this.getTopOrder(work.getWorkorderCode());
if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0 if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0||"1".equals(work.getEndReport())//最终报工标识
||
"1".equals(work.getEndReport())//最终报工标识
){ ){
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){ //关闭母子订单//订单的订单编码
R rclose = remoteSapService.sapCloseOrder(sapWorkOrder); SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery();
logger.info("工单"+work.getWorkorderCode()+",sapworkorder:"+sapWorkOrder+",sap关闭"+r.getCode()+",返回信息:"+r.getMsg()); sapCloseOrderQuery.setLeadOrder(sapWorkOrders.get(0));
} sapCloseOrderQuery.setOrder(sapWorkOrders.get(1));
R closeR = remoteSapService.sapCloseOrder(sapCloseOrderQuery);
logger.info(work.getWorkorderCodeSap()+"下发工单后关闭母子工单"+sapCloseOrderQuery.getLeadOrder()+":"+
sapCloseOrderQuery.getOrder()+":"+
closeR.getCode()+","+
closeR.getMsg()+","+
closeR.getData());
work.setStatus("w3"); work.setStatus("w3");
work.setUpdateTime(DateUtils.getNowDate()); work.setUpdateTime(DateUtils.getNowDate());
//pro_work_order status->w3报工--belong_work_order //pro_work_order status->w3报工--belong_work_order

@ -124,7 +124,16 @@ 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' and parent_order = '0' where belong_work_order = #{workorderCode} and del_flag = '0'
</select>
<select id="selectMesReportWorkConsumeList"
resultType="com.op.system.api.domain.mes.MesReportWorkConsumeDTO">
select
material_code materialCode,
quantity
from mes_report_work_consume
where
workorder_code = #{workorderCode} and del_flag = '0'
</select> </select>
</mapper> </mapper>

@ -21,6 +21,7 @@ import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.SysSapLog; import com.op.system.api.domain.SysSapLog;
import com.op.system.api.domain.dto.MesPrepareDTO; import com.op.system.api.domain.dto.MesPrepareDTO;
import com.op.system.api.domain.dto.MesPrepareDetailDTO; import com.op.system.api.domain.dto.MesPrepareDetailDTO;
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapCreateOrder;
import com.op.system.api.domain.sap.SapMaterialPreparation; import com.op.system.api.domain.sap.SapMaterialPreparation;
import com.op.system.api.domain.sap.SapShopOrderQuery; import com.op.system.api.domain.sap.SapShopOrderQuery;
@ -306,14 +307,14 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
sapList.add(sap); sapList.add(sap);
//添加调用sap日志 //添加调用sap日志
SysSapLog sysSapLog = new SysSapLog(); // SysSapLog sysSapLog = new SysSapLog();
sysSapLog.setId(IdUtils.fastSimpleUUID()); // sysSapLog.setId(IdUtils.fastSimpleUUID());
sysSapLog.setMesssge(Arrays.asList(sapList).toString()); // sysSapLog.setMesssge(Arrays.asList(sapList).toString());
sysSapLog.setMethod("downProOrderWorkorderByWorkorderIds"); // sysSapLog.setMethod("downProOrderWorkorderByWorkorderIds");
sysSapLog.setReqcode("请求"); // sysSapLog.setReqcode("请求");
sysSapLog.setCreateTime(DateUtils.getNowDate()); // sysSapLog.setCreateTime(DateUtils.getNowDate());
proOrderMapper.addSapLog(sysSapLog); // proOrderMapper.addSapLog(sysSapLog);
logger.info(whiteOrder.getWorkorderCode()+"sap工单回传sap虚拟工单号开始"+Arrays.asList(sapList).toString());
R<List<Map<String, String>>> r = remoteSapService.SapCreateOrder(sapList); R<List<Map<String, String>>> r = remoteSapService.SapCreateOrder(sapList);
logger.info("sap工单回传" + r.getMsg()); logger.info("sap工单回传" + r.getMsg());
if (500 == r.getCode()) { if (500 == r.getCode()) {
@ -328,7 +329,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
} }
Date updateTime = DateUtils.getNowDate(); Date updateTime = DateUtils.getNowDate();
if (!CollectionUtils.isEmpty(returnCodes)) { if (!CollectionUtils.isEmpty(returnCodes)) {
logger.info("sap工单回传sap虚拟工单号" + StringUtils.join(returnCodes, ",")); logger.info("sap工单回传sap虚拟工单号结束" + StringUtils.join(returnCodes, ","));
//按照母子顺序进行更新 //按照母子顺序进行更新
for (int m=0;m<returnCodes.size();m++) { for (int m=0;m<returnCodes.size();m++) {
ProOrderWorkorder oworkSap = new ProOrderWorkorder(); ProOrderWorkorder oworkSap = new ProOrderWorkorder();
@ -347,11 +348,16 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
//获取领料单 //获取领料单
this.getMesPrepare(returnCodes,wcodes); this.getMesPrepare(returnCodes,wcodes);
//关闭母订单子订单会自动关闭//订单的订单编码 //关闭母子订单//订单的订单编码
//for(String orderCode:ordercodes){ SapCloseOrderQuery sapCloseOrderQuery = new SapCloseOrderQuery();
R closeR= remoteSapService.sapCloseOrder(ordercodes.get(0)); sapCloseOrderQuery.setLeadOrder(ordercodes.get(0));
logger.info(workorderId+"下发工单后关闭母订单"+ordercodes.get(0)+":"+closeR.getMsg()); 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()]); String[] idsArrayAll = (String[])wids.toArray(new String[wids.size()]);
proOrderWorkorderMapper.downWorkorders(idsArrayAll); proOrderWorkorderMapper.downWorkorders(idsArrayAll);

@ -26,7 +26,7 @@ import com.op.common.core.web.page.TableDataInfo;
/** /**
* Controller * Controller
* *
* @author Open Platform * @author Open Platform
* @date 2023-10-17 * @date 2023-10-17
*/ */
@ -35,8 +35,6 @@ import com.op.common.core.web.page.TableDataInfo;
public class QcCheckTypeProjectController extends BaseController { public class QcCheckTypeProjectController extends BaseController {
@Autowired @Autowired
private IQcCheckTypeProjectService qcCheckTypeProjectService; private IQcCheckTypeProjectService qcCheckTypeProjectService;
@Autowired
private IQcMaterialGroupService qcMaterialGroupService;
/** /**
* *

@ -7,10 +7,12 @@ 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.annotation.RequiresPermissions;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.*; import com.op.quality.domain.*;
import com.op.quality.service.*; import com.op.quality.service.*;
import com.op.system.api.RemoteMesService; import com.op.system.api.RemoteMesService;
import com.op.system.api.domain.SysDictData;
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.util.CollectionUtils;
@ -39,7 +41,8 @@ public class QuaController extends BaseController {
private IQcCheckTaskWarehousingService qcCheckTaskWarehousingService; private IQcCheckTaskWarehousingService qcCheckTaskWarehousingService;
@Autowired @Autowired
private IQcCheckTypeService qcCheckTypeService; private IQcCheckTypeService qcCheckTypeService;
@Autowired
private IQcMaterialGroupService qcMaterialGroupService;
@Autowired @Autowired
private IQcCheckTaskIncomeService qcCheckTaskIncomeService; private IQcCheckTaskIncomeService qcCheckTaskIncomeService;
@ -179,17 +182,14 @@ public class QuaController extends BaseController {
* *
*/ */
@GetMapping(value = "getCheckTaskList") @GetMapping(value = "getCheckTaskList")
public AjaxResult getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome) { public TableDataInfo getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome) {
if(StringUtils.isBlank(qcCheckTaskIncome.getFactoryCode())){
return error("[factoryCode]不能为空"); if(StringUtils.isNotBlank(qcCheckTaskIncome.getCheckStatus())){
} qcCheckTaskIncome.setCheckStatus("'"+ qcCheckTaskIncome.getCheckStatus().replace(",","','")+"'");
if(StringUtils.isBlank(qcCheckTaskIncome.getCheckType())){
return error("[checkType]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskIncome.getCheckManCode())){
return error("[checkManCode]不能为空");
} }
return success(qcProCheckService.getCheckTaskList(qcCheckTaskIncome)); startPage();
List<QcCheckTaskIncome> list = qcProCheckService.getCheckTaskList(qcCheckTaskIncome);
return getDataTable(list);
} }
/** /**
* *
@ -204,13 +204,44 @@ public class QuaController extends BaseController {
} }
return success(qcProCheckService.getCheckTaskDetailList(qcCheckTaskDetail)); return success(qcProCheckService.getCheckTaskDetailList(qcCheckTaskDetail));
} }
/**检测结果提交**/
@PostMapping("/commitCheckResults") /**
public AjaxResult commitCheckResults(@RequestBody List<QcCheckTaskDetail> details) { *
if(CollectionUtils.isEmpty(details)){ */
@PostMapping(value = "commitCheckResults")
public AjaxResult commitCheckResults(@RequestBody List<QcCheckTaskDetail> qcCheckTaskDetails) {
if(CollectionUtils.isEmpty(qcCheckTaskDetails)){
return error("[List<QcCheckTaskDetail>]不能为空"); return error("[List<QcCheckTaskDetail>]不能为空");
} }
return toAjax(qcCheckTaskIncomeService.commitCheckResults(details)); return success(qcCheckTaskIncomeService.commitCheckResults(qcCheckTaskDetails));
}
/**
*
*/
@GetMapping(value = "getQcUnitList")
public TableDataInfo getQcUnitList(SysDictData sysDictData) {
startPage();
List<SysDictData> list = qcProCheckService.getQcUnitList(sysDictData);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/pdaMaterialTree")
public AjaxResult pdaMaterialTree(QcMaterialGroup materialGroup) {
DynamicDataSourceContextHolder.push("ds_"+materialGroup.getFactoryCode());
return success(qcMaterialGroupService.selectQcMaterialTreeList(materialGroup));
} }
/**
*
*/
@GetMapping("/getCheckTypeProjectList")
public TableDataInfo list(QcCheckTypeProject qcCheckTypeProject) {
DynamicDataSourceContextHolder.push("ds_"+qcCheckTypeProject.getFactoryCode());
startPage();
List<QcCheckTypeProject> list = qcMaterialGroupService.getCheckTypeProjectList(qcCheckTypeProject);
return getDataTable(list);
}
} }

@ -95,6 +95,15 @@ public class QcCheckTaskDetail extends BaseEntity {
private List<String> actualValues; private List<String> actualValues;
private String typeProjectId; private String typeProjectId;
private String defectCode; private String defectCode;
private String checkType;
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getDefectCode() { public String getDefectCode() {
return defectCode; return defectCode;

@ -70,10 +70,48 @@ public class QcCheckTypeProject extends BaseEntity {
@Excel(name = "物料编码") @Excel(name = "物料编码")
private String materialCode; private String materialCode;
private String materialName;
private Integer sort; private Integer sort;
private String projectNo; private String projectNo;
private String checkTool;
private String checkMode;
private String uint;
public String getUint() {
return uint;
}
public void setUint(String uint) {
this.uint = uint;
}
public String getCheckTool() {
return checkTool;
}
public void setCheckTool(String checkTool) {
this.checkTool = checkTool;
}
public String getCheckMode() {
return checkMode;
}
public void setCheckMode(String checkMode) {
this.checkMode = checkMode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public Integer getSort() { public Integer getSort() {
return sort; return sort;
} }

@ -6,6 +6,7 @@ import com.op.quality.domain.QcBomComponent;
import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckTaskIncome; import com.op.quality.domain.QcCheckTaskIncome;
import com.op.quality.domain.QcSupplier; import com.op.quality.domain.QcSupplier;
import com.op.system.api.domain.SysDictData;
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; import org.apache.ibatis.annotations.Param;
@ -79,4 +80,6 @@ public interface QcCheckTaskIncomeMapper {
int updateQcCheckTask(QcCheckTaskIncome qcCheckTask); int updateQcCheckTask(QcCheckTaskIncome qcCheckTask);
int updateQcCheckTaskDetails(@Param("list") List<QcCheckTaskDetail> details); int updateQcCheckTaskDetails(@Param("list") List<QcCheckTaskDetail> details);
List<SysDictData> getQcUnitList(SysDictData sysDictData);
} }

@ -1,9 +1,12 @@
package com.op.quality.mapper; package com.op.quality.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.op.quality.domain.QcCheckTaskDetail; import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckTypeProject; import com.op.quality.domain.QcCheckTypeProject;
import com.op.system.api.domain.SysDictData;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
@ -65,4 +68,8 @@ public interface QcCheckTypeProjectMapper {
List<QcCheckTaskDetail> getTPByTypeMaterial(QcCheckTypeProject qctp); List<QcCheckTaskDetail> getTPByTypeMaterial(QcCheckTypeProject qctp);
List<QcCheckTaskDetail> getTPByTypeGroup(QcCheckTypeProject qctp); List<QcCheckTaskDetail> getTPByTypeGroup(QcCheckTypeProject qctp);
List<QcCheckTypeProject> getCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject);
@MapKey("dictValue")
Map<String, SysDictData> getDictMap(SysDictData sysDictData);
} }

@ -1,20 +1,22 @@
package com.op.quality.service; package com.op.quality.service;
import java.util.List; import java.util.List;
import com.op.quality.domain.QcCheckTypeProject;
import com.op.quality.domain.QcMaterialGroup; import com.op.quality.domain.QcMaterialGroup;
import com.op.quality.domain.vo.TreeSelect; import com.op.quality.domain.vo.TreeSelect;
import com.op.system.api.domain.SysDept; import com.op.system.api.domain.SysDept;
/** /**
* Service * Service
* *
* @author materialGroup * @author materialGroup
* @date 2023-10-16 * @date 2023-10-16
*/ */
public interface IQcMaterialGroupService { public interface IQcMaterialGroupService {
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@ -22,7 +24,7 @@ public interface IQcMaterialGroupService {
/** /**
* *
* *
* @param qcMaterialGroup * @param qcMaterialGroup
* @return * @return
*/ */
@ -38,7 +40,7 @@ public interface IQcMaterialGroupService {
/** /**
* *
* *
* @param qcMaterialGroup * @param qcMaterialGroup
* @return * @return
*/ */
@ -46,7 +48,7 @@ public interface IQcMaterialGroupService {
/** /**
* *
* *
* @param qcMaterialGroup * @param qcMaterialGroup
* @return * @return
*/ */
@ -54,7 +56,7 @@ public interface IQcMaterialGroupService {
/** /**
* *
* *
* @param ids * @param ids
* @return * @return
*/ */
@ -62,11 +64,13 @@ public interface IQcMaterialGroupService {
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
public int deleteQcMaterialGroupById(String id); public int deleteQcMaterialGroupById(String id);
public boolean validationData(String id); public boolean validationData(String id);
List<QcCheckTypeProject> getCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject);
} }

@ -6,6 +6,7 @@ import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcCheckTaskIncome; 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.system.api.domain.SysDictData;
import java.util.List; import java.util.List;
@ -34,4 +35,6 @@ public interface QcProCheckService {
List<QcCheckTaskIncome> getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome); List<QcCheckTaskIncome> getCheckTaskList(QcCheckTaskIncome qcCheckTaskIncome);
List<QcCheckTaskDetail > getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail); List<QcCheckTaskDetail > getCheckTaskDetailList(QcCheckTaskDetail qcCheckTaskDetail);
List<SysDictData> getQcUnitList(SysDictData sysDictData);
} }

@ -1,4 +1,4 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.impl;
import java.util.List; import java.util.List;
@ -19,7 +19,7 @@ import javax.servlet.http.HttpServletRequest;
/** /**
* Service * Service
* *
* @author Open Platform * @author Open Platform
* @date 2023-10-13 * @date 2023-10-13
*/ */
@ -30,7 +30,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@ -42,7 +42,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
/** /**
* *
* *
* @param qcCheckProject * @param qcCheckProject
* @return * @return
*/ */
@ -54,7 +54,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
/** /**
* *
* *
* @param qcCheckProject * @param qcCheckProject
* @return * @return
*/ */
@ -77,7 +77,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
/** /**
* *
* *
* @param qcCheckProject * @param qcCheckProject
* @return * @return
*/ */
@ -91,7 +91,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
/** /**
* *
* *
* @param ids * @param ids
* @return * @return
*/ */
@ -103,7 +103,7 @@ public class QcCheckProjectServiceImpl implements IQcCheckProjectService {
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */

@ -1,4 +1,4 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.impl;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;

@ -1,4 +1,4 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;

@ -1,4 +1,4 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
@ -102,12 +102,12 @@ public class QcCheckReportProductServiceImpl implements IQcCheckReportProductSer
qctp.setTypeId(qcCheckReportIncome.getCheckType());//生产过程检验 qctp.setTypeId(qcCheckReportIncome.getCheckType());//生产过程检验
qctp.setMaterialCode(qcCheckReportIncome.getMaterialCode());//特性 qctp.setMaterialCode(qcCheckReportIncome.getMaterialCode());//特性
/**qc_check_type_project**/ /**qc_check_type_project**/
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp); List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
if(CollectionUtils.isEmpty(items)){ if(CollectionUtils.isEmpty(items)){
/**qc_material_group_detail**/ /**qc_material_group_detail**/
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckReportIncome.getMaterialCode()); QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckReportIncome.getMaterialCode());
if(group == null){ if(group == null){
return 0;//没有找到检测项目 return 0;//没有找到检测项目
} }
qctp.setGroupId(group.getGroupId());//共性 qctp.setGroupId(group.getGroupId());//共性
items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp); items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);

@ -296,6 +296,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
String factoryCode = details.get(0).getFactoryCode(); String factoryCode = details.get(0).getFactoryCode();
String updateBy = details.get(0).getUpdateBy(); String updateBy = details.get(0).getUpdateBy();
String belongId = details.get(0).getBelongTo(); String belongId = details.get(0).getBelongTo();
String checkType = details.get(0).getCheckType();
//默认合格 //默认合格
String result = "Y"; String result = "Y";
@ -318,22 +319,23 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
logger.info("qc_check_task:"+n); logger.info("qc_check_task:"+n);
/**更新qc_check_task_detail**/ /**更新qc_check_task_detail**/
for(QcCheckTaskDetail detail:details){ for(QcCheckTaskDetail detail:details){
detail.setUpdateTime(nowTime);
} }
n= qcCheckTaskIncomeMapper.updateQcCheckTaskDetails(details);; n= qcCheckTaskIncomeMapper.updateQcCheckTaskDetails(details);
logger.info("更新qc_check_task_detail:"+n); logger.info("更新qc_check_task_detail:"+n);
//不合格处理 //不合格处理
if("N".equals(result)){ if("N".equals(result)){
// QcCheckUnqualified unqualified = new QcCheckUnqualified(); QcCheckUnqualified unqualified = new QcCheckUnqualified();
// unqualified.setId(IdUtils.fastSimpleUUID()); unqualified.setId(IdUtils.fastSimpleUUID());
// unqualified.setTaskId(qcCheckTaskIncome.getRecordId()); unqualified.setTaskId(belongId);
// unqualified.setCreateTime(DateUtils.getNowDate()); unqualified.setCreateTime(DateUtils.getNowDate());
// unqualified.setCreateBy(qcCheckTaskIncome.getUpdateBy()); unqualified.setCreateBy(updateBy);
// unqualified.setFactoryCode(factoryCode); unqualified.setFactoryCode(factoryCode);
// unqualified.setType(qcCheckTaskIncome.getCheckType()); unqualified.setType(checkType);
// /**qc_check_unqualified**/ /**qc_check_unqualified**/
// qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified); n = qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified);
logger.info("qc_check_unqualified:"+n);
} }
return n ; return n ;

@ -1,11 +1,14 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.impl;
import java.util.List; import java.util.List;
import java.util.Map;
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;
import com.op.system.api.domain.SysDictData;
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.mapper.QcCheckTypeProjectMapper; import com.op.quality.mapper.QcCheckTypeProjectMapper;
@ -18,7 +21,7 @@ import javax.servlet.http.HttpServletRequest;
/** /**
* Service * Service
* *
* @author Open Platform * @author Open Platform
* @date 2023-10-17 * @date 2023-10-17
*/ */
@ -29,7 +32,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@ -41,19 +44,29 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService
/** /**
* *
* *
* @param qcCheckTypeProject * @param qcCheckTypeProject
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public List<QcCheckTypeProject> selectQcCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject) { public List<QcCheckTypeProject> selectQcCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject) {
return qcCheckTypeProjectMapper.selectQcCheckTypeProjectList(qcCheckTypeProject); List<QcCheckTypeProject> dtos = qcCheckTypeProjectMapper.selectQcCheckTypeProjectList(qcCheckTypeProject);
DynamicDataSourceContextHolder.push("master");
SysDictData sData = new SysDictData();
sData.setDictType("unit");
Map<String,SysDictData> dictMap = qcCheckTypeProjectMapper.getDictMap(sData);
if(dictMap != null){
for(QcCheckTypeProject dto:dtos){
dto.setUint(dictMap.get(dto.getUint()).getDictLabel());
}
}
return dtos;
} }
/** /**
* *
* *
* @param qcCheckTypeProject * @param qcCheckTypeProject
* @return * @return
*/ */
@ -71,7 +84,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService
/** /**
* *
* *
* @param qcCheckTypeProject * @param qcCheckTypeProject
* @return * @return
*/ */
@ -85,7 +98,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService
/** /**
* *
* *
* @param ids * @param ids
* @return * @return
*/ */
@ -97,7 +110,7 @@ public class QcCheckTypeProjectServiceImpl implements IQcCheckTypeProjectService
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */

@ -1,4 +1,4 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.impl;
import java.util.List; import java.util.List;

@ -1,4 +1,4 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.impl;
import java.util.List; import java.util.List;
@ -18,7 +18,7 @@ import javax.servlet.http.HttpServletRequest;
/** /**
* Service * Service
* *
* @author Open Platform * @author Open Platform
* @date 2023-10-18 * @date 2023-10-18
*/ */
@ -29,7 +29,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@ -41,7 +41,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
/** /**
* *
* *
* @param qcMaterialGroupDetail * @param qcMaterialGroupDetail
* @return * @return
*/ */
@ -53,7 +53,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
/** /**
* *
* *
* @param qcMaterialGroupDetail * @param qcMaterialGroupDetail
* @return * @return
*/ */
@ -71,7 +71,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
/** /**
* *
* *
* @param qcMaterialGroupDetail * @param qcMaterialGroupDetail
* @return * @return
*/ */
@ -84,7 +84,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
/** /**
* *
* *
* @param ids * @param ids
* @return * @return
*/ */
@ -96,7 +96,7 @@ public class QcMaterialGroupDetailServiceImpl implements IQcMaterialGroupDetailS
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */

@ -1,4 +1,4 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -7,13 +7,17 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
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.SpringUtils; import com.op.common.core.utils.SpringUtils;
import com.op.common.core.utils.StringUtils; 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.datascope.annotation.DataScope; import com.op.common.datascope.annotation.DataScope;
import com.op.common.security.utils.SecurityUtils; import com.op.common.security.utils.SecurityUtils;
import com.op.quality.domain.QcCheckTypeProject;
import com.op.quality.domain.vo.TreeSelect; import com.op.quality.domain.vo.TreeSelect;
import com.op.quality.mapper.QcCheckTypeProjectMapper;
import com.op.system.api.domain.SysDictData;
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.mapper.QcMaterialGroupMapper; import com.op.quality.mapper.QcMaterialGroupMapper;
@ -26,7 +30,7 @@ import javax.servlet.http.HttpServletRequest;
/** /**
* Service * Service
* *
* @author materialGroup * @author materialGroup
* @date 2023-10-16 * @date 2023-10-16
*/ */
@ -34,10 +38,12 @@ import javax.servlet.http.HttpServletRequest;
public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService { public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
@Autowired @Autowired
private QcMaterialGroupMapper qcMaterialGroupMapper; private QcMaterialGroupMapper qcMaterialGroupMapper;
@Autowired
private QcCheckTypeProjectMapper qcCheckTypeProjectMapper;
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@ -46,7 +52,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
return qcMaterialGroupMapper.selectQcMaterialGroupById(id); return qcMaterialGroupMapper.selectQcMaterialGroupById(id);
} }
@Override @Override
@DataScope(deptAlias = "d") //@DataScope(deptAlias = "d")
@DS("#header.poolName") @DS("#header.poolName")
public List<QcMaterialGroup> selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup) { public List<QcMaterialGroup> selectQcMaterialGroupList(QcMaterialGroup qcMaterialGroup) {
return qcMaterialGroupMapper.selectQcMaterialGroupList(qcMaterialGroup); return qcMaterialGroupMapper.selectQcMaterialGroupList(qcMaterialGroup);
@ -54,7 +60,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
/** /**
* *
* *
* @param qcMaterialGroup * @param qcMaterialGroup
* @return * @return
*/ */
@ -119,7 +125,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
/** /**
* *
* *
* @param qcMaterialGroup * @param qcMaterialGroup
* @return * @return
*/ */
@ -137,7 +143,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
/** /**
* *
* *
* @param qcMaterialGroup * @param qcMaterialGroup
* @return * @return
*/ */
@ -151,7 +157,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
/** /**
* *
* *
* @param ids * @param ids
* @return * @return
*/ */
@ -163,7 +169,7 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
@ -179,6 +185,21 @@ public class QcMaterialGroupServiceImpl implements IQcMaterialGroupService {
return qcMaterialGroupMapper.validationData(id).size() > 0; return qcMaterialGroupMapper.validationData(id).size() > 0;
} }
@Override
public List<QcCheckTypeProject> getCheckTypeProjectList(QcCheckTypeProject qcCheckTypeProject) {
List<QcCheckTypeProject> dtos = qcCheckTypeProjectMapper.getCheckTypeProjectList(qcCheckTypeProject);
DynamicDataSourceContextHolder.push("master");
SysDictData sData = new SysDictData();
sData.setDictType("unit");
Map<String,SysDictData> dictMap = qcCheckTypeProjectMapper.getDictMap(sData);
if(dictMap != null){
for(QcCheckTypeProject dto:dtos){
dto.setUint(dictMap.get(dto.getUint()).getDictLabel());
}
}
return dtos;
}
private boolean hasChild(List<QcMaterialGroup> list, QcMaterialGroup t) { private boolean hasChild(List<QcMaterialGroup> list, QcMaterialGroup t) {
return getChildList(list, t).size() > 0 ? true : false; return getChildList(list, t).size() > 0 ? true : false;
} }

@ -1,5 +1,6 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
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;
@ -14,6 +15,7 @@ import com.op.quality.domain.QcProCheck;
import com.op.quality.mapper.QcCheckTaskIncomeMapper; import com.op.quality.mapper.QcCheckTaskIncomeMapper;
import com.op.quality.mapper.QcProCheckMapper; import com.op.quality.mapper.QcProCheckMapper;
import com.op.quality.service.QcProCheckService; import com.op.quality.service.QcProCheckService;
import com.op.system.api.domain.SysDictData;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -127,4 +129,10 @@ public class QcProCheckServiceImpl implements QcProCheckService {
return qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail); return qcCheckTaskIncomeMapper.getCkeckProjectList(qcCheckTaskDetail);
} }
@Override
@DS("master")
public List<SysDictData> getQcUnitList(SysDictData sysDictData) {
return qcCheckTaskIncomeMapper.getQcUnitList(sysDictData);
}
} }

@ -1,4 +1,4 @@
package com.op.quality.service.serviceImpl; package com.op.quality.service.impl;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -20,7 +20,7 @@ import javax.servlet.http.HttpServletRequest;
/** /**
* Service * Service
* *
* @author Open Platform * @author Open Platform
* @date 2023-10-09 * @date 2023-10-09
*/ */
@ -35,7 +35,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
/** /**
* *
* *
* @param userCode * @param userCode
* @return * @return
*/ */
@ -53,7 +53,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
/** /**
* *
* *
* @param qcUserMaterial * @param qcUserMaterial
* @return * @return
*/ */
@ -65,7 +65,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
/** /**
* *
* *
* @param qcUserMaterial * @param qcUserMaterial
* @return * @return
*/ */
@ -105,7 +105,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
/** /**
* *
* *
* @param qcUserMaterial * @param qcUserMaterial
* @return * @return
*/ */
@ -118,7 +118,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
/** /**
* *
* *
* @param userCodes * @param userCodes
* @return * @return
*/ */
@ -130,7 +130,7 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
/** /**
* *
* *
* @param qcUserMaterial * @param qcUserMaterial
* @return * @return
*/ */

@ -131,7 +131,6 @@ 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, td.belong_to belongTo,
qctp.upper_diff upperDiff, qctp.upper_diff upperDiff,
qctp.down_diff downDiff, qctp.down_diff downDiff,
@ -140,8 +139,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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} and td.del_flag='0' and qctp.del_flag = '0' where td.belong_to = #{belongTo} and td.del_flag='0' and qctp.del_flag = '0'
</select> </select>
<select id="getQcUnitList" resultType="com.op.system.api.domain.SysDictData">
select dict_label dictLabel,
dict_value dictValue
from sys_dict_data
where dict_type = 'unit'
and status = '0'
</select>
<insert id="insertQcCheckTaskIncome" parameterType="QcCheckTaskIncome"> <insert id="insertQcCheckTaskIncome" parameterType="QcCheckTaskIncome">
insert into qc_check_task insert into qc_check_task
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recordId != null">record_id,</if> <if test="recordId != null">record_id,</if>
@ -258,14 +264,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<foreach collection="list" item="item" separator=";"> <foreach collection="list" item="item" separator=";">
update qc_check_task_detail update qc_check_task_detail
set set
zh_desc = #{item.name1}, actual_value = #{item.actualValue},
contact_phone = #{item.telf1}, status = #{item.status},
address = #{item.stras}, update_by = #{item.updateBy},
factory_code = #{item.bukrs}, update_time = #{item.updateTime}
create_time= #{item.erdat},
update_time = #{item.erdat}
where where
supplier_code = #{item.lifnr} record_id = #{item.recordId}
</foreach> </foreach>
</update> </update>

@ -26,7 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectQcCheckTypeProjectVo"> <sql id="selectQcCheckTypeProjectVo">
select id, project_id, type_id, standard_value, upper_diff, down_diff, sample, status, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag, group_id, material_code, sample_num from qc_check_type_project select id, project_id, type_id, standard_value, upper_diff, down_diff, sample, status, attr1,
create_by, create_time, update_by, update_time, factory_code, del_flag, group_id, material_code, sample_num
from qc_check_type_project
</sql> </sql>
<select id="selectQcCheckTypeProjectList" parameterType="QcCheckTypeProject" resultMap="QcCheckTypeProjectResult"> <select id="selectQcCheckTypeProjectList" parameterType="QcCheckTypeProject" resultMap="QcCheckTypeProjectResult">
@ -137,7 +139,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and qctp.type_id = #{typeId} and qctp.type_id = #{typeId}
order by qctp.sort order by qctp.sort
</select> </select>
<select id="getCheckTypeProjectList" resultType="com.op.quality.domain.QcCheckTypeProject">
SELECT
ctp.id,
ctp.project_id projectId,
cp.rule_name ruleName,
cp.property_code propertyCode,
ctp.type_id typeId,
ct.check_name,
ctp.standard_value standardValue,
ctp.upper_diff upperDiff,
ctp.down_diff downDiff,
qcp.unit_code unitCode,
ctp.sample,
ctp.material_code materialCode,
p.product_desc_zh materialName,
qcp.check_tool checkTool,
qcp.check_mode checkMode
FROM qc_check_type_project ctp
LEFT JOIN qc_check_project cp ON ctp.project_id = cp.id
left join qc_check_type ct on ct.id = ctp.type_id
left join base_product p on p.product_code = ctp.material_code
<where>
AND ctp.del_flag = '0' AND cp.del_flag = '0'
<if test="groupId != null and groupId != ''"> and ctp.group_id = #{groupId}</if>
</where>
order by ctp.type_id
</select>
<select id="getDictMap" resultType="com.op.system.api.domain.SysDictData">
select dict_label dictLabel,
dict_value dictValue
from sys_dict_data where dict_type = #{dictType} and status = '0'
</select>
<insert id="insertQcCheckTypeProject" parameterType="QcCheckTypeProject"> <insert id="insertQcCheckTypeProject" parameterType="QcCheckTypeProject">
insert into qc_check_type_project insert into qc_check_type_project
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

@ -248,12 +248,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qct.material_code, qct.material_name, qct.quality, qct.unit, qct.material_code, qct.material_name, qct.quality, qct.unit,
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, 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.check_status, qct.check_man_code,qct.check_man_name, qct.check_time, qct.check_result,
qct.status,qct.create_by,qct.create_time qct.status,qct.create_by,qct.create_time,qct.check_type
from qc_check_task qct from qc_check_task qct
<where> <where>
and qct.del_flag = '0' and qct.del_flag = '0'
<if test="checkType != null and checkType != ''"> and qct.check_type = #{checkType}</if> <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> <if test="checkManCode != null and checkManCode != ''"> and qct.check_man_code = #{checkManCode}</if>
<if test="checkStatus != null and checkStatus != ''"> and qct.check_status in (#{checkStatus})</if>
</where> </where>
order by qct.create_time desc order by qct.create_time desc
</select> </select>

@ -2,8 +2,8 @@ package com.op.sap.service;
import com.op.common.core.domain.R; import com.op.common.core.domain.R;
import com.op.sap.domain.vo.SapCloseOrderQuery;
import com.op.sap.domain.vo.SapPurchaseOrderQuery; import com.op.sap.domain.vo.SapPurchaseOrderQuery;
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapCreateOrder;
import com.op.system.api.domain.sap.SapRFW; import com.op.system.api.domain.sap.SapRFW;
import com.op.system.api.domain.sap.SapShopOrderQuery; import com.op.system.api.domain.sap.SapShopOrderQuery;

@ -7,11 +7,11 @@ 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.utils.uuid.IdUtils; import com.op.common.core.utils.uuid.IdUtils;
import com.op.sap.domain.vo.SapCloseOrderQuery;
import com.op.sap.domain.vo.SapPurchaseOrderQuery; import com.op.sap.domain.vo.SapPurchaseOrderQuery;
import com.op.sap.service.SapOrderService; import com.op.sap.service.SapOrderService;
import com.op.sap.util.SAPConnUtils; import com.op.sap.util.SAPConnUtils;
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapCreateOrder; import com.op.system.api.domain.sap.SapCreateOrder;
import com.op.system.api.domain.sap.SapRFW; import com.op.system.api.domain.sap.SapRFW;
import com.op.system.api.domain.sap.SapShopOrderQuery; import com.op.system.api.domain.sap.SapShopOrderQuery;

Loading…
Cancel
Save