Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

Conflicts:
	svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorServiceApplicationService.java
	svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java
	svr/svr-door-serivce/src/main/java/com/yihu/jw/door/util/MessageUtil.java
	svr/svr-door-serivce/src/main/resources/application.yml
yeshijie 4 years ago
parent
commit
2764e38ad6

+ 1 - 38
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -1039,8 +1039,7 @@ public class DoorOrderService {
        // 更新记录
        this.setUpdateColumnInfo(one);
        doorServiceOrderDao.save(one);
        // 更新居民签约服务包服务项次数
        this.reduceServiceItemTimes(serverPackagePriceByOrderId(orderId), one.getPatient());
        // 发送微信消息通知--用户评价//·
        BasePatientDO patient = patientInfoService.findById(one.getPatient());
        // 获取微信模板  fwyspf-服务医生评分
@ -1285,42 +1284,6 @@ public class DoorOrderService {
        return map;
    }
    /**
     * 更新居民签约服务包服务项次数
     * @param itemInfo 格式[{"itemCode":"","fee":"","number":""}]
     * @param patient 居民code
     */
    public void reduceServiceItemTimes(String itemInfo, String patient){
        Map<String, Object> map = new HashMap<>();
        //获取居民签约服务项及次数
//        SignFamily signFamily = signFamilyDao.findByPatient(patient);
        String sql = "SELECT ip.`code`,ip.service_item_code as itemCode, ip.service_times as times  FROM wlyy_server_package_patient pp , wlyy_server_package_item_patient ip " +
//                "where pp.`code` = ip.server_package_patient_code and  pp.patient = '" + patient + "' and pp.hospital = '" + signFamily.getHospital() + "' and pp.`status` = 1 " +
                "where pp.`code` = ip.server_package_patient_code and  pp.patient = '" + patient + "' and pp.hospital = '" + "" + "' and pp.`status` = 1 " +
                "order BY pp.end_time ";
        List<Map<String, Object>> list =jdbcTemplate.query(sql, new BeanPropertyRowMapper(String.class));
        JSONArray jsonArray = JSONArray.parseArray(itemInfo);
        for(Object o : jsonArray) {
            JSONObject jsonObject = (JSONObject) o;
            String itemCode = jsonObject.getString("itemCode");
            Integer number = jsonObject.getInteger("number");
            //遍历是否是居民签约的服务项,如果是,看服务项次数够不够减,不够减的继续遍历其他服务项,够减则跳出循环更新次数
            for (Map<String, Object> m : list) {
                if ((m.get(itemCode) + "").equals(itemCode)) {
                    String itemPatientCode = map.get("code") + "";
                    Integer times = (Integer) map.get("times");
                    if (number <= times) {
//                        serverPackageItemPatientDao.updateTimesByCode(itemPatientCode, times - number);
                        break;
                    } else {
//                        serverPackageItemPatientDao.updateTimesByCode(itemPatientCode, 0);
                        number -= times;
                    }
                }
            }
        }
    }
    /**
     * 获取订单下服务包数量、单价

+ 3 - 3
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -939,7 +939,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        orderBriefInfo.put("prescriptionTime", DateUtil.dateToStr(orderDO.getPrescriptionTime(), "MM-dd HH:mm"));
        orderBriefInfo.put("cancelTime", DateUtil.dateToStr(orderDO.getCancelTime(), "MM-dd HH:mm"));
        // 计算服务包支付多少钱
       /*  // 计算服务包支付多少钱
        List<Map<String, Object>> feeDetailDOS = doorOrderService.getDoorFeeDetailGroupByStatus(id);
        String jsonData = null;
        try {
@ -948,9 +948,9 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
            e.printStackTrace();
        }
        if (!CollectionUtils.isEmpty(feeDetailDOS)) {
            Map<String, Object> map = doorOrderService.countServerPackagePrice(jsonData, orderDO.getPatient());
           Map<String, Object> map = doorOrderService.countServerPackagePrice(jsonData, orderDO.getPatient());
            orderBriefInfo.put("packageFee", map.get("serverPackagePrice"));
        }
        }*/
        orderJson.put("order", orderBriefInfo);
        //关联服务项