回单打印
This commit is contained in:
parent
c13bfa4419
commit
e3472fd1c9
@ -1,12 +1,13 @@
|
||||
package com.czlis.interfaceCommon.mapper;
|
||||
|
||||
import com.czlis.common.core.domain.entity.LabReqmain;
|
||||
import com.czlis.interfaceCommon.pojo.entity.BackPaperDetail;
|
||||
import com.czlis.interfaceCommon.pojo.entity.BackPaperParam;
|
||||
import com.czlis.interfaceCommon.pojo.entity.LabRptgetruledetailCX;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BackPaperMapper {
|
||||
List<BackPaperDetail> selectBySqhs(List<String> sqhs);
|
||||
BackPaperParam selectReqmian(String sqh);
|
||||
List<LabRptgetruledetailCX> getLabRptgetruledetail(Integer bglqdh);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ package com.czlis.interfaceCommon.mapper;
|
||||
|
||||
|
||||
import com.czlis.common.core.domain.entity.ComDict;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
@ -14,10 +14,10 @@ public interface ComDictMapper {
|
||||
int delComDict(ComDict comDict);
|
||||
int updateComDict(ComDict comDict);
|
||||
//根据主键判断是否存在数据
|
||||
int getCountById(String zdlb, String zddh) ;
|
||||
int getCountById(@Param("zdlb")String zdlb, @Param("zddh")String zddh) ;
|
||||
//根据编号查名称
|
||||
String getComDictNameById(String zdlb,String zddh);
|
||||
String getComDictNameById(@Param("zdlb")String zdlb,@Param("zddh")String zddh);
|
||||
//根据名称查编号
|
||||
String getComDictIdByName(String zdlb,String zdmc);
|
||||
String getComDictIdByName(@Param("zdlb") String zdlb,@Param("zdmc") String zdmc);
|
||||
List<ComDict> getComDictListByZdlb(String zdlb);
|
||||
}
|
||||
|
||||
@ -14,4 +14,6 @@ public class BackPaperDetail {
|
||||
private String sqxmdh;
|
||||
private String sqxmmc;
|
||||
private String cp_msg;
|
||||
private Integer bglqdh1;
|
||||
private Integer bglqdh2;
|
||||
}
|
||||
|
||||
@ -24,7 +24,6 @@ public class BackPaperParam {
|
||||
private String brxb;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date brsr;
|
||||
private String txm;
|
||||
private String bgddh;
|
||||
private Integer nl;
|
||||
private String nldw;
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package com.czlis.interfaceCommon.pojo.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LabRptgetruledetailCX {
|
||||
private Integer bglqdh;
|
||||
private Integer xh;
|
||||
private String kssj;
|
||||
private String jssj;
|
||||
private Integer bgxss;
|
||||
private String bglqsm;
|
||||
private String bz;
|
||||
private String weekday;
|
||||
private String weekday1;
|
||||
}
|
||||
@ -7,17 +7,14 @@ import com.czlis.common.config.RuoYiConfig;
|
||||
import com.czlis.interfaceCommon.mapper.BackPaperMapper;
|
||||
import com.czlis.interfaceCommon.pojo.entity.BackPaperDetail;
|
||||
import com.czlis.interfaceCommon.pojo.entity.BackPaperParam;
|
||||
import com.czlis.interfaceCommon.pojo.entity.LabRptgetruledetailCX;
|
||||
import com.czlis.interfaceCommon.pojo.entity.MZBarCodeParam;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.jdbc.datasource.DataSourceUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -47,14 +44,37 @@ public class ReportUtil {
|
||||
public void printBackpaper(List<String> sqhs) {
|
||||
String sqh= sqhs.get(0);
|
||||
BackPaperParam backPaperParam=backPaperMapper.selectReqmian(sqh);
|
||||
String yljg= backPaperParam.getYljg();
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
Map<String, Object> parameters = objectMapper.convertValue(backPaperParam,Map.class);
|
||||
parameters.put("company",commonUtil.getCompany(yljg));
|
||||
List<BackPaperDetail> detail= backPaperMapper.selectBySqhs(sqhs);
|
||||
parameters.put("company",commonUtil.getCompany(backPaperParam.getYljg()));
|
||||
parameters.put("age",AgeUtils.getAge(backPaperParam.getBrsr()));
|
||||
parameters.put("ksdh",commonUtil.getComDictNameById("DP",backPaperParam.getKsdh()));
|
||||
parameters.put("brxb",commonUtil.getComDictNameById("SX",backPaperParam.getBrxb()));
|
||||
parameters.put("bgds",String.valueOf(sqhs.size()));
|
||||
List<BackPaperDetail> detailList= backPaperMapper.selectBySqhs(sqhs);
|
||||
for (BackPaperDetail detail : detailList) {
|
||||
Integer bglqdh1=detail.getBglqdh1();
|
||||
Integer bglqdh2=detail.getBglqdh2();
|
||||
String bglqsm="";
|
||||
if (bglqdh1 != null) {
|
||||
List<LabRptgetruledetailCX> labRptgetruledetail = backPaperMapper.getLabRptgetruledetail(bglqdh1);
|
||||
if (labRptgetruledetail.size() > 0) {
|
||||
bglqsm = labRptgetruledetail.get(0).getBglqsm();
|
||||
}
|
||||
}
|
||||
if (bglqdh2 != null && bglqsm != null && !bglqsm.trim().equals("")) {
|
||||
List<LabRptgetruledetailCX> labRptgetruledetail= backPaperMapper.getLabRptgetruledetail(bglqdh2);
|
||||
if (labRptgetruledetail.size() > 0) {
|
||||
bglqsm=labRptgetruledetail.get(0).getBglqsm();
|
||||
}
|
||||
}
|
||||
detail.setCp_msg(bglqsm);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
//构造数据
|
||||
JasperReportUtil.print(RuoYiConfig.getMzPrintName(),"backpaper",parameters,detail);
|
||||
JasperReportUtil.print(RuoYiConfig.getMzPrintName(),"backpaper",parameters,detailList);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("打印回单报错,条码号:{}",sqh,e);
|
||||
|
||||
@ -3,16 +3,23 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.czlis.interfaceCommon.mapper.BackPaperMapper">
|
||||
<!-- 根据申请号集合查询 -->
|
||||
<select id="selectBySqhs" resultType="com.czlis.common.core.domain.entity.LabReqdetail">
|
||||
SELECT sqh,xh,sqxmdh,sqxmmc,'' as cp_msg FROM lab_reqdetail
|
||||
<select id="selectBySqhs" resultType="com.czlis.interfaceCommon.pojo.entity.BackPaperDetail">
|
||||
SELECT sqh,lab_reqdetail.xh,sqxmdh,sqxmmc,'' as cp_msg,xm_fee.bglqdh as bglqdh1,lab_feeitemclass.bglqdh as bglqdh2 FROM lab_reqdetail
|
||||
left join xm_fee on xm_fee.sfxmdh=lab_reqdetail.sqxmdh
|
||||
left join lab_feeitem_vs_class on lab_feeitem_vs_class.sfxmdh=lab_reqdetail.sqxmdh
|
||||
left join lab_feeitemclass on lab_feeitemclass.sflbdh=lab_feeitem_vs_class.sflbdh
|
||||
WHERE sqh IN
|
||||
<foreach collection="list" item="sqh" open="(" separator="," close=")">
|
||||
#{sqh}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectReqmian" resultType="com.czlis.mzcx.pojo.MzcxSqdDTO">
|
||||
select * from lab_reqmain where sqh = #{sqh}
|
||||
<select id="selectReqmian" resultType="com.czlis.interfaceCommon.pojo.entity.BackPaperParam">
|
||||
select ksdh,sqys,sqsj,jsys,jssj,brly,brdh,brxm,brxb,brsr,bgddh,nl,nldw,kh,yljg from lab_reqmain where sqh = #{sqh}
|
||||
</select>
|
||||
<select id="getLabRptgetruledetail" resultType="com.czlis.interfaceCommon.pojo.entity.LabRptgetruledetailCX">
|
||||
select * from lab_rptgetruledetail a where CONVERT(varchar(5), GETDATE(), 8)>= a.kssj and a.jssj>=CONVERT(varchar(5), GETDATE(), 8)
|
||||
and DATEPART(weekday, GETDATE()- 1)>= a.weekday and a.weekday1>=DATEPART(weekday, GETDATE()- 1)
|
||||
and a.bglqdh = #{bglqdh}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user