Commit c9062b66 authored by 竹天卫's avatar 竹天卫

优化委托流程

parent db30b97e
......@@ -51,7 +51,7 @@ public interface SampleMapper extends BaseMapper<Sample> {
@Select("select * from sample where entrust_id = #{entrustId} and is_check != 1 order by id asc")
List<Sample> getNoCheckList(Integer entrustId);
@Select("select * from sample where entrust_id = #{entrustId} and cement_code = #{cementCode}")
@Select("select * from sample where entrust_id = #{entrustId} and cement_code= #{cementCode}")
List<Sample> getByCementCode(@Param("entrustId") Integer entrustId, @Param("cementCode") String cementCode);
......
......@@ -931,25 +931,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
}
//该委托单下的样品改为已领用状态
/*QueryWrapper<Sample> sampleWrapper = new QueryWrapper<>();
sampleWrapper.eq("entrust_id", entrust.getId());
List<Sample> sampleList = sampleMapper.selectList(sampleWrapper);
if(sampleList != null && sampleList.size()>0){
for(Sample sample : sampleList){
sample.setStatus(1);//已领用状态
}
}
sampleService.updateBatchById(sampleList);*/
//委托表改成已发送样品处理,状态改为样品处理状态中
entrust.setIsHandle(1)
.setStatus(3);
entrustMapper.updateById(entrust);
logsService.saveLog(SysLogs.ObjType.ENTRUST_LOG, entrust.getId(), "发送样品处理任务", null);
return BaseResponse.okMsg("已发送样品处理任务");
}
......@@ -1213,17 +1199,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (sample.getIsParallel() == 0) {
sample.setIsHandle(1); //样品处理全部完成
sampleMapper.updateById(sample);
} else if (sample.getIsParallel() == 1) {
} else{
List<Sample> sampleList1 = sampleMapper.getByCementCode(entrust.getId(), sample.getCementCode());
if(sampleList1.size() < 2 ){
return BaseResponse.errorMsg("平行样样品数量信息错误");
}
// 如果是平行样,平行样的状态也改成已处理完成
if (sampleList1.size() == 2) {
for (Sample sam : sampleList1) {
sam.setIsHandle(1);
sampleMapper.updateById(sam);
}
} else {
sample.setIsHandle(1); //样品处理全部完成
sampleMapper.updateById(sample);
for (Sample sam : sampleList1) {
sam.setIsHandle(1);
sampleMapper.updateById(sam);
}
}
}
......
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