Commit 5fdeea28 authored by 竹天卫's avatar 竹天卫

校核接口完成。联调中

parent 1c14e234
...@@ -338,15 +338,18 @@ public class EntrustController { ...@@ -338,15 +338,18 @@ public class EntrustController {
@ApiOperation(value = "校核计算") @ApiOperation(value = "校核计算")
@PostMapping("/checkCount") @PostMapping("/checkCount")
public BaseResponse checkCount(Integer teamGroupId, @RequestBody Map<String, Object> mainResult) { public BaseResponse checkCount(Integer teamGroupId,Integer isParallel,
@RequestBody Map<String, Object> mainResult,
@RequestBody Map<String, Object> secondaryResult) {
try { try {
return entrustService.checkCount(teamGroupId, mainResult); return entrustService.checkCount(teamGroupId, isParallel, mainResult, secondaryResult);
}catch (Exception e) { }catch (Exception e) {
log.debug("校核计算{}",e); log.debug("校核计算{}",e);
} }
return BaseResponse.errorMsg("失败!"); return BaseResponse.errorMsg("失败!");
} }
@ApiOperation(value = "数据校核") @ApiOperation(value = "数据校核")
@PostMapping("/check") @PostMapping("/check")
public BaseResponse check(@RequestBody CheckQuery query) { public BaseResponse check(@RequestBody CheckQuery query) {
......
...@@ -42,7 +42,7 @@ public class EquipmentController { ...@@ -42,7 +42,7 @@ public class EquipmentController {
private IEquipmentService equipmentService; private IEquipmentService equipmentService;
@ApiOperation(value = "设备分页列表") @ApiOperation(value = "设备分页列表 (设备列表,设备检定列表)")
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
@ApiImplicitParam(name = "brand", value = "设备品牌", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "brand", value = "设备品牌", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "supplierId", value = "供应商表id", paramType = "query", dataType = "Integer"), @ApiImplicitParam(name = "supplierId", value = "供应商表id", paramType = "query", dataType = "Integer"),
...@@ -116,7 +116,7 @@ public class EquipmentController { ...@@ -116,7 +116,7 @@ public class EquipmentController {
return BaseResponse.errorMsg("失败!"); return BaseResponse.errorMsg("失败!");
} }
@ApiOperation(value = "检定设备 (不传id为添加记录,传id为修改记录)") @ApiOperation(value = "检定设备")
@PostMapping("/test") @PostMapping("/test")
public BaseResponse test(@RequestBody EquipmentTestQuery query) { public BaseResponse test(@RequestBody EquipmentTestQuery query) {
try { try {
...@@ -127,7 +127,7 @@ public class EquipmentController { ...@@ -127,7 +127,7 @@ public class EquipmentController {
return BaseResponse.errorMsg("失败!"); return BaseResponse.errorMsg("失败!");
} }
@ApiOperation(value = "设备检定分页列表") /* @ApiOperation(value = "设备检定分页列表")
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
@ApiImplicitParam(name = "equipmentId", value = "设备表id", paramType = "query", dataType = "Integer") @ApiImplicitParam(name = "equipmentId", value = "设备表id", paramType = "query", dataType = "Integer")
}) })
...@@ -139,8 +139,9 @@ public class EquipmentController { ...@@ -139,8 +139,9 @@ public class EquipmentController {
log.debug("设备检定分页列表{}", e); log.debug("设备检定分页列表{}", e);
} }
return BaseResponse.errorMsg("失败!"); return BaseResponse.errorMsg("失败!");
} }*/
/*
@ApiOperation(value = "设备检定详情") @ApiOperation(value = "设备检定详情")
@GetMapping("getTestDetail/{id}") @GetMapping("getTestDetail/{id}")
public BaseResponse getTestDetail(@PathVariable Integer id){ public BaseResponse getTestDetail(@PathVariable Integer id){
...@@ -151,6 +152,7 @@ public class EquipmentController { ...@@ -151,6 +152,7 @@ public class EquipmentController {
} }
return BaseResponse.errorMsg("失败!"); return BaseResponse.errorMsg("失败!");
} }
*/
@ApiOperation(value = "设备故障维修登记 (不传id为添加记录,传id为修改记录)") @ApiOperation(value = "设备故障维修登记 (不传id为添加记录,传id为修改记录)")
......
...@@ -67,6 +67,27 @@ public class Equipment implements Serializable { ...@@ -67,6 +67,27 @@ public class Equipment implements Serializable {
@ApiModelProperty("检/校周期(年)") @ApiModelProperty("检/校周期(年)")
private Integer testCycle; private Integer testCycle;
@ApiModelProperty("检定日期")
private LocalDate testDate;
@ApiModelProperty("校验日期")
private LocalDate checkDate;
@ApiModelProperty("期间核查日期")
private LocalDate periodDate;
@ApiModelProperty("实施结果")
private String tryResult;
@ApiModelProperty("附件地址")
private String enclosureUrl;
@ApiModelProperty("文件名")
private String alias;
@ApiModelProperty("扩展名")
private String extName;
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
......
...@@ -57,6 +57,9 @@ public class Team extends BaseEntity implements Serializable { ...@@ -57,6 +57,9 @@ public class Team extends BaseEntity implements Serializable {
@ApiModelProperty("状态 0:禁用 1:激活") @ApiModelProperty("状态 0:禁用 1:激活")
private Integer status; private Integer status;
@ApiModelProperty("委托是否可见 0:不可见 1:可见")
private Integer isDisplay;
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
m.name as methodName, m.number as number m.name as methodName, m.number as number
FROM team t FROM team t
left join method m on m.id = t.method_id left join method m on m.id = t.method_id
where t.status=1 where t.status=1 and t.is_display = 1
ORDER BY t.id ASC ORDER BY t.id ASC
</select> </select>
......
...@@ -19,9 +19,6 @@ import java.util.List; ...@@ -19,9 +19,6 @@ import java.util.List;
@ApiModel("设备检定请求") @ApiModel("设备检定请求")
public class EquipmentTestQuery { public class EquipmentTestQuery {
@ApiModelProperty("设备检定表id")
private Integer id;
@ApiModelProperty("设备表id") @ApiModelProperty("设备表id")
private Integer equipmentId; private Integer equipmentId;
...@@ -41,6 +38,6 @@ public class EquipmentTestQuery { ...@@ -41,6 +38,6 @@ public class EquipmentTestQuery {
private String remark; private String remark;
@ApiModelProperty("校核附件信息") @ApiModelProperty("校核附件信息")
private List<EnclosureQuery> enclosureQueryList; private EnclosureQuery enclosureQuery;
} }
...@@ -34,5 +34,8 @@ public class TeamQuery { ...@@ -34,5 +34,8 @@ public class TeamQuery {
@ApiModelProperty("资质范围") @ApiModelProperty("资质范围")
private String qualifications; private String qualifications;
@ApiModelProperty("是否可见 0:不可见 1:可见")
private Integer isDisplay;
} }
...@@ -57,6 +57,27 @@ public class EquipmentVo { ...@@ -57,6 +57,27 @@ public class EquipmentVo {
@ApiModelProperty("检/校周期(年)") @ApiModelProperty("检/校周期(年)")
private Integer testCycle; private Integer testCycle;
@ApiModelProperty("检定日期")
private LocalDate testDate;
@ApiModelProperty("校验日期")
private LocalDate checkDate;
@ApiModelProperty("期间核查日期")
private LocalDate periodDate;
@ApiModelProperty("实施结果")
private String tryResult;
@ApiModelProperty("附件地址")
private String enclosureUrl;
@ApiModelProperty("文件名")
private String alias;
@ApiModelProperty("扩展名")
private String extName;
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
......
...@@ -95,6 +95,15 @@ public class SampleVo { ...@@ -95,6 +95,15 @@ public class SampleVo {
@ApiModelProperty("项目编号") @ApiModelProperty("项目编号")
private String projectCode; private String projectCode;
@ApiModelProperty("样品处理是否全部完成(0未处理完成,1处理完成")
private Integer isHandle;
@ApiModelProperty("样品是否检测完成(0未检测完成, 1检测完成,)")
private Integer isDistribution;
@ApiModelProperty("样品是否校核完成(0未检测完成, 1检测完成,)")
private Integer isCheck;
} }
...@@ -74,7 +74,9 @@ public interface IEntrustService extends IService<Entrust> { ...@@ -74,7 +74,9 @@ public interface IEntrustService extends IService<Entrust> {
BaseResponse<List<SampleDistribution>> getEnclosureList(Integer sampleId, Integer teamGroupId, Integer userId); BaseResponse<List<SampleDistribution>> getEnclosureList(Integer sampleId, Integer teamGroupId, Integer userId);
BaseResponse<Map<String, Object>> checkCount(Integer teamGroupId, Map<String, Object> mainResult); BaseResponse<Map<String, String>> checkCount(Integer teamGroupId,Integer isParallel,
Map<String, Object> mainResult,
Map<String, Object> secondaryResult);
BaseResponse<String> check(CheckQuery query); BaseResponse<String> check(CheckQuery query);
......
...@@ -156,14 +156,14 @@ public class CommonServiceImpl { ...@@ -156,14 +156,14 @@ public class CommonServiceImpl {
/** /**
* *
* @param teamGroupId 检测组id * @param checkResutlList 检测组id集合
* @param resultMap 输入集合 * @param resultMap 输入集合
* @return * @return
*/ */
public Map<String, Object> checkCount(Integer teamGroupId, Map<String, Object> resultMap ){ public Map<String, String> checkCount(List<String> checkResutlList, Map<String, Object> resultMap ){
List<String> checkResutlList = teamMapper.getByGroup(teamGroupId); // List<String> checkResutlList = teamMapper.getByGroup(teamGroupId);
//定义输出集合 //定义输出集合
Map<String, Object> countMap = new HashMap<>(); Map<String, String> countMap = new HashMap<>();
//输出检测项第一次循环 //输出检测项第一次循环
for(String name : checkResutlList){ for(String name : checkResutlList){
if(name.equals("L.O.I")){ if(name.equals("L.O.I")){
...@@ -216,25 +216,25 @@ public class CommonServiceImpl { ...@@ -216,25 +216,25 @@ public class CommonServiceImpl {
//输出检测项第二次循环 //输出检测项第二次循环
for(String name : checkResutlList){ for(String name : checkResutlList){
if(name.equals("SO3")){ if(name.equals("SO3")){
BigDecimal countSO3 = CheckCountUtil.countSO3(resultMap, countMap); String countSO3 = CheckCountUtil.countSO3(resultMap, countMap);
countMap.put(name, countSO3); countMap.put(name, countSO3);
}else if(name.equals("KH")){ }else if(name.equals("KH")){
BigDecimal countKH = CheckCountUtil.countKH(countMap); String countKH = CheckCountUtil.countKH(countMap);
countMap.put(name, countKH); countMap.put(name, countKH);
}else if(name.equals("SM")){ }else if(name.equals("SM")){
BigDecimal countSM = CheckCountUtil.countSM(countMap); String countSM = CheckCountUtil.countSM(countMap);
countMap.put(name, countSM); countMap.put(name, countSM);
}else if(name.equals("AM")){ }else if(name.equals("AM")){
BigDecimal countAM = CheckCountUtil.countAM(countMap); String countAM = CheckCountUtil.countAM(countMap);
countMap.put(name, countAM); countMap.put(name, countAM);
}else if(name.equals("易烧性等级")){ }else if(name.equals("易烧性等级")){
String burnupLevel = CheckCountUtil.countBurnupLevel(resultMap,countMap); String burnupLevel = CheckCountUtil.countBurnupLevel(resultMap,countMap);
countMap.put(name, burnupLevel); countMap.put(name, burnupLevel);
}else if(name.equals("报出_Mad")){ }else if(name.equals("报出_Mad")){
BigDecimal countBCMad = CheckCountUtil.countBCMad(countMap); String countBCMad = CheckCountUtil.countBCMad(countMap);
countMap.put(name, countBCMad); countMap.put(name, countBCMad);
}else if(name.equals("报出_Aad")){ }else if(name.equals("报出_Aad")){
BigDecimal countBCAad = CheckCountUtil.countBCAad(countMap); String countBCAad = CheckCountUtil.countBCAad(countMap);
countMap.put(name, countBCAad); countMap.put(name, countBCAad);
} }
...@@ -243,25 +243,25 @@ public class CommonServiceImpl { ...@@ -243,25 +243,25 @@ public class CommonServiceImpl {
//输出检测项第三次循环 //输出检测项第三次循环
for(String name : checkResutlList){ for(String name : checkResutlList){
if(name.equals("合量")){ if(name.equals("合量")){
BigDecimal countHL = CheckCountUtil.countHL(countMap); String countHL = CheckCountUtil.countHL(countMap);
countMap.put(name, countHL); countMap.put(name, countHL);
}else if(name.equals("Mad")){ }else if(name.equals("Mad")){
BigDecimal countMad = CheckCountUtil.countMad(countMap); String countMad = CheckCountUtil.countMad(countMap);
countMap.put(name, countMad); countMap.put(name, countMad);
}else if(name.equals("Aad")){ }else if(name.equals("Aad")){
BigDecimal countAad = CheckCountUtil.countAad(countMap); String countAad = CheckCountUtil.countAad(countMap);
countMap.put(name, countAad); countMap.put(name, countAad);
}else if(name.equals("Vad1")){ }else if(name.equals("Vad1")){
BigDecimal countVad1 = CheckCountUtil.countVad1(resultMap, countMap); String countVad1 = CheckCountUtil.countVad1(resultMap, countMap);
countMap.put(name, countVad1); countMap.put(name, countVad1);
}else if(name.equals("Vad2")) { }else if(name.equals("Vad2")) {
BigDecimal countVad2 = CheckCountUtil.countVad2(resultMap, countMap); String countVad2 = CheckCountUtil.countVad2(resultMap, countMap);
countMap.put(name, countVad2); countMap.put(name, countVad2);
}else if(name.equals("Mad判断")) { }else if(name.equals("Mad判断")) {
Integer countMadPD = CheckCountUtil.countMadPD(countMap); String countMadPD = CheckCountUtil.countMadPD(countMap);
countMap.put(name, countMadPD); countMap.put(name, countMadPD);
}else if(name.equals("Ad")) { }else if(name.equals("Ad")) {
BigDecimal countAd = CheckCountUtil.countAd(countMap); String countAd = CheckCountUtil.countAd(countMap);
countMap.put(name, countAd); countMap.put(name, countAd);
} }
...@@ -270,13 +270,13 @@ public class CommonServiceImpl { ...@@ -270,13 +270,13 @@ public class CommonServiceImpl {
//输出检测项第四次循环 //输出检测项第四次循环
for(String name : checkResutlList){ for(String name : checkResutlList){
if(name.equals("报出_Vad")){ if(name.equals("报出_Vad")){
BigDecimal countBCVad = CheckCountUtil.countBCVad(countMap); String countBCVad = CheckCountUtil.countBCVad(countMap);
countMap.put(name, countBCVad); countMap.put(name, countBCVad);
}else if(name.equals("Ad系数0.1或0")) { }else if(name.equals("Ad系数0.1或0")) {
BigDecimal countAdXS = CheckCountUtil.countAdXS(countMap); String countAdXS = CheckCountUtil.countAdXS(countMap);
countMap.put(name, countAdXS); countMap.put(name, countAdXS);
}else if(name.equals("Vdaf系数0.8~0.95")) { }else if(name.equals("Vdaf系数0.8~0.95")) {
BigDecimal countVdafXS = CheckCountUtil.countVdafXS(countMap); String countVdafXS = CheckCountUtil.countVdafXS(countMap);
countMap.put(name, countVdafXS); countMap.put(name, countVdafXS);
} }
...@@ -285,7 +285,7 @@ public class CommonServiceImpl { ...@@ -285,7 +285,7 @@ public class CommonServiceImpl {
//输出检测项第五次循环 //输出检测项第五次循环
for(String name : checkResutlList){ for(String name : checkResutlList){
if(name.equals("Vad")){ if(name.equals("Vad")){
BigDecimal countVad = CheckCountUtil.countVad(countMap); String countVad = CheckCountUtil.countVad(countMap);
countMap.put(name, countVad); countMap.put(name, countVad);
} }
} }
...@@ -293,7 +293,7 @@ public class CommonServiceImpl { ...@@ -293,7 +293,7 @@ public class CommonServiceImpl {
//输出检测项第六次循环 //输出检测项第六次循环
for(String name : checkResutlList){ for(String name : checkResutlList){
if(name.equals("Vdaf")){ if(name.equals("Vdaf")){
BigDecimal countVdaf = CheckCountUtil.countVdaf(countMap); String countVdaf = CheckCountUtil.countVdaf(countMap);
countMap.put(name, countVdaf); countMap.put(name, countVdaf);
} }
} }
...@@ -301,16 +301,16 @@ public class CommonServiceImpl { ...@@ -301,16 +301,16 @@ public class CommonServiceImpl {
//输出检测项第七次循环 //输出检测项第七次循环
for(String name : checkResutlList){ for(String name : checkResutlList){
if(name.equals("K1,")){ if(name.equals("K1,")){
BigDecimal countK1_ = CheckCountUtil.countK1_(countMap); String countK1_ = CheckCountUtil.countK1_(countMap);
countMap.put(name, countK1_); countMap.put(name, countK1_);
}else if(name.equals("K")) { }else if(name.equals("K")) {
String countK = CheckCountUtil.countK(resultMap, countMap); String countK = CheckCountUtil.countK(resultMap, countMap);
countMap.put(name, countK); countMap.put(name, countK);
}else if(name.equals("Vdaf判断")) { }else if(name.equals("Vdaf判断")) {
Integer countVdafPD = CheckCountUtil.countVdafPD(countMap); String countVdafPD = CheckCountUtil.countVdafPD(countMap);
countMap.put(name, countVdafPD); countMap.put(name, countVdafPD);
}else if(name.equals("V,daf")) { }else if(name.equals("V,daf")) {
BigDecimal countV_daf = CheckCountUtil.countV_daf(countMap); String countV_daf = CheckCountUtil.countV_daf(countMap);
countMap.put(name, countV_daf); countMap.put(name, countV_daf);
} }
...@@ -319,10 +319,10 @@ public class CommonServiceImpl { ...@@ -319,10 +319,10 @@ public class CommonServiceImpl {
//输出检测项第八次循环 //输出检测项第八次循环
for(String name : checkResutlList){ for(String name : checkResutlList){
if(name.equals("40Mad 0或1")){ if(name.equals("40Mad 0或1")){
BigDecimal count40Mad0Or1 = CheckCountUtil.count40Mad0Or1(countMap); String count40Mad0Or1 = CheckCountUtil.count40Mad0Or1(countMap);
countMap.put(name, count40Mad0Or1); countMap.put(name, count40Mad0Or1);
}else if(name.equals("K0,")) { }else if(name.equals("K0,")) {
BigDecimal countK0_ = CheckCountUtil.countK0_(countMap); String countK0_ = CheckCountUtil.countK0_(countMap);
countMap.put(name, countK0_); countMap.put(name, countK0_);
} }
} }
...@@ -330,7 +330,7 @@ public class CommonServiceImpl { ...@@ -330,7 +330,7 @@ public class CommonServiceImpl {
//输出检测项第九次循环 //输出检测项第九次循环
for(String name : checkResutlList){ for(String name : checkResutlList){
if(name.equals("Qnet,ad MJ/kg")){ if(name.equals("Qnet,ad MJ/kg")){
BigDecimal countQnet_adMJ_kg = CheckCountUtil.countQnet_adMJ_kg(resultMap, countMap); String countQnet_adMJ_kg = CheckCountUtil.countQnet_adMJ_kg(resultMap, countMap);
countMap.put(name, countQnet_adMJ_kg); countMap.put(name, countQnet_adMJ_kg);
} }
} }
......
...@@ -8,6 +8,7 @@ import cn.wise.sc.cement.business.model.PageQuery; ...@@ -8,6 +8,7 @@ import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.query.*; import cn.wise.sc.cement.business.model.query.*;
import cn.wise.sc.cement.business.model.vo.*; import cn.wise.sc.cement.business.model.vo.*;
import cn.wise.sc.cement.business.service.*; import cn.wise.sc.cement.business.service.*;
import cn.wise.sc.cement.business.util.CheckCountUtil;
import cn.wise.sc.cement.business.util.RedisUtil; import cn.wise.sc.cement.business.util.RedisUtil;
import cn.wise.sc.cement.business.wrapper.page.Query; import cn.wise.sc.cement.business.wrapper.page.Query;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
...@@ -96,6 +97,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -96,6 +97,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
private SampleCheckMapper sampleCheckMapper; private SampleCheckMapper sampleCheckMapper;
@Resource @Resource
private SampleCheckTeamMapper sampleCheckTeamMapper; private SampleCheckTeamMapper sampleCheckTeamMapper;
@Resource
private EquipmentUseMapper equipmentUseMapper;
/** /**
* 委托分页 * 委托分页
...@@ -1345,12 +1348,93 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1345,12 +1348,93 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
* @param mainResult * @param mainResult
* @return * @return
*/ */
public BaseResponse<Map<String, Object>> checkCount(Integer teamGroupId, Map<String, Object> mainResult){ public BaseResponse<Map<String, String>> checkCount(Integer teamGroupId,Integer isParallel,
Map<String, Object> map = commonService.checkCount(teamGroupId, mainResult); Map<String, Object> mainResult,
return BaseResponse.okData(map); Map<String, Object> secondaryResult){
List<String> checkResutlList = teamMapper.getByGroup(teamGroupId);
Map<String, String> countMap = new HashMap<>();
if(isParallel == 0){
Map<String, String> mainMap = commonService.checkCount(checkResutlList, mainResult);
countMap = mainMap;
}else if(isParallel == 0){
Map<String, String> mainMap = commonService.checkCount(checkResutlList, mainResult);
Map<String, String> secondaryMap = commonService.checkCount(checkResutlList, mainResult);
for(String name : checkResutlList){
if(name.equals("L.O.I")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("SiO2")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("Al2O3+TiO2")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("Al2O3")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("Fe2O3")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("CaO")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("MgO")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("TiO2")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("K2O")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("Na2O")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("SO3")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("Cl")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("合量")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("KH")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("SM")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else if(name.equals("AM")){
String parallelResult =
CheckCountUtil.countParallel(mainMap.get(name),secondaryMap.get(name));
countMap.put(name, name);
}else{
countMap.put(name, mainMap.get(name));
}
}
}
return BaseResponse.okData(countMap);
} }
/** /**
* 数据校核 * 数据校核
* @param query * @param query
...@@ -1377,7 +1461,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1377,7 +1461,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
String cementCode = ""; String cementCode = "";
if(query.getSampleCheckTeamQueryList() != null && query.getSampleCheckTeamQueryList().size()>0){ if(query.getSampleCheckTeamQueryList() != null && query.getSampleCheckTeamQueryList().size()>0){
List<SampleCheckTeamQuery> sctQueryList = query.getSampleCheckTeamQueryList(); List<SampleCheckTeamQuery> sctQueryList = query.getSampleCheckTeamQueryList();
List<EquipmentUse> useList = new ArrayList<>();
for(SampleCheckTeamQuery sctQuery : sctQueryList){ for(SampleCheckTeamQuery sctQuery : sctQueryList){
if(sctQuery==null || sctQuery.getCementCode() == null){ if(sctQuery==null || sctQuery.getCementCode() == null){
return BaseResponse.errorMsg("检测组或样品信息错误"); return BaseResponse.errorMsg("检测组或样品信息错误");
...@@ -1395,10 +1478,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1395,10 +1478,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.setCountResult(sctQuery.getEndResult().toString()) .setCountResult(sctQuery.getEndResult().toString())
.setIsParallel(sctQuery.getIsParallel()) .setIsParallel(sctQuery.getIsParallel())
.setCreateTime(LocalDateTime.now()); .setCreateTime(LocalDateTime.now());
sampleCheckService.save(check); sampleCheckMapper.insert(check);
//保存校核检测组检测项信息 //保存校核检测组检测项信息
List<SampleCheckTeam> sampleCheckTeamList = new ArrayList<>(); // List<SampleCheckTeam> sampleCheckTeamList = new ArrayList<>();
SampleCheckTeam sampleCheckTeam = new SampleCheckTeam(); SampleCheckTeam sampleCheckTeam = new SampleCheckTeam();
sampleCheckTeam.setCheckId(check.getId()) sampleCheckTeam.setCheckId(check.getId())
.setSampleId(sctQuery.getMainSampleId()) .setSampleId(sctQuery.getMainSampleId())
...@@ -1407,8 +1490,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1407,8 +1490,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.setEquipmentName(sctQuery.getMainEquipmentName()) .setEquipmentName(sctQuery.getMainEquipmentName())
.setInputResult(sctQuery.getMainResult().toString()) .setInputResult(sctQuery.getMainResult().toString())
.setCreateTime(LocalDateTime.now()); .setCreateTime(LocalDateTime.now());
if(check.getIsParallel() == 0){ sampleCheckTeamMapper.insert(sampleCheckTeam);
sampleCheckTeamService.save(sampleCheckTeam);
//添加设备使用记录 设备使用记录表 equipment_use //添加设备使用记录 设备使用记录表 equipment_use
EquipmentUse equipmentUse = new EquipmentUse(); EquipmentUse equipmentUse = new EquipmentUse();
SysUser sysUser = userService.getById(sampleCheckTeam.getUserId()); SysUser sysUser = userService.getById(sampleCheckTeam.getUserId());
...@@ -1422,9 +1504,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1422,9 +1504,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.setTestItem(check.getTeamGroupName()) .setTestItem(check.getTeamGroupName())
.setCreateTime(LocalDateTime.now()) .setCreateTime(LocalDateTime.now())
.setRemark("委托派发-数据校核"); .setRemark("委托派发-数据校核");
useList.add(equipmentUse); equipmentUseMapper.insert(equipmentUse);
}else{ if(check.getIsParallel() == 1){
sampleCheckTeamList.add(sampleCheckTeam);
SampleCheckTeam sampleCheckTeam2 = new SampleCheckTeam(); SampleCheckTeam sampleCheckTeam2 = new SampleCheckTeam();
sampleCheckTeam2.setCheckId(check.getId()) sampleCheckTeam2.setCheckId(check.getId())
.setSampleId(sctQuery.getSecondarySampleId()) .setSampleId(sctQuery.getSecondarySampleId())
...@@ -1433,14 +1514,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1433,14 +1514,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.setEquipmentName(sctQuery.getSecondaryEquipmentName()) .setEquipmentName(sctQuery.getSecondaryEquipmentName())
.setInputResult(sctQuery.getSecondaryResult().toString()) .setInputResult(sctQuery.getSecondaryResult().toString())
.setCreateTime(sampleCheckTeam.getCreateTime()); .setCreateTime(sampleCheckTeam.getCreateTime());
sampleCheckTeamList.add(sampleCheckTeam2); sampleCheckTeamMapper.insert(sampleCheckTeam2);
sampleCheckTeamService.saveBatch(sampleCheckTeamList);
//添加设备使用记录 设备使用记录表 equipment_use //添加设备使用记录 设备使用记录表 equipment_use
for(SampleCheckTeam scTeam : sampleCheckTeamList){ EquipmentUse equipmentUse2 = new EquipmentUse();
EquipmentUse equipmentUse = new EquipmentUse(); SysUser sysUser2 = userService.getById(sampleCheckTeam2.getUserId());
SysUser sysUser = userService.getById(scTeam.getUserId()); equipmentUse2.setEquipmentId(sampleCheckTeam2.getEquipmentId())
equipmentUse.setEquipmentId(scTeam.getEquipmentId()) .setUserId(sampleCheckTeam2.getUserId())
.setUserId(scTeam.getUserId())
.setUserName(sysUser.getName()) .setUserName(sysUser.getName())
.setUseDate(LocalDate.now()) .setUseDate(LocalDate.now())
.setProjectId(entrust.getProjectId()) .setProjectId(entrust.getProjectId())
...@@ -1449,11 +1528,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl ...@@ -1449,11 +1528,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.setTestItem(check.getTeamGroupName()) .setTestItem(check.getTeamGroupName())
.setCreateTime(LocalDateTime.now()) .setCreateTime(LocalDateTime.now())
.setRemark("委托派发-数据校核"); .setRemark("委托派发-数据校核");
useList.add(equipmentUse); equipmentUseMapper.insert(equipmentUse2);
}
} }
} }
equipmentUseService.saveBatch(useList);
} }
//更新样品表状态为已经校核状态 is_check 0未处理 1处理完成 //更新样品表状态为已经校核状态 is_check 0未处理 1处理完成
QueryWrapper<Sample> sampleQW = new QueryWrapper<>(); QueryWrapper<Sample> sampleQW = new QueryWrapper<>();
......
...@@ -146,21 +146,29 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -146,21 +146,29 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
if(query== null || query.getEquipmentId()==null){ if(query== null || query.getEquipmentId()==null){
return BaseResponse.errorMsg("参数错误!"); return BaseResponse.errorMsg("参数错误!");
} }
EquipmentVo equipmentVo = equipmentMapper.getDetail(query.getEquipmentId()); // EquipmentVo equipmentVo = equipmentMapper.getDetail(query.getEquipmentId());
if(equipmentVo == null){ Equipment equipment = equipmentMapper.selectById(query.getEquipmentId());
if(equipment == null){
return BaseResponse.errorMsg("信息错误!"); return BaseResponse.errorMsg("信息错误!");
} }
EnclosureQuery enclosureQuery = query.getEnclosureQuery();
EquipmentTest equipmentTest = new EquipmentTest(); EquipmentTest equipmentTest = new EquipmentTest();
BeanUtils.copyProperties(query, equipmentTest); BeanUtils.copyProperties(query, equipmentTest);
if(query.getId() == null){
equipmentTest.setUserId(userService.getLoginUser().getId()) equipmentTest.setUserId(userService.getLoginUser().getId())
.setCreateTime(LocalDateTime.now()); .setCreateTime(LocalDateTime.now());
testMapper.insert(equipmentTest); testMapper.insert(equipmentTest);
}else{ equipment.setTestDate(equipmentTest.getTestDate());
testMapper.updateById(equipmentTest); equipment.setCheckDate(equipmentTest.getCheckDate());
} equipment.setPeriodDate(equipmentTest.getPeriodDate());
equipment.setTryResult(equipmentTest.getTryResult());
equipment.setEnclosureUrl(enclosureQuery.getEnclosureUrl());
equipment.setAlias(enclosureQuery.getAlias());
equipment.setExtName(enclosureQuery.getExtName());
equipmentMapper.updateById(equipment);
//保存校核附件信息 //保存校核附件信息
Boolean ref = commonService.saveEntityEnclosure(EntityEnclosure.EntityType.EQUIPMENT_TEST, equipmentTest.getId(), query.getEnclosureQueryList()); List<EnclosureQuery> enclosureQueryList = new ArrayList<>();
enclosureQueryList.add(enclosureQuery);
Boolean ref = commonService.saveEntityEnclosure(EntityEnclosure.EntityType.EQUIPMENT_TEST, equipmentTest.getId(), enclosureQueryList);
if(!ref){ if(!ref){
return BaseResponse.errorMsg("保存保存校核附件失败!"); return BaseResponse.errorMsg("保存保存校核附件失败!");
} }
......
...@@ -81,6 +81,12 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT ...@@ -81,6 +81,12 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT
if(query.getMethodId() == null){ if(query.getMethodId() == null){
return BaseResponse.errorMsg("请选择检依据"); return BaseResponse.errorMsg("请选择检依据");
} }
if(query.getIsDisplay() == null){
return BaseResponse.errorMsg("请选择委托是否可见");
}
if(query.getIsDisplay() != 1 && query.getIsDisplay() !=0){
return BaseResponse.errorMsg("委托是否可见参数错误");
}
BeanUtils.copyProperties(query, create); BeanUtils.copyProperties(query, create);
create.setStatus(1).setCreateTime(LocalDateTime.now()); create.setStatus(1).setCreateTime(LocalDateTime.now());
teamMapper.insert(create); teamMapper.insert(create);
......
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