Browse Source

Merge branch 'dev' of trick9191/patient-co-management into dev

trick9191 7 years ago
parent
commit
2f4ae71b23

+ 3 - 3
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionAdress.java

@ -23,7 +23,7 @@ public class PrescriptionAdress extends IdEntity {
    private String cityName;//城市
    private String townName;//区
    private String adress; //地址
    private String defaultFlag;//0.非首选,1.首选
    private Integer defaultFlag;//0.非首选,1.首选
    private Date createTime;//创建时间
    private Date updateTime;//更新时间
@ -107,11 +107,11 @@ public class PrescriptionAdress extends IdEntity {
        this.adress = adress;
    }
    public String getDefaultFlag() {
    public Integer getDefaultFlag() {
        return defaultFlag;
    }
    public void setDefaultFlag(String defaultFlag) {
    public void setDefaultFlag(Integer defaultFlag) {
        this.defaultFlag = defaultFlag;
    }

+ 7 - 7
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java

@ -30,13 +30,13 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
    public void onApplicationEvent(ContextRefreshedEvent ContextRefreshedEvent) {
        try {
            // 启动签约到期处理JOB
            if (!quartzHelper.isExistJob("sign_end_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("sign_end_job_trigger");
                quartzHelper.addJob(SignEndJob.class, trigger, "sign_end_job", new HashMap<String, Object>());
                logger.info("sign end job start success");
            } else {
                logger.info("sign end job exist");
            }
//            if (!quartzHelper.isExistJob("sign_end_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("sign_end_job_trigger");
//                quartzHelper.addJob(SignEndJob.class, trigger, "sign_end_job", new HashMap<String, Object>());
//                logger.info("sign end job start success");
//            } else {
//                logger.info("sign end job exist");
//            }
            if (!quartzHelper.isExistJob("evaluate_score_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("evaluate_score_job");
                quartzHelper.addJob(EvaluateScoreJob.class, trigger, "evaluate_score_job", new HashMap<String, Object>());

+ 19 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.web.quota;
import com.yihu.wlyy.job.*;
import com.yihu.wlyy.job.consult.ConsultCleanerJob;
import com.yihu.wlyy.job.consult.EvaluateScoreJob;
import com.yihu.wlyy.job.consult.FamousConsultTimesJob;
import com.yihu.wlyy.job.consult.FinishConsultJob;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
@ -606,7 +607,7 @@ public class JobController extends BaseController {
            return error(-1, e.getMessage());
        }
    }
    
    /**
     *根据时间范围同步居民随访记录
     *@author huangwenjie
@ -659,4 +660,21 @@ public class JobController extends BaseController {
    }
    /**
     * 医生评价分数统计
     * @return
     */
    @RequestMapping(value = "startEvaluateScoreJob", method = RequestMethod.GET)
    @ApiOperation("医生评价分数统计")
    public String startEvaluateScoreJob() {
        try {
            quartzHelper.startNow(EvaluateScoreJob.class, "startEvaluateScoreJob", null);
            return success("启动成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
        }
    }
}

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionAdressDao.java

@ -0,0 +1,11 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionAdress;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2017/10/20.
 */
public interface PrescriptionAdressDao extends PagingAndSortingRepository<PrescriptionAdress, Long>, JpaSpecificationExecutor<PrescriptionAdress> {
}

+ 99 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionAdressService.java

@ -0,0 +1,99 @@
package com.yihu.wlyy.service.app.prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionAdress;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import com.yihu.wlyy.repository.prescription.PrescriptionAdressDao;
import com.yihu.wlyy.service.BaseService;
import net.sf.json.JSON;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2017/10/20.
 */
@Service
@Transactional(rollbackOn = Exception.class)
public class PrescriptionAdressService extends BaseService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private PrescriptionAdressDao prescriptionAdressDao;
    //获取列表
    public List<Map<String,Object>> getAdressList(String patient){
        String sql = "SELECT ad.* FROM wlyy_prescription_adress ad WHERE ad.patient ='"+patient+"' ORDER BY ad.default_flag DESC";
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
        return rs;
    }
    //保存
    public String saveAdress(String adressJosn){
        JSONObject jsonObject = JSONObject.fromObject(adressJosn);
        PrescriptionAdress p = (PrescriptionAdress) net.sf.json.JSONObject.toBean(jsonObject,PrescriptionAdress.class);
        p.setCreateTime(new Date());
        if(p.getDefaultFlag()==1){
            String sql ="UPDATE wlyy_prescription_adress set defaultFlag = 0 WHERE patient ='"+p.getPatient()+"' ";
            jdbcTemplate.execute(sql);
        }
        prescriptionAdressDao.save(p);
        return "1";
    }
    //更新
    public String updateAdress(String adressJson){
        JSONObject jsonObject = JSONObject.fromObject(adressJson);
        PrescriptionAdress p = (PrescriptionAdress) net.sf.json.JSONObject.toBean(jsonObject,PrescriptionAdress.class);
        p.setCreateTime(new Date());
        if(p.getDefaultFlag()==1){
            String sql ="UPDATE wlyy_prescription_adress set defaultFlag = 0 WHERE patient ='"+p.getPatient()+"' ";
            jdbcTemplate.execute(sql);
        }
        prescriptionAdressDao.save(p);
        return "1";
    }
    //删除
    public String delAdress(Long id){
        prescriptionAdressDao.delete(id);
        return "1";
    }
    public List<Map<String,Object>> getProvince(){
        String sql = "SELECT " +
                " p.`code`, " +
                " p.`name` " +
                " FROM " +
                " dm_province p";
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
        return rs;
    }
    public List<Map<String,Object>> getCityByProvince(String province){
        String sql = "SELECT " +
                " p.`code`, " +
                " p.`name` " +
                " FROM " +
                " dm_city p " +
                " WHERE p.province = '"+province+"'";
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
        return rs;
    }
    public List<Map<String,Object>> getTowmByCity(String city){
        String sql = "SELECT " +
                " p.`code`, " +
                " p.`name` " +
                " FROM " +
                " dm_town p " +
                " WHERE p.city = '"+city+"'";
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
        return rs;
    }
}

+ 103 - 135
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -5151,7 +5151,7 @@ public class StatisticsService extends BaseService {
                sql = "SELECT " +
                        " t.code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " dm_town t " +
                        " LEFT JOIN ( " +
@ -5166,12 +5166,12 @@ public class StatisticsService extends BaseService {
                        " ) s ON s.code = t.code " +
                        " WHERE " +
                        " t.city='350200' " +
                        " ORDER BY num DESC";
                        " ORDER BY val DESC";
            }else if("2".equals(lowlevel)){
                 sql = "SELECT " +
                        " t.code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " dm_hospital t " +
                        " LEFT JOIN ( " +
@ -5187,12 +5187,12 @@ public class StatisticsService extends BaseService {
                        " WHERE " +
                        " t.city='350200' " +
                        " AND LENGTH(t.code)=10 " +
                        " ORDER BY num DESC";
                        " ORDER BY val DESC";
            }else if("1".equals(lowlevel)){
                 sql = " SELECT " +
                        " t.id code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " wlyy_admin_team t " +
                        " LEFT JOIN ( " +
@ -5205,7 +5205,7 @@ public class StatisticsService extends BaseService {
                sql +=  "  GROUP BY " +
                        "  p.admin_team_id " +
                        " ) s ON s.code = t.id " +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
            }
        //区级维度
        }else if("3".equals(level)){
@ -5213,7 +5213,7 @@ public class StatisticsService extends BaseService {
                 sql = "SELECT " +
                        " t.code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " dm_hospital t " +
                        " LEFT JOIN ( " +
@ -5230,12 +5230,12 @@ public class StatisticsService extends BaseService {
                        " t.city='350200' " +
                        " AND LENGTH(t.code)=10 " +
                        " AND t.town ='"+area+"'" +
                        " ORDER BY num DESC";
                        " ORDER BY val DESC";
            }else if("1".equals(lowlevel)){
                 sql = " SELECT " +
                        " t.id code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " wlyy_admin_team t " +
                        " LEFT JOIN ( " +
@ -5249,7 +5249,7 @@ public class StatisticsService extends BaseService {
                        "  p.admin_team_id " +
                        " ) s ON s.code = t.id " +
                        " WHERE LEFT(t.org_code,6) ='"+area+"' " +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
            }
        //机构级维度
        }else if("2".equals(level)){
@ -5257,7 +5257,7 @@ public class StatisticsService extends BaseService {
                 sql = " SELECT " +
                        " t.id code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " wlyy_admin_team t " +
                        " LEFT JOIN ( " +
@ -5271,7 +5271,7 @@ public class StatisticsService extends BaseService {
                        "  p.admin_team_id " +
                        " ) s ON s.code = t.id " +
                        " WHERE t.org_code ='"+area+"'" +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
            }
        }
        rs = jdbcTemplate.queryForList(sql);
@ -5530,7 +5530,7 @@ public class StatisticsService extends BaseService {
                    String sql = "SELECT  " +
                            " tw.`code`, " +
                            " tw.`name`, " +
                            " ifnull(c.sum/100,0) sum " +
                            " ifnull(c.sum/100,0) val " +
                            " FROM dm_town tw LEFT JOIN ( " +
                            " SELECT " +
                            " sum(t.total_amount) sum, " +
@ -5543,7 +5543,7 @@ public class StatisticsService extends BaseService {
                            " ) c ON c.code = tw.code  " +
                            " WHERE " +
                            " tw.city = '350200' " +
                            " ORDER BY sum DESC ";
                            " ORDER BY val DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
@ -5552,7 +5552,7 @@ public class StatisticsService extends BaseService {
                    String sql = "SELECT  " +
                            " tw.`code`, " +
                            " tw.`name`, " +
                            " ifnull(FORMAT(c.avg/100,2),0) avg " +
                            " ifnull(FORMAT(c.avg/100,2),0) val " +
                            " FROM dm_town tw LEFT JOIN ( " +
                            " SELECT " +
                            " avg(t.total_amount) avg, " +
@ -5565,7 +5565,7 @@ public class StatisticsService extends BaseService {
                            " ) c ON c.code = tw.code  " +
                            " WHERE " +
                            " tw.city = '350200' " +
                            " ORDER BY avg DESC ";
                            " ORDER BY c.avg DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
@ -5578,7 +5578,7 @@ public class StatisticsService extends BaseService {
                    String sql = "SELECT  " +
                            " tw.`code`, " +
                            " tw.`name`, " +
                            " ifnull(c.sum/100,0) sum " +
                            " ifnull(c.sum/100,0) val " +
                            " FROM dm_hospital tw LEFT JOIN ( " +
                            " SELECT " +
                            " sum(t.total_amount) sum, " +
@ -5592,7 +5592,7 @@ public class StatisticsService extends BaseService {
                            " WHERE " +
                            " tw.city = '350200' " +
                            " AND LENGTH(tw.code)=10 " +
                            " ORDER BY sum DESC ";
                            " ORDER BY val DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
@ -5601,7 +5601,7 @@ public class StatisticsService extends BaseService {
                    String sql = " SELECT  " +
                            " tw.`code`, " +
                            " tw.`name`, " +
                            " ifnull(FORMAT(c.avg/100,2),0) avg " +
                            " ifnull(FORMAT(c.avg/100,2),0) val " +
                            " FROM dm_hospital tw LEFT JOIN ( " +
                            " SELECT " +
                            " avg(t.total_amount) avg, " +
@ -5615,7 +5615,7 @@ public class StatisticsService extends BaseService {
                            " WHERE " +
                            " tw.city = '350200' " +
                            " AND LENGTH(tw.code)=10 " +
                            " ORDER BY avg DESC ";
                            " ORDER BY c.avg DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
@ -5627,7 +5627,7 @@ public class StatisticsService extends BaseService {
                    String sql = "SELECT  " +
                            " tw.`id` code, " +
                            " tw.`name`, " +
                            " ifnull(c.sum/100,0) sum " +
                            " ifnull(c.sum/100,0) val " +
                            " FROM wlyy_admin_team tw LEFT JOIN ( " +
                            " SELECT " +
                            " sum(t.total_amount) sum, " +
@ -5638,7 +5638,7 @@ public class StatisticsService extends BaseService {
                    sql +=  " AND t.trade_status = 1 " +
                            " GROUP BY p.admin_team_id " +
                            " ) c ON c.code = tw.id  " +
                            " ORDER BY sum DESC ";
                            " ORDER BY val DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                    statisticsAllService.translateTeamLeaderName2(rs);
                    return rs;
@ -5646,7 +5646,7 @@ public class StatisticsService extends BaseService {
                    String sql = "SELECT  " +
                            " tw.`id` code, " +
                            " tw.`name`, " +
                            " ifnull(FORMAT(c.avg/100,2),0) avg " +
                            " ifnull(FORMAT(c.avg/100,2),0) val " +
                            " FROM wlyy_admin_team tw LEFT JOIN ( " +
                            " SELECT " +
                            " avg(t.total_amount) avg, " +
@ -5657,7 +5657,7 @@ public class StatisticsService extends BaseService {
                    sql +=  " AND t.trade_status = 1 " +
                            " GROUP BY p.hospital " +
                            " ) c ON c.code = tw.id  " +
                            " ORDER BY avg DESC ";
                            " ORDER BY c.avg DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                    statisticsAllService.translateTeamLeaderName2(rs);
                    return rs;
@ -5673,7 +5673,7 @@ public class StatisticsService extends BaseService {
                    String sql = "SELECT  " +
                            " tw.`code`, " +
                            " tw.`name`, " +
                            " ifnull(c.sum/100,0) sum " +
                            " ifnull(c.sum/100,0) val " +
                            " FROM dm_hospital tw LEFT JOIN ( " +
                            " SELECT " +
                            " sum(t.total_amount) sum, " +
@ -5686,10 +5686,10 @@ public class StatisticsService extends BaseService {
                            " GROUP BY p.hospital " +
                            " ) c ON c.code = tw.code  " +
                            " WHERE " +
                            " ADN tw.city = '350200' " +
                            " tw.city = '350200' " +
                            " AND tw.town = '"+ area+"'" +
                            " AND LENGTH(tw.code)=10 " +
                            " ORDER BY sum DESC ";
                            " ORDER BY val DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
@ -5698,7 +5698,7 @@ public class StatisticsService extends BaseService {
                    String sql = " SELECT  " +
                            " tw.`code`, " +
                            " tw.`name`, " +
                            " ifnull(FORMAT(c.avg/100,2),0) avg " +
                            " ifnull(FORMAT(c.avg/100,2),0) val " +
                            " FROM dm_hospital tw LEFT JOIN ( " +
                            " SELECT " +
                            " avg(t.total_amount) avg, " +
@ -5714,7 +5714,7 @@ public class StatisticsService extends BaseService {
                            " tw.city = '350200' " +
                            " AND tw.town = '"+ area+"'" +
                            " AND LENGTH(tw.code)=10 " +
                            " ORDER BY avg DESC ";
                            " ORDER BY c.avg DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
@ -5727,7 +5727,7 @@ public class StatisticsService extends BaseService {
                    String sql = "SELECT  " +
                            " tw.`id` code, " +
                            " tw.`name`, " +
                            " ifnull(c.sum/100,0) sum " +
                            " ifnull(c.sum/100,0) val " +
                            " FROM wlyy_admin_team tw LEFT JOIN ( " +
                            " SELECT " +
                            " sum(t.total_amount) sum, " +
@ -5740,7 +5740,7 @@ public class StatisticsService extends BaseService {
                            " GROUP BY p.admin_team_id " +
                            " ) c ON c.code = tw.id  " +
                            " WHERE  LEFT(tw.org_code,6) ='"+area+"' " +
                            " ORDER BY sum DESC ";
                            " ORDER BY val DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                    statisticsAllService.translateTeamLeaderName2(rs);
                    return rs;
@ -5748,7 +5748,7 @@ public class StatisticsService extends BaseService {
                    String sql = "SELECT  " +
                            " tw.`id` code, " +
                            " tw.`name`, " +
                            " ifnull(FORMAT(c.avg/100,2),0) avg " +
                            " ifnull(FORMAT(c.avg/100,2),0) val " +
                            " FROM wlyy_admin_team tw LEFT JOIN ( " +
                            " SELECT " +
                            " avg(t.total_amount) avg, " +
@ -5761,7 +5761,7 @@ public class StatisticsService extends BaseService {
                            " GROUP BY p.admin_team_id " +
                            " ) c ON c.code = tw.id  " +
                            " WHERE  LEFT(tw.org_code,6) ='"+area+"' " +
                            " ORDER BY avg DESC ";
                            " ORDER BY c.avg DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                    statisticsAllService.translateTeamLeaderName2(rs);
                    return rs;
@ -5776,7 +5776,7 @@ public class StatisticsService extends BaseService {
                    String sql = "SELECT  " +
                            " tw.`id` code, " +
                            " tw.`name`, " +
                            " ifnull(c.sum/100,0) sum " +
                            " ifnull(c.sum/100,0) val " +
                            " FROM wlyy_admin_team tw LEFT JOIN ( " +
                            " SELECT " +
                            " sum(t.total_amount) sum, " +
@ -5785,11 +5785,11 @@ public class StatisticsService extends BaseService {
                            " wlyy_prescription_pay t JOIN wlyy_prescription p ON p.code = t.prescription_code " ;
                    sql = setDisSql(sql,disease);
                    sql +=  " AND t.trade_status = 1 " +
                            " AND p.hospital,6 ='"+area+"' " +
                            " AND p.hospital ='"+area+"' " +
                            " GROUP BY p.admin_team_id " +
                            " ) c ON c.code = tw.id  " +
                            " WHERE  tw.org_code ='"+area+"' " +
                            " ORDER BY sum DESC ";
                            " ORDER BY val DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                    statisticsAllService.translateTeamLeaderName2(rs);
                    return rs;
@ -5797,7 +5797,7 @@ public class StatisticsService extends BaseService {
                    String sql = "SELECT  " +
                            " tw.`id` code, " +
                            " tw.`name`, " +
                            " ifnull(FORMAT(c.avg/100,2),0) avg " +
                            " ifnull(FORMAT(c.avg/100,2),0) val " +
                            " FROM wlyy_admin_team tw LEFT JOIN ( " +
                            " SELECT " +
                            " avg(t.total_amount) avg, " +
@ -5810,7 +5810,7 @@ public class StatisticsService extends BaseService {
                            " GROUP BY p.admin_team_id " +
                            " ) c ON c.code = tw.id  " +
                            " WHERE  tw.org_code ='"+area+"' " +
                            " ORDER BY avg DESC ";
                            " ORDER BY c.avg DESC ";
                    List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                    statisticsAllService.translateTeamLeaderName2(rs);
@ -5832,50 +5832,38 @@ public class StatisticsService extends BaseService {
        return sql;
    }
    public List<Map<String,Object>> getPrescriptionDispatchingTotal(String level,String area,String disease){
    public Map<String,Object> getPrescriptionDispatchingTotal(String level,String area,String disease){
        String sql = "SELECT " +
                " COUNT(1) total" +
                " FROM " +
                " wlyy_prescription p " ;
        sql = setLevelAndDisSql2(sql,disease, level, area);
        sql += " AND p.`status` > 50 " +
        sql += " AND p.`status` >= " +PrescriptionLog.PrescriptionLogStatus.pay_success.getValue()+
                " AND p.dispensary_type = ? ";
        List<Map<String,Object>> rs = new ArrayList();
        Map<String,Object> rs = new HashedMap();
        //自取数目
        List<Map<String,Object>> seltList = jdbcTemplate.queryForList(sql,new Object[]{1});
        if(seltList!=null&&seltList.size()>0){
            Map<String,Object> map = new HashedMap();
            map.put("seltTotal",seltList.get(0).get("total"));
            rs.add(map);
            rs.put("seltTotal",seltList.get(0).get("total"));
        }else{
            Map<String,Object> map = new HashedMap();
            map.put("seltTotal",0);
            rs.add(map);
            rs.put("seltTotal",0);
        }
        //快递配送
        List<Map<String,Object>> deliveryList = jdbcTemplate.queryForList(sql,new Object[]{2});
        if(deliveryList!=null&&deliveryList.size()>0){
            Map<String,Object> map = new HashedMap();
            map.put("deliveryTotal",deliveryList.get(0).get("total"));
            rs.add(map);
            rs.put("deliveryTotal",deliveryList.get(0).get("total"));
        }else{
            Map<String,Object> map = new HashedMap();
            map.put("deliveryTotal",0);
            rs.add(map);
            rs.put("deliveryTotal",0);
        }
        //健管师配送
        List<Map<String,Object>> healthDoctorList = jdbcTemplate.queryForList(sql,new Object[]{2});
        List<Map<String,Object>> healthDoctorList = jdbcTemplate.queryForList(sql,new Object[]{3});
        if(healthDoctorList!=null&&healthDoctorList.size()>0){
            Map<String,Object> map = new HashedMap();
            map.put("doctorTotal",healthDoctorList.get(0).get("total"));
            rs.add(map);
            rs.put("doctorTotal",healthDoctorList.get(0).get("total"));
        }else{
            Map<String,Object> map = new HashedMap();
            map.put("doctorTotal",0);
            rs.add(map);
            rs.put("doctorTotal",0);
        }
        return rs;
    }
@ -5971,7 +5959,7 @@ public class StatisticsService extends BaseService {
                sql = "SELECT " +
                        " t.code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " dm_town t " +
                        " LEFT JOIN ( " +
@ -5986,12 +5974,12 @@ public class StatisticsService extends BaseService {
                        " ) s ON s.code = t.code " +
                        " WHERE " +
                        " t.city='350200' " +
                        " ORDER BY num DESC";
                        " ORDER BY val DESC";
            }else if("2".equals(lowlevel)){
                sql = "SELECT " +
                        " t.code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " dm_hospital t " +
                        " LEFT JOIN ( " +
@ -6007,12 +5995,12 @@ public class StatisticsService extends BaseService {
                        " WHERE " +
                        " t.city='350200' " +
                        " AND LENGTH(t.code)=10 " +
                        " ORDER BY num DESC";
                        " ORDER BY val DESC";
            }else if("1".equals(lowlevel)){
                sql = " SELECT " +
                        " t.id code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " wlyy_admin_team t " +
                        " LEFT JOIN ( " +
@ -6025,7 +6013,7 @@ public class StatisticsService extends BaseService {
                sql +=  "  GROUP BY " +
                        "  p.admin_team_id " +
                        " ) s ON s.code = t.id " +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
            }
            //区级维度
        }else if("3".equals(level)){
@ -6033,7 +6021,7 @@ public class StatisticsService extends BaseService {
                sql = "SELECT " +
                        " t.code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " dm_hospital t " +
                        " LEFT JOIN ( " +
@ -6050,12 +6038,12 @@ public class StatisticsService extends BaseService {
                        " t.city='350200' " +
                        " AND LENGTH(t.code)=10 " +
                        " AND t.town ='"+area+"'" +
                        " ORDER BY num DESC";
                        " ORDER BY val DESC";
            }else if("1".equals(lowlevel)){
                sql = " SELECT " +
                        " t.id code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " wlyy_admin_team t " +
                        " LEFT JOIN ( " +
@ -6069,7 +6057,7 @@ public class StatisticsService extends BaseService {
                        "  p.admin_team_id " +
                        " ) s ON s.code = t.id " +
                        " WHERE LEFT(t.org_code,6) ='"+area+"' " +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
            }
            //机构级维度
        }else if("2".equals(level)){
@ -6077,7 +6065,7 @@ public class StatisticsService extends BaseService {
                sql = " SELECT " +
                        " t.id code, " +
                        " t.name, " +
                        " ifnull(s.count,0) num  " +
                        " ifnull(s.count,0) val  " +
                        " FROM " +
                        " wlyy_admin_team t " +
                        " LEFT JOIN ( " +
@ -6091,7 +6079,7 @@ public class StatisticsService extends BaseService {
                        "  p.admin_team_id " +
                        " ) s ON s.code = t.id " +
                        " WHERE t.org_code ='"+area+"'" +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
            }
        }
        rs = jdbcTemplate.queryForList(sql);
@ -6101,11 +6089,11 @@ public class StatisticsService extends BaseService {
        return rs;
    }
    public List<Map<String,Object>> getPrescriptionAgeTotal(String level,String area,String disease){
    public Map<String,Object> getPrescriptionAgeTotal(String level,String area,String disease){
        String sql = "SELECT " +
                " ( " +
                " ( SELECT count(pe.patient) 0age from (" +
                "  SELECT " +
                "   count(1) 0age " +
                "   DISTINCT p.patient " +
                "  FROM " +
                "   wlyy_prescription p " +
                "  JOIN wlyy_patient pt ON pt. CODE = p.patient ";
@ -6115,11 +6103,11 @@ public class StatisticsService extends BaseService {
                "   )>= 0 " +
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 6 " +
                "  ) <= 6 ) pe" +
                " ) 0age, " +
                " ( " +
                " ( SELECT count(pe.patient) 7age from (" +
                "  SELECT " +
                "   count(1) 7age " +
                "   DISTINCT p.patient " +
                "  FROM " +
                "   wlyy_prescription p " +
                "  JOIN wlyy_patient pt ON pt. CODE = p.patient ";
@ -6129,11 +6117,11 @@ public class StatisticsService extends BaseService {
                "   ) >= 7 " +
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 18 " +
                "  ) <= 18 ) pe" +
                " ) 7age, " +
                " ( " +
                " ( SELECT count(pe.patient) 19age from (" +
                "  SELECT " +
                "   count(1) 19age " +
                "   DISTINCT p.patient " +
                "  FROM " +
                "   wlyy_prescription p " +
                "  JOIN wlyy_patient pt ON pt. CODE = p.patient " ;
@ -6143,11 +6131,11 @@ public class StatisticsService extends BaseService {
                "   ) >= 19 " +
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 30 " +
                "  ) <= 30 ) pe" +
                " ) 19age, " +
                " ( " +
                " ( SELECT count(pe.patient) 31age from (" +
                "  SELECT " +
                "   count(1) 31age " +
                "   DISTINCT p.patient " +
                "  FROM " +
                "   wlyy_prescription p " +
                "  JOIN wlyy_patient pt ON pt. CODE = p.patient " ;
@ -6157,11 +6145,11 @@ public class StatisticsService extends BaseService {
                "   ) >= 31 " +
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 50 " +
                "  ) <= 50 ) pe" +
                " ) 31age, " +
                " ( " +
                " ( SELECT count(pe.patient) 51age from (" +
                "  SELECT " +
                "   count(1) 51age " +
                "   DISTINCT p.patient " +
                "  FROM " +
                "   wlyy_prescription p " +
                "  JOIN wlyy_patient pt ON pt. CODE = p.patient ";
@ -6171,27 +6159,27 @@ public class StatisticsService extends BaseService {
                "   ) >= 51 " +
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 64 " +
                "  ) <= 64 ) pe" +
                "  ) 51age, " +
                " ( " +
                " ( SELECT count(pe.patient) 65age from (" +
                "  SELECT " +
                "   count(1) 65age " +
                "   DISTINCT p.patient " +
                "  FROM " +
                "   wlyy_prescription p " +
                "  JOIN wlyy_patient pt ON pt. CODE = p.patient " ;
        sql = setLevelAndDisSql2(sql,disease,level,area);
        sql +=  " AND  YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "    RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "   ) >= 65 " +
                "   ) >= 65 ) pe" +
                "  ) 65age, " +
                "  ( " +
                "  ( SELECT count(pe.patient) total from (" +
                "  SELECT " +
                "   count(1) total " +
                "   DISTINCT p.patient " +
                "  FROM " +
                "   wlyy_prescription p " +
                "  JOIN wlyy_patient pt ON pt. CODE = p.patient " ;
        sql = setLevelAndDisSql2(sql,disease,level,area);
        sql += "  ) total";
        sql += " ) pe ) total";
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
        if(rs!=null&&rs.size()>0){
@ -6210,7 +6198,7 @@ public class StatisticsService extends BaseService {
            rs.get(0).put("51ageRate",getAgeRate(age51,total));
            rs.get(0).put("65ageRate",getAgeRate(age65,total));
        }
        return rs;
        return rs.get(0);
    }
    public String getAgeRate(Long age,Long total){
@ -6233,10 +6221,8 @@ public class StatisticsService extends BaseService {
        return "0";
    }
    public List<Map<String,Object>> getPrescriptionAgeHistogram(String level,String area,String disease,String startDate,String endDate){
    public Map<String,Object> getPrescriptionAgeHistogram(String level,String area,String disease){
        startDate += " 00:00:00";
        endDate += " 23:59:59";
        String sql ="SELECT " +
                " ( " +
                "  SELECT " +
@ -6251,8 +6237,6 @@ public class StatisticsService extends BaseService {
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 6 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"' " +
                " ) 0age,( " +
                " SELECT " +
                " COUNT(c.patient)  " +
@ -6270,8 +6254,7 @@ public class StatisticsService extends BaseService {
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 6 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"') c " +
                " ) c " +
                " ) 0people, " +
                " ( " +
                "  SELECT " +
@ -6286,8 +6269,6 @@ public class StatisticsService extends BaseService {
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 18 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"' " +
                " ) 7age,( " +
                " SELECT " +
                " COUNT(c.patient)  " +
@ -6306,8 +6287,7 @@ public class StatisticsService extends BaseService {
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 18 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"') c " +
                " ) c " +
                " ) 7people, " +
                " ( " +
                "  SELECT " +
@ -6322,8 +6302,6 @@ public class StatisticsService extends BaseService {
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 30 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"' " +
                " ) 19age,( " +
                " SELECT " +
                " COUNT(c.patient)  " +
@ -6341,8 +6319,7 @@ public class StatisticsService extends BaseService {
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 30 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"') c " +
                "  ) c " +
                "  ) 19people, " +
                "  ( " +
                "  SELECT " +
@ -6357,8 +6334,6 @@ public class StatisticsService extends BaseService {
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 50 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"' " +
                " ) 31age,( " +
                " SELECT " +
                " COUNT(c.patient)  " +
@ -6376,8 +6351,7 @@ public class StatisticsService extends BaseService {
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 50 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"') c " +
                "  ) c " +
                "  ) 31people, " +
                "  ( " +
                "  SELECT " +
@ -6392,8 +6366,6 @@ public class StatisticsService extends BaseService {
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 64 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"' " +
                " ) 51age,( " +
                " SELECT " +
                " COUNT(c.patient)  " +
@ -6411,8 +6383,7 @@ public class StatisticsService extends BaseService {
                "  AND YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "   RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "  ) <= 64 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"') c " +
                "  ) c " +
                " ) 51people, " +
                " ( " +
                "  SELECT " +
@ -6424,8 +6395,6 @@ public class StatisticsService extends BaseService {
        sql +=  " AND  YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "    RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "   ) >= 65 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"' " +
                " ) 65age,( " +
                " SELECT " +
                " COUNT(c.patient)  " +
@ -6440,8 +6409,7 @@ public class StatisticsService extends BaseService {
        sql +=  " AND  YEAR (CURDATE()) - YEAR (birthday) - ( " +
                "    RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) " +
                "   ) >= 65 " +
                "  AND p.create_time >='"+startDate+"'  " +
                "  AND p.create_time <='"+endDate+"') c " +
                "  ) c " +
                " ) 65people";
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
@ -6470,7 +6438,7 @@ public class StatisticsService extends BaseService {
            rs.get(0).put("65ageRate",getAgeRateLine(age65,people65));
        }
        return rs;
        return rs.get(0);
    }
    public List<Map<String,Object>> getPrescriptionAgeLowLevel(String level,String lowlevel,String area,String disease) {
@ -6480,7 +6448,7 @@ public class StatisticsService extends BaseService {
                String sql = "SELECT " +
                        " tw.`code`, " +
                        " tw.`name`, " +
                        "  ifnull(c.total,0) num " +
                        "  ifnull(c.total,0) val " +
                        " FROM " +
                        " dm_town tw LEFT JOIN ( " +
                        " SELECT " +
@ -6501,14 +6469,14 @@ public class StatisticsService extends BaseService {
                        " ) c ON c.code = tw.code " +
                        " WHERE " +
                        " tw.city = '350200' " +
                        "   ORDER BY num DESC ";
                        "   ORDER BY val DESC ";
                List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                return rs;
            }else if("2".equals(lowlevel)){
                String sql = "SELECT " +
                        " tw.`code`, " +
                        " tw.`name`, " +
                        "  ifnull(c.total,0) num " +
                        "  ifnull(c.total,0) val " +
                        " FROM " +
                        " dm_hospital tw LEFT JOIN ( " +
                        " SELECT " +
@ -6530,14 +6498,14 @@ public class StatisticsService extends BaseService {
                        " WHERE " +
                        " tw.city = '350200' " +
                        " AND LENGTH(tw.code)=10 " +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
                List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                return rs;
            }else if("1".equals(lowlevel)){
                String sql ="SELECT " +
                        " tw.id code, " +
                        " tw.`name`, " +
                        "  ifnull(c.total,0) num " +
                        "  ifnull(c.total,0) val " +
                        " FROM " +
                        " wlyy_admin_team tw LEFT JOIN ( " +
                        " SELECT " +
@ -6558,7 +6526,7 @@ public class StatisticsService extends BaseService {
                        " ) c ON c.code = tw.id " +
                        " WHERE " +
                        " 1=1  " +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
                List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                statisticsAllService.translateTeamLeaderName2(rs);
                return rs;
@ -6568,7 +6536,7 @@ public class StatisticsService extends BaseService {
                String sql = "SELECT " +
                        " tw.`code`, " +
                        " tw.`name`, " +
                        "  ifnull(c.total,0) num " +
                        "  ifnull(c.total,0) val " +
                        " FROM " +
                        " dm_hospital tw LEFT JOIN ( " +
                        " SELECT " +
@ -6592,14 +6560,14 @@ public class StatisticsService extends BaseService {
                        " tw.city = '350200' " +
                        " AND tw.town ='"+area+"' " +
                        " AND LENGTH(tw.code)=10 " +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
                List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                return rs;
            }else if("1".equals(lowlevel)){
                String sql ="SELECT " +
                        " tw.id code, " +
                        " tw.`name`, " +
                        "  ifnull(c.total,0) num " +
                        "  ifnull(c.total,0) val " +
                        " FROM " +
                        " wlyy_admin_team tw LEFT JOIN ( " +
                        " SELECT " +
@ -6622,7 +6590,7 @@ public class StatisticsService extends BaseService {
                        " WHERE " +
                        " 1=1  " +
                        " AND LEFT(tw.org_code,6) ='"+area+"' " +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
                List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                statisticsAllService.translateTeamLeaderName2(rs);
                return rs;
@ -6632,7 +6600,7 @@ public class StatisticsService extends BaseService {
                String sql ="SELECT " +
                        " tw.id code, " +
                        " tw.`name`, " +
                        "  ifnull(c.total,0) num " +
                        "  ifnull(c.total,0) val " +
                        " FROM " +
                        " wlyy_admin_team tw LEFT JOIN ( " +
                        " SELECT " +
@ -6655,7 +6623,7 @@ public class StatisticsService extends BaseService {
                        " WHERE " +
                        " 1=1  " +
                        " AND tw.org_code ='"+area+"' " +
                        " ORDER BY num DESC ";
                        " ORDER BY val DESC ";
                List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
                statisticsAllService.translateTeamLeaderName2(rs);
                return rs;

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java

@ -904,6 +904,9 @@ public class DateUtil {
		while (dEnd.after(calBegin.getTime())) {
			// 根据日历的规则,为给定的日历字段添加或减去指定的时间量
			calBegin.add(Calendar.DAY_OF_MONTH, 1);
			if(!dEnd.after(calBegin.getTime())){
				break;
			}
			Map<String,Object> stt = new HashedMap();
			stt.put("date",DateUtil.dateToStr(calBegin.getTime(),"yyyy-MM-dd"));
			stt.put("avg",0);
@ -934,6 +937,9 @@ public class DateUtil {
		while (dEnd.after(calBegin.getTime())) {
			// 根据日历的规则,为给定的日历字段添加或减去指定的时间量
			calBegin.add(Calendar.DAY_OF_MONTH, 1);
			if(!dEnd.after(calBegin.getTime())){
				break;
			}
			if(checkDateMonday(calBegin)){
				Map<String,Object> stt = new HashedMap();
				stt.put("date",DateUtil.dateToStr(calBegin.getTime(),"yyyy-MM-dd"));
@ -966,6 +972,9 @@ public class DateUtil {
		while (dEnd.after(calBegin.getTime())) {
			// 根据日历的规则,为给定的日历字段添加或减去指定的时间量
			calBegin.add(Calendar.DAY_OF_MONTH, 1);
			if(!dEnd.after(calBegin.getTime())){
				break;
			}
			if(checkFristDayOfDateMonth(calBegin)){
				Map<String,Object> stt = new HashedMap();
				stt.put("date",DateUtil.dateToStr(calBegin.getTime(),"yyyy-MM"));

+ 72 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionPayController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.patient.prescription;
import com.yihu.wlyy.service.app.prescription.PatientPrescriptionPayService;
import com.yihu.wlyy.service.app.prescription.PrescriptionAdressService;
import com.yihu.wlyy.service.app.prescription.PrescriptionNoticesService;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
@ -34,6 +35,8 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
    private PrescriptionService prescriptionService;
    @Autowired
    private PrescriptionNoticesService noticesService;
    @Autowired
    private PrescriptionAdressService prescriptionAdressService;
    /**
@ -212,5 +215,74 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
            return error(-1, "发送失败!");
        }
    }
//===========================v1.3.9======================================================================
    @RequestMapping(value = "/getAdressList", method = RequestMethod.POST)
    @ApiOperation(value = "获取患者所有默认地址")
    public String getAdressList( @ApiParam(name = "patient", value = "居民code")
                                     @RequestParam(value = "patient", required = true)String patient){
        try {
            prescriptionAdressService.getAdressList(patient);
            return write(200, "发送成功!");
        } catch (Exception e) {
            return error(-1, "发送失败!");
        }
    }
    @RequestMapping(value = "/saveAdress", method = RequestMethod.POST)
    @ApiOperation(value = "保存地址")
    public String saveAdress(@ApiParam(name = "adressJosn", value = "实体json串")
                             @RequestParam(value = "adressJosn", required = true)String adressJosn){
        try {
            return write(200, "获取成功!", "data", prescriptionAdressService.saveAdress(adressJosn));
        } catch (Exception e) {
            return error(-1, "获取失败!");
        }
    }
    @RequestMapping(value = "/delAdress", method = RequestMethod.POST)
    @ApiOperation(value = "删除地址")
    public String delAdress(@ApiParam(name = "id", value = "主键")
                                @RequestParam(value = "id", required = true)Long id){
        try {
            return write(200, "获取成功!", "data", prescriptionAdressService.delAdress(id));
        } catch (Exception e) {
            return error(-1, "获取失败!");
        }
    }
    @RequestMapping(value = "/getProvince", method = RequestMethod.POST)
    @ApiOperation(value = "获取省会")
    public String getProvince(){
        try {
            return write(200, "获取成功!", "data", prescriptionAdressService.getProvince());
        } catch (Exception e) {
            return error(-1, "获取失败!");
        }
    }
    @RequestMapping(value = "/getCityByProvince", method = RequestMethod.POST)
    @ApiOperation(value = "根据省会获取城市")
    public String getCityByProvince(@ApiParam(name = "province", value = "省会code")
                                        @RequestParam(value = "province", required = true)String province){
        try {
            return write(200, "获取成功!", "data", prescriptionAdressService.getCityByProvince(province));
        } catch (Exception e) {
            return error(-1, "获取失败!");
        }
    }
    @RequestMapping(value = "/getTowmByCity", method = RequestMethod.POST)
    @ApiOperation(value = "根据城市获取区")
    public String getTowmByCity(@ApiParam(name = "city", value = "城市code")
                                    @RequestParam(value = "city", required = true)String city){
        try {
            return write(200, "获取成功!", "data", prescriptionAdressService.getTowmByCity(city));
        } catch (Exception e) {
            return error(-1, "获取失败!");
        }
    }
}

+ 2 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -1825,11 +1825,9 @@ public class StatisticsController extends BaseController {
    @ApiOperation("年龄统计-中部部条形图")
    public String getPrescriptionAgeHistogram(@ApiParam(name="level", value="级别") @RequestParam(required = true)String level,
                                              @ApiParam(name="area", value="级别编码") @RequestParam(required = true)String area,
                                              @ApiParam(name="disease", value="疾病") @RequestParam(required = false)String disease,
                                              @ApiParam(name="startDate", value="开始时间") @RequestParam(required = true)String startDate,
                                              @ApiParam(name="endDate", value="结束时间") @RequestParam(required = true)String endDate){
                                              @ApiParam(name="disease", value="疾病") @RequestParam(required = false)String disease){
        try{
            return write(200, "查询成功", "data", statisticsService.getPrescriptionAgeHistogram(level,area,disease,startDate,endDate));
            return write(200, "查询成功", "data", statisticsService.getPrescriptionAgeHistogram(level,area,disease));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");