bug修复

master
zpl 4 years ago
parent 40e94f3575
commit 3173a234be

@ -161,5 +161,11 @@ public interface Constants {
// 在制品标签 // 在制品标签
String PRINT_TYPE_SFC = "SFC"; String PRINT_TYPE_SFC = "SFC";
/**
* Y-使N-/
*/
String TOOL_STATUS_Y = "Y";
String TOOL_STATUS_N = "N";
} }

@ -150,7 +150,7 @@ public class ToolController {
try{ try{
return R.ok(toolService.getOneToolByToolNo(tool)); return R.ok(toolService.getOneToolByToolNo(tool));
}catch (Exception e){ }catch (Exception e){
return R.failed("数据保存失败" + e.getMessage()); return R.failed("数据查询失败" + e.getMessage());
} }
} }

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.mapper.ToolMapper; import com.foreverwin.mesnac.common.mapper.ToolMapper;
import com.foreverwin.mesnac.common.model.Tool; import com.foreverwin.mesnac.common.model.Tool;
@ -59,12 +60,14 @@ public class ToolServiceImpl extends ServiceImpl<ToolMapper, Tool> implements To
tool.setHandle(handle); tool.setHandle(handle);
Tool byId = toolMapper.selectById(handle); Tool byId = toolMapper.selectById(handle);
if (byId != null){ if (byId != null){
tool.setStatus(Constants.TOOL_STATUS_Y);
tool.setCreateUser(byId.getCreateUser()); tool.setCreateUser(byId.getCreateUser());
tool.setCreatedDateTime(byId.getCreatedDateTime()); tool.setCreatedDateTime(byId.getCreatedDateTime());
tool.setModifyUser(user); tool.setModifyUser(user);
tool.setModifiedDateTime(LocalDateTime.now()); tool.setModifiedDateTime(LocalDateTime.now());
toolMapper.updateById(tool); toolMapper.updateById(tool);
}else{ } else{
tool.setStatus(Constants.TOOL_STATUS_Y);
tool.setCreateUser(user); tool.setCreateUser(user);
tool.setCreatedDateTime(LocalDateTime.now()); tool.setCreatedDateTime(LocalDateTime.now());
toolMapper.insert(tool); toolMapper.insert(tool);

@ -86,7 +86,16 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
} }
// 不良代码 // 不良代码
String ncCodeNo = resourceRepairTask.getNcCodeNo(); String ncCodeNo = resourceRepairTask.getNcCodeNo();
if (ncCodeNo != null && !ncCodeNo.equals("")){
String[] ncSplit = ncCodeNo.split(","); String[] ncSplit = ncCodeNo.split(",");
for (int i = 0; i < ncSplit.length; i++) {
String ncCodeHandle = HandleEnum.NC_CODE.getHandle(site, ncSplit[i]);
if ( ncCodeService.getById(ncCodeHandle) == null ){
throw BusinessException.build("不良代码错误!!!");
}
}
}
/* Collection<String> collection = new ArrayList<>(); /* Collection<String> collection = new ArrayList<>();
for (int i = 0; i < ncSplit.length; i++) { for (int i = 0; i < ncSplit.length; i++) {
collection.add(HandleEnum.NC_CODE.getHandle(site,ncSplit[i])); collection.add(HandleEnum.NC_CODE.getHandle(site,ncSplit[i]));
@ -95,12 +104,6 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
if ( ncCodes.size() != ncSplit.length ){ if ( ncCodes.size() != ncSplit.length ){
throw BusinessException.build("不良代码错误!!!"); throw BusinessException.build("不良代码错误!!!");
}*/ }*/
for (int i = 0; i < ncSplit.length; i++) {
String ncCodeHandle = HandleEnum.NC_CODE.getHandle(site, ncSplit[i]);
if ( ncCodeService.getById(ncCodeHandle) == null ){
throw BusinessException.build("不良代码错误!!!");
}
}
// 维修单号、维修HANDLE // 维修单号、维修HANDLE
List<String> nextNumber = nextNumberHelper.getNextNumber(site, Constants.RESOURCE_REPAIR_TASK, 1); List<String> nextNumber = nextNumberHelper.getNextNumber(site, Constants.RESOURCE_REPAIR_TASK, 1);
resourceRepairTask.setRepairNo(nextNumber.get(0)); resourceRepairTask.setRepairNo(nextNumber.get(0));

Loading…
Cancel
Save