Merge remote-tracking branch 'origin/master'

# Conflicts:
#	op-modules/op-sap/src/main/java/com/op/sap/service/SapOrderService.java
#	op-modules/op-sap/src/main/java/com/op/sap/service/impl/SapOrderServiceImpl.java
master
mengjiao 1 year ago
commit 74032decd5

@ -30,4 +30,7 @@ public interface RemoteDeviceService {
@PostMapping("/deviceTask/createEquipmentOperationTask")
public R createEquipmentOperationTask();
@PostMapping("/deviceTask/equipmentBKTask")
public R equipmentBKTask();
}

@ -128,6 +128,10 @@ public class QcCheckTaskProduceDTO extends BaseEntity {
private String checkTimeEnd;
private String typeCode;
private String checkType;
private String carName;
private String carCode;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date produceDate;
@Excel(name = "抽样数量")
private BigDecimal sampleQuality;
@ -144,6 +148,30 @@ public class QcCheckTaskProduceDTO extends BaseEntity {
@Excel(name = "C类不合格数量")
private BigDecimal cNoOkquality;
public Date getProduceDate() {
return produceDate;
}
public void setProduceDate(Date produceDate) {
this.produceDate = produceDate;
}
public String getCarName() {
return carName;
}
public void setCarName(String carName) {
this.carName = carName;
}
public String getCarCode() {
return carCode;
}
public void setCarCode(String carCode) {
this.carCode = carCode;
}
public BigDecimal getaNoOkquality() {
return aNoOkquality;
}

@ -0,0 +1,258 @@
package com.op.system.api.domain.quality;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* qc_user_material
*
* @author Open Platform
* @date 2023-10-09
*/
public class QcUserMaterialDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** id */
private String id;
/** 员工编码 */
@Excel(name = "员工编码")
private String userCode;
/** 员工名称 */
@Excel(name = "员工名称")
private String userName;
/** 物料编码 */
@Excel(name = "物料编码")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 预留字段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;
/** 删除标识1删除0正常 */
private String delFlag;
/** 编号 */
private String userId;
/** 手机号 */
private String phonenumber;
private String email;
private String materialNames;
/** 状态 */
private String status;
private String materialId;
private String[] userCodes;
private String label;
private String key;
private List<String> selectedValues;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getUserCode() {
return userCode;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserName() {
return userName;
}
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 setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getMaterialNames() {
return materialNames;
}
public void setMaterialNames(String materialNames) {
this.materialNames = materialNames;
}
public String getMaterialId() {
return materialId;
}
public void setMaterialId(String materialId) {
this.materialId = materialId;
}
public String[] getUserCodes() {
return userCodes;
}
public void setUserCodes(String[] userCodes) {
this.userCodes = userCodes;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public List<String> getSelectedValues() {
return selectedValues;
}
public void setSelectedValues(List<String> selectedValues) {
this.selectedValues = selectedValues;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userCode", getUserCode())
.append("userName", getUserName())
.append("materialCode", getMaterialCode())
.append("materialName", getMaterialName())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("userId", getUserId())
.append("phonenumber", getPhonenumber())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.append("delFlag", getDelFlag())
.toString();
}
}

@ -42,6 +42,11 @@ public class RemoteDeviceFallbackFactory implements FallbackFactory<RemoteDevice
public R createEquipmentOperationTask() {
return R.fail("设备运行记录生成失败:" + throwable.getMessage());
}
@Override
public R equipmentBKTask() {
return R.fail("设备运行记录数据库备份失败"+throwable.getMessage());
}
};
}
}

@ -76,4 +76,17 @@ public class DeviceTaskController {
}
return R.fail("设备运行记录生成失败");
}
/**
*
* @return
*/
@PostMapping("/equipmentBKTask")
public R equipmentBKTask() {
AjaxResult result = taskService.equipmentBKTask();
if (result.isSuccess()){
return R.ok("设备运行记录数据库备份成功");
}
return R.fail("设备运行记录数据库备份失败");
}
}

@ -66,4 +66,7 @@ public interface DeviceInterfaceMapper {
* @return
*/
List<Map<String, Integer>> selectEquipmentFaultNumForMonth(String groupCode);
// 通过设备编码获取设备运行记录
Map<String, Double> selectSumEquipmentOperation(String equipmentCode);
}

@ -5,7 +5,8 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.device.domain.EquOperation;
import com.op.device.domain.EquOperationRecord;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
@ -73,4 +74,16 @@ public interface EquOperationMapper {
// 校验当天运行记录数量
int checkInsertOperation();
// 获取当前YEAR-2的备份表的运行数据第一条
EquOperation checkBackupOperation();
// 获取备份插入数据数量
int getBackupOperationNum();
// 分批次备份
int backupOperation(@Param("startIndex") int startIndex,@Param("batchSize") int batchSize);
// 分批次删除
int deleteOperation(@Param("delSize") int delSize);
}

@ -19,4 +19,6 @@ public interface IDeviceTaskService {
AjaxResult createMaintenancePlanTask();
AjaxResult createEquipmentOperationTask();
AjaxResult equipmentBKTask();
}

@ -32,6 +32,8 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
private DeviceInterfaceMapper deviceInterfaceMapper;
@Autowired
private EquOperationRecordMapper equOperationRecordMapper;
@Autowired
private EquOperationMapper equOperationMapper;
/**
*
@ -64,64 +66,6 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
public AjaxResult getEquipmentInfo() {
// 获取所有设备信息
List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectEquipmentList();
for (IEquipmentVO equipmentVO : equipmentVOList) {
// 设备状态
if (equipmentVO.getEquipmentStatus().equals("1")) {
equipmentVO.setEquipmentStatus("正常");
} else {
equipmentVO.setEquipmentStatus("停用");
}
/* 停机故障率逻辑 */
double totalTime = 0;// 运行总时间
double downTime = 0;// 停机时间
// 通过设备编码获取运行记录中的运行记录List
List<EquOperationRecord> operationRecordList = equOperationRecordMapper.selectEquOperationRecordByEquipmentCode(equipmentVO.getEquipmentCode());
if (operationRecordList.size() != 0) {
for (EquOperationRecord operationRecord : operationRecordList) {
// 运行时间差值
double diffTime = operationRecord.getEndTime().getTime() - operationRecord.getStartTime().getTime();
// 开机运行时间运行总时间累加
if (operationRecord.getType().equals("on")) {
totalTime += diffTime;
}
// 维修停机时间累加(故障)
if (operationRecord.getMaintenanceType().equals("repair")) {
downTime += diffTime;
}
}
// 设置停机故障率
if (downTime == 0L) {
// 如果未查到该设备停机故障时间
equipmentVO.setFailureRate(0D);
} else {
// 计算故障停机率(设备停机时间总和/一定时间内运行总时间(年))
double failureRate = downTime / totalTime;
System.out.println(failureRate);
equipmentVO.setFailureRate(failureRate);
}
}
/* 设备有效利用率逻辑(每月) */
// 查询该设备下报工单信息(年月日可在该sql中修改)
MesReportWork reportWork = deviceInterfaceMapper.selectReportWorkByEquipmentCode(equipmentVO.getEquipmentCode());
if (reportWork != null) {
BigDecimal theoryQuantity = reportWork.getQuantity();// 理论产量
BigDecimal actualQuantity = reportWork.getQuantityFeedback();// 实际产量
// 计算该设备有效利用率(实际产量/理论产量)
BigDecimal utilizationRatio = actualQuantity.divide(theoryQuantity, 2, BigDecimal.ROUND_HALF_UP);
equipmentVO.setUtilizationRatio(utilizationRatio.doubleValue());
} else {
// 如果未查到该信息则默认设置为0
equipmentVO.setUtilizationRatio(0D);
}
}
return success(equipmentVOList);
}
@ -204,6 +148,7 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
@DS("#header.poolName")
public AjaxResult getEquipmentIntactRate(EquOperation equOperation) {
//查询所有设备(设备停用的除外)
// CAST(SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END)*100.00/COUNT(*) as decimal(18,2)) AS intactRate
EquOperation equipmentIntactRate = deviceInterfaceMapper.getEquipmentIntactRate(equOperation);
return success(equipmentIntactRate);
}

@ -366,7 +366,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
equ.setStatus("1");
equOrderMapper.updateEquipmentStatus(equ);
// 更新设备运行记录
updateOperationRecord(equOrder.getEquipmentCode(),"on","");
// updateOperationRecord(equOrder.getEquipmentCode(),"on","");
//上传附件
if (StringUtils.isNotEmpty(equOrder.getPicturePath())) {
String[] ids = equOrder.getPicturePath().split(",");
@ -501,20 +501,20 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
Equipment equ = new Equipment();
equ.setEquipmentCode(order.getEquipmentCode());
// 运行记录类型
String operationType;
// 停机保养
if (pdadto.getShutDown().equals("1")){
operationType = "off";
}else {
operationType = "on";
}
// String operationType;
// // 停机保养
// if (pdadto.getShutDown().equals("1")){
// operationType = "off";
// }else {
// operationType = "on";
// }
// 更改设备状态为保养中
equ.setStatus("3");
equOrderMapper.updateEquipmentStatus(equ);
// 更新设备运行记录
updateOperationRecord(order.getEquipmentCode(),operationType,"upkeep");
// updateOperationRecord(order.getEquipmentCode(),operationType,"upkeep");
// 设置开始时间
order.setOrderStart(DateUtils.getNowDate());

@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -210,6 +211,39 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
return success();
}
/**
*
* @return
*/
@Override
public AjaxResult equipmentBKTask() {
// 加载sf-cloud库的sys_datasource
SysUser sysUser = new SysUser();
sysUser.setUserId(1L);
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
List<Map<String, String>> dateSources = dateSources0.getData();
ExecutorService executorService = new ThreadPoolExecutor(
dateSources.size(),
dateSources.size(),
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>());
try {
dateSources.forEach(dateSource -> {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++设备运行记录数据库备份开始++++++++++");
Runnable run = () -> backupEquipmentOperation(dateSource.get("poolName"));
executorService.execute(run);
});
} catch (Exception e) {
logger.error("service == dataClearTask == exception", e);
return error("service == dataClearTask == exception");
} finally {
executorService.shutdown();
}
return success();
}
public void createSpotCheckPlanFunc(String poolName){
DynamicDataSourceContextHolder.push(poolName);// 这是数据源的key
/**equ_plan equ_plan_equ**/
@ -431,7 +465,7 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
operation.setCreateTime(DateUtils.getNowDate());
}
int batchSize = 200;// 批次数量
int batchSize = 100;// 批次数量
// 分批次处理
int batchCount = (operationList.size() + batchSize - 1)/batchSize;// 计算批次数量
@ -442,7 +476,7 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
List<EquOperation> subList = operationList.subList(startIndex,endIndex);
int num = equOperationMapper.insertEquOperationByBatch(subList);
System.out.println("数据源:"+poolName+"--->"+"第"+i+"轮"+"开始索引:"+startIndex+"________结束索引:"+endIndex+"________成功插入数量:"+num);
System.out.println("数据源:"+poolName+"--->"+"第"+(i+1)+"轮"+"开始索引:"+startIndex+"________结束索引:"+endIndex+"________成功插入数量:"+num);
}
}else {
System.out.println("数据源:"+poolName+"当天生成过运行记录");
@ -450,6 +484,40 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService {
}
private void backupEquipmentOperation(String poolName) {
DynamicDataSourceContextHolder.push(poolName);// 这是数据源的key
// 校验当前YEAR-2是否备份过数据
EquOperation check = equOperationMapper.checkBackupOperation();
if (check == null) {
// 获取插入数量
int insertNum = equOperationMapper.getBackupOperationNum();
int insertSize = 100;// 新增批次数量
// 分批次备份
int batchCount = (insertNum + insertSize - 1)/insertSize;// 计算批次数量
for (int i = 0;i < batchCount; i++) {
int startIndex = i * insertSize;// 索引开始值
int endIndex = Math.min((i + 1)*insertSize,insertNum);// 索引结束值
// 备份至数据库
int num = equOperationMapper.backupOperation(startIndex,insertSize);
System.out.println("数据源:"+poolName+"--->"+"第"+(i+1)+"轮备份"+"开始索引:"+startIndex+"________结束索引:"+endIndex+"________成功插入数量:"+num);
}
// 删除源数据库数据
int delSize = 100;// 删除批次数量
for (int i = 0; i < insertNum/delSize+1; i++) {
// 在源数据库中删除
int num = equOperationMapper.deleteOperation(delSize);
System.out.println("数据源:"+poolName+"--->"+"第"+(i+1)+"轮删除"+"------>成功删除数量:"+num);
}
}else {
System.out.println("数据源:"+poolName+"---->"+"年份:"+( LocalDate.now().getYear()-2) +"--->已备份");
}
}
public static void main(String[] args) {
int batchSize = 200;// 批次数量

@ -21,13 +21,22 @@
</select>
<select id="selectEquipmentList" resultType="com.op.device.domain.vo.IEquipmentVO">
select be.equipment_code AS 'equipmentCode', be.equipment_name AS 'equipmentName',be.equipment_status AS 'equipmentStatus'
select be.equipment_code AS 'equipmentCode', be.equipment_name AS 'equipmentName',be.equipment_status AS 'equipmentStatus', (SELECT ROUND(
SUM(CAST(fault_time AS FLOAT)) /
SUM(CAST(actual_operation_time AS FLOAT)),
2)
FROM equ_operation
WHERE equipment_code = be.equipment_code) AS 'failureRate', (
SELECT ROUND(SUM(mrw.quantity_feedback) / SUM(mrw.quantity), 2)
FROM mes_report_work mrw
WHERE mrw.del_flag = '0'
AND mrw.status = 'PREPARE'
AND mrw.machine_code = be.equipment_code
AND mrw.feedback_time >= DATEADD(MONTH, -1, GETDATE())
) AS 'utilizationRatio'
from base_equipment be
where be.equipment_code in (select wo.equipment_code
from equ_repair_work_order wo
where wo.del_flag = '0'
and wo.work_status = '1'
GROUP BY wo.equipment_code)
where be.del_flag = '0'
and be.equipment_category = '0'
</select>
<select id="selectRepairEquipmentList" resultType="com.op.device.domain.vo.IEquipmentVO">
@ -78,10 +87,19 @@
<!--完好设备占比-->
<select id="getEquipmentIntactRate" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation">
SELECT
SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END) AS operationEquipment,
SUM(CASE WHEN equipment_status = '0' or equipment_status = '2' THEN 1 Else 0 END) AS faultEquipment,
COUNT(*) AS totalEquipment,
CAST(SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END)*100.00/COUNT(*) as decimal(18,2)) AS intactRate
SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END) AS operationEquipment,
SUM(CASE WHEN equipment_status = '0' or equipment_status = '2' THEN 1 Else 0 END) AS faultEquipment,
COUNT(*) AS totalEquipment,
(
SELECT COUNT(id)
FROM equ_operation
WHERE '4%' > failure_rate AND CONVERT(date, create_time) = CONVERT(date, GETDATE())
)*100 /
(
SELECT COUNT(id)
FROM equ_operation
WHERE CONVERT(date, create_time) = CONVERT(date, GETDATE())
) AS intactRate
FROM base_equipment
WHERE del_flag = '0' AND status = '1'
</select>
@ -105,4 +123,12 @@
ORDER BY MONTH (eo.create_time)
</select>
<select id="selectSumEquipmentOperation" resultType="java.util.Map">
SELECT
SUM(CAST(actual_operation_time AS FLOAT)) AS actualOperationTime,
SUM(CAST(fault_time AS FLOAT)) AS faultTime
FROM equ_operation
WHERE equipment_code = #{equipmentCode};
</select>
</mapper>

