Browse Source

首页信息增加单社区查询

wangzhinan 3 years ago
parent
commit
390cd3ec6e

+ 13 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineDeviceEndpoint.java

@ -898,9 +898,11 @@ public class MedicineDeviceEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseRequestMapping.BaseDevice.getFirstPageInfo)
    @ApiOperation(value = "获取移动端首页信息", notes = "获取移动端首页信息")
    public Envelop getFirstPageInfo(@ApiParam(name = "userId", value = "用户id", required = true)
    public Envelop getFirstPageInfo(@ApiParam(name = "belongCommunity", value = "单个社区")
                                        @RequestParam(value = "belongCommunity", required = false) String belongCommunity,
            @ApiParam(name = "userId", value = "用户id", required = true)
                                   @RequestParam(value = "userId") String userId) throws Exception {
        JSONObject jsonObject = deviceService.getFirstPageInfo(userId);
        JSONObject jsonObject = deviceService.getFirstPageInfo(belongCommunity, userId);
        if (jsonObject.getString("response").equalsIgnoreCase(ConstantUtils.FAIL)) {
            return failed(jsonObject.getString("msg"));
        }
@ -910,32 +912,37 @@ public class MedicineDeviceEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseRequestMapping.BaseDevice.getDevicePriceStatisticsByUserId)
    @ApiOperation(value = "总览-销量", notes = "总览-销量")
    public Envelop getDevicePriceStatisticsByUserId(
    public Envelop getDevicePriceStatisticsByUserId(@ApiParam(name = "belongCommunity", value = "单个社区")
                                                        @RequestParam(value = "belongCommunity", required = false) String belongCommunity,
            @ApiParam(name = "day", value = "天数", required = false)
            @RequestParam(value = "day", required = false) Integer day,
            @ApiParam(name = "userId", value = "1、市级、2、区级、3、社区", required = true)
            @RequestParam(value = "userId") String userId) throws Exception {
        return success(deviceService.getDevicePriceStatisticsByUserId(userId, day));
        return success(deviceService.getDevicePriceStatisticsByUserId(belongCommunity,userId, day));
    }
    @GetMapping(value = BaseRequestMapping.BaseDevice.getShippingTypeByUserId)
    @ApiOperation(value = "总览-取药情况统计", notes = "总览-取药情况统计")
    public Envelop getShippingTypeByUserId(
            @ApiParam(name = "belongCommunity", value = "单个社区")
            @RequestParam(value = "belongCommunity", required = false) String belongCommunity,
            @ApiParam(name = "day", value = "天数", required = false)
            @RequestParam(value = "day", required = false) Integer day,
            @ApiParam(name = "userId", value = "1、市级、2、区级、3、社区", required = true)
            @RequestParam(value = "userId") String userId) throws Exception {
        return success(deviceService.getShippingTypeByUserId(userId, day));
        return success(deviceService.getShippingTypeByUserId(belongCommunity, userId, day));
    }
    @GetMapping(value = BaseRequestMapping.BaseDevice.getPrescriptionStaticsByUserId)
    @ApiOperation(value = "总览-处方订单情况统计", notes = "总览-处方订单情况统计")
    public Envelop getPrescriptionStaticsByUserId(
            @ApiParam(name = "belongCommunity", value = "单个社区")
            @RequestParam(value = "belongCommunity", required = false) String belongCommunity,
            @ApiParam(name = "day", value = "天数", required = false)
            @RequestParam(value = "day", required = false) Integer day,
            @ApiParam(name = "userId", value = "1、市级、2、区级、3、社区", required = true)
            @RequestParam(value = "userId") String userId) throws Exception {
        return success(deviceService.getPrescriptionStaticsByUserId(userId, day));
        return success(deviceService.getPrescriptionStaticsByUserId(belongCommunity, userId, day));
    }
}

+ 20 - 7
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicinedeviceService.java

@ -5262,7 +5262,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
     * @return
     * @throws Exception
     */
    public JSONObject getFirstPageInfo(String userId) throws Exception {
    public JSONObject getFirstPageInfo(String belongCommunity, String userId) throws Exception {
        JSONObject result = new JSONObject();
        JSONObject jsonObject = new JSONObject();
        String condition = "";
@ -5329,6 +5329,10 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                    }
                }
            }
            //选择单个社区
            if (belongCommunity != null && !StringUtils.isEmpty(belongCommunity)) {
                belongCommunitys = belongCommunity;
            }
            if (!StringUtils.isEmpty(belongCommunitys)) {
                conditionSql += "AND ',"+ belongCommunitys +",' LIKE CONCAT('%,',d.belong_community,',%')\n";
                orderConditionSql += "AND ',"+ belongCommunitys +",' LIKE CONCAT('%,',d.belong_community,',%')\n";
@ -5410,11 +5414,11 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
        jsonObject.put("maintain", maintain);
        jsonObject.put("prescriptionStatics", getPrescriptionStaticsByUserId(userId, 1));
        jsonObject.put("prescriptionStatics", getPrescriptionStaticsByUserId(belongCommunity, userId, 1));
        //非设备管理员
        if (!"replenisher".equals(role.getCode())) {
            jsonObject.put("devicePriceStatistics", getDevicePriceStatisticsByUserId(userId, 1));
            jsonObject.put("shippingType", getShippingTypeByUserId(userId, 1));
            jsonObject.put("devicePriceStatistics", getDevicePriceStatisticsByUserId(belongCommunity, userId, 1));
            jsonObject.put("shippingType", getShippingTypeByUserId(belongCommunity, userId, 1));
        }
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg", jsonObject);
@ -5428,7 +5432,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
     * @param userId
     * @return
     */
    public JSONObject getDevicePriceStatisticsByUserId(String userId,Integer day){
    public JSONObject getDevicePriceStatisticsByUserId(String belongCommunity, String userId,Integer day){
        JSONObject object = new JSONObject();
        String condition = "";
@ -5486,6 +5490,9 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                    }
                }
            }
            if (belongCommunity != null && !StringUtils.isEmpty(belongCommunity)) {
                belongCommunitys = belongCommunity;
            }
            if (!StringUtils.isEmpty(belongCommunitys)) {
                condition += "AND ',"+ belongCommunitys +",' LIKE CONCAT('%,',o.belong_community,',%')\n";
            }
