统计接口和增加标本上机接口

This commit is contained in:
jiangs 2026-04-08 16:34:44 +08:00
parent d11f9aac96
commit 35b7f74957
5 changed files with 88 additions and 44 deletions

View File

@ -3,6 +3,7 @@ package com.transitPlatForm.transitPF.controller;
import com.transitPlatForm.common.annotation.Anonymous;
import com.transitPlatForm.common.core.domain.Result;
import com.transitPlatForm.common.utils.DateUtils;
import com.transitPlatForm.interfaceCommon.utils.CommonUtil;
import com.transitPlatForm.transitPF.mapper.RegStatMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -27,18 +28,32 @@ import java.util.stream.Collectors;
public class RegStatController {
@Autowired
RegStatMapper regStatMapper;
@Autowired
private CommonUtil commonUtil;
@Anonymous
@ApiOperation("获取业务数据总数")
@GetMapping("/getallcount")
public Result getallcount() {
Date st= DateUtils.parseDate("2025-10-01");
Date et= DateUtils.parseDate("2025-11-01");
//获取当前日期的月份
String currentDateTime = commonUtil.getCurrentDateTime();
Date st = DateUtils.parseDate(currentDateTime.substring(0,7)+"-01");
int month = Integer.parseInt(currentDateTime.substring(5, 7));
int nextMonth = month + 1;
// 补零
String monthStr = nextMonth < 10 ? "0" + nextMonth : String.valueOf(nextMonth);
String currentDateTime1 = currentDateTime.substring(0, 4) + "-" + monthStr + "-01 00:00:00";
Date et = DateUtils.parseDate(currentDateTime1);
Map<String, Object> map = new HashMap<>();
Map<String, Object> regStatAll = regStatMapper.selectRegStatAll();
//概况
map.put("regStatAll", regStatAll);
List<Map<String, Object>> regStatMonth = regStatMapper.selectRegStatMonth(st, et);
List<Map<String, Object>> regStatMonth0 = regStatMonth.stream()
.sorted(Comparator.comparingInt(o -> (Integer) o.get("daynum"))).collect(Collectors.toList());
//委托机构当月送检标本数量(按天显示的)
map.put("regStatMonth", regStatMonth0);
List<Map<String, Object>> regStatHospMonth = regStatMapper.selectRegStatHospMonth(st, et);
if (!regStatHospMonth.isEmpty()) {
@ -57,6 +72,7 @@ public class RegStatController {
int val2 = (Integer) o2.get("sl");
return Integer.compare(val2, val1);
}).collect(Collectors.toList());
//送检样本状态占比
map.put("regStatStatus", regStatStatus0);
List<Map<String, Object>> regStatSample = regStatMapper.selectRegStatSample(st, et);
List<Map<String, Object>> regStatSample0 = regStatSample.stream()
@ -65,9 +81,11 @@ public class RegStatController {
int val2 = (Integer) o2.get("sl");
return Integer.compare(val2, val1);
}).collect(Collectors.toList());
//送检样本占比
map.put("regStatSample", regStatSample0);
return new Result("0", "成功", map);
}
private List<Map<String, Object>> setmapgroup(List<Map<String, Object>> maps) {
List<Map<String, Object>> mapref = new ArrayList<>();
if (!maps.isEmpty()) {
@ -102,6 +120,7 @@ public class RegStatController {
}
return mapref;
}
List<Map<String, Object>> setdayline(List<Map<String, Object>> maps, Integer lastnum) {
List<Map<String, Object>> mapref = new ArrayList<>();
if (!maps.isEmpty()) {

View File

@ -4,6 +4,8 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ -12,4 +14,6 @@ public class RegItemVO {
private String SrcOrderItemCode;
private String SrcOrderItemName;
private String DstHospName;
private Date DateStart;
private Date DateEnd;
}

View File

@ -58,4 +58,10 @@ public class SampleSignVO {
private String cancelName;
@ApiModelProperty(value = "标本退回时间")
private Date backTime;
@ApiModelProperty(value = "上机时间")
private Date operdatetime;
@ApiModelProperty(value = "上机操作人代码")
private String opercode;
@ApiModelProperty(value = "上机操作人姓名")
private String opername;
}

View File

@ -258,6 +258,20 @@ public class RegInterfaceImpl {
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample50,regApply);
break;
case "60": //上机检测
if(Integer.parseInt(status) == 90 || Integer.parseInt(status) == 70) return new Result("-1","该标本已经作废或者已经审核,不允许再上机!");
Date operdatetime = sampleSignVO.getOperdatetime();
String opercode = sampleSignVO.getOpercode();
String opername = sampleSignVO.getOpername();
if(operdatetime == null) return new Result("-1","上机时间不能为空!");
if(opername == null || opername.equals("")) return new Result("-1","上机人姓名不能为空!");
RegTransitSample regTransitSample60 = new RegTransitSample();
regTransitSample60.setBarcode(barcode);
regTransitSample60.setOperdatetime(operdatetime);
regTransitSample60.setOpercode(opercode);
regTransitSample60.setOpername(opername);
regTransitSample60.setStatus("60");
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample60,regApply);
break;
case "70": //结果审核
Date reportTime = sampleSignVO.getReportTime();

View File

@ -8,20 +8,21 @@
select srchospname,sampletypecode,sampletypename,count(1) as sl from reg_TransitSample
<where>
<if test="SrcHospName != null and SrcHospName !=''">and SrcHospName = #{SrcHospName}</if>
<if test="SampleTypeCode != null and SampleTypeCode !=''">and sampletypecode = #{SampleTypeCode}</if>
<if test="SampleTypeName != null and SampleTypeName !=''">and sampletypename = #{SampleTypeName}</if>
<if test="OrderTime != null">and (OrderTime between #{DateStart} and #{DateEnd})</if>
<if test="SampleTypeCode != null and SampleTypeCode !=''">and sampletypecode like '%'+#{SampleTypeCode}+'%' </if>
<if test="SampleTypeName != null and SampleTypeName !=''">and sampletypename like '%'+#{SampleTypeName}+'%'</if>
<if test="DateStart != null">and (OrderTime between #{DateStart} and #{DateEnd})</if>
</where>
group by srchospname,sampletypecode,sampletypename
</select>
<select id="getItemCount" resultType="map">
select a.SrcHospName,b.SrcOrderItemCode,b.SrcOrderItemName,count(1) as sl,b.cost,a.DstHospName from reg_TransitSample a,reg_TransitSample_detail b where a.barcode = b.barcode
select a.SrcHospName,isnull(b.SrcOrderItemCode,b.orderitemcode) as SrcOrderItemCode,isnull(b.SrcOrderItemName,b.orderitemname) as SrcOrderItemName ,count(1) as sl,b.cost,a.DstHospName from reg_TransitSample a,reg_TransitSample_detail b where a.barcode = b.barcode
<if test="SrcHospName != null and SrcHospName !=''">and SrcHospName = #{SrcHospName}</if>
<if test="SrcOrderItemCode != null and SrcOrderItemCode !=''">and SrcOrderItemCode = #{SrcOrderItemCode}</if>
<if test="SrcOrderItemName != null and SrcOrderItemName !=''">and SrcOrderItemName = #{SrcOrderItemName}</if>
<if test="SrcOrderItemCode != null and SrcOrderItemCode !=''">and SrcOrderItemCode like '%'+#{SrcOrderItemCode}+'%' </if>
<if test="SrcOrderItemName != null and SrcOrderItemName !=''">and isnull(b.SrcOrderItemName,b.orderitemname) like '%'+#{SrcOrderItemName}+'%' </if>
<if test="DstHospName != null and DstHospName !=''">and DstHospName = #{DstHospName}</if>
group by a.SrcHospName,b.SrcOrderItemCode,b.SrcOrderItemName,b.cost,a.DstHospName
<if test="DateStart != null">and (a.OrderTime between #{DateStart} and #{DateEnd})</if>
group by a.SrcHospName,isnull(b.SrcOrderItemCode,b.orderitemcode),isnull(b.SrcOrderItemName,b.orderitemname),b.cost,a.DstHospName
</select>
</mapper>