|  | @ -127,6 +127,7 @@ public class PatientPrescriptionPayService extends BaseService {
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public JSONObject dispatch(String prescriptionCode, String orgCode) throws Exception {
 | 
	
		
			
				|  |  |         LOGGER.info("========================>" + "prescriptionCode "+prescriptionCode+" orgCode" +orgCode);
 | 
	
		
			
				|  |  |         JSONObject result = new JSONObject();
 | 
	
		
			
				|  |  |         List manage = new ArrayList();
 | 
	
		
			
				|  |  |         List types = new ArrayList();
 | 
	
	
		
			
				|  | @ -252,6 +253,7 @@ public class PatientPrescriptionPayService extends BaseService {
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public Map recipeReturnUrl(HttpServletRequest request, HttpServletResponse response, String accessToken) throws Exception {
 | 
	
		
			
				|  |  |         LOGGER.debug("=================================> "+"start");
 | 
	
		
			
				|  |  |         Map resultMap = new HashMap();
 | 
	
		
			
				|  |  |         Prescription prescription = null;
 | 
	
		
			
				|  |  |         int flag = 0;
 | 
	
	
		
			
				|  | @ -350,6 +352,7 @@ public class PatientPrescriptionPayService extends BaseService {
 | 
	
		
			
				|  |  |             String billNo = "201708111044012018301";//待结算费用单据号
 | 
	
		
			
				|  |  |             String insuranceAmount = "1542";//医保支付金额
 | 
	
		
			
				|  |  |             String outChargeNo = request.getParameter("outChargeNo");//接入应用业务流水号
 | 
	
		
			
				|  |  |             LOGGER.debug("=================================> "+outChargeNo);
 | 
	
		
			
				|  |  |             String selfPayAmount = "0";//自付金额
 | 
	
		
			
				|  |  |             String tradeStatus = "0";//交易状态
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -376,7 +379,7 @@ public class PatientPrescriptionPayService extends BaseService {
 | 
	
		
			
				|  |  |             String exceedAmount = "0";//超封顶线金额
 | 
	
		
			
				|  |  |             String accountBalance = "284125";//个人账户余额
 | 
	
		
			
				|  |  |             String healthBalance = "7133";//健康账户余额
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             LOGGER.debug("=================================> "+"111111111111111111111");
 | 
	
		
			
				|  |  |             prescriptionPay.setBillNo(billNo);//待结算费用单据号
 | 
	
		
			
				|  |  |             prescriptionPay.setInsuranceAmount(Integer.parseInt(insuranceAmount));//医保支付金额
 | 
	
		
			
				|  |  |             prescriptionPay.setSelfPayAmount(Integer.parseInt(selfPayAmount));//自付金额
 | 
	
	
		
			
				|  | @ -403,7 +406,7 @@ public class PatientPrescriptionPayService extends BaseService {
 | 
	
		
			
				|  |  |             prescriptionPay.setExceedAmount(Integer.parseInt(exceedAmount));//超封顶线金额
 | 
	
		
			
				|  |  |             prescriptionPay.setAccountBalance(Integer.parseInt(accountBalance));//个人账户余额
 | 
	
		
			
				|  |  |             prescriptionPay.setHealthBalance(Integer.parseInt(healthBalance));//健康账户余额
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             LOGGER.debug("=================================> "+"2222222222222222222222");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             //        保存数据库更改记录
 | 
	
		
			
				|  |  |             payDao.save(prescriptionPay);
 | 
	
	
		
			
				|  | @ -413,6 +416,7 @@ public class PatientPrescriptionPayService extends BaseService {
 | 
	
		
			
				|  |  |             prescription = prescriptionDao.findByCode(prescriptionCode);
 | 
	
		
			
				|  |  |             PrescriptionExpressage expressage = expressageDao.findByPrescriptionPay(prescriptionCode);
 | 
	
		
			
				|  |  |             if ("0".equals(tradeStatus)) {
 | 
	
		
			
				|  |  |                 LOGGER.debug("=================================> "+"333333333333333333333333333");
 | 
	
		
			
				|  |  |                 //支付成功返回续方code给前端
 | 
	
		
			
				|  |  |                 resultMap.put("prescriptionCode",prescriptionCode);
 | 
	
		
			
				|  |  |                 prescriptionPay.setTradeStatus("1");//交易状态 成功1 失败0
 | 
	
	
		
			
				|  | @ -430,11 +434,12 @@ public class PatientPrescriptionPayService extends BaseService {
 | 
	
		
			
				|  |  |                     int type = message.getType();
 | 
	
		
			
				|  |  |                     String title = message.getTitle();
 | 
	
		
			
				|  |  |                     String content = message.getContent();
 | 
	
		
			
				|  |  |                     pushMsgTask.put(receiver, "3", title, content, "");
 | 
	
		
			
				|  |  |                     pushMsgTask.put(receiver, "8", title, content, "");
 | 
	
		
			
				|  |  |                     message.setOver("1");//操作结束
 | 
	
		
			
				|  |  |                     message.setState(1);//已发送
 | 
	
		
			
				|  |  |                     message.setCzrq(new Date());
 | 
	
		
			
				|  |  |                     messageDao.save(message);
 | 
	
		
			
				|  |  |                     LOGGER.debug("=================================> "+"4444444444444444444444444");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 //支付成功发起结算
 | 
	
		
			
				|  |  |                 jwPrescriptionService.executeSickSettle(prescriptionCode);
 | 
	
	
		
			
				|  | @ -647,6 +652,12 @@ public class PatientPrescriptionPayService extends BaseService {
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     @Transactional
 | 
	
		
			
				|  |  |     public Map charge(int type, String addressJson, String orgCode, String prescriptionCode, int totalAmount, String people, String accessToken, String returnUrl) throws Exception {
 | 
	
		
			
				|  |  |         LOGGER.info("=================> ");
 | 
	
		
			
				|  |  |         LOGGER.info("type "+type);
 | 
	
		
			
				|  |  |         LOGGER.info("addressJson "+addressJson);
 | 
	
		
			
				|  |  |         LOGGER.info("orgCode "+orgCode);
 | 
	
		
			
				|  |  |         LOGGER.info("prescriptionCode "+prescriptionCode);
 | 
	
		
			
				|  |  |         LOGGER.info("people "+people);
 | 
	
		
			
				|  |  |         Map resultMap = new HashMap();
 | 
	
		
			
				|  |  |         //获取机构映射
 | 
	
		
			
				|  |  |         HospitalMapping hos = mappingDao.findByCode(orgCode);
 | 
	
	
		
			
				|  | @ -802,9 +813,9 @@ public class PatientPrescriptionPayService extends BaseService {
 | 
	
		
			
				|  |  |                 message.setSenderName("SYSTEM");//发送者
 | 
	
		
			
				|  |  |                 message.setTitle("新增系统消息");
 | 
	
		
			
				|  |  |                 SimpleDateFormat format = new SimpleDateFormat("MM月dd日");
 | 
	
		
			
				|  |  |                 String content = format.format(new Date()) + "新增1个签约居民待分配健管师,目前共" + amount + "人待处理";
 | 
	
		
			
				|  |  |                 String content = format.format(new Date()) + "新增1个续方订单待分配配送员,目前共" + amount + "人待处理";
 | 
	
		
			
				|  |  |                 message.setContent(content);
 | 
	
		
			
				|  |  |                 message.setType(3);//分配健管师
 | 
	
		
			
				|  |  |                 message.setType(8);//分配健管师
 | 
	
		
			
				|  |  |                 message.setPlatform(2);//消息平台,1微信端/患者端,2医生APP端
 | 
	
		
			
				|  |  |                 message.setState(0);//消息状态,1已发送,0待发送,-1发送失败
 | 
	
		
			
				|  |  |                 message.setRead(1);//查看状态,1未读,0已读
 | 
	
	
		
			
				|  | @ -961,6 +972,7 @@ public class PatientPrescriptionPayService extends BaseService {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         resultMap.put("outChargeNo", uuid);
 | 
	
		
			
				|  |  |         resultMap.put("payUrl", result);
 | 
	
		
			
				|  |  |         resultMap.put("status", "200");
 | 
	
		
			
				|  |  |         return resultMap;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 |