|
|
|
|
@ -100,6 +100,7 @@ public class RemindMsgController extends BladeController { |
|
|
|
|
// qw.like(RemindMsg.PART_NAME, partName);
|
|
|
|
|
// }
|
|
|
|
|
// qw.like(map.containsKey("partName"), RemindMsg.PART_NAME, map.get("partName"));
|
|
|
|
|
qw.orderByDesc("CREATE_TIME"); |
|
|
|
|
IPage<RemindMsg> pages = service.page(Condition.getPage(query), qw); |
|
|
|
|
IPage<RemindMsgVO> pagesVO = RemindMsgWrapper.build().pageVO(pages); |
|
|
|
|
pagesVO.getRecords() |
|
|
|
|
@ -155,9 +156,39 @@ public class RemindMsgController extends BladeController { |
|
|
|
|
@ApiLog("新增提醒信息") |
|
|
|
|
@Operation(summary = "新增批量", description = "传入RemindMsg List") |
|
|
|
|
public R saveBat(@Valid @RequestBody List<RemindMsg> addList) { |
|
|
|
|
addList.forEach(one -> { |
|
|
|
|
|
|
|
|
|
for(RemindMsg one : addList){ |
|
|
|
|
if(0== one.getRemindMsgType()){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if(1== one.getRemindMsgType()){ |
|
|
|
|
QueryWrapper<RemindMsg> qw = new QueryWrapper<>(); |
|
|
|
|
qw.eq("PLATEING",one.getPlateing()); |
|
|
|
|
if(service.count(qw)>0){ |
|
|
|
|
return R.fail(one.getPlateing()+"此镀种信息已存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if(2== one.getRemindMsgType()){ |
|
|
|
|
QueryWrapper<RemindMsg> qw = new QueryWrapper<>(); |
|
|
|
|
qw.eq("SUB_PART_CODE",one.getSubPartCode()); |
|
|
|
|
if(service.count(qw)>0){ |
|
|
|
|
return R.fail(one.getSubPartCode()+"此零件信息已存在"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(3== one.getRemindMsgType()){ |
|
|
|
|
QueryWrapper<RemindMsg> qw = new QueryWrapper<>(); |
|
|
|
|
qw.eq("FORMULA",one.getFormula()); |
|
|
|
|
if(service.count(qw)>0){ |
|
|
|
|
return R.fail(one.getFormula()+"此程式编号已存在"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
one.setId(null); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// addList.forEach(one -> {
|
|
|
|
|
// one.setId(null);
|
|
|
|
|
// });
|
|
|
|
|
return R.status(service.saveBatch(addList)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -169,6 +200,36 @@ public class RemindMsgController extends BladeController { |
|
|
|
|
@ApiLog("修改提醒信息") |
|
|
|
|
@Operation(summary = "修改一条", description = "传入RemindMsg Obj") |
|
|
|
|
public R update(@Valid @RequestBody RemindMsg updateOne) { |
|
|
|
|
|
|
|
|
|
if(0== updateOne.getRemindMsgType()){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if(1== updateOne.getRemindMsgType()){ |
|
|
|
|
QueryWrapper<RemindMsg> qw = new QueryWrapper<>(); |
|
|
|
|
qw.eq("PLATEING",updateOne.getPlateing()); |
|
|
|
|
qw.ne("ID",updateOne.getId()); |
|
|
|
|
if(service.count(qw)>0){ |
|
|
|
|
return R.fail(updateOne.getPlateing()+"此镀种信息已存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if(2== updateOne.getRemindMsgType()){ |
|
|
|
|
QueryWrapper<RemindMsg> qw = new QueryWrapper<>(); |
|
|
|
|
qw.eq("SUB_PART_CODE",updateOne.getSubPartCode()); |
|
|
|
|
qw.ne("ID",updateOne.getId()); |
|
|
|
|
if(service.count(qw)>0){ |
|
|
|
|
return R.fail(updateOne.getSubPartCode()+"此零件信息已存在"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(3== updateOne.getRemindMsgType()){ |
|
|
|
|
QueryWrapper<RemindMsg> qw = new QueryWrapper<>(); |
|
|
|
|
qw.eq("FORMULA",updateOne.getFormula()); |
|
|
|
|
qw.ne("ID",updateOne.getId()); |
|
|
|
|
if(service.count(qw)>0){ |
|
|
|
|
return R.fail(updateOne.getFormula()+"此程式编号已存在"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return R.status(service.updateById(updateOne)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -257,6 +318,33 @@ public class RemindMsgController extends BladeController { |
|
|
|
|
"导入模版-消息提醒.xls"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/downloadExcelTemplatePlate") |
|
|
|
|
@ApiOperationSupport(order = 71) |
|
|
|
|
@Operation(summary = "下载Excel模板", description = "") |
|
|
|
|
public ResponseEntity<org.springframework.core.io.Resource> downloadExcelTemplatePlate() { |
|
|
|
|
return ExcelExtUtil.downloadXlsTemplate( |
|
|
|
|
"Excel/QA/镀种消息提醒.xls", |
|
|
|
|
"导入模版-镀种消息提醒.xls"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/downloadExcelTemplateColor") |
|
|
|
|
@ApiOperationSupport(order = 71) |
|
|
|
|
@Operation(summary = "下载Excel模板", description = "") |
|
|
|
|
public ResponseEntity<org.springframework.core.io.Resource> downloadExcelTemplateColor() { |
|
|
|
|
return ExcelExtUtil.downloadXlsTemplate( |
|
|
|
|
"Excel/QA/颜色消息提醒.xls", |
|
|
|
|
"导入模版-颜色消息提醒.xls"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/downloadExcelTemplateMaterial") |
|
|
|
|
@ApiOperationSupport(order = 71) |
|
|
|
|
@Operation(summary = "下载Excel模板", description = "") |
|
|
|
|
public ResponseEntity<org.springframework.core.io.Resource> downloadExcelTemplateMaterial() { |
|
|
|
|
return ExcelExtUtil.downloadXlsTemplate( |
|
|
|
|
"Excel/QA/材料消息提醒.xls", |
|
|
|
|
"导入模版-材料消息提醒.xls"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* [提醒信息] 导入Excel |
|
|
|
|
*/ |
|
|
|
|
|