@ -89,6 +89,7 @@
<if test="createTimeStart != null "> and CONVERT(date,create_time) >= #{createTimeStart}</if>
<if test="createTimeEnd != null "> and #{createTimeEnd} >= CONVERT(date,create_time)</if>
</where>
order by CAST(create_time AS DATE) desc,group_line
</select>
<select id="selectEquOperationById" parameterType="String" resultMap="EquOperationResult">
@ -119,6 +120,14 @@
where CONVERT(date, create_time) = CONVERT(date, GETDATE())
</select>
<select id="checkBackupOperation" resultMap="EquOperationResult">
select top 1 id from equ_operation_backup where YEAR(create_time) = YEAR(GETDATE())-2
</select>
<select id="getBackupOperationNum" resultType="java.lang.Integer">
select count(id) from equ_operation where YEAR(create_time) = YEAR(GETDATE())-2
</select>
<insert id="insertEquOperation" parameterType="EquOperation">
insert into equ_operation
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -188,6 +197,15 @@
</foreach>
</insert>
<insert id="backupOperation">
insert into equ_operation_backup
select s.*
from equ_operation s
where YEAR (s.create_time) = YEAR (GETDATE())-2
ORDER BY id
OFFSET #{startIndex} ROWS FETCH NEXT #{batchSize} ROWS ONLY
</insert>
<update id="updateEquOperation" parameterType="EquOperation">
update equ_operation
<trim prefix="SET" suffixOverrides=",">
@ -230,4 +248,12 @@
#{id}
</foreach>
</delete>
<delete id="deleteOperation">
delete
from equ_operation
where id in (select s.id from equ_operation s where YEAR (s.create_time) = YEAR (GETDATE())-2
ORDER BY id
OFFSET 0 ROWS FETCH NEXT #{delSize} ROWS ONLY)
</delete>
</mapper>

@ -144,4 +144,10 @@ public class RyTask {
logger.info("++设备运行记录生成任务开始++createEquipmentOperationTask+++++");
remoteDeviceService.createEquipmentOperationTask();
}
/** 每年1月1日150执行 **/
public void equipmentBKTask(){
logger.info("++设备运行记录+数据库备份的数据+开始++equipmentBkTask+++++");
remoteDeviceService.equipmentBKTask();
}
}

@ -83,7 +83,7 @@ public class OpenController extends BaseController {
}
/**创建生产过程(烘房 首检)检验*/
@PostMapping(value = "createCheckProduceTask")
@PostMapping(value = "/createCheckProduceTask")
public AjaxResult createCheckProduceTask(@RequestBody QcCheckTaskProduceDTO qcCheckTaskProduce) {
if(StringUtils.isBlank(qcCheckTaskProduce.getIncomeBatchNo())){
return error("[IncomeBatchNo]不能为空");

@ -7,10 +7,7 @@ import com.op.system.api.domain.mes.MesReportWorkConsumeDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.system.api.domain.quality.QcCheckTaskDetailDTO;
import com.op.system.api.domain.quality.QcCheckTaskProduceDTO;
import com.op.system.api.domain.quality.QcCheckTypeProjectDTO;
import com.op.system.api.domain.quality.QcMaterialGroupDetailDTO;
import com.op.system.api.domain.quality.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -78,5 +75,7 @@ public interface OpenMapper {
void insertQcCheckTaskProduce(QcCheckTaskProduceDTO qcCheckTaskProduce);
public int addBatch(@Param("list") List<QcCheckTaskDetailDTO> items);
QcUserMaterialDTO getUserByMaterial(String materialCode);
}

@ -23,10 +23,7 @@ import com.op.system.api.domain.mes.MesReportWorkConsumeDTO;
import com.op.system.api.domain.mes.MesReportWorkDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.mes.ProRfidProcessDetail;
import com.op.system.api.domain.quality.QcCheckTaskDetailDTO;
import com.op.system.api.domain.quality.QcCheckTaskProduceDTO;
import com.op.system.api.domain.quality.QcCheckTypeProjectDTO;
import com.op.system.api.domain.quality.QcMaterialGroupDetailDTO;
import com.op.system.api.domain.quality.*;
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapRFW;
import org.apache.commons.lang.StringUtils;
@ -305,6 +302,17 @@ public class OpenServiceImpl implements OpenService {
QcCheckTypeProjectDTO qctp= new QcCheckTypeProjectDTO();
qctp.setTypeId(qcCheckTaskProduce.getCheckType());//生产过程检验
qctp.setMaterialCode(qcCheckTaskProduce.getMaterialCode());//特性
/**qc_user_material取默认检查人**/
QcUserMaterialDTO qcUserMaterialDTO = openMapper.getUserByMaterial(qcCheckTaskProduce.getMaterialCode());
if(qcUserMaterialDTO == null){
qcCheckTaskProduce.setCheckManCode("mobile");
qcCheckTaskProduce.setCheckManName("手持测试用户");
}else{
qcCheckTaskProduce.setCheckManCode(qcUserMaterialDTO.getUserCode());
qcCheckTaskProduce.setCheckManName(qcUserMaterialDTO.getUserName());
}
/**qc_check_type_project**/
List<QcCheckTaskDetailDTO> items = openMapper.getTPByTypeMaterial(qctp);
if(CollectionUtils.isEmpty(items)){
@ -328,6 +336,9 @@ public class OpenServiceImpl implements OpenService {
qcCheckTaskProduce.setFactoryCode(factoryCode);
qcCheckTaskProduce.setCreateTime(nowDate);
qcCheckTaskProduce.setTypeCode("produce");//大检验节点
qcCheckTaskProduce.setIncomeTime(qcCheckTaskProduce.getProduceDate());
qcCheckTaskProduce.setSupplierCode(qcCheckTaskProduce.getCarCode());
qcCheckTaskProduce.setSupplierName(qcCheckTaskProduce.getCarName());
openMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
/**qc_check_task_detail**/
for(QcCheckTaskDetailDTO item:items){

@ -195,6 +195,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and qctp.type_id = #{typeId}
order by qctp.sort
</select>
<select id="getUserByMaterial" resultType="com.op.system.api.domain.quality.QcUserMaterialDTO">
select top 1 user_code userCode,
user_name userName
from qc_user_material where material_code = #{materialCode}
order by create_time desc
</select>
<insert id="insertEquRepairOrder" parameterType="DeviceRepairOrder">
insert into equ_repair_order

@ -33,7 +33,7 @@ public class ProOrderWorkorder extends TreeEntity {
private String orderId;
/** 订单编码 */
@Excel(name = "子订单编码")
@Excel(name = "子订单编码")
private String orderCode;
/** 产品ID */
@ -211,7 +211,7 @@ public class ProOrderWorkorder extends TreeEntity {
}
private String prepareId;
@Excel(name = "子订单新编号")
private String workorderCodeSap;
/** 批次号 */
@ -219,9 +219,39 @@ public class ProOrderWorkorder extends TreeEntity {
private List<StringBuilder> batchNumList;
private List<String> batchInfo;
private String pproductCode;
@Excel(name = "母产品名称")
private String pproductName;
@Excel(name = "母订单新编号")
private String pworkorderCodeSap;
/** $column.columnComment */
private String factoryCode;
public String getPproductCode() {
return pproductCode;
}
public void setPproductCode(String pproductCode) {
this.pproductCode = pproductCode;
}
public String getPproductName() {
return pproductName;
}
public void setPproductName(String pproductName) {
this.pproductName = pproductName;
}
public String getPworkorderCodeSap() {
return pworkorderCodeSap;
}
public void setPworkorderCodeSap(String pworkorderCodeSap) {
this.pworkorderCodeSap = pworkorderCodeSap;
}
public List<String> getBatchInfo() {
return batchInfo;
}

@ -166,5 +166,6 @@ public interface ProOrderWorkorderMapper {
int updateWhiteWorkOrder(ProOrderWorkorder whiteOrder);
ProOrderWorkorder getPWorkOrder(ProOrderWorkorder whiteOrder);
}

@ -38,6 +38,11 @@
<result property="endFlag" column="end_flag" />
<result property="carNum" column="car_num" />
<result property="sortNo" column="sort_no" />
<result property="workorderCodeSap" column="workorder_code_sap" />
<result property="pproductCode" column="pproductCode" />
<result property="pproductName" column="pproductName" />
<result property="pworkorderCodeSap" column="pworkorderCodeSap" />
</resultMap>
<sql id="selectProOrderWorkorderVo">
@ -49,37 +54,33 @@
</sql>
<select id="selectProOrderWorkorderList" parameterType="ProOrderWorkorder" resultMap="ProOrderWorkorderResult">
<include refid="selectProOrderWorkorderVo"/>
select pow.workorder_id, pow.workorder_code, pow.workorder_name, pow.order_id, pow.order_code,
pow.product_code, pow.product_name,pow.product_spc, pow.unit, pow.quantity_split,
pow.route_code, pow.prod_line_code, pow.product_date,
pow.shift_id, pow.parent_order,pow.status, pow.prod_type,pow.factory_code,
pow.end_flag,pow.car_num,pow.sort_no,
pow.workorder_code_sap,
ppow.product_code pproductCode,ppow.product_name pproductName,pow.workorder_code_sap pworkorderCodeSap
from pro_order_workorder pow
left join pro_order_workorder ppow on pow.parent_order = ppow.workorder_code
<where>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="workorderName != null and workorderName != ''"> and workorder_name like concat('%', #{workorderName}, '%')</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="productSpc != null and productSpc != ''"> and product_spc = #{productSpc}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="quantityProduced != null "> and quantity_produced = #{quantityProduced}</if>
<if test="quantitySplit != null "> and quantity_split = #{quantitySplit}</if>
<if test="routeCode != null and routeCode != ''"> and route_code = #{routeCode}</if>
<if test="prodLineCode != null and prodLineCode != ''"> and prod_line_code = #{prodLineCode}</if>
<if test="productDate != null "> and product_date = #{productDate}</if>
<if test="shiftId != null and shiftId != ''"> and shift_id = #{shiftId}</if>
<if test="parentOrder != null and parentOrder != ''"> and parent_order = #{parentOrder}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="statusArray != null and statusArray != ''"> and status in (${statusArray})</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
<if test="prodType != null and prodType != ''"> and prod_type = #{prodType}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="endFlag != null and endFlag != ''"> and end_flag = #{endFlag}</if>
<if test="productDateStart != null "> and CONVERT(varchar(10),product_date, 120) >= '${productDateStart}'</if>
<if test="productDateEnd != null "> and '${productDateEnd}%' >= CONVERT(varchar(10),product_date, 120)</if>
and del_flag = '0'
<if test="workorderCode != null and workorderCode != ''"> and pow.workorder_code like concat('%', #{workorderCode}, '%')</if>
<if test="workorderName != null and workorderName != ''"> and pow.workorder_name like concat('%', #{workorderName}, '%')</if>
<if test="orderId != null and orderId != ''"> and pow.order_id = #{orderId}</if>
<if test="orderCode != null and orderCode != ''"> and pow.order_code like concat('%', #{orderCode}, '%')</if>
<if test="productCode != null and productCode != ''"> and pow.product_code like concat('%', #{productCode}, '%')</if>
<if test="productName != null and productName != ''"> and pow.product_name like concat('%', #{productName}, '%')</if>
<if test="productDate != null "> and pow.product_date = #{productDate}</if>
<if test="shiftId != null and shiftId != ''"> and pow.shift_id = #{shiftId}</if>
<if test="parentOrder != null and parentOrder != ''"> and pow.parent_order = #{parentOrder}</if>
<if test="status != null and status != ''"> and pow.status = #{status}</if>
<if test="statusArray != null and statusArray != ''"> and pow.status in (${statusArray})</if>
<if test="prodType != null and prodType != ''"> and pow.prod_type = #{prodType}</if>
<if test="factoryCode != null and factoryCode != ''"> and pow.factory_code = #{factoryCode}</if>
<if test="endFlag != null and endFlag != ''"> and pow.end_flag = #{endFlag}</if>
<if test="productDateStart != null "> and CONVERT(varchar(10),pow.product_date, 120) >= '${productDateStart}'</if>
<if test="productDateEnd != null "> and '${productDateEnd}' >= CONVERT(varchar(10),pow.product_date, 120)</if>
and pow.del_flag = '0'
</where>
</select>

@ -3,6 +3,7 @@ package com.op.quality.controller;
import com.op.common.core.utils.StringUtils;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import com.op.quality.domain.QcLineChartDto;
import com.op.quality.service.IQcInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -126,4 +127,10 @@ public class QcInterfaceController {
public List<QcInterface> getMonthOfYearContrast(@RequestBody QcInterface qcInterface) {
return qcInterfaceService.getMonthOfYearContrast(qcInterface);
}
@GetMapping("/getLineQcData")
public QcLineChartDto getLineQcData(QcInterface qcInterface) {
return qcInterfaceService.getLineQcData(qcInterface);
}
}

@ -45,6 +45,15 @@ public class QcCheckType extends BaseEntity {
private String delFlag;
private int taskNum;
private String checkManCode;
public String getCheckManCode() {
return checkManCode;
}
public void setCheckManCode(String checkManCode) {
this.checkManCode = checkManCode;
}
public int getTaskNum() {
return taskNum;

@ -47,6 +47,33 @@ public class QcInterface extends BaseEntity {
private List<String> data;
private String reasons;
private String typeCode;
private String productDateStart;
private String ProductDateEnd;
private String nameDate;
public String getNameDate() {
return nameDate;
}
public void setNameDate(String nameDate) {
this.nameDate = nameDate;
}
public String getProductDateStart() {
return productDateStart;
}
public void setProductDateStart(String productDateStart) {
this.productDateStart = productDateStart;
}
public String getProductDateEnd() {
return ProductDateEnd;
}
public void setProductDateEnd(String productDateEnd) {
ProductDateEnd = productDateEnd;
}
public String getTypeCode() {
return typeCode;

@ -0,0 +1,39 @@
package com.op.quality.domain;
import java.util.List;
/**
* echart
*
* @author Open Platform
* @date 2023-07-03
*/
public class QcLineChartDto {
private List<String> seriesNames;
private List<String> xAxisDatas;
private List<QcLineChartSeriesDto> seriesDatas;
public List<String> getSeriesNames() {
return seriesNames;
}
public void setSeriesNames(List<String> seriesNames) {
this.seriesNames = seriesNames;
}
public List<String> getxAxisDatas() {
return xAxisDatas;
}
public void setxAxisDatas(List<String> xAxisDatas) {
this.xAxisDatas = xAxisDatas;
}
public List<QcLineChartSeriesDto> getSeriesDatas() {
return seriesDatas;
}
public void setSeriesDatas(List<QcLineChartSeriesDto> seriesDatas) {
this.seriesDatas = seriesDatas;
}
}

@ -0,0 +1,48 @@
package com.op.quality.domain;
import java.util.List;
/**
* echart
*
* @author Open Platform
* @date 2023-07-03
*/
public class QcLineChartSeriesDto {
private String name;
private String type;
private String stack;
private List<String> data;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getStack() {
return stack;
}
public void setStack(String stack) {
this.stack = stack;
}
public List<String> getData() {
return data;
}
public void setData(List<String> data) {
this.data = data;
}
}

@ -79,5 +79,5 @@ public interface QcCheckUnqualifiedMapper {
List<QcCheckTaskIncome> getWorkOrder(QcCheckTaskIncome qcCheckTaskIncome);
int updateWorkOrderStatus(QcCheckTaskIncome qcCheckTaskIncome);
int updateWorkOrderBatchStatus(QcCheckTaskIncome qcCheckTaskIncome);
}

@ -41,4 +41,8 @@ public interface QcInterfaceMapper {
Map<String, QcInterface> getMothNoOkNum(QcInterface qcInterface);
List<QcCheckTaskDetail> getReasons(QcInterface dto);
List<String> getLineChartsNames(QcInterface qcInterface);
@MapKey("nameDate")
Map<String, QcInterface> getLineChartsDatas(QcInterface qcInterface);
}

@ -3,6 +3,7 @@ package com.op.quality.service;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcInterface;
import com.op.quality.domain.QcLineChartDto;
import java.util.List;
import java.util.Map;
@ -35,4 +36,6 @@ public interface IQcInterfaceService {
QcInterface getLineDayNoOk(QcInterface qcInterface);
List<QcInterface> getMonthOfYearContrast(QcInterface qcInterface);
QcLineChartDto getLineQcData(QcInterface qcInterface);
}

@ -285,9 +285,9 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
n = qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce);
/**pro_order_workorder-->status->w5**/
qcCheckTaskIncome.setStatus("w5");
qcCheckUnqualifiedMapper.updateWorkOrderStatus(qcCheckTaskIncome);
/**pro_order_workorder_batch-->qc_status->2**/
qcCheckTaskIncome.setStatus("2");
qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome);
}else if("product".equals(qcCheckTaskIncome.getTypeCode())){
QcCheckTaskWarehousing warehousing = new QcCheckTaskWarehousing();
warehousing.setCheckStatus("2");
@ -386,13 +386,16 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
qcCheckTask.setCheckResult(result);//检验结果Y合格 N不合格
BigDecimal noOkQquality = new BigDecimal("0");
if(qcCheckTaskIncome.getaNoOkquality()!=null){
noOkQquality.add(qcCheckTaskIncome.getaNoOkquality());
noOkQquality = noOkQquality.add(qcCheckTaskIncome.getaNoOkquality());
qcCheckTask.setaNoOkquality(qcCheckTaskIncome.getaNoOkquality());
}
if(qcCheckTaskIncome.getbNoOkquality()!=null){
noOkQquality.add(qcCheckTaskIncome.getbNoOkquality());
noOkQquality = noOkQquality.add(qcCheckTaskIncome.getbNoOkquality());
qcCheckTask.setbNoOkquality(qcCheckTaskIncome.getbNoOkquality());
}
if(qcCheckTaskIncome.getcNoOkquality()!=null){
noOkQquality.add(qcCheckTaskIncome.getcNoOkquality());
noOkQquality = noOkQquality.add(qcCheckTaskIncome.getcNoOkquality());
qcCheckTask.setcNoOkquality(qcCheckTaskIncome.getcNoOkquality());
}
if(qcCheckTask.getNoOkQuality()==null){
qcCheckTask.setNoOkQuality(noOkQquality);
@ -413,9 +416,9 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
qcCheckTaskIncome.setCheckResult(result.equals("Y")?"1":"2");
qcCheckUnqualifiedMapper.updateQualityStatus(qcCheckTaskIncome);
}else if("produce".equals(qcCheckTaskIncome.getTypeCode())){
/**pro_order_workorder-->status->w5**/
qcCheckTaskIncome.setStatus("w5");
qcCheckUnqualifiedMapper.updateWorkOrderStatus(qcCheckTaskIncome);
/**pro_order_workorder_batch-->status->w5**/
qcCheckTaskIncome.setStatus("2");
qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome);
}else if("product".equals(qcCheckTaskIncome.getTypeCode())){
}

@ -2,6 +2,7 @@ package com.op.quality.service.impl;
import java.util.List;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
@ -123,7 +124,8 @@ public class QcCheckTypeServiceImpl implements IQcCheckTypeService {
@Override
public List<QcCheckType> getTopTaskInfo(QcCheckType qcCheckType) {
DynamicDataSourceContextHolder.push(qcCheckType.getFactoryCode());// 这是数据源的key
return qcCheckTypeMapper.getTopTaskInfo(qcCheckType);
List<QcCheckType> dtos = qcCheckTypeMapper.getTopTaskInfo(qcCheckType);//检验任务
return dtos;
}
}

@ -1,10 +1,9 @@
package com.op.quality.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.quality.domain.QcCheckTaskDetail;
import com.op.quality.domain.QcInterface;
import com.op.quality.domain.QcProCheck;
import com.op.quality.domain.*;
import com.op.quality.mapper.QcInterfaceMapper;
import com.op.quality.service.IQcInterfaceService;
import org.apache.commons.lang.StringUtils;
@ -319,6 +318,53 @@ public class QcInterfaceServiceImpl implements IQcInterfaceService {
return dtos;
}
@Override
@DS("#header.poolName")
public QcLineChartDto getLineQcData(QcInterface qcInterface) {
QcLineChartDto lineChartDto = new QcLineChartDto();
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();
calendar.set(Calendar.DAY_OF_MONTH, 1);
Date firstDayOfMonth = calendar.getTime();
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String startTime = dateFormat.format(firstDayOfMonth);
String endTime = dateFormat.format(now);
qcInterface.setProductDateStart(startTime);
qcInterface.setProductDateEnd(endTime);
//图例名称
List<String> seriesNames = qcInterfaceMapper.getLineChartsNames(qcInterface);
lineChartDto.setSeriesNames(seriesNames);
//日期名称数组
List<String> xAxisDatas = getDays(startTime,endTime);
lineChartDto.setxAxisDatas(xAxisDatas);
Map<String,QcInterface> productdatas = qcInterfaceMapper.getLineChartsDatas(qcInterface);
//值
List<QcLineChartSeriesDto> seriesDatas = new ArrayList<>();
QcLineChartSeriesDto lineChartSeriesDto = null;
for(String productName:seriesNames){
lineChartSeriesDto = new QcLineChartSeriesDto();
lineChartSeriesDto.setName(productName);
lineChartSeriesDto.setType("line");
List<String> datas = new ArrayList<>();
for(String dayStr:xAxisDatas) {
QcInterface data0 = productdatas.get(productName + dayStr);
if (data0 != null) {
BigDecimal rate = new BigDecimal(data0.getNoOkQuality())
.multiply(new BigDecimal(100))
.divide(new BigDecimal(data0.getQuality()),2,BigDecimal.ROUND_HALF_UP);
datas.add(rate.toString());
} else {
datas.add("0");
}
}
lineChartSeriesDto.setData(datas);
seriesDatas.add(lineChartSeriesDto);
}
lineChartDto.setSeriesDatas(seriesDatas);
return lineChartDto;
}
/**两个日期之间的所有日期**/
public static List<String> getDays(String startTime,String endTime) {

@ -1,5 +1,7 @@
package com.op.quality.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -73,6 +75,10 @@ public class QcUserMaterialServiceImpl implements IQcUserMaterialService {
@Override
@DS("#header.poolName")
public int insertQcUserMaterial(QcUserMaterial qcUserMaterial) {
List<String> userCodes = new ArrayList<>();
userCodes.add(qcUserMaterial.getUserCode());
qcUserMaterial.setUserCodes(userCodes.toArray(new String[userCodes.size()]));
Date now = DateUtils.getNowDate();
if (StringUtils.isNotEmpty(qcUserMaterial.getUserCodes())) {
//删除之前的关联关系

@ -47,21 +47,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
count(0) taskNum,
'检验任务' attr1
from qc_check_task qct
left join qc_check_type qc on qct.check_type = qc.order_code
where qct.check_status = '0'
left join qc_check_type qc on qct.check_type = qc.order_code
where qct.check_status = '0' and qct.check_man_code = #{checkManCode}
group by qct.check_type,qc.check_name
union ALL
select qcu.type,
qc.check_name,
count(0) taskNum,
'不合格处理'
union all
select '','',
count(0) taskNum,
'不合格处理' attr1
from qc_check_unqualified qcu
left join qc_check_type qc on qcu.type = qc.order_code
where qcu.status != '2'
group by qcu.type,qc.check_name
left join qc_check_task qct on qcu.task_id = qct.record_id
where qcu.status != '2' and qct.check_man_code = #{checkManCode}
</select>
<insert id="insertQcCheckType" parameterType="QcCheckType">
insert into qc_check_type
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -186,8 +186,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update wms_raw_order_in set quality_status = #{checkResult}
where order_no = #{orderNo}
</update>
<update id="updateWorkOrderStatus">
update pro_order_workorder set status = #{status} where workorder_code_sap = #{orderNo}
<update id="updateWorkOrderBatchStatus">
update pro_order_workorder_batch set qc_status = #{status} where batch_code = #{incomeBatchNo}
</update>
<delete id="deleteQcCheckUnqualifiedById" parameterType="String">

@ -241,4 +241,23 @@
where belong_to = #{recordId}
and status = 'N' and del_flag='0'
</select>
<select id="getLineChartsNames" resultType="java.lang.String">
select
distinct supplier_name
from qc_check_task
where type_code = 'produce' and del_flag = '0'
and CONVERT(varchar(10),income_time, 120) >= #{productDateStart}
and #{productDateEnd} >= CONVERT(varchar(10),income_time, 120)
</select>
<select id="getLineChartsDatas" resultType="com.op.quality.domain.QcInterface">
select
sum(sample_quality) quality,
sum(noOk_quality) noOkQuality,
concat(supplier_name,CONVERT(varchar(10),income_time, 120)) nameDate
from qc_check_task
where type_code = 'produce' and del_flag = '0'
and CONVERT(varchar(10),income_time, 120) >= #{productDateStart}
and #{productDateEnd} >= CONVERT(varchar(10),income_time, 120)
group by supplier_name,CONVERT(varchar(10),income_time, 120)
</select>
</mapper>

@ -66,6 +66,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="factoryCode" column="factory_code" />
<result property="delFlag" column="del_flag" />
<result property="checkType" column="check_type" />
<result property="aNoOkquality" column="aNoOkquality" />
<result property="bNoOkquality" column="bNoOkquality" />
<result property="cNoOkquality" column="cNoOkquality" />
<result property="sampleQuality" column="sample_quality" />
</resultMap>
<sql id="selectQuaVo">
select id,rfid,factory_id,factory_code,order_id,machine_id,bad_meg,product_id,isqua,file_id,attr1,attr2,
@ -248,7 +253,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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,qct.check_type
qct.status,qct.create_by,qct.create_time,qct.check_type,
qct.noOk_quality,qct.aNoOkquality,qct.bNoOkquality,qct.cNoOkquality,qct.sample_quality
from qc_check_task qct
<where>
and qct.del_flag = '0'

@ -81,10 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and bp.product_code not in (
select um.material_code
from qc_user_material um
where um.user_code in
<foreach item="userCode" collection="userCodes" open="(" separator="," close=")">
#{userCode}
</foreach>
where um.user_code =#{userCode}
)
<if test="materialName != null and materialName != ''"> and bp.product_desc_zh like concat('%', #{materialName}, '%')</if>
</select>
@ -94,10 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
concat(bp.product_desc_zh,'(',bp.product_code,')') label
from qc_user_material um
left join base_product bp on um.material_code = bp.product_code
where um.user_code in
<foreach item="userCode" collection="userCodes" open="(" separator="," close=")">
#{userCode}
</foreach>
where um.user_code = #{userCode}
<if test="materialName != null and materialName != ''"> and bp.product_desc_zh like concat('%', #{materialName}, '%')</if>
</select>

@ -3,7 +3,6 @@ package com.op.sap.service;
import com.op.common.core.domain.R;
import com.op.sap.domain.vo.SapOrderReceiptQuery;
import com.op.system.api.domain.sap.SapPurchaseOrderQuery;//SapPurchaseOrderQuery
import com.op.system.api.domain.sap.*;
import com.op.system.api.model.SapProOrder;

@ -8,7 +8,6 @@ import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.sap.domain.vo.SapOrderReceiptQuery;
import com.op.sap.service.SapOrderService;
import com.op.system.api.domain.sap.*;

Loading…
Cancel
Save