实体类转移
This commit is contained in:
parent
81af943526
commit
af84dc275f
@ -1,7 +1,9 @@
|
|||||||
package com.czlis.interfaceCommon.utils;
|
package com.czlis.interfaceCommon.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.czlis.common.config.RuoYiConfig;
|
import com.czlis.common.config.RuoYiConfig;
|
||||||
|
|
||||||
import com.czlis.interfaceCommon.mapper.BackPaperMapper;
|
import com.czlis.interfaceCommon.mapper.BackPaperMapper;
|
||||||
@ -15,12 +17,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ReportUtil {
|
public class ReportUtil {
|
||||||
@ -28,34 +30,38 @@ public class ReportUtil {
|
|||||||
CommonUtil commonUtil;
|
CommonUtil commonUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
BackPaperMapper backPaperMapper;
|
BackPaperMapper backPaperMapper;
|
||||||
|
|
||||||
|
|
||||||
public void printBarCode(MZBarCodeParam mzBarCodeParam) {
|
public void printBarCode(MZBarCodeParam mzBarCodeParam) {
|
||||||
try {
|
try {
|
||||||
//构造数据
|
//构造数据
|
||||||
Map parameters = new HashMap();
|
Map parameters = new HashMap();
|
||||||
parameters.put("barcode",mzBarCodeParam.getSqh());
|
parameters.put("barcode", mzBarCodeParam.getSqh());
|
||||||
parameters.put("line1",mzBarCodeParam.getBrxm() + " " + mzBarCodeParam.getBrxb() + " " + mzBarCodeParam.getNl());
|
parameters.put("line1", mzBarCodeParam.getBrxm() + " " + mzBarCodeParam.getBrxb() + " " + mzBarCodeParam.getNl());
|
||||||
parameters.put("line2",mzBarCodeParam.getSfxmmc());
|
parameters.put("line2", mzBarCodeParam.getSfxmmc());
|
||||||
JasperReportUtil.print(RuoYiConfig.getMzPrintName(),"barcode",parameters);
|
JasperReportUtil.print(RuoYiConfig.getMzPrintName(), "barcode", parameters);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("打印条码报错,条码号:{}",mzBarCodeParam.getSqh(),e);
|
log.error("打印条码报错,条码号:{}", mzBarCodeParam.getSqh(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void printBackpaper(List<String> sqhs) {
|
public void printBackpaper(List<String> sqhs) {
|
||||||
String sqh= sqhs.get(0);
|
String sqh = sqhs.get(0);
|
||||||
BackPaperParam backPaperParam=backPaperMapper.selectReqmian(sqh);
|
BackPaperParam backPaperParam = backPaperMapper.selectReqmian(sqh);
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
// ObjectMapper objectMapper = new ObjectMapper();
|
||||||
Map<String, Object> parameters = objectMapper.convertValue(backPaperParam,Map.class);
|
Map<String, Object> parameters = BeanUtil.beanToMap(backPaperParam);
|
||||||
parameters.put("company",commonUtil.getCompany(backPaperParam.getYljg()));
|
parameters.put("company", commonUtil.getCompany(backPaperParam.getYljg()));
|
||||||
parameters.put("age",AgeUtils.getAge(backPaperParam.getBrsr()));
|
parameters.put("age", AgeUtils.getAge(backPaperParam.getBrsr()));
|
||||||
parameters.put("ksdh",commonUtil.getComDictNameById("DP",backPaperParam.getKsdh()));
|
parameters.put("ksdh", commonUtil.getComDictNameById("DP", backPaperParam.getKsdh()));
|
||||||
parameters.put("brxb",commonUtil.getComDictNameById("SX",backPaperParam.getBrxb()));
|
parameters.put("brxb", commonUtil.getComDictNameById("SX", backPaperParam.getBrxb()));
|
||||||
parameters.put("bgds",String.valueOf(sqhs.size()));
|
parameters.put("bgds", String.valueOf(sqhs.size()));
|
||||||
List<BackPaperDetail> detailList= backPaperMapper.selectBySqhs(sqhs);
|
List<BackPaperDetail> detailList = backPaperMapper.selectBySqhs(sqhs);
|
||||||
for (BackPaperDetail detail : detailList) {
|
for (BackPaperDetail detail : detailList) {
|
||||||
Integer bglqdh1=detail.getBglqdh1();
|
Integer bglqdh1 = detail.getBglqdh1();
|
||||||
Integer bglqdh2=detail.getBglqdh2();
|
Integer bglqdh2 = detail.getBglqdh2();
|
||||||
String bglqsm="";
|
String bglqsm = "";
|
||||||
if (bglqdh1 != null) {
|
if (bglqdh1 != null) {
|
||||||
List<LabRptgetruledetailCX> labRptgetruledetail = backPaperMapper.getLabRptgetruledetail(bglqdh1);
|
List<LabRptgetruledetailCX> labRptgetruledetail = backPaperMapper.getLabRptgetruledetail(bglqdh1);
|
||||||
if (labRptgetruledetail.size() > 0) {
|
if (labRptgetruledetail.size() > 0) {
|
||||||
@ -63,9 +69,9 @@ public class ReportUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bglqdh2 != null && bglqsm != null && !bglqsm.trim().equals("")) {
|
if (bglqdh2 != null && bglqsm != null && !bglqsm.trim().equals("")) {
|
||||||
List<LabRptgetruledetailCX> labRptgetruledetail= backPaperMapper.getLabRptgetruledetail(bglqdh2);
|
List<LabRptgetruledetailCX> labRptgetruledetail = backPaperMapper.getLabRptgetruledetail(bglqdh2);
|
||||||
if (labRptgetruledetail.size() > 0) {
|
if (labRptgetruledetail.size() > 0) {
|
||||||
bglqsm=labRptgetruledetail.get(0).getBglqsm();
|
bglqsm = labRptgetruledetail.get(0).getBglqsm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
detail.setCp_msg(bglqsm);
|
detail.setCp_msg(bglqsm);
|
||||||
@ -74,10 +80,11 @@ public class ReportUtil {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
//构造数据
|
//构造数据
|
||||||
JasperReportUtil.print(RuoYiConfig.getMzPrintName(),"backpaper",parameters,detailList);
|
System.out.println("入参参数:"+parameters.toString());
|
||||||
|
JasperReportUtil.print(RuoYiConfig.getMzPrintName(), "backpaper", parameters, detailList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("打印回单报错,条码号:{}",sqh,e);
|
log.error("打印回单报错,条码号:{}", sqh, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.czlis.mzcx.controller;
|
package com.czlis.mzcx.controller;
|
||||||
|
|
||||||
|
import com.czlis.common.annotation.Anonymous;
|
||||||
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.page.TableDataInfo;
|
import com.czlis.common.core.page.TableDataInfo;
|
||||||
@ -53,6 +54,8 @@ public class MZCXController extends BaseController {
|
|||||||
public Result printAll(@RequestBody List<String> sqhs){
|
public Result printAll(@RequestBody List<String> sqhs){
|
||||||
return mzcxService.printAll(sqhs);
|
return mzcxService.printAll(sqhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Anonymous
|
||||||
@PostMapping("/printBackpaper")
|
@PostMapping("/printBackpaper")
|
||||||
public Result printBackpaper(@RequestBody List<String> sqhs){
|
public Result printBackpaper(@RequestBody List<String> sqhs){
|
||||||
return mzcxService.printBackpaper(sqhs);
|
return mzcxService.printBackpaper(sqhs);
|
||||||
|
|||||||
@ -38,7 +38,7 @@ public class MZCXServiceImpl implements MZCXService {
|
|||||||
private CommonUtil commonUtil;
|
private CommonUtil commonUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result querySQD(String brdh, String stime, String etime, String klx,String zt) {
|
public Result querySQD(String brdh, String stime, String etime, String klx, String zt) {
|
||||||
GetReqInterface getReqInterface = new GetReqInterface();
|
GetReqInterface getReqInterface = new GetReqInterface();
|
||||||
getReqInterface.setBrdh(brdh);
|
getReqInterface.setBrdh(brdh);
|
||||||
getReqInterface.setStime(stime);
|
getReqInterface.setStime(stime);
|
||||||
@ -57,9 +57,9 @@ public class MZCXServiceImpl implements MZCXService {
|
|||||||
map.put("st", stime);
|
map.put("st", stime);
|
||||||
map.put("et", etime);
|
map.put("et", etime);
|
||||||
map.put("klx", klx);
|
map.put("klx", klx);
|
||||||
map.put("zt",zt);
|
map.put("zt", zt);
|
||||||
map.put("as_yljg","1");
|
map.put("as_yljg", "1");
|
||||||
return new Result("0","查询成功!",mzcxMapper.querySQD(map));
|
return new Result("0", "查询成功!", mzcxMapper.querySQD(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -73,18 +73,25 @@ public class MZCXServiceImpl implements MZCXService {
|
|||||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, jsonStr);
|
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, jsonStr);
|
||||||
if (result != null && result.getData() != null) {
|
if (result != null && result.getData() != null) {
|
||||||
try {
|
try {
|
||||||
JSONObject json=JSONUtil.parseFromXml(result.getData().toString());
|
JSONObject json = JSONUtil.parseFromXml(result.getData().toString());
|
||||||
String listkey=json.keySet().iterator().next();
|
String listkey = json.keySet().iterator().next();
|
||||||
JSONObject response=json.getJSONObject(listkey);
|
JSONObject response = json.getJSONObject(listkey);
|
||||||
String infokey=response.keySet().iterator().next();
|
String infokey = response.keySet().iterator().next();
|
||||||
List<OutPatListDTO> patientList=response.getBeanList(infokey, OutPatListDTO.class);
|
List<OutPatListDTO> patientList = response.getBeanList(infokey, OutPatListDTO.class);
|
||||||
return new Result("0","查询成功!",patientList);
|
return new Result("0", "查询成功!", patientList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("XML转换outPatListDTO失败: {}", e.getMessage(), e);
|
log.error("XML转换outPatListDTO失败: {}", e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new Result("0","查询成功!",new OutPatListDTO());
|
return new Result("0", "查询成功!", new OutPatListDTO());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打印条码
|
||||||
|
*
|
||||||
|
* @param sqh
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result printSQD(String sqh) {
|
public Result printSQD(String sqh) {
|
||||||
LabReqmain labReqmainOne = commonUtil.getLabReqmainOne(sqh);
|
LabReqmain labReqmainOne = commonUtil.getLabReqmainOne(sqh);
|
||||||
@ -95,10 +102,10 @@ public class MZCXServiceImpl implements MZCXService {
|
|||||||
String age = ageFromBirthDay.get("age");
|
String age = ageFromBirthDay.get("age");
|
||||||
String unit = ageFromBirthDay.get("unit");
|
String unit = ageFromBirthDay.get("unit");
|
||||||
|
|
||||||
mzBarCodeParam.setNl(age+unit);
|
mzBarCodeParam.setNl(age + unit);
|
||||||
mzBarCodeParam.setBrxm(labReqmainOne.getBrxm());
|
mzBarCodeParam.setBrxm(labReqmainOne.getBrxm());
|
||||||
String brxb = labReqmainOne.getBrxb();
|
String brxb = labReqmainOne.getBrxb();
|
||||||
switch (brxb){
|
switch (brxb) {
|
||||||
case "1":
|
case "1":
|
||||||
brxb = "男";
|
brxb = "男";
|
||||||
break;
|
break;
|
||||||
@ -112,21 +119,28 @@ public class MZCXServiceImpl implements MZCXService {
|
|||||||
mzBarCodeParam.setBrxb(brxb);
|
mzBarCodeParam.setBrxb(brxb);
|
||||||
mzBarCodeParam.setSfxmmc(labReqmainOne.getJymd());
|
mzBarCodeParam.setSfxmmc(labReqmainOne.getJymd());
|
||||||
reportUtil.printBarCode(mzBarCodeParam);
|
reportUtil.printBarCode(mzBarCodeParam);
|
||||||
return new Result("0","打印成功!");
|
return new Result("0", "打印成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result printAll(List<String> sqhs) {
|
public Result printAll(List<String> sqhs) {
|
||||||
for (String sqh : sqhs) {
|
for (String sqh : sqhs) {
|
||||||
printSQD(sqh);
|
printSQD(sqh);
|
||||||
}
|
}
|
||||||
return new Result("0","打印成功!");
|
return new Result("0", "打印成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打印回单接口
|
||||||
|
*
|
||||||
|
* @param sqhs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result printBackpaper(List<String> sqhs){
|
public Result printBackpaper(List<String> sqhs) {
|
||||||
log.info("aaaaa: {}", sqhs);
|
log.info("aaaaa: {}", sqhs);
|
||||||
reportUtil.printBackpaper(sqhs);
|
reportUtil.printBackpaper(sqhs);
|
||||||
return new Result("0","打印成功!");
|
return new Result("0", "打印成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user