仪器报告模版对照
This commit is contained in:
parent
4950fd5d8f
commit
09f36797d1
@ -0,0 +1,15 @@
|
|||||||
|
package com.czlis.common.core.domain.entity.lis;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class LabReportinstr {
|
||||||
|
private String yq;
|
||||||
|
private Integer xh;
|
||||||
|
private Integer bgdh;
|
||||||
|
private String yljg;
|
||||||
|
}
|
||||||
@ -45,10 +45,10 @@ public class ReportUtil {
|
|||||||
@Autowired
|
@Autowired
|
||||||
BackPaperMapper backPaperMapper;
|
BackPaperMapper backPaperMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private DataSource dataSource; // 实际是 DruidDataSource 实例
|
private DataSource dataSource;
|
||||||
|
|
||||||
@Value("${server.port:}")
|
@Value("${server.port:}")
|
||||||
private String port;
|
String port;
|
||||||
@Value("${czlis.printURL:}")
|
@Value("${czlis.printURL:}")
|
||||||
String printURL;
|
String printURL;
|
||||||
|
|
||||||
@ -343,9 +343,9 @@ public class ReportUtil {
|
|||||||
barCodeParam.setYq(yq);
|
barCodeParam.setYq(yq);
|
||||||
barCodeParam.setYbh(ybh);
|
barCodeParam.setYbh(ybh);
|
||||||
barCodeParam.setHospitalName(hospitalName);
|
barCodeParam.setHospitalName(hospitalName);
|
||||||
barCodeParam.setUsernopic(getSignName(labPat.getYhdh()));
|
barCodeParam.setUsernopic(getSignName(labPat.getYhdh())); //检验者
|
||||||
barCodeParam.setCheckerpic(getSignName(labPat.getHdys()));
|
barCodeParam.setCheckerpic(getSignName(labPat.getHdys())); //审核者
|
||||||
barCodeParam.setCheckercbpic(getSignName(labPat.getChecker()));
|
barCodeParam.setCheckercbpic(getSignName(labPat.getChecker())); //初审者
|
||||||
String[] picPath = getReportpic(jyrq, yq, ybh);
|
String[] picPath = getReportpic(jyrq, yq, ybh);
|
||||||
barCodeParam.setPic(picPath);
|
barCodeParam.setPic(picPath);
|
||||||
return printToPdf("report_image2", barCodeParam, UUID.randomUUID().toString(), true);
|
return printToPdf("report_image2", barCodeParam, UUID.randomUUID().toString(), true);
|
||||||
@ -376,6 +376,12 @@ public class ReportUtil {
|
|||||||
}
|
}
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取电子签名
|
||||||
|
* @param yhdh
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public String getSignName(String yhdh) {
|
public String getSignName(String yhdh) {
|
||||||
if(yhdh==null||"".equals(yhdh))return "";
|
if(yhdh==null||"".equals(yhdh))return "";
|
||||||
//SELECT zplx INTO :ls_pictype FROM off_staff WHERE rydh = :as_userno ;
|
//SELECT zplx INTO :ls_pictype FROM off_staff WHERE rydh = :as_userno ;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.czlis.liswork.controller.work;
|
package com.czlis.liswork.controller.work;
|
||||||
|
|
||||||
|
import com.czlis.common.annotation.Log;
|
||||||
import com.czlis.common.core.controller.BaseController;
|
import com.czlis.common.core.controller.BaseController;
|
||||||
import com.czlis.common.core.domain.Result;
|
import com.czlis.common.core.domain.Result;
|
||||||
import com.czlis.common.core.domain.entity.SysLoginParam;
|
import com.czlis.common.core.domain.entity.SysLoginParam;
|
||||||
|
|||||||
@ -0,0 +1,46 @@
|
|||||||
|
package com.czlis.liswork.controller.xtwh;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.Result;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabReportinstr;
|
||||||
|
import com.czlis.liswork.service.LabReportinstrService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Api(tags = "报告单仪器对应表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/labReportinstr")
|
||||||
|
@Slf4j
|
||||||
|
public class LabReportinstrController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LabReportinstrService labReportinstrService;
|
||||||
|
|
||||||
|
@ApiOperation("查询对应表数据")
|
||||||
|
@GetMapping("/query")
|
||||||
|
public Result getLabReportinstr(LabReportinstr labReportinstr) {
|
||||||
|
return labReportinstrService.getLabReportinstr(labReportinstr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增对应表数据")
|
||||||
|
@PostMapping("/add")
|
||||||
|
public Result add(@RequestBody LabReportinstr labReportinstr){
|
||||||
|
return labReportinstrService.add(labReportinstr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除对应表数据")
|
||||||
|
@GetMapping("/del")
|
||||||
|
public Result delete(LabReportinstr labReportinstr){
|
||||||
|
return labReportinstrService.delete(labReportinstr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改对应表数据")
|
||||||
|
@PostMapping("update")
|
||||||
|
public Result update(@RequestBody LabReportinstr labReportinstr){
|
||||||
|
return labReportinstrService.update(labReportinstr);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.czlis.liswork.mapper.xtwh;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabReportinstr;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface LabReportinstrMapper {
|
||||||
|
List<LabReportinstr> getLabReportinstr(LabReportinstr labReportinstr);
|
||||||
|
void add(LabReportinstr labReportinstr);
|
||||||
|
void update(LabReportinstr labReportinstr);
|
||||||
|
void delete(LabReportinstr labReportinstr);
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.czlis.liswork.service;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.Result;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabReportinstr;
|
||||||
|
|
||||||
|
public interface LabReportinstrService {
|
||||||
|
Result getLabReportinstr(LabReportinstr labReportinstr);
|
||||||
|
|
||||||
|
Result add(LabReportinstr labReportinstr);
|
||||||
|
|
||||||
|
Result delete(LabReportinstr labReportinstr);
|
||||||
|
|
||||||
|
Result update(LabReportinstr labReportinstr);
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.czlis.liswork.service.impl;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.Result;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabReportinstr;
|
||||||
|
import com.czlis.liswork.mapper.xtwh.LabReportinstrMapper;
|
||||||
|
import com.czlis.liswork.service.LabReportinstrService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class LabReportinstrServiceImpl implements LabReportinstrService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
LabReportinstrMapper labReportinstrMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result getLabReportinstr(LabReportinstr labReportinstr) {
|
||||||
|
List<LabReportinstr> labReportinstrList = labReportinstrMapper.getLabReportinstr(labReportinstr);
|
||||||
|
return new Result("0","获取数据成功!",labReportinstrList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result add(LabReportinstr labReportinstr) {
|
||||||
|
labReportinstrMapper.add(labReportinstr);
|
||||||
|
return new Result("0","新增数据成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result delete(LabReportinstr labReportinstr) {
|
||||||
|
labReportinstrMapper.delete(labReportinstr);
|
||||||
|
return new Result("0","删除数据成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result update(LabReportinstr labReportinstr) {
|
||||||
|
labReportinstrMapper.update(labReportinstr);
|
||||||
|
return new Result("0","修改数据成功!");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,70 +0,0 @@
|
|||||||
package com.czlis.liswork.utils;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUnit;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class LisWorkUtil {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生日格式为:yyyy-MM-dd
|
|
||||||
* 根据出生日期计算年龄
|
|
||||||
* @param birthday
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Map<String,String> getAgeFromBirthDay(String birthday){
|
|
||||||
Map<String,String> map = new HashMap<>();
|
|
||||||
int age = DateUtil.ageOfNow(birthday);
|
|
||||||
if(age > 0){
|
|
||||||
map.put("age",String.valueOf(age));
|
|
||||||
map.put("unit","岁");
|
|
||||||
}else if(age == 0){
|
|
||||||
//不足一年的
|
|
||||||
long between = DateUtil.between(DateUtil.parse(birthday, "yyyy-MM-dd"), DateUtil.parse(DateUtil.today(), "yyyy-MM-dd"), DateUnit.DAY,true);
|
|
||||||
|
|
||||||
if(between/30 > 0){
|
|
||||||
long month = between/30;
|
|
||||||
map.put("age",String.valueOf(month));
|
|
||||||
map.put("unit","月");
|
|
||||||
}else if( between/30 == 0){
|
|
||||||
//不足一月的
|
|
||||||
map.put("age",String.valueOf(between));
|
|
||||||
map.put("unit","天");
|
|
||||||
}else{
|
|
||||||
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据年龄获取出生日期
|
|
||||||
* @param nl
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Date getBirthDayFromAge(int nl, String nldw){
|
|
||||||
Calendar cal = Calendar.getInstance();
|
|
||||||
cal.setTime(DateUtil.date());
|
|
||||||
switch (nldw){
|
|
||||||
case "岁":
|
|
||||||
cal.add(Calendar.YEAR,-nl);
|
|
||||||
case "月":
|
|
||||||
cal.add(Calendar.MONTH,-nl);
|
|
||||||
case "天":
|
|
||||||
cal.add(Calendar.DATE,-nl);
|
|
||||||
}
|
|
||||||
Date BirthDay = cal.getTime();
|
|
||||||
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
|
|
||||||
String format = df.format(BirthDay);
|
|
||||||
return DateUtil.parse(format,"yyyy-MM-dd");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
35
liswork/src/main/resources/mapper/LabReportinstrMapper.xml
Normal file
35
liswork/src/main/resources/mapper/LabReportinstrMapper.xml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.czlis.liswork.mapper.xtwh.LabReportinstrMapper">
|
||||||
|
|
||||||
|
<select id="getLabReportinstr" resultType="com.czlis.common.core.domain.entity.lis.LabReportinstr">
|
||||||
|
select * from lab_reportinstr
|
||||||
|
<where>
|
||||||
|
<if test="bgdh != null and bgdh != ''"> and bgdh = #{bgdh}</if>
|
||||||
|
<if test="yq != null and bgdh != ''"> and yq = #{yq}</if>
|
||||||
|
<if test="xh != null"> and xh = #{xh}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="add">
|
||||||
|
insert into lab_reportinstr(
|
||||||
|
bgdh,yq,xh,yljg
|
||||||
|
)values(
|
||||||
|
#{bgdh},#{yq},#{xh},#{yljg}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<delete id="delete">
|
||||||
|
delete from lab_reportinstr where bgdh = #{bgdh} and yq = #{yq} and xh = #{xh}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="update">
|
||||||
|
update lab_reportinstr
|
||||||
|
<set>
|
||||||
|
bgdh = #{bgdh}
|
||||||
|
</set>
|
||||||
|
where yq = #{yq} and xh = #{xh}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -98,3 +98,16 @@ if not exists(select 1 from com_opt where yq = '' and xxdh = 'A5MERGEA4')
|
|||||||
begin
|
begin
|
||||||
insert into com_opt(yq,xxdh,xxlb,xxqz,bz,lx) values('','A5MERGEA4','SYS','0','A5报告单是否合并成A4打印','1')
|
insert into com_opt(yq,xxdh,xxlb,xxqz,bz,lx) values('','A5MERGEA4','SYS','0','A5报告单是否合并成A4打印','1')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--报告单仪器对应表
|
||||||
|
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'lab_reportinstr')
|
||||||
|
begin
|
||||||
|
create table lab_reportinstr
|
||||||
|
(
|
||||||
|
yq varchar(10),
|
||||||
|
xh int ,
|
||||||
|
bgdh int,
|
||||||
|
yljg varchar(10),
|
||||||
|
PRIMARY KEY (yq, xh,bgdh)
|
||||||
|
)
|
||||||
|
end
|
||||||
@ -97,6 +97,7 @@ public class ZybgcxServcieImpl implements ZybgcxService {
|
|||||||
map.put("confirmdt",labPatOne.getConfirmdt());
|
map.put("confirmdt",labPatOne.getConfirmdt());
|
||||||
bgdhBase64List.add(map);
|
bgdhBase64List.add(map);
|
||||||
}
|
}
|
||||||
|
log.info("bgdhBase64List:"+bgdhBase64List);
|
||||||
//过滤A4的报告单
|
//过滤A4的报告单
|
||||||
List<Map<String, Object>> collectA4 = bgdhBase64List.stream().filter(bgdhBase64 -> bgdhBase64.get("pageType").equals("A4")).collect(Collectors.toList());
|
List<Map<String, Object>> collectA4 = bgdhBase64List.stream().filter(bgdhBase64 -> bgdhBase64.get("pageType").equals("A4")).collect(Collectors.toList());
|
||||||
for (Map<String, Object> stringObjectMap : collectA4) {
|
for (Map<String, Object> stringObjectMap : collectA4) {
|
||||||
@ -114,8 +115,8 @@ public class ZybgcxServcieImpl implements ZybgcxService {
|
|||||||
Integer brdh2 = Integer.valueOf(o2.get("brdh").toString().trim()) ;
|
Integer brdh2 = Integer.valueOf(o2.get("brdh").toString().trim()) ;
|
||||||
int i = brdh1.compareTo(brdh2);
|
int i = brdh1.compareTo(brdh2);
|
||||||
if(i == 0){
|
if(i == 0){
|
||||||
DateTime confirmdt1 = DateUtil.parse(o1.get("confirmdt").toString(), "yyyy-MM-dd");
|
Date confirmdt1 = (Date) o1.get("confirmdt");
|
||||||
DateTime confirmdt2 = DateUtil.parse(o2.get("confirmdt").toString(), "yyyy-MM-dd");
|
Date confirmdt2 = (Date) o2.get("confirmdt");
|
||||||
return confirmdt1.compareTo(confirmdt2);
|
return confirmdt1.compareTo(confirmdt2);
|
||||||
}else{
|
}else{
|
||||||
return i;
|
return i;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user