Kaynağa Gözat

代码修改

bing 2 yıl önce
ebeveyn
işleme
d8a4cf5be1

+ 18 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/team/service/WlyyAdminTeamService.java

@ -16,6 +16,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.Comparator;
@ -37,20 +39,31 @@ public class WlyyAdminTeamService {
    private HibenateUtils hibenateUtils;
    @Autowired
    private BaseTownDao baseTownDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    //查询机构
    public MixEnvelop findHospitalByTown(String townCode,String name,Integer page,Integer pageSize){
        PageRequest pageRequest = new PageRequest(page-1,pageSize);
        MixEnvelop mixEnvelop = new MixEnvelop();
        List<DmHospitalDO> list =null;
        if (StringUtils.isNoneBlank(name)){
            list=hospitalDao.findByTownCodeAndName(townCode,name,pageRequest);
        }else {
            list = hospitalDao.findByTownCode(townCode,pageRequest);
        String sql = " select t.* from dm_hospital t inner join t_mediicine_device de on t.code = de.belong_community where t.del='1' and de.del=1  ";
        String sqlCount =  " select count(distinct t.id) from dm_hospital t inner join t_mediicine_device de on t.code = de.belong_community where t.del='1' and de.del=1 ";
        String sqlWhere =  "  ";
        if (StringUtils.isNotBlank(townCode)){
            sqlWhere += " and t.town='"+townCode+"' ";
        }
        if (StringUtils.isNotBlank(name)){
            sqlWhere += " and t.name like '%"+name+"%' ";
        }
        sql +=sqlWhere +" group by t.code order by t.code asc limit "+(page-1)*pageSize+","+pageSize;
        list = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(DmHospitalDO.class));
        Integer count = jdbcTemplate.queryForObject(sqlCount+sqlWhere,Integer.class);
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setTotalCount(list==null?0:list.size());
        mixEnvelop.setTotalCount(count);
        return mixEnvelop;
    }
    //查询团队

+ 10 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineDeviceEndpoint.java

@ -965,13 +965,17 @@ public class MedicineDeviceEndpoint extends EnvelopRestEndpoint {
    public Envelop getShippingTypeByUserId(
            @ApiParam(name = "day", value = "天数", required = false)
            @RequestParam(value = "day", required = false) Integer day,
            @ApiParam(name = "startTime", value = "开始时间", required = false)
            @RequestParam(value = "startTime", required = false) String startTime,
            @ApiParam(name = "endTime", value = "结束时间", required = false)
            @RequestParam(value = "endTime", required = false) String endTime,
            @ApiParam(name = "userId", value = "1、市级、2、区级、3、社区", required = true)
            @RequestParam(value = "userId") String userId,
            @ApiParam(name = "level", value = "1、市级、2、区级、3、社区", required = false)
            @RequestParam(value = "level",required = false) Integer level,
            @ApiParam(name = "area", value = "1、市级、2、区级、3、社区", required = false)
            @RequestParam(value = "area",required = false) String area) throws Exception {
        return success(deviceService.getShippingTypeByUserId(userId, day,level,area));
        return success(deviceService.getShippingTypeByUserId(userId, day,startTime,endTime,level,area));
    }
    @GetMapping(value = BaseRequestMapping.BaseDevice.getPrescriptionStaticsByUserId)
@ -979,13 +983,17 @@ public class MedicineDeviceEndpoint extends EnvelopRestEndpoint {
    public Envelop getPrescriptionStaticsByUserId(
            @ApiParam(name = "day", value = "天数", required = false)
            @RequestParam(value = "day", required = false) Integer day,
            @ApiParam(name = "startTime", value = "开始时间", required = false)
            @RequestParam(value = "startTime", required = false) String startTime,
            @ApiParam(name = "endTime", value = "结束时间", required = false)
            @RequestParam(value = "endTime", required = false) String endTime,
            @ApiParam(name = "userId", value = "1、市级、2、区级、3、社区", required = true)
            @RequestParam(value = "userId") String userId,
            @ApiParam(name = "level", value = "1、市级、2、区级、3、社区", required = false)
            @RequestParam(value = "level",required = false) Integer level,
            @ApiParam(name = "area", value = "1、市级、2、区级、3、社区", required = false)
            @RequestParam(value = "area",required = false) String area) throws Exception {
        return success(deviceService.getPrescriptionStaticsByUserId(userId, day,level,area));
        return success(deviceService.getPrescriptionStaticsByUserId(userId, day,startTime,endTime,level,area));
    }
    @GetMapping("/open/setDeviceAttribute")

+ 22 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicinedeviceService.java

@ -6313,11 +6313,11 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
        jsonObject.put("maintain", maintain);
        jsonObject.put("prescriptionStatics", getPrescriptionStaticsByUserId(userId, 1,level,area));
        jsonObject.put("prescriptionStatics", getPrescriptionStaticsByUserId(userId, 1,null,null,level,area));
        //非设备管理员
        if (!"replenisher".equals(role.getCode())) {
            jsonObject.put("devicePriceStatistics", getDevicePriceStatisticsByUserId(userId, 1,level,area));
            jsonObject.put("shippingType", getShippingTypeByUserId(userId, 1,level,area));
            jsonObject.put("shippingType", getShippingTypeByUserId(userId, 1,null,null,level,area));
        }
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg", jsonObject);
@ -6481,7 +6481,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
     * @param userId
     * @return
     */
    public JSONObject getShippingTypeByUserId(String userId,Integer day,Integer level,String area){
    public JSONObject getShippingTypeByUserId(String userId,Integer day,String startTime,String endTime,Integer level,String area){
        JSONObject object = new JSONObject();
        String condition = "";
        String areaCondition = "";
@ -6571,9 +6571,17 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
            } else {
                startDate = DateUtil.getPreDays(new Date(), -day);
            }
            String endTime = DateUtil.getStringDate();
            endTime = DateUtil.getStringDate();
            timeCondition = " and o.shipping_time >='" + DateUtil.dateToStrLong(startDate) + "' and o.shipping_time <= '" + endTime + "'  ";
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(startTime)){
            timeCondition = " and o.create_time >='" + startTime + "' ";
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(endTime)){
            timeCondition += " and o.create_time <= '" + endTime + "'  ";
        }
        String sql = "SELECT count(1) as \"count\" FROM t_mediicine_order o WHERE o.sell_state=1 "+condition+ timeCondition+ areaCondition;
        Map<String,Object> totalMap = jdbcTemplate.queryForMap(sql);
        int total =0;
@ -6616,7 +6624,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
     * @param day
     * @return
     */
    public JSONObject getPrescriptionStaticsByUserId(String userId,Integer day,Integer level,String area){
    public JSONObject getPrescriptionStaticsByUserId(String userId,Integer day,String startTime,String endTime,Integer level,String area){
        JSONObject object = new JSONObject();
        String condition = "";
        UserDO user = userDao.findOne(userId);
@ -6706,9 +6714,17 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
            } else {
                startDate = DateUtil.getPreDays(new Date(), -day);
            }
            String endTime = DateUtil.getStringDate();
            endTime = DateUtil.getStringDate();
            timeCondition = " and o.create_time >='" + DateUtil.dateToStrLong(startDate) + "' and o.create_time <= '" + endTime + "'  ";
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(startTime)){
            timeCondition = " and o.create_time >='" + startTime + "' ";
        }
        if (org.apache.commons.lang3.StringUtils.isNotBlank(endTime)){
            timeCondition += " and o.create_time <= '" + endTime + "'  ";
        }
        String sql = "SELECT count(1) as \"count\" FROM t_mediicine_order o WHERE 1=1 "+condition+ timeCondition+areaCondition;
        Map<String,Object> totalMap = jdbcTemplate.queryForMap(sql);
        int total =0;