|
|
|
@ -17,6 +17,7 @@ import com.op.quality.mapper.*;
|
|
|
|
|
import com.op.quality.service.IQcCheckTaskProduceService;
|
|
|
|
|
import com.op.quality.service.IQcCheckTaskUserService;
|
|
|
|
|
import com.op.system.api.domain.SysUser;
|
|
|
|
|
import com.op.system.api.domain.quality.QcUserMaterialDTO;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -144,24 +145,49 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
|
|
|
|
|
//String typeCode = qcCheckTaskIncomeMapper.getTypeCode(qcCheckTaskIncome.getCheckType());
|
|
|
|
|
qcCheckTaskIncome.setTypeCode("material");//大检验节点
|
|
|
|
|
/**qc_task_user start**/
|
|
|
|
|
String checkManName = qcCheckTaskIncome.getCheckManName();
|
|
|
|
|
String checkManCode = qcCheckTaskIncome.getCheckManCode();
|
|
|
|
|
qcCheckTaskIncome.setCheckManName("");
|
|
|
|
|
qcCheckTaskIncome.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(qcCheckTaskIncome.getCheckNo());
|
|
|
|
|
qcCheckTaskUser.setBelongTo(beLongId);
|
|
|
|
|
qcCheckTaskUserList.add(qcCheckTaskUser);
|
|
|
|
|
if(StringUtils.isNotBlank(qcCheckTaskIncome.getCheckManName())){//管理系统创建任务
|
|
|
|
|
String checkManName = qcCheckTaskIncome.getCheckManName();
|
|
|
|
|
String checkManCode = qcCheckTaskIncome.getCheckManCode();
|
|
|
|
|
qcCheckTaskIncome.setCheckManName("");
|
|
|
|
|
qcCheckTaskIncome.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(qcCheckTaskIncome.getCheckNo());
|
|
|
|
|
qcCheckTaskUser.setBelongTo(beLongId);
|
|
|
|
|
qcCheckTaskUserList.add(qcCheckTaskUser);
|
|
|
|
|
}
|
|
|
|
|
//检验人插入
|
|
|
|
|
qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList);
|
|
|
|
|
}else{//上位机触发
|
|
|
|
|
qcCheckTaskIncome.setCheckManName("");
|
|
|
|
|
qcCheckTaskIncome.setCheckManCode("");
|
|
|
|
|
/**qc_user_material取默认检查人**/
|
|
|
|
|
List<QcUserMaterialDTO> users = qcCheckTaskIncomeMapper.getUserByMaterial(qcCheckTaskIncome.getMaterialCode());
|
|
|
|
|
if(CollectionUtils.isEmpty(users)){
|
|
|
|
|
QcUserMaterialDTO dto0 = new QcUserMaterialDTO();
|
|
|
|
|
dto0.setUserCode("mobile");
|
|
|
|
|
dto0.setUserName("手持测试用户");
|
|
|
|
|
users.add(dto0);
|
|
|
|
|
}else{
|
|
|
|
|
for(QcUserMaterialDTO user:users){
|
|
|
|
|
user.setId(IdUtils.fastSimpleUUID());
|
|
|
|
|
user.setBelongTo(beLongId);
|
|
|
|
|
user.setCheckNo(qcCheckTaskIncome.getCheckNo());
|
|
|
|
|
user.setCreateBy(createBy);
|
|
|
|
|
user.setFactoryCode(factoryCode);
|
|
|
|
|
user.setCreateTime(nowDate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int m=qcCheckTaskIncomeMapper.addCheckUsers(users);
|
|
|
|
|
logger.info("检查人新增"+m+"成功");
|
|
|
|
|
}
|
|
|
|
|
qcCheckTaskIncomeMapper.insertQcCheckTaskIncome(qcCheckTaskIncome);
|
|
|
|
|
//检验人插入
|
|
|
|
|
qcCheckTaskUserService.insertQcCheckTaskUserList(qcCheckTaskUserList);
|
|
|
|
|
|
|
|
|
|
/**qc_check_task_detail**/
|
|
|
|
|
for(QcCheckTaskDetail item:items){
|
|
|
|
|
item.setRecordId(IdUtils.fastSimpleUUID());
|
|
|
|
@ -312,10 +338,11 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
|
|
|
|
|
qcCheckTaskIncome.setCheckStatus("2");
|
|
|
|
|
qcCheckTaskIncome.setCheckResult(result);
|
|
|
|
|
qcCheckTaskIncome.setCheckTime(DateUtils.getNowDate());
|
|
|
|
|
qcCheckTaskIncome.setCheckManCode(SecurityUtils.getUsername());
|
|
|
|
|
n = qcCheckTaskIncomeMapper.updateQcCheckTaskIncome(qcCheckTaskIncome);
|
|
|
|
|
|
|
|
|
|
/**wms_raw_order_in-->quality_status->**/
|
|
|
|
|
qcCheckTaskIncome.setCheckResult(result.equals("Y")?"1":"0");
|
|
|
|
|
qcCheckTaskIncome.setCheckResult(result.equals("Y")?"1":"2");
|
|
|
|
|
qcCheckUnqualifiedMapper.updateQualityStatus(qcCheckTaskIncome);
|
|
|
|
|
}else if("produce".equals(qcCheckTaskIncome.getTypeCode())){
|
|
|
|
|
QcCheckTaskProduce qcCheckTaskProduce = new QcCheckTaskProduce();
|
|
|
|
@ -323,6 +350,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
|
|
|
|
|
qcCheckTaskProduce.setRecordId(recordId);
|
|
|
|
|
qcCheckTaskProduce.setCheckResult(result);
|
|
|
|
|
qcCheckTaskProduce.setCheckTime(DateUtils.getNowDate());
|
|
|
|
|
qcCheckTaskProduce.setCheckManCode(SecurityUtils.getUsername());
|
|
|
|
|
n = qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -335,6 +363,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
|
|
|
|
|
warehousing.setRecordId(recordId);
|
|
|
|
|
warehousing.setCheckResult(result);
|
|
|
|
|
warehousing.setCheckTime(DateUtils.getNowDate());
|
|
|
|
|
warehousing.setCheckManCode(SecurityUtils.getUsername());
|
|
|
|
|
n = qcCheckTaskWarehousingMapper.updateQcCheckTaskWarehousing(warehousing);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|