Compare commits
2 Commits
eaea741480
...
a49bee0abd
| Author | SHA1 | Date | |
|---|---|---|---|
| a49bee0abd | |||
| d0673f36b1 |
@@ -0,0 +1,53 @@
|
|||||||
|
package com.zt.plat.module.qms.thirdpartyapi.controller.admin;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.*;
|
||||||
|
import com.zt.plat.module.qms.thirdpartyapi.service.AutoIngredientsService;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动配料接口
|
||||||
|
*/
|
||||||
|
@Tag(name = "自动配料(自动火试金)接口")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/thirdpartyapi/auto-ingredients")
|
||||||
|
public class AutoIngredientsController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AutoIngredientsService autoIngredientsService;
|
||||||
|
|
||||||
|
@GetMapping("/task-list")
|
||||||
|
@Operation(summary = "获取检验批列表")
|
||||||
|
public CommonResult<?> taskList(AutoIngredientsTaskQueryReqVO reqVO) {
|
||||||
|
List<AutoIngredientsTaskRespVO> list = autoIngredientsService.taskList(reqVO);
|
||||||
|
return CommonResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/task-detail-list")
|
||||||
|
@Operation(summary = "获取检验批中的检测任务")
|
||||||
|
public CommonResult<?> taskDetailList(@RequestParam("id") Long id) {
|
||||||
|
List<AutoIngredientsTaskDetailRespVO> list = autoIngredientsService.taskDetailList(id);
|
||||||
|
return CommonResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/submit-assay-result")
|
||||||
|
@Operation(summary = "检测结果同步")
|
||||||
|
public CommonResult<?> submitAssayResult(@RequestBody AutoIngredientsTaskAssayResultReqVO body) {
|
||||||
|
System.out.println(com.alibaba.fastjson2.JSON.toJSONString(body));
|
||||||
|
autoIngredientsService.submitAssayResult(body);
|
||||||
|
return CommonResult.success("成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.zt.plat.module.qms.thirdpartyapi.controller.vo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AutoIngredientsTaskAssayResultReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "任务id")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
@Schema(description = "样品结果列表")
|
||||||
|
private List<AutoIngredientsTaskDetailAssayResultReqVO> sampleList;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.zt.plat.module.qms.thirdpartyapi.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AutoIngredientsTaskDetailAssayResultReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "样品id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "任务id")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
@Schema(description = "样品编号")
|
||||||
|
private String sampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "样品名称")
|
||||||
|
private String sampleName;
|
||||||
|
|
||||||
|
@Schema(description = "杯号(样品坩埚号)")
|
||||||
|
private String cupNumber;
|
||||||
|
|
||||||
|
@Schema(description = "碳酸钠")
|
||||||
|
private String ingredient_Na2CO3;
|
||||||
|
|
||||||
|
@Schema(description = "硼砂")
|
||||||
|
private String ingredient_Na2B4O7_10H2O;
|
||||||
|
|
||||||
|
@Schema(description = "氧化铅")
|
||||||
|
private String ingredient_PbO;
|
||||||
|
|
||||||
|
@Schema(description = "硝酸钾")
|
||||||
|
private String ingredient_KNO3;
|
||||||
|
|
||||||
|
@Schema(description = "面粉")
|
||||||
|
private String ingredient_C;
|
||||||
|
|
||||||
|
@Schema(description = "二氧化硅")
|
||||||
|
private String ingredient_SiO2;
|
||||||
|
|
||||||
|
@Schema(description = "硝酸银")
|
||||||
|
private String ingredient_AgNO3;
|
||||||
|
|
||||||
|
@Schema(description = "样品备注")
|
||||||
|
private String[] remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.zt.plat.module.qms.thirdpartyapi.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AutoIngredientsTaskDetailRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "样品id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "任务id")
|
||||||
|
private Long taskId;
|
||||||
|
|
||||||
|
@Schema(description = "样品编号")
|
||||||
|
private String sampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "样品名称")
|
||||||
|
private String sampleName;
|
||||||
|
|
||||||
|
@Schema(description = "杯号(样品坩埚号)")
|
||||||
|
private String cupNumber;
|
||||||
|
|
||||||
|
@Schema(description = "硫含量")
|
||||||
|
private String S;
|
||||||
|
|
||||||
|
@Schema(description = "铜含量")
|
||||||
|
private String Cu;
|
||||||
|
|
||||||
|
@Schema(description = "样品质量")
|
||||||
|
private String sampleWeight;
|
||||||
|
|
||||||
|
@Schema(description = "检测项目(测定元素)")
|
||||||
|
private String assayProject;
|
||||||
|
|
||||||
|
@Schema(description = "分析人登录名")
|
||||||
|
private String assayOperator;
|
||||||
|
|
||||||
|
@Schema(description = "分析人姓名")
|
||||||
|
private String assayOperatorName;
|
||||||
|
|
||||||
|
@Schema(description = "样品备注")
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.zt.plat.module.qms.thirdpartyapi.controller.vo;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动配料 任务查询
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AutoIngredientsTaskQueryReqVO {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务开始时间(yyyy-MM-dd HH:mm:ss)
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应)
|
||||||
|
@JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化(请求)
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "任务开始时间(yyyy-MM-dd HH:mm:ss)")
|
||||||
|
private LocalDateTime taskTimeStart;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务结束时间(yyyy-MM-dd HH:mm:ss)
|
||||||
|
*/
|
||||||
|
@JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应)
|
||||||
|
@JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化(请求)
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "任务结束时间(yyyy-MM-dd HH:mm:ss)")
|
||||||
|
private LocalDateTime taskTimeEnd;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.zt.plat.module.qms.thirdpartyapi.controller.vo;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动配料任务响应
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class AutoIngredientsTaskRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "任务id(样品组别)")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "任务编号")
|
||||||
|
private String taskNo;
|
||||||
|
|
||||||
|
@JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化(响应)
|
||||||
|
@JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化(请求)
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "任务时间(yyyy-MM-dd HH:mm:ss)")
|
||||||
|
private LocalDateTime taskTime;
|
||||||
|
|
||||||
|
@Schema(description = "分析登录名")
|
||||||
|
private String assayOperator;
|
||||||
|
|
||||||
|
@Schema(description = "分析人姓名")
|
||||||
|
private String assayOperatorName;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.zt.plat.module.qms.thirdpartyapi.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskAssayResultReqVO;
|
||||||
|
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskDetailRespVO;
|
||||||
|
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskQueryReqVO;
|
||||||
|
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskRespVO;
|
||||||
|
|
||||||
|
public interface AutoIngredientsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务列表
|
||||||
|
* @param reqVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<AutoIngredientsTaskRespVO> taskList(AutoIngredientsTaskQueryReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务明细
|
||||||
|
* @param taskId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<AutoIngredientsTaskDetailRespVO> taskDetailList(Long taskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步检测结果
|
||||||
|
* @param body
|
||||||
|
*/
|
||||||
|
void submitAssayResult(AutoIngredientsTaskAssayResultReqVO body);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.zt.plat.module.qms.thirdpartyapi.service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskExtendRespVO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper;
|
||||||
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
|
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskAssayResultReqVO;
|
||||||
|
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskDetailRespVO;
|
||||||
|
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskQueryReqVO;
|
||||||
|
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskRespVO;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AutoIngredientsServiceImpl implements AutoIngredientsService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessAssayTaskMapper businessAssayTaskMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessAssayTaskDetailMapper businessAssayTaskDetailMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessAssayParameterDataMapper businessAssayParameterDataMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AutoIngredientsTaskRespVO> taskList(AutoIngredientsTaskQueryReqVO reqVO) {
|
||||||
|
BusinessAssayTaskPageReqVO search = new BusinessAssayTaskPageReqVO();
|
||||||
|
search.setIsIngredients(QmsCommonConstant.YES);
|
||||||
|
search.setIngredientsStatus(QmsCommonConstant.IN_PROGRESS);
|
||||||
|
if (reqVO.getTaskTimeStart() != null && reqVO.getTaskTimeEnd() != null) {
|
||||||
|
LocalDateTime[] taskAssignSubmiTimes = {reqVO.getTaskTimeStart(), reqVO.getTaskTimeEnd()};
|
||||||
|
search.setTaskAssignSubmitTime(taskAssignSubmiTimes);
|
||||||
|
}
|
||||||
|
List<BusinessAssayTaskExtendRespVO> list = businessAssayTaskMapper.selectList(search);
|
||||||
|
List<AutoIngredientsTaskRespVO> resultList = list.stream().map(m -> new AutoIngredientsTaskRespVO(m.getId(), m.getTaskNo(), m.getTaskAssignSubmitTime(), m.getAssayOperator(), m.getAssayOperator())).collect(Collectors.toList());
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AutoIngredientsTaskDetailRespVO> taskDetailList(Long taskId) {
|
||||||
|
// List<BusinessAssayTaskDetailDO> list = businessAssayTaskDetailMapper.selectByBusinessAssayTaskId(taskId);
|
||||||
|
// businessAssayTaskDataMapper.selectByBusinessAssayTaskId(taskId)
|
||||||
|
List<AutoIngredientsTaskDetailRespVO> resultList = new ArrayList<>();
|
||||||
|
// for (BusinessAssayTaskDetailDO businessAssayTaskDetailDO : list) {
|
||||||
|
// AutoIngredientsTaskDetailRespVO autoIngredientsTaskDetailRespVO = new AutoIngredientsTaskDetailRespVO();
|
||||||
|
// autoIngredientsTaskDetailRespVO.setAssayOperator(null)
|
||||||
|
// resultList.add(autoIngredientsTaskDetailRespVO);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void submitAssayResult(AutoIngredientsTaskAssayResultReqVO body) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user