@ -5561,7 +5568,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
     * @param userId
     * @return
     */
    public JSONObject getShippingTypeByUserId(String userId,Integer day){
    public JSONObject getShippingTypeByUserId(String belongCommunity, String userId,Integer day){
        JSONObject object = new JSONObject();
        String condition = "";
@ -5619,6 +5626,9 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                    }
                }
            }
            if (belongCommunity != null && !StringUtils.isEmpty(belongCommunity)) {
                belongCommunitys = belongCommunity;
            }
            if (!StringUtils.isEmpty(belongCommunitys)) {
                condition += "AND ',"+ belongCommunitys +",' LIKE CONCAT('%,',o.belong_community,',%')\n";
            }
@ -5678,7 +5688,7 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
     * @param day
     * @return
     */
    public JSONObject getPrescriptionStaticsByUserId(String userId,Integer day){
    public JSONObject getPrescriptionStaticsByUserId(String belongCommunity, String userId,Integer day){
        JSONObject object = new JSONObject();
        String condition = "";
        UserDO user = userDao.findOne(userId);
@ -5737,6 +5747,9 @@ public class MedicinedeviceService  extends BaseJpaService<Mediicinedevice, Medi
                    }
                }
            }
            if (belongCommunity != null && !StringUtils.isEmpty(belongCommunity)) {
                belongCommunitys = belongCommunity;
            }
            if (!StringUtils.isEmpty(belongCommunitys)) {
                condition += "AND ',"+ belongCommunitys +",' LIKE CONCAT('%,',o.belong_community,',%')\n";
            }