|
|
|
@ -20,18 +20,16 @@ import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
|
import com.op.common.core.web.domain.AjaxResult;
|
|
|
|
|
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 com.op.quality.mapper.*;
|
|
|
|
|
import com.op.quality.service.IQcCheckTaskUserService;
|
|
|
|
|
import com.op.system.api.RemoteUserService;
|
|
|
|
|
import com.op.system.api.domain.SysUser;
|
|
|
|
|
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
|
|
|
|
|
import com.op.system.api.domain.quality.QcUserMaterialDTO;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.op.quality.mapper.QcCheckTaskProduceMapper;
|
|
|
|
|
import com.op.quality.service.IQcCheckTaskProduceService;
|
|
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
@ -73,6 +71,9 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
|
|
|
|
|
@Autowired
|
|
|
|
|
private IQcCheckTaskUserService qcCheckTaskUserService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询生产过程检验任务
|
|
|
|
|
*
|
|
|
|
@ -167,24 +168,56 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
|
|
|
|
|
qcCheckTaskProduce.setCreateTime(nowDate);
|
|
|
|
|
qcCheckTaskProduce.setTypeCode("produce");//大检验节点
|
|
|
|
|
/**qc_task_user start**/
|
|
|
|
|
String checkManName = qcCheckTaskProduce.getCheckManName();
|
|
|
|
|
String checkManCode = qcCheckTaskProduce.getCheckManCode();
|
|
|
|
|
qcCheckTaskProduce.setCheckManName("");
|
|
|
|
|
qcCheckTaskProduce.setCheckManCode("");
|
|
|
|
|
String[] splitNames = checkManName.split(",");
|
|
|
|
|
String[] splitCodes = checkManCode.split(",");
|
|
|
|
|
List<QcCheckTaskUser> qcCheckTaskUserList = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < splitNames.length; i++) {
|
|
|
|
|
QcCheckTaskUser qcCheckTaskUser = new QcCheckTaskUser();
|
|
|
|
|
qcCheckTaskUser.setCheckManName(splitNames[i]);
|
|
|
|
|
qcCheckTaskUser.setCheckManCode(splitCodes[i]);
|
|
|
|
|
qcCheckTaskUser.setCheckNo(qcCheckTaskProduce.getCheckNo());
|
|
|
|
|
qcCheckTaskUser.setBelongTo(beLongId);
|
|
|
|
|
qcCheckTaskUserList.add(qcCheckTaskUser);
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(qcCheckTaskProduce.getCheckManName())){
|
|
|
|
|
String checkManName = qcCheckTaskProduce.getCheckManName();
|
|
|
|
|
String checkManCode = qcCheckTaskProduce.getCheckManCode();
|
|
|
|
|
qcCheckTaskProduce.setCheckManName("");
|
|
|
|
|
qcCheckTaskProduce.setCheckManCode("");
|
|
|
|
|
String[] splitNames = checkManName.split(",");
|
|
|
|
|
String[] splitCodes = checkManCode.split(",");
|
|
|
|
|
List<QcCheckTaskUser> qcCheckTaskUserList = new ArrayList<>();
|
|
|
|
|
for (int i = 0; i < splitNames.length; i++) {
|
|
|
|
|
QcCheckTaskUser qcCheckTaskUser = new QcCheckTaskUser();
|
|
|
|
|
qcCheckTaskUser.setCheckManName(splitNames[i]);
|
|
|
|
|
qcCheckTaskUser.setCheckManCode(splitCodes[i]);
|
|
|
|
|
qcCheckTaskUser.setCheckNo(qcCheckTaskProduce.getCheckNo());
|
|
|
|
|
qcCheckTaskUser.setBelongTo(beLongId);
|
|
|
|
|
qcCheckTaskUserList.add(qcCheckTaskUser);
|
|
|
|
|
}
|
|
|
|
|
//检验人插入
|
|
|
|
|
qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList);
|
|
|
|
|
}else{//上位机
|
|
|
|
|
qcCheckTaskProduce.setCheckManName("");
|
|
|
|
|
qcCheckTaskProduce.setCheckManCode("");
|
|
|
|
|
/**qc_user_material取默认检查人**/
|
|
|
|
|
List<QcUserMaterialDTO> users = qcCheckTaskIncomeMapper.getUserByMaterial(qcCheckTaskProduce.getMaterialCode());
|
|
|
|
|
if(CollectionUtils.isEmpty(users)){
|
|
|
|
|
QcUserMaterialDTO dto0 = new QcUserMaterialDTO();
|
|
|
|
|
dto0.setId(IdUtils.fastSimpleUUID());
|
|
|
|
|
dto0.setBelongTo(beLongId);
|
|
|
|
|
dto0.setCheckNo(qcCheckTaskProduce.getCheckNo());
|
|
|
|
|
dto0.setCreateBy(createBy);
|
|
|
|
|
dto0.setFactoryCode(factoryCode);
|
|
|
|
|
dto0.setCreateTime(nowDate);
|
|
|
|
|
dto0.setUserCode("mobile");
|
|
|
|
|
dto0.setUserName("手持测试用户");
|
|
|
|
|
users.add(dto0);
|
|
|
|
|
}else{
|
|
|
|
|
for(QcUserMaterialDTO user:users){
|
|
|
|
|
user.setId(IdUtils.fastSimpleUUID());
|
|
|
|
|
user.setBelongTo(beLongId);
|
|
|
|
|
user.setCheckNo(qcCheckTaskProduce.getCheckNo());
|
|
|
|
|
user.setCreateBy(createBy);
|
|
|
|
|
user.setFactoryCode(factoryCode);
|
|
|
|
|
user.setCreateTime(nowDate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int m=qcCheckTaskIncomeMapper.addCheckUsers(users);
|
|
|
|
|
logger.info("检查人新增"+m+"成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
|
|
|
|
|
//检验人插入
|
|
|
|
|
qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList);
|
|
|
|
|
|
|
|
|
|
/**qc_check_task_detail**/
|
|
|
|
|
for (QcCheckTaskDetail item : items) {
|
|
|
|
|
item.setRecordId(IdUtils.fastSimpleUUID());
|
|
|
|
|