bug修复

master
zpl 4 years ago
parent 40e94f3575
commit 3173a234be

@ -161,5 +161,11 @@ public interface Constants {
// 在制品标签
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{
return R.ok(toolService.getOneToolByToolNo(tool));
}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.metadata.IPage;
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.mapper.ToolMapper;
import com.foreverwin.mesnac.common.model.Tool;
@ -59,12 +60,14 @@ public class ToolServiceImpl extends ServiceImpl<ToolMapper, Tool> implements To
tool.setHandle(handle);
Tool byId = toolMapper.selectById(handle);
if (byId != null){
tool.setStatus(Constants.TOOL_STATUS_Y);
tool.setCreateUser(byId.getCreateUser());
tool.setCreatedDateTime(byId.getCreatedDateTime());
tool.setModifyUser(user);
tool.setModifiedDateTime(LocalDateTime.now());
toolMapper.updateById(tool);
}else{
} else{
tool.setStatus(Constants.TOOL_STATUS_Y);
tool.setCreateUser(user);
tool.setCreatedDateTime(LocalDateTime.now());
toolMapper.insert(tool);

@ -86,7 +86,16 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
}
// 不良代码
String ncCodeNo = resourceRepairTask.getNcCodeNo();
String[] ncSplit = ncCodeNo.split(",");
if (ncCodeNo != null && !ncCodeNo.equals("")){
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<>();
for (int i = 0; i < ncSplit.length; 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 ){
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
List<String> nextNumber = nextNumberHelper.getNextNumber(site, Constants.RESOURCE_REPAIR_TASK, 1);
resourceRepairTask.setRepairNo(nextNumber.get(0));

Loading…
Cancel
Save