Commit 2523344a authored by hkl's avatar hkl

feat:1.分析批次修改

parent 3747ab4e
......@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.dynamicStaticAnalysis.dto.AnalysisBatchUnitDeviceDTO;
import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatchUnitDevice;
......@@ -111,6 +113,9 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
delWrapper.eq(WorkBatchDetail::getWorkBatchId, dto.getId());
workBatchDetailMapper.delete(delWrapper);
List<WorkBatchSaveOrUpdateDetailDTO> transfiniteList = dto.getDetailList();
//获取当前登录人信息
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String realname = user.getRealname();
for (WorkBatchSaveOrUpdateDetailDTO detailDTO : transfiniteList) {
WorkBatchDetail workBatchDetail = new WorkBatchDetail();
workBatchDetail.setId(UUIDGenerator.generate());
......@@ -129,6 +134,8 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
workBatchDetail.setRemark(detailDTO.getRemark());
workBatchDetail.setUpdateTime(new Date());
workBatchDetail.setCreateTime(new Date());
workBatchDetail.setCreateBy(realname);
workBatchDetail.setUpdateBy(realname);
workBatchDetail.setWorkStatus(0);
workBatchDetailMapper.insert(workBatchDetail);
}
......@@ -158,6 +165,9 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
this.save(workBatch);
// 保存明细
//获取当前登录人信息
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String realname = user.getRealname();
List<DispatchDTO> transfiniteList = dto.getDetailList();
List<WorkBatchDetail> workBatchDetailList = new ArrayList<>();
for (DispatchDTO transfiniteDTO : transfiniteList) {
......@@ -180,7 +190,10 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
workBatchDetail.setUnitScoreLevel(Integer.valueOf(transfiniteDTO.getUnitScoreLevel()));
workBatchDetail.setUnitScoreLevelStr(transfiniteDTO.getUnitScoreLevelStr());
workBatchDetail.setWorkStatus(0);
workBatchDetail.setUpdateTime(new Date());
workBatchDetail.setCreateTime(new Date());
workBatchDetail.setCreateBy(realname);
workBatchDetail.setUpdateBy(realname);
workBatchDetailList.add(workBatchDetail);
......@@ -202,7 +215,7 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
// 1.构建工单主信息
WorkBatch workBatch = BeanUtil.copyProperties(dto, WorkBatch.class);
workBatch.setId(UUIDGenerator.generate());
workBatch.setWorkStatus(0); // 9-已作业
workBatch.setWorkStatus(0); // 0-已作业
workBatch.setSource(2); // 超限页面
......@@ -234,6 +247,9 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
throw JeecgBootException.error("创建失败,没有对应的超限数据");
}
// 2.3 循环构建保存对象
//获取当前登录人信息
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String realname = user.getRealname();
List<WorkBatchDetail> workBatchDetailList = new ArrayList<>();
for (AnalysisBatchUnitDeviceVO transfinite : transfiniteList) {
WorkBatchDetail workBatchDetail = new WorkBatchDetail();
......@@ -254,6 +270,11 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
workBatchDetail.setUnitScore(Convert.toBigDecimal(transfinite.getUnitScore()));
workBatchDetail.setUnitScoreLevel(transfinite.getUnitScoreLevel());
workBatchDetail.setUnitScoreLevelStr(transfinite.getUnitScoreLevelStr());
workBatchDetail.setUpdateTime(new Date());
workBatchDetail.setCreateTime(new Date());
workBatchDetail.setCreateBy(realname);
workBatchDetail.setUpdateBy(realname);
workBatchDetail.setWorkStatus(0);
workBatchDetailList.add(workBatchDetail);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment