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

校核接口完成。联调中

parent 1c14e234
......@@ -338,15 +338,18 @@ public class EntrustController {
@ApiOperation(value = "校核计算")
@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 {
return entrustService.checkCount(teamGroupId, mainResult);
return entrustService.checkCount(teamGroupId, isParallel, mainResult, secondaryResult);
}catch (Exception e) {
log.debug("校核计算{}",e);
}
return BaseResponse.errorMsg("失败!");
}
@ApiOperation(value = "数据校核")
@PostMapping("/check")
public BaseResponse check(@RequestBody CheckQuery query) {
......
......@@ -42,7 +42,7 @@ public class EquipmentController {
private IEquipmentService equipmentService;
@ApiOperation(value = "设备分页列表")
@ApiOperation(value = "设备分页列表 (设备列表,设备检定列表)")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "brand", value = "设备品牌", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "supplierId", value = "供应商表id", paramType = "query", dataType = "Integer"),
......@@ -116,7 +116,7 @@ public class EquipmentController {
return BaseResponse.errorMsg("失败!");
}
@ApiOperation(value = "检定设备 (不传id为添加记录,传id为修改记录)")
@ApiOperation(value = "检定设备")
@PostMapping("/test")
public BaseResponse test(@RequestBody EquipmentTestQuery query) {
try {
......@@ -127,7 +127,7 @@ public class EquipmentController {
return BaseResponse.errorMsg("失败!");
}
@ApiOperation(value = "设备检定分页列表")
/* @ApiOperation(value = "设备检定分页列表")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "equipmentId", value = "设备表id", paramType = "query", dataType = "Integer")
})
......@@ -139,8 +139,9 @@ public class EquipmentController {
log.debug("设备检定分页列表{}", e);
}
return BaseResponse.errorMsg("失败!");
}
}*/
/*
@ApiOperation(value = "设备检定详情")
@GetMapping("getTestDetail/{id}")
public BaseResponse getTestDetail(@PathVariable Integer id){
......@@ -151,6 +152,7 @@ public class EquipmentController {
}
return BaseResponse.errorMsg("失败!");
}
*/
@ApiOperation(value = "设备故障维修登记 (不传id为添加记录,传id为修改记录)")
......
......@@ -67,6 +67,27 @@ public class Equipment implements Serializable {
@ApiModelProperty("检/校周期(年)")
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("创建时间")
private LocalDateTime createTime;
......
......@@ -57,6 +57,9 @@ public class Team extends BaseEntity implements Serializable {
@ApiModelProperty("状态 0:禁用 1:激活")
private Integer status;
@ApiModelProperty("委托是否可见 0:不可见 1:可见")
private Integer isDisplay;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
......
......@@ -31,7 +31,7 @@
m.name as methodName, m.number as number
FROM team t
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
</select>
......
......@@ -19,9 +19,6 @@ import java.util.List;
@ApiModel("设备检定请求")
public class EquipmentTestQuery {
@ApiModelProperty("设备检定表id")
private Integer id;
@ApiModelProperty("设备表id")
private Integer equipmentId;
......@@ -41,6 +38,6 @@ public class EquipmentTestQuery {
private String remark;
@ApiModelProperty("校核附件信息")
private List<EnclosureQuery> enclosureQueryList;
private EnclosureQuery enclosureQuery;
}
......@@ -34,5 +34,8 @@ public class TeamQuery {
@ApiModelProperty("资质范围")
private String qualifications;
@ApiModelProperty("是否可见 0:不可见 1:可见")
private Integer isDisplay;
}
......@@ -57,6 +57,27 @@ public class EquipmentVo {
@ApiModelProperty("检/校周期(年)")
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("创建时间")
private LocalDateTime createTime;
......
......@@ -95,6 +95,15 @@ public class SampleVo {
@ApiModelProperty("项目编号")
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> {
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);
......
......@@ -156,14 +156,14 @@ public class CommonServiceImpl {
/**
*
* @param teamGroupId 检测组id
* @param checkResutlList 检测组id集合
* @param resultMap 输入集合
* @return
*/
public Map<String, Object> checkCount(Integer teamGroupId, Map<String, Object> resultMap ){
List<String> checkResutlList = teamMapper.getByGroup(teamGroupId);
public Map<String, String> checkCount(List<String> checkResutlList, Map<String, Object> resultMap ){
// List<String> checkResutlList = teamMapper.getByGroup(teamGroupId);
//定义输出集合
Map<String, Object> countMap = new HashMap<>();
Map<String, String> countMap = new HashMap<>();
//输出检测项第一次循环
for(String name : checkResutlList){
if(name.equals("L.O.I")){
......@@ -216,25 +216,25 @@ public class CommonServiceImpl {
//输出检测项第二次循环
for(String name : checkResutlList){
if(name.equals("SO3")){
BigDecimal countSO3 = CheckCountUtil.countSO3(resultMap, countMap);
String countSO3 = CheckCountUtil.countSO3(resultMap, countMap);
countMap.put(name, countSO3);
}else if(name.equals("KH")){
BigDecimal countKH = CheckCountUtil.countKH(countMap);
String countKH = CheckCountUtil.countKH(countMap);
countMap.put(name, countKH);
}else if(name.equals("SM")){
BigDecimal countSM = CheckCountUtil.countSM(countMap);
String countSM = CheckCountUtil.countSM(countMap);
countMap.put(name, countSM);
}else if(name.equals("AM")){
BigDecimal countAM = CheckCountUtil.countAM(countMap);
String countAM = CheckCountUtil.countAM(countMap);
countMap.put(name, countAM);
}else if(name.equals("易烧性等级")){
String burnupLevel = CheckCountUtil.countBurnupLevel(resultMap,countMap);
countMap.put(name, burnupLevel);
}else if(name.equals("报出_Mad")){
BigDecimal countBCMad = CheckCountUtil.countBCMad(countMap);
String countBCMad = CheckCountUtil.countBCMad(countMap);
countMap.put(name, countBCMad);
}else if(name.equals("报出_Aad")){
BigDecimal countBCAad = CheckCountUtil.countBCAad(countMap);
String countBCAad = CheckCountUtil.countBCAad(countMap);
countMap.put(name, countBCAad);
}
......@@ -243,25 +243,25 @@ public class CommonServiceImpl {
//输出检测项第三次循环
for(String name : checkResutlList){
if(name.equals("合量")){
BigDecimal countHL = CheckCountUtil.countHL(countMap);
String countHL = CheckCountUtil.countHL(countMap);
countMap.put(name, countHL);
}else if(name.equals("Mad")){
BigDecimal countMad = CheckCountUtil.countMad(countMap);
String countMad = CheckCountUtil.countMad(countMap);
countMap.put(name, countMad);
}else if(name.equals("Aad")){
BigDecimal countAad = CheckCountUtil.countAad(countMap);
String countAad = CheckCountUtil.countAad(countMap);
countMap.put(name, countAad);
}else if(name.equals("Vad1")){
BigDecimal countVad1 = CheckCountUtil.countVad1(resultMap, countMap);
String countVad1 = CheckCountUtil.countVad1(resultMap, countMap);
countMap.put(name, countVad1);
}else if(name.equals("Vad2")) {
BigDecimal countVad2 = CheckCountUtil.countVad2(resultMap, countMap);
String countVad2 = CheckCountUtil.countVad2(resultMap, countMap);
countMap.put(name, countVad2);
}else if(name.equals("Mad判断")) {
Integer countMadPD = CheckCountUtil.countMadPD(countMap);
String countMadPD = CheckCountUtil.countMadPD(countMap);
countMap.put(name, countMadPD);
}else if(name.equals("Ad")) {
BigDecimal countAd = CheckCountUtil.countAd(countMap);
String countAd = CheckCountUtil.countAd(countMap);
countMap.put(name, countAd);
}
......@@ -270,13 +270,13 @@ public class CommonServiceImpl {
//输出检测项第四次循环
for(String name : checkResutlList){
if(name.equals("报出_Vad")){
BigDecimal countBCVad = CheckCountUtil.countBCVad(countMap);
String countBCVad = CheckCountUtil.countBCVad(countMap);
countMap.put(name, countBCVad);
}else if(name.equals("Ad系数0.1或0")) {
BigDecimal countAdXS = CheckCountUtil.countAdXS(countMap);
String countAdXS = CheckCountUtil.countAdXS(countMap);
countMap.put(name, countAdXS);
}else if(name.equals("Vdaf系数0.8~0.95")) {
BigDecimal countVdafXS = CheckCountUtil.countVdafXS(countMap);
String countVdafXS = CheckCountUtil.countVdafXS(countMap);
countMap.put(name, countVdafXS);
}
......@@ -285,7 +285,7 @@ public class CommonServiceImpl {
//输出检测项第五次循环
for(String name : checkResutlList){
if(name.equals("Vad")){
BigDecimal countVad = CheckCountUtil.countVad(countMap);
String countVad = CheckCountUtil.countVad(countMap);
countMap.put(name, countVad);
}
}
......@@ -293,7 +293,7 @@ public class CommonServiceImpl {
//输出检测项第六次循环
for(String name : checkResutlList){
if(name.equals("Vdaf")){
BigDecimal countVdaf = CheckCountUtil.countVdaf(countMap);
String countVdaf = CheckCountUtil.countVdaf(countMap);
countMap.put(name, countVdaf);
}
}
......@@ -301,16 +301,16 @@ public class CommonServiceImpl {
//输出检测项第七次循环
for(String name : checkResutlList){
if(name.equals("K1,")){
BigDecimal countK1_ = CheckCountUtil.countK1_(countMap);
String countK1_ = CheckCountUtil.countK1_(countMap);
countMap.put(name, countK1_);
}else if(name.equals("K")) {
String countK = CheckCountUtil.countK(resultMap, countMap);
countMap.put(name, countK);
}else if(name.equals("Vdaf判断")) {
Integer countVdafPD = CheckCountUtil.countVdafPD(countMap);
String countVdafPD = CheckCountUtil.countVdafPD(countMap);
countMap.put(name, countVdafPD);
}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);
}
......@@ -319,10 +319,10 @@ public class CommonServiceImpl {
//输出检测项第八次循环
for(String name : checkResutlList){
if(name.equals("40Mad 0或1")){
BigDecimal count40Mad0Or1 = CheckCountUtil.count40Mad0Or1(countMap);
String count40Mad0Or1 = CheckCountUtil.count40Mad0Or1(countMap);
countMap.put(name, count40Mad0Or1);
}else if(name.equals("K0,")) {
BigDecimal countK0_ = CheckCountUtil.countK0_(countMap);
String countK0_ = CheckCountUtil.countK0_(countMap);
countMap.put(name, countK0_);
}
}
......@@ -330,7 +330,7 @@ public class CommonServiceImpl {
//输出检测项第九次循环
for(String name : checkResutlList){
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);
}
}
......
......@@ -146,21 +146,29 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
if(query== null || query.getEquipmentId()==null){
return BaseResponse.errorMsg("参数错误!");
}
EquipmentVo equipmentVo = equipmentMapper.getDetail(query.getEquipmentId());
if(equipmentVo == null){
// EquipmentVo equipmentVo = equipmentMapper.getDetail(query.getEquipmentId());
Equipment equipment = equipmentMapper.selectById(query.getEquipmentId());
if(equipment == null){
return BaseResponse.errorMsg("信息错误!");
}
EnclosureQuery enclosureQuery = query.getEnclosureQuery();
EquipmentTest equipmentTest = new EquipmentTest();
BeanUtils.copyProperties(query, equipmentTest);
if(query.getId() == null){
equipmentTest.setUserId(userService.getLoginUser().getId())
.setCreateTime(LocalDateTime.now());
testMapper.insert(equipmentTest);
}else{
testMapper.updateById(equipmentTest);
}
equipmentTest.setUserId(userService.getLoginUser().getId())
.setCreateTime(LocalDateTime.now());
testMapper.insert(equipmentTest);
equipment.setTestDate(equipmentTest.getTestDate());
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){
return BaseResponse.errorMsg("保存保存校核附件失败!");
}
......
......@@ -81,6 +81,12 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT
if(query.getMethodId() == null){
return BaseResponse.errorMsg("请选择检依据");
}
if(query.getIsDisplay() == null){
return BaseResponse.errorMsg("请选择委托是否可见");
}
if(query.getIsDisplay() != 1 && query.getIsDisplay() !=0){
return BaseResponse.errorMsg("委托是否可见参数错误");
}
BeanUtils.copyProperties(query, create);
create.setStatus(1).setCreateTime(LocalDateTime.now());
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