|  | @@ -21,7 +21,6 @@ import thyyxxk.webserver.entity.medicalinsurance.setlinfo.TimesList;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.entity.medicalinsurance.setllist.*;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.entity.inpatient.ZyActpatient;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.service.redislike.RedisLikeService;
 | 
	
		
			
				|  |  | -import thyyxxk.webserver.service.outpatient.wxapi.SendWxInfoService;
 | 
	
		
			
				|  |  |  import thyyxxk.webserver.utils.*;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import java.math.BigDecimal;
 | 
	
	
		
			
				|  | @@ -41,15 +40,13 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |      private static final String OUTPUT = "output";
 | 
	
		
			
				|  |  |      private final ExecService exec;
 | 
	
		
			
				|  |  |      private final SiQueryDao dao;
 | 
	
		
			
				|  |  | -    private final SendWxInfoService wxsrvc;
 | 
	
		
			
				|  |  |      private final SiSetlinfoDao setlinfoDao;
 | 
	
		
			
				|  |  |      private final RedisLikeService redis;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  | -    public SiQueryService(ExecService exec, SiQueryDao dao, SendWxInfoService wxsrvc, SiSetlinfoDao setlinfoDao, RedisLikeService redis) {
 | 
	
		
			
				|  |  | +    public SiQueryService(ExecService exec, SiQueryDao dao, SiSetlinfoDao setlinfoDao, RedisLikeService redis) {
 | 
	
		
			
				|  |  |          this.exec = exec;
 | 
	
		
			
				|  |  |          this.dao = dao;
 | 
	
		
			
				|  |  | -        this.wxsrvc = wxsrvc;
 | 
	
		
			
				|  |  |          this.setlinfoDao = setlinfoDao;
 | 
	
		
			
				|  |  |          this.redis = redis;
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -376,7 +373,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              JSONArray setldetail = output.getJSONArray("setldetail");
 | 
	
		
			
				|  |  | -            if (null != setldetail && setldetail.size() > 0) {
 | 
	
		
			
				|  |  | +            if (null != setldetail && !setldetail.isEmpty()) {
 | 
	
		
			
				|  |  |                  List<SiSetldetail> list = new ArrayList<>();
 | 
	
		
			
				|  |  |                  for (int i = 0; i < setldetail.size(); i++) {
 | 
	
		
			
				|  |  |                      SiSetldetail setldtel = JSONObject.parseObject(setldetail.getJSONObject(i).toJSONString(), SiSetldetail.class);
 | 
	
	
		
			
				|  | @@ -410,7 +407,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |              return ResultVoUtil.success(map);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          List<SiSetlFeeDetl> list = dao.selectFeeDetlList(psninfo.getMdtrtId(), psninfo.getPatNo(), psninfo.getTimes(), psninfo.getLedgerSn());
 | 
	
		
			
				|  |  | -        if (list.size() > 0) {
 | 
	
		
			
				|  |  | +        if (!list.isEmpty()) {
 | 
	
		
			
				|  |  |              map.put("feedtle", list);
 | 
	
		
			
				|  |  |              map.put("analyse", analyseFeedtle(list));
 | 
	
		
			
				|  |  |              return ResultVoUtil.success(map);
 | 
	
	
		
			
				|  | @@ -431,7 +428,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (result.getIntValue(RESULT_CODE) == 0) {
 | 
	
		
			
				|  |  |              JSONArray output = result.getJSONArray(OUTPUT);
 | 
	
		
			
				|  |  | -            if (null == output || output.size() == 0) {
 | 
	
		
			
				|  |  | +            if (null == output || output.isEmpty()) {
 | 
	
		
			
				|  |  |                  return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有查询到费用明细。");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              for (int i = 0; i < output.size(); i++) {
 | 
	
	
		
			
				|  | @@ -441,7 +438,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |                      list.clear();
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            if (list.size() > 0) {
 | 
	
		
			
				|  |  | +            if (!list.isEmpty()) {
 | 
	
		
			
				|  |  |                  dao.insertSetlFeeDetlBatch(list);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              list = dao.selectFeeDetlList(psninfo.getMdtrtId(), psninfo.getPatNo(), psninfo.getTimes(), psninfo.getLedgerSn());
 | 
	
	
		
			
				|  | @@ -593,7 +590,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |          if (result.getIntValue(RESULT_CODE) == 0) {
 | 
	
		
			
				|  |  |              JSONObject output = result.getJSONObject(OUTPUT);
 | 
	
		
			
				|  |  |              JSONArray pts = output.getJSONArray("data");
 | 
	
		
			
				|  |  | -            if (pts.size() == 0) {
 | 
	
		
			
				|  |  | +            if (pts.isEmpty()) {
 | 
	
		
			
				|  |  |                  return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有查询到医保在院的患者信息。");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              List<InHspPsnInfo> list = new ArrayList<>();
 | 
	
	
		
			
				|  | @@ -630,7 +627,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |          if (result.getIntValue(RESULT_CODE) == 0) {
 | 
	
		
			
				|  |  |              JSONObject output = result.getJSONObject(OUTPUT);
 | 
	
		
			
				|  |  |              JSONArray array = output.getJSONArray("refmedin");
 | 
	
		
			
				|  |  | -            if (null == array || array.size() == 0) {
 | 
	
		
			
				|  |  | +            if (null == array || array.isEmpty()) {
 | 
	
		
			
				|  |  |                  return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有查询到符合条件的转院信息。");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              List<RefMedin> list = new ArrayList<>();
 | 
	
	
		
			
				|  | @@ -699,7 +696,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |          if (result.getIntValue(RESULT_CODE) == 0) {
 | 
	
		
			
				|  |  |              JSONObject output = result.getJSONObject(OUTPUT);
 | 
	
		
			
				|  |  |              JSONArray array = output.getJSONArray("feedetail");
 | 
	
		
			
				|  |  | -            if (null == array || array.size() == 0) {
 | 
	
		
			
				|  |  | +            if (null == array || array.isEmpty()) {
 | 
	
		
			
				|  |  |                  return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有查询到此人的慢特病用药记录。");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              List<MedUseRcd> list = new ArrayList<>();
 | 
	
	
		
			
				|  | @@ -776,11 +773,13 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |          if (result.getIntValue(RESULT_CODE) == 0) {
 | 
	
		
			
				|  |  |              JSONObject output = result.getJSONObject(OUTPUT);
 | 
	
		
			
				|  |  |              JSONArray details = output.getJSONArray("feedetail");
 | 
	
		
			
				|  |  | -            if (null == details || details.size() == 0) {
 | 
	
		
			
				|  |  | +            if (null == details || details.isEmpty()) {
 | 
	
		
			
				|  |  |                  return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有查询到此患者的慢特病备案信息。");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              List<SpcChrDiseAcct> list = new ArrayList<>();
 | 
	
		
			
				|  |  | -            Date now = new Date();
 | 
	
		
			
				|  |  | +            Calendar calendar = Calendar.getInstance();
 | 
	
		
			
				|  |  | +            calendar.add(Calendar.DATE,-1);
 | 
	
		
			
				|  |  | +            Date now = calendar.getTime();
 | 
	
		
			
				|  |  |              for (int i = 0; i < details.size(); i++) {
 | 
	
		
			
				|  |  |                  JSONObject detail = details.getJSONObject(i);
 | 
	
		
			
				|  |  |                  SpcChrDiseAcct spcChrDiseAcct = JSONObject.parseObject(detail.toJSONString(), SpcChrDiseAcct.class);
 | 
	
	
		
			
				|  | @@ -794,7 +793,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            if (list.size() > 0) {
 | 
	
		
			
				|  |  | +            if (!list.isEmpty()) {
 | 
	
		
			
				|  |  |                  return ResultVoUtil.success(list);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "此患者没有有效的慢特病备案,或慢特病备案已过期!");
 | 
	
	
		
			
				|  | @@ -819,7 +818,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |          if (result.getIntValue(RESULT_CODE) == 0) {
 | 
	
		
			
				|  |  |              JSONObject output = result.getJSONObject(OUTPUT);
 | 
	
		
			
				|  |  |              JSONArray array = output.getJSONArray("psnfixmedin");
 | 
	
		
			
				|  |  | -            if (null == array || array.size() == 0) {
 | 
	
		
			
				|  |  | +            if (null == array || array.isEmpty()) {
 | 
	
		
			
				|  |  |                  return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有查询到对应的定点信息。");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              List<PsnFixMedin> list = new ArrayList<>();
 | 
	
	
		
			
				|  | @@ -1296,7 +1295,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      private ResultVo<List<SiSetlFeeDetl>> getChrgitems(String psnNo, String setlId, String mdtrtId, String admdvs) {
 | 
	
		
			
				|  |  |          List<SiSetlFeeDetl> list = dao.selectAllSetlFeeDtle(mdtrtId);
 | 
	
		
			
				|  |  | -        if (list.size() > 0) {
 | 
	
		
			
				|  |  | +        if (!list.isEmpty()) {
 | 
	
		
			
				|  |  |              return ResultVoUtil.success(list);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.QUERY_FEE_DETAILS, admdvs);
 | 
	
	
		
			
				|  | @@ -1315,7 +1314,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (0 == result.getInteger(RESULT_CODE)) {
 | 
	
		
			
				|  |  |              JSONArray output = result.getJSONArray(OUTPUT);
 | 
	
		
			
				|  |  | -            if (null == output || output.size() == 0) {
 | 
	
		
			
				|  |  | +            if (null == output || output.isEmpty()) {
 | 
	
		
			
				|  |  |                  return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有查询到费用明细。");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              for (int i = 0; i < output.size(); i++) {
 | 
	
	
		
			
				|  | @@ -1331,7 +1330,7 @@ public class SiQueryService {
 | 
	
		
			
				|  |  |                      list.clear();
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            if (list.size() > 0) {
 | 
	
		
			
				|  |  | +            if (!list.isEmpty()) {
 | 
	
		
			
				|  |  |                  dao.insertSetlFeeDetlBatch(list);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              return ResultVoUtil.success(dao.selectAllSetlFeeDtle(mdtrtId));
 |