|
|
@ -1,14 +1,25 @@
|
|
|
|
package com.op.quality.service.impl;
|
|
|
|
package com.op.quality.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
|
|
|
|
import com.op.common.security.utils.SecurityUtils;
|
|
|
|
|
|
|
|
import com.op.quality.domain.*;
|
|
|
|
|
|
|
|
import com.op.quality.mapper.QcCheckTaskDetailMapper;
|
|
|
|
|
|
|
|
import com.op.quality.mapper.QcCheckTypeProjectMapper;
|
|
|
|
|
|
|
|
import com.op.quality.mapper.QcMaterialGroupDetailMapper;
|
|
|
|
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.QcCheckTaskProduceMapper;
|
|
|
|
import com.op.quality.mapper.QcCheckTaskProduceMapper;
|
|
|
|
import com.op.quality.domain.QcCheckTaskProduce;
|
|
|
|
|
|
|
|
import com.op.quality.service.IQcCheckTaskProduceService;
|
|
|
|
import com.op.quality.service.IQcCheckTaskProduceService;
|
|
|
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
import org.springframework.web.context.request.RequestContextHolder;
|
|
|
|
|
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 生产过程检验任务Service业务层处理
|
|
|
|
* 生产过程检验任务Service业务层处理
|
|
|
@ -21,6 +32,15 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private QcCheckTaskProduceMapper qcCheckTaskProduceMapper;
|
|
|
|
private QcCheckTaskProduceMapper qcCheckTaskProduceMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private QcCheckTypeProjectMapper qcCheckTypeProjectMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private QcCheckTaskDetailMapper qcCheckTaskDetailMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询生产过程检验任务
|
|
|
|
* 查询生产过程检验任务
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -42,6 +62,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@DS("#header.poolName")
|
|
|
|
@DS("#header.poolName")
|
|
|
|
public List<QcCheckTaskProduce> selectQcCheckTaskProduceList(QcCheckTaskProduce qcCheckTaskProduce) {
|
|
|
|
public List<QcCheckTaskProduce> selectQcCheckTaskProduceList(QcCheckTaskProduce qcCheckTaskProduce) {
|
|
|
|
|
|
|
|
qcCheckTaskProduce.setDelFlag("0");
|
|
|
|
return qcCheckTaskProduceMapper.selectQcCheckTaskProduceList(qcCheckTaskProduce);
|
|
|
|
return qcCheckTaskProduceMapper.selectQcCheckTaskProduceList(qcCheckTaskProduce);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -55,7 +76,58 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
|
|
|
|
@DS("#header.poolName")
|
|
|
|
@DS("#header.poolName")
|
|
|
|
public int insertQcCheckTaskProduce(QcCheckTaskProduce qcCheckTaskProduce) {
|
|
|
|
public int insertQcCheckTaskProduce(QcCheckTaskProduce qcCheckTaskProduce) {
|
|
|
|
qcCheckTaskProduce.setCreateTime(DateUtils.getNowDate());
|
|
|
|
qcCheckTaskProduce.setCreateTime(DateUtils.getNowDate());
|
|
|
|
return qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate());
|
|
|
|
|
|
|
|
int liushuiNum = qcCheckTaskProduceMapper.getTodayMaxNum(qcCheckTaskProduce);
|
|
|
|
|
|
|
|
String liushuiStr = String.format("%04d", liushuiNum);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String createBy = SecurityUtils.getUsername();
|
|
|
|
|
|
|
|
Date nowDate= DateUtils.getNowDate();
|
|
|
|
|
|
|
|
//获取当前所选工厂
|
|
|
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
|
|
|
String key = "#header.poolName";
|
|
|
|
|
|
|
|
String factoryCode = request.getHeader(key.substring(8)).replace("ds_","");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qcCheckTaskProduce.setCheckNo(bpDD+liushuiStr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**qc_check_task_income**/
|
|
|
|
|
|
|
|
String beLongId = IdUtils.fastSimpleUUID();
|
|
|
|
|
|
|
|
qcCheckTaskProduce.setRecordId(beLongId);
|
|
|
|
|
|
|
|
qcCheckTaskProduce.setFactoryCode(factoryCode);
|
|
|
|
|
|
|
|
qcCheckTaskProduce.setCreateTime(nowDate);
|
|
|
|
|
|
|
|
qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**取检测项**/
|
|
|
|
|
|
|
|
QcCheckTypeProject qctp= new QcCheckTypeProject();
|
|
|
|
|
|
|
|
qctp.setTypeId(qcCheckTaskProduce.getCheckType());//来料检验
|
|
|
|
|
|
|
|
qctp.setMaterialCode(qcCheckTaskProduce.getMaterialCode());//特性
|
|
|
|
|
|
|
|
/**qc_check_type_project**/
|
|
|
|
|
|
|
|
List<QcCheckTaskDetail> items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp);
|
|
|
|
|
|
|
|
if(CollectionUtils.isEmpty(items)){
|
|
|
|
|
|
|
|
/**qc_material_group_detail**/
|
|
|
|
|
|
|
|
QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckTaskProduce.getMaterialCode());
|
|
|
|
|
|
|
|
if(group == null){
|
|
|
|
|
|
|
|
return 0;//没有找到检测项目
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
qctp.setGroupId(group.getGroupId());//共性
|
|
|
|
|
|
|
|
items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**qc_check_task_detail**/
|
|
|
|
|
|
|
|
if(CollectionUtils.isEmpty(items)){
|
|
|
|
|
|
|
|
return 0;//没有找到检测项目
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(QcCheckTaskDetail item:items){
|
|
|
|
|
|
|
|
item.setRecordId(IdUtils.fastSimpleUUID());
|
|
|
|
|
|
|
|
item.setBelongTo(beLongId);
|
|
|
|
|
|
|
|
item.setCreateTime(nowDate);
|
|
|
|
|
|
|
|
item.setCreateBy(createBy);
|
|
|
|
|
|
|
|
item.setFactoryCode(factoryCode);
|
|
|
|
|
|
|
|
item.setStatus("Y");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return qcCheckTaskDetailMapper.addBatch(items);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -96,8 +168,16 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
public List<QcCheckTaskProduce> getQcListWorkCenter(QcCheckTaskProduce qcCheckTaskProduce) {
|
|
|
|
public List<QcCheckTaskProduce> getQcListWorkCenter(QcCheckTaskProduce qcCheckTaskProduce) {
|
|
|
|
return null;
|
|
|
|
return qcCheckTaskProduceMapper.getQcListWorkCenter(qcCheckTaskProduce);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
|
|
|
public List<QcCheckType> getCheckTypes(QcCheckType qcCheckType) {
|
|
|
|
|
|
|
|
qcCheckType.setTypeCode("produce");
|
|
|
|
|
|
|
|
return qcCheckTaskProduceMapper.getCheckTypes(qcCheckType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|