use of com.eservice.api.model.abnormal.Abnormal in project sinsim by WilsonHu.
the class AbnormalController method list.
@PostMapping("/list")
public Result list(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size) {
PageHelper.startPage(page, size);
List<Abnormal> list = abnormalService.findAll();
PageInfo pageInfo = new PageInfo(list);
return ResultGenerator.genSuccessResult(pageInfo);
}
use of com.eservice.api.model.abnormal.Abnormal in project sinsim by WilsonHu.
the class AbnormalRecordController method updateAbnormalRecordDetail.
/**
* 根据传入的strAbnormalRecordDetail,更新对应多表:
* "machine_id":"", --> machine.machine_id
* "安装是否异常":"", --> task_record.status task状态,“1”==>未开始, “2”==>进行中,“3”==>安装完成, “4”==>质检完成,“5“===>异常
* "异常类型":"", --> abnormal_record.abnormal_type
* "异常原因":"", --> abnormal_record.comment
* "异常照片":"", -->abnormal_image.image
* "安装完成":"", --> task_record.status或machine.status都可以,反正这两个表都更新
* 注意:有外键的字段,需要上传实际存在的外键数据。
* 一项update失败的情况下,全部update无效(事务OK)
*
* @param strAbnormalRecordDetail
* @return
*/
@PostMapping("/updateAbnormalRecordDetail")
@Transactional
public Result updateAbnormalRecordDetail(@RequestParam String strAbnormalRecordDetail) {
// 获取整体detail
AbnormalRecordDetail abnormalRecordDetail1 = JSON.parseObject(strAbnormalRecordDetail, AbnormalRecordDetail.class);
Integer abnormalRecordDetail_ID = abnormalRecordDetail1.getId();
AbnormalRecord abnormalRecord = abnormalRecordService.findById(abnormalRecordDetail_ID);
abnormalRecord.setAbnormalType(abnormalRecordDetail1.getAbnormalType());
abnormalRecord.setTaskRecordId(abnormalRecordDetail1.getTaskRecordId());
abnormalRecord.setSubmitUser(abnormalRecordDetail1.getSubmitUser());
abnormalRecord.setSolutionUser(abnormalRecordDetail1.getSolutionUser());
abnormalRecord.setComment(abnormalRecordDetail1.getComment());
abnormalRecord.setSolution(abnormalRecordDetail1.getSolution());
Abnormal abnormal = abnormalRecordDetail1.getAbnormal();
AbnormalImage abnormalImage = abnormalRecordDetail1.getAbnormalImage();
TaskRecord taskRecord = abnormalRecordDetail1.getTaskRecord();
Machine machine = abnormalRecordDetail1.getMachine();
abnormalRecordService.update(abnormalRecord);
abnormalService.update(abnormal);
abnormalImageService.update(abnormalImage);
taskRecordService.update(taskRecord);
machineService.update(machine);
return ResultGenerator.genSuccessResult();
}
Aggregations