Selaa lähdekoodia

模板消息修改

wujunjie 7 vuotta sitten
vanhempi
commit
fc55234406

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java

@ -46,7 +46,7 @@ public class Message extends IdEntity {
	private String tzType;//体征类别
	private String tzCode;//体征code
	private Integer sex;//患者性别
	private String relationCode;//业务关联code,type=6时为咨询code
	private String relationCode;//业务关联code,type=6时为咨询code type=8时为续方表code
	private String prescriptionStatus;//type=6续方审核状态 0待审核,1审核通过,2审核失败|type=7续方状态 0待取药,1已取药
	public String getCode() {

+ 17 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PatientPrescriptionPayService.java

@ -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;
    }

+ 10 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionNoticesService.java

@ -14,6 +14,8 @@ import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import com.ylzinfo.onepay.sdk.utils.StringUtil;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -33,6 +35,7 @@ public class PrescriptionNoticesService extends BaseService {
    private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
    @Autowired
    private WeiXinOpenIdUtils weiXinOpenIdUtils;
    private static final Logger LOGGER = LoggerFactory.getLogger(PrescriptionNoticesService.class);
    /**
@ -46,6 +49,13 @@ public class PrescriptionNoticesService extends BaseService {
     * @param url       带参数的模板跳转链接
     */
    public void sendMessages(String patient, String doctName, String ordenTime, int type, int status, String url) throws Exception {
        LOGGER.info("=======================> sendMessages start!!");
        LOGGER.debug("patient "+patient);
        LOGGER.debug("doctName "+doctName);
        LOGGER.debug("ordenTime "+ordenTime);
        LOGGER.debug("type "+type);
        LOGGER.debug("status "+status);
        LOGGER.debug("url "+ url);
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        JSONArray jsonArray = null;
@ -57,7 +67,6 @@ public class PrescriptionNoticesService extends BaseService {
        JSONObject sendJson = new JSONObject();
        String first = "";
        String remark = "";
        if (type == 1) {
            switch (status) {
                case 0: