| 
														
															@@ -1,6 +1,7 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 package cn.hnthyy.thmz.service.impl.his.mzdzfp; 
														 | 
														
														 | 
														
															 package cn.hnthyy.thmz.service.impl.his.mzdzfp; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import cn.hnthyy.thmz.Utils.*; 
														 | 
														
														 | 
														
															 import cn.hnthyy.thmz.Utils.*; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import cn.hnthyy.thmz.comment.PassToken; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import cn.hnthyy.thmz.common.Constants; 
														 | 
														
														 | 
														
															 import cn.hnthyy.thmz.common.Constants; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import cn.hnthyy.thmz.common.exception.BizException; 
														 | 
														
														 | 
														
															 import cn.hnthyy.thmz.common.exception.BizException; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import cn.hnthyy.thmz.entity.his.mz.BillItem; 
														 | 
														
														 | 
														
															 import cn.hnthyy.thmz.entity.his.mz.BillItem; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -63,6 +64,7 @@ import org.springframework.transaction.annotation.Transactional; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import javax.annotation.Resource; 
														 | 
														
														 | 
														
															 import javax.annotation.Resource; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.lang.reflect.Field; 
														 | 
														
														 | 
														
															 import java.lang.reflect.Field; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.math.BigDecimal; 
														 | 
														
														 | 
														
															 import java.math.BigDecimal; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import java.math.BigInteger; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.ArrayList; 
														 | 
														
														 | 
														
															 import java.util.ArrayList; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.Comparator; 
														 | 
														
														 | 
														
															 import java.util.Comparator; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import java.util.Date; 
														 | 
														
														 | 
														
															 import java.util.Date; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -224,6 +226,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 if (mzyReqrec == null) { 
														 | 
														
														 | 
														
															                 if (mzyReqrec == null) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     throw new BizException("没有挂号记录,不能打印电子发票"); 
														 | 
														
														 | 
														
															                     throw new BizException("没有挂号记录,不能打印电子发票"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 } 
														 | 
														
														 | 
														
															                 } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 mzReceiptSerial.setTimes(mzyReqrec.getTimes()); 
														 | 
														
														 | 
														
															                 mzReceiptSerial.setTimes(mzyReqrec.getTimes()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -232,6 +235,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .patientId(mzReceiptSerial.getPatientId()) 
														 | 
														
														 | 
														
															                 .patientId(mzReceiptSerial.getPatientId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .times(mzReceiptSerial.getTimes()) 
														 | 
														
														 | 
														
															                 .times(mzReceiptSerial.getTimes()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .receiptNo(mzReceiptSerial.getReceiptNo()) 
														 | 
														
														 | 
														
															                 .receiptNo(mzReceiptSerial.getReceiptNo()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+//                .serialNo(String.valueOf(mzReceiptSerial.getSerialNo())) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .typeFlag(1) 
														 | 
														
														 | 
														
															                 .typeFlag(1) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .delFlag(0) 
														 | 
														
														 | 
														
															                 .delFlag(0) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .build())); 
														 | 
														
														 | 
														
															                 .build())); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -248,7 +252,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             requestId = mzDzfpUploadList.get(0).getRequestId(); 
														 | 
														
														 | 
														
															             requestId = mzDzfpUploadList.get(0).getRequestId(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         MzInvoiceInfo mzInvoiceInfo; 
														 | 
														
														 | 
														
															         MzInvoiceInfo mzInvoiceInfo; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        requestId = Convert.toStr(requestId, IdUtil.simpleUUID()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        requestId = Convert.toStr(requestId, OptimalLimitDigitGenerator.generate().toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (ghFlag) { 
														 | 
														
														 | 
														
															         if (ghFlag) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             mzInvoiceInfo = createGhInvoiceInfo(mzReceiptSerial, requestId, 1); 
														 | 
														
														 | 
														
															             mzInvoiceInfo = createGhInvoiceInfo(mzReceiptSerial, requestId, 1); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } else { 
														 | 
														
														 | 
														
															         } else { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -259,6 +263,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .patientId(mzReceiptSerial.getPatientId()) 
														 | 
														
														 | 
														
															                 .patientId(mzReceiptSerial.getPatientId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .times(mzReceiptSerial.getTimes()) 
														 | 
														
														 | 
														
															                 .times(mzReceiptSerial.getTimes()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .receiptNo(mzReceiptSerial.getReceiptNo()) 
														 | 
														
														 | 
														
															                 .receiptNo(mzReceiptSerial.getReceiptNo()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .serialNo(String.valueOf(mzReceiptSerial.getSerialNo())) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .requestId(requestId) 
														 | 
														
														 | 
														
															                 .requestId(requestId) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .typeFlag(1) 
														 | 
														
														 | 
														
															                 .typeFlag(1) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .delFlag(0) 
														 | 
														
														 | 
														
															                 .delFlag(0) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -376,7 +381,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             } 
														 | 
														
														 | 
														
															             } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             requestId = redDzfp.get(0).getRequestId(); 
														 | 
														
														 | 
														
															             requestId = redDzfp.get(0).getRequestId(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        requestId = Convert.toStr(requestId, IdUtil.simpleUUID()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        requestId = Convert.toStr(requestId, OptimalLimitDigitGenerator.generate().toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         MzInvoiceInfo mzInvoiceInfo; 
														 | 
														
														 | 
														
															         MzInvoiceInfo mzInvoiceInfo; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (ghFlag) { 
														 | 
														
														 | 
														
															         if (ghFlag) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             mzInvoiceInfo = createGhInvoiceInfo(mzReceiptSerial, requestId, 2); 
														 | 
														
														 | 
														
															             mzInvoiceInfo = createGhInvoiceInfo(mzReceiptSerial, requestId, 2); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -388,6 +393,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .patientId(mzReceiptSerial.getPatientId()) 
														 | 
														
														 | 
														
															                 .patientId(mzReceiptSerial.getPatientId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .times(mzReceiptSerial.getTimes()) 
														 | 
														
														 | 
														
															                 .times(mzReceiptSerial.getTimes()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .receiptNo(mzReceiptSerial.getReceiptNo()) 
														 | 
														
														 | 
														
															                 .receiptNo(mzReceiptSerial.getReceiptNo()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .serialNo(String.valueOf(mzReceiptSerial.getSerialNo())) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .requestId(requestId) 
														 | 
														
														 | 
														
															                 .requestId(requestId) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .typeFlag(2) 
														 | 
														
														 | 
														
															                 .typeFlag(2) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .delFlag(0) 
														 | 
														
														 | 
														
															                 .delFlag(0) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -432,6 +438,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Date now = new Date(); 
														 | 
														
														 | 
														
															         Date now = new Date(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(mzReceiptSerial.getPatientId()); 
														 | 
														
														 | 
														
															         MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(mzReceiptSerial.getPatientId()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         MzyReqrec mzyReqrec = mzyReqrecService.queryMzyReqrecByPatientIdAndTimes(mzReceiptSerial.getPatientId(), mzReceiptSerial.getTimes()); 
														 | 
														
														 | 
														
															         MzyReqrec mzyReqrec = mzyReqrecService.queryMzyReqrecByPatientIdAndTimes(mzReceiptSerial.getPatientId(), mzReceiptSerial.getTimes()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        mzReceiptSerial.setSerialNo(mzyReqrec.getSerialNo()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         ZdUnitCode zdUnitCode = zdUnitCodeService.queryByCode(mzyReqrec.getUnitCode()); 
														 | 
														
														 | 
														
															         ZdUnitCode zdUnitCode = zdUnitCodeService.queryByCode(mzyReqrec.getUnitCode()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         AssertUtil.isNotBlank(mzyReqrec, "没有挂号记录,无法打印发票"); 
														 | 
														
														 | 
														
															         AssertUtil.isNotBlank(mzyReqrec, "没有挂号记录,无法打印发票"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         ZdChequeType zdChequeType = zdChequeTypeService.queryChequeTypeByCode(mzyReqrec.getPaymode()); 
														 | 
														
														 | 
														
															         ZdChequeType zdChequeType = zdChequeTypeService.queryChequeTypeByCode(mzyReqrec.getPaymode()); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -451,7 +458,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         MzInvoiceInfo mzInvoiceInfo = MzInvoiceInfo.builder() 
														 | 
														
														 | 
														
															         MzInvoiceInfo mzInvoiceInfo = MzInvoiceInfo.builder() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .usciCode(Constants.USCI_CODE) 
														 | 
														
														 | 
														
															                 .usciCode(Constants.USCI_CODE) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                .requestId(StrUtil.isBlank(requestId) ? IdUtil.simpleUUID() : requestId) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .requestId(StrUtil.isBlank(requestId) ? OptimalLimitDigitGenerator.generate().toString() : requestId) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .invoiceType("02") 
														 | 
														
														 | 
														
															                 .invoiceType("02") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .buyerUsciCode(mzPatientMi.getSocialNo()) 
														 | 
														
														 | 
														
															                 .buyerUsciCode(mzPatientMi.getSocialNo()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .buyerUsciName(mzPatientMi.getName()) 
														 | 
														
														 | 
														
															                 .buyerUsciName(mzPatientMi.getName()) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -463,7 +470,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .build(); 
														 | 
														
														 | 
														
															                 .build(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SpecialAttrDTO specialAttrDTO = SpecialAttrDTO.builder() 
														 | 
														
														 | 
														
															         SpecialAttrDTO specialAttrDTO = SpecialAttrDTO.builder() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                .medicalSerialNo(Convert.toStr(mzyReqrec.getSerialNo())) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .medicalSerialNo(requestId) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .patientName(mzPatientMi.getName()) 
														 | 
														
														 | 
														
															                 .patientName(mzPatientMi.getName()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .deptCode(zdUnitCode.getCode()) 
														 | 
														
														 | 
														
															                 .deptCode(zdUnitCode.getCode()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .deptName(zdUnitCode.getName()) 
														 | 
														
														 | 
														
															                 .deptName(zdUnitCode.getName()) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -528,7 +535,8 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         MzDzfpUpload mzDzfpUpload = MzDzfpUpload.builder() 
														 | 
														
														 | 
														
															         MzDzfpUpload mzDzfpUpload = MzDzfpUpload.builder() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .patientId(mzReceiptSerial.getPatientId()) 
														 | 
														
														 | 
														
															                 .patientId(mzReceiptSerial.getPatientId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .times(mzReceiptSerial.getTimes()) 
														 | 
														
														 | 
														
															                 .times(mzReceiptSerial.getTimes()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                .receiptNo(mzReceiptSerial.getReceiptSn()) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .receiptNo(mzReceiptSerial.getReceiptNo()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .serialNo(String.valueOf(mzReceiptSerial.getReceiptSn())) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .fpNo(resultInfo.getData().get("invoice_code").toString()) 
														 | 
														
														 | 
														
															                 .fpNo(resultInfo.getData().get("invoice_code").toString()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .opCode(resultInfo.getData().get("invoice_number").toString()) 
														 | 
														
														 | 
														
															                 .opCode(resultInfo.getData().get("invoice_number").toString()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .requestId(mzInvoiceInfo.getRequestId()) 
														 | 
														
														 | 
														
															                 .requestId(mzInvoiceInfo.getRequestId()) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -609,6 +617,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<MzChargeDetail> realMzChargeDetails = mzChargeDetails.stream().filter(item -> !Constants.TC.equals(item.getBillItemCode()) && Convert.toBigDecimal(item.getUnitPrice(), BigDecimal.ZERO).compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList()); 
														 | 
														
														 | 
														
															         List<MzChargeDetail> realMzChargeDetails = mzChargeDetails.stream().filter(item -> !Constants.TC.equals(item.getBillItemCode()) && Convert.toBigDecimal(item.getUnitPrice(), BigDecimal.ZERO).compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 //        log.info("realMzChargeDetails--费用明细:{}", realMzChargeDetails); 
														 | 
														
														 | 
														
															 //        log.info("realMzChargeDetails--费用明细:{}", realMzChargeDetails); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<String> codes = realMzChargeDetails.stream().map(MzChargeDetail::getChargeItemCode).collect(Collectors.toList()); 
														 | 
														
														 | 
														
															         List<String> codes = realMzChargeDetails.stream().map(MzChargeDetail::getChargeItemCode).collect(Collectors.toList()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        mzReceiptSerial.setSerialNo(realMzChargeDetails.get(0).getSerialNo()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<ZdChargeItem> zdChargeItemList = zdChargeItemMapper.selectZdChargeItemByCodeList(codes); 
														 | 
														
														 | 
														
															         List<ZdChargeItem> zdChargeItemList = zdChargeItemMapper.selectZdChargeItemByCodeList(codes); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         List<YpZdDict> ypZdDicts = ypZdDictMapper.selectYpZdDictByCodeList(codes); 
														 | 
														
														 | 
														
															         List<YpZdDict> ypZdDicts = ypZdDictMapper.selectYpZdDictByCodeList(codes); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Map<String, ZdChargeItem> ybCodeMap = new HashMap<>(); 
														 | 
														
														 | 
														
															         Map<String, ZdChargeItem> ybCodeMap = new HashMap<>(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -634,7 +643,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .patientId(mzReceiptSerial.getPatientId()) 
														 | 
														
														 | 
														
															                 .patientId(mzReceiptSerial.getPatientId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .times(mzReceiptSerial.getTimes().toString()) 
														 | 
														
														 | 
														
															                 .times(mzReceiptSerial.getTimes().toString()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .usciCode(Constants.USCI_CODE) 
														 | 
														
														 | 
														
															                 .usciCode(Constants.USCI_CODE) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                .requestId(StrUtil.isBlank(requestId) ? IdUtil.simpleUUID() : requestId) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .requestId(StrUtil.isBlank(requestId) ? OptimalLimitDigitGenerator.generate().toString() : requestId) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .invoiceType("02") 
														 | 
														
														 | 
														
															                 .invoiceType("02") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .buyerUsciCode(mzPatientMi.getSocialNo()) 
														 | 
														
														 | 
														
															                 .buyerUsciCode(mzPatientMi.getSocialNo()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .buyerUsciName(mzPatientMi.getName()) 
														 | 
														
														 | 
														
															                 .buyerUsciName(mzPatientMi.getName()) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -645,7 +654,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .issueDate(DateUtil.formatDateTime(now)) 
														 | 
														
														 | 
														
															                 .issueDate(DateUtil.formatDateTime(now)) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .build(); 
														 | 
														
														 | 
														
															                 .build(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         SpecialAttrDTO specialAttrDTO = SpecialAttrDTO.builder() 
														 | 
														
														 | 
														
															         SpecialAttrDTO specialAttrDTO = SpecialAttrDTO.builder() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                .medicalSerialNo(Convert.toStr(realMzChargeDetails.get(0).getSerialNo())) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .medicalSerialNo(requestId) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .patientName(mzPatientMi.getName()) 
														 | 
														
														 | 
														
															                 .patientName(mzPatientMi.getName()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .deptCode(zdUnitCode.getCode()) 
														 | 
														
														 | 
														
															                 .deptCode(zdUnitCode.getCode()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .deptName(zdUnitCode.getName()) 
														 | 
														
														 | 
														
															                 .deptName(zdUnitCode.getName()) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -846,11 +855,12 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             blueInvoiceNo = list.get(0).getFpNo(); 
														 | 
														
														 | 
														
															             blueInvoiceNo = list.get(0).getFpNo(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             blueIssueDate = list.get(0).getBlueIssueDate(); 
														 | 
														
														 | 
														
															             blueIssueDate = list.get(0).getBlueIssueDate(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         } 
														 | 
														
														 | 
														
															         } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        requestId = Convert.toStr(requestId, IdUtil.simpleUUID()); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        requestId = Convert.toStr(requestId, OptimalLimitDigitGenerator.generate().toString()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         MzInvoiceInfo mzInvoiceInfo = createZyInvoiceInfo(uploadParam, requestId); 
														 | 
														
														 | 
														
															         MzInvoiceInfo mzInvoiceInfo = createZyInvoiceInfo(uploadParam, requestId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         //先插入记录 
														 | 
														
														 | 
														
															         //先插入记录 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         mzDzfpUploadMapper.delete(getQueryWrapper(uploadParam)); 
														 | 
														
														 | 
														
															         mzDzfpUploadMapper.delete(getQueryWrapper(uploadParam)); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         uploadParam.setRequestId(requestId); 
														 | 
														
														 | 
														
															         uploadParam.setRequestId(requestId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+//        uploadParam.setReceiptNo(requestId); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         mzDzfpUploadMapper.insert(uploadParam); 
														 | 
														
														 | 
														
															         mzDzfpUploadMapper.insert(uploadParam); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         ResultInfo resultInfo; 
														 | 
														
														 | 
														
															         ResultInfo resultInfo; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         if (uploadParam.getTypeFlag() == 3) { 
														 | 
														
														 | 
														
															         if (uploadParam.getTypeFlag() == 3) { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -918,6 +928,12 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         mzInvoiceInfo.setSpecialAttrDTO(SpecialAttrDTO.builder() 
														 | 
														
														 | 
														
															         mzInvoiceInfo.setSpecialAttrDTO(SpecialAttrDTO.builder() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .medicalSerialNo(requestId) 
														 | 
														
														 | 
														
															                 .medicalSerialNo(requestId) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .patientName(employee.getEmployeeName()) 
														 | 
														
														 | 
														
															                 .patientName(employee.getEmployeeName()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .outpatientNo(aPatientMi.getOutpatientNo()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .deptName(zdUnitCode.getName()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .deptCode(uploadParam.getPatientId()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .sex(aPatientMi.getSex()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .age(aPatientMi.getAge().toString()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                .patientName(employee.getEmployeeName()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .patientIdTypeCode(gePatientIdTypeCode(aPatientMi.getPsnCertType())) 
														 | 
														
														 | 
														
															                 .patientIdTypeCode(gePatientIdTypeCode(aPatientMi.getPsnCertType())) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .patientIdNo(aPatientMi.getSocialNo()) 
														 | 
														
														 | 
														
															                 .patientIdNo(aPatientMi.getSocialNo()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 .anamnesisNo(Tools.getHisOrdNum(uploadParam.getPatientId(), uploadParam.getTimes(), uploadParam.getReceiptNo())) 
														 | 
														
														 | 
														
															                 .anamnesisNo(Tools.getHisOrdNum(uploadParam.getPatientId(), uploadParam.getTimes(), uploadParam.getReceiptNo())) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1071,8 +1087,15 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @return: cn.hnthyy.thmz.entity.mzdzfp.ResultInfo 
														 | 
														
														 | 
														
															      * @return: cn.hnthyy.thmz.entity.mzdzfp.ResultInfo 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      */ 
														 | 
														
														 | 
														
															      */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     public ResultInfo zyBlueInvoice(MzInvoiceInfo mzInvoiceInfo) { 
														 | 
														
														 | 
														
															     public ResultInfo zyBlueInvoice(MzInvoiceInfo mzInvoiceInfo) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        String url = getUrl() + "bsw-server/evasp/api/nscs/hospital/blueInvoice"; 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        String paramJson = JsonUtil.object2Json(mzInvoiceInfo); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+//        String url = getUrl() + "public/ebill/invoicehisissue"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+//        String paramJson = JsonUtil.object2Json(mzInvoiceInfo); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+//        return requestInvoice(paramJson, url, "开具住院蓝字发票"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String url = getUrl() + "public/ebill/invoicehisissue"; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        JSMzInvoiceInfo jsMzInvoiceInfo = new JSMzInvoiceInfo().transformFromMzInvoiceInfo(mzInvoiceInfo); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        String paramJson = JsonUtil.object2Json(jsMzInvoiceInfo); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        log.info("url:{}", url); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        log.info("请求前参数:{}", paramJson); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         return requestInvoice(paramJson, url, "开具住院蓝字发票"); 
														 | 
														
														 | 
														
															         return requestInvoice(paramJson, url, "开具住院蓝字发票"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     } 
														 | 
														
														 | 
														
															     } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1131,6 +1154,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @param: param 
														 | 
														
														 | 
														
															      * @param: param 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      * @return: cn.hnthyy.thmz.entity.jy.ResultVo 
														 | 
														
														 | 
														
															      * @return: cn.hnthyy.thmz.entity.jy.ResultVo 
														 | 
													
												
											
												
													
														| 
														 | 
														
															      **/ 
														 | 
														
														 | 
														
															      **/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    @PassToken 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     private ResultVo requestZyChargeList(MzDzfpUpload param) { 
														 | 
														
														 | 
														
															     private ResultVo requestZyChargeList(MzDzfpUpload param) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         ResultVo resultVo = new ResultVo(); 
														 | 
														
														 | 
														
															         ResultVo resultVo = new ResultVo(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         Map<String, Object> paramMap = new HashMap<>(); 
														 | 
														
														 | 
														
															         Map<String, Object> paramMap = new HashMap<>(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1138,6 +1162,7 @@ public class BswServerImpl implements BswServer { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         paramMap.put("times", param.getTimes()); 
														 | 
														
														 | 
														
															         paramMap.put("times", param.getTimes()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         paramMap.put("ledgerSn", param.getReceiptNo()); 
														 | 
														
														 | 
														
															         paramMap.put("ledgerSn", param.getReceiptNo()); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         paramMap.put("needChargeDate", true); 
														 | 
														
														 | 
														
															         paramMap.put("needChargeDate", true); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        log.info("requestZyChargeList-->入参url:{}", wxPayOrderServiceUrl + "/chargeList/selectChargeList"); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         log.info("requestZyChargeList-->入参:{}", paramMap); 
														 | 
														
														 | 
														
															         log.info("requestZyChargeList-->入参:{}", paramMap); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         try { 
														 | 
														
														 | 
														
															         try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             String res = HttpRequest 
														 | 
														
														 | 
														
															             String res = HttpRequest 
														 |