Browse Source

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

LAPTOP-KB9HII50\70708 2 months ago
parent
commit
3ad5f97497

+ 34 - 11
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/a4endpoint/MedicineOrderEndpoint.java

@ -124,9 +124,9 @@ public class MedicineOrderEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "userId", value = "用户id")
            @RequestParam(value = "userId", required = true) String userId,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @RequestParam(value = "page") Integer page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size,
            @RequestParam(value = "size") Integer size,
            @ApiParam(name = "timeSort", value = "时间排序,1升序,-1倒序", required = false)
            @RequestParam(value = "timeSort",required = false) String timeSort) throws Exception {
        JSONObject result = orderservice.queryOrderListFullInfo(content,orderNum, equNum, contact, startTime, endTime, sellState, orderState,reviewerState, dispensingWindow, community, town,userId,page,size,wechatId,timeSort);
@ -275,15 +275,38 @@ public class MedicineOrderEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "处方订单列表导出" , notes="处方订单列表导出")
    @ResponseBody
    public void export(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "content", value = "搜索内容(处方号,联系方式,出货设备,社区名,姓名,取药码")
            @RequestParam(value = "content", required = false) String content,
            @ApiParam(name = "orderNum", value = "订单号")
            @RequestParam(value = "orderNum", required = false) String orderNum,
            @ApiParam(name = "equNum", value = "设备号")
            @RequestParam(value = "equNum", required = false) String equNum,
            @ApiParam(name = "contact", value = "手机号")
            @RequestParam(value = "contact", required = false) String contact,
            @ApiParam(name = "startTime", value = "开始时间", required = false, defaultValue = "")
            @RequestParam(value = "startTime",required = false) String startTime,
            @ApiParam(name = "endTime", value = "结束时间", required = false, defaultValue = "")
            @RequestParam(value = "endTime",required = false) String endTime,
            @ApiParam(name = "sellState", value = "出货状态")
            @RequestParam(value = "sellState", required = false) String sellState,
            @ApiParam(name = "orderState", value = "订单状态")
            @RequestParam(value = "orderState", required = false) String orderState,
            @ApiParam(name = "reviewerState", value = "审方状态-1不通过0未审1审核通过")
            @RequestParam(value = "reviewerState", required = false) String reviewerState,
            @ApiParam(name = "dispensingWindow", value = "取药区域")
            @RequestParam(value = "dispensingWindow", required = false) String dispensingWindow,
            @ApiParam(name = "community", value = "所属社区")
            @RequestParam(value = "community", required = false) String community,
            @ApiParam(name = "town", value = "所属区")
            @RequestParam(value = "town", required = false) String town,
            @ApiParam(name = "userId", value = "用户id")
            @RequestParam(value = "userId", required = true) String userId,
            @ApiParam(name = "timeSort", value = "时间排序,1升序,-1倒序", required = false)
            @RequestParam(value = "timeSort",required = false) String timeSort,
            HttpServletResponse response) {
        try {
            List<Mediicineorder> result = orderservice.search(fields, filters, sorts);
            JSONObject jsonObject = orderservice.queryOrderListFullInfo(content,orderNum, equNum, contact, startTime, endTime, sellState, orderState,reviewerState, dispensingWindow, community, town,userId,null,null,wechatId,timeSort);
            List<Mediicineorder> result = jsonObject.getJSONArray("msg").toJavaList(Mediicineorder.class);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename=" + new String("medicineOrder.xls"));
            OutputStream os = response.getOutputStream();
@ -341,8 +364,8 @@ public class MedicineOrderEndpoint extends EnvelopRestEndpoint {
                addCell(sheet, j, 7, DateUtil.dateToStrLong(tmp.getPrescribeTime()));
                addCell(sheet, j, 8, DateUtil.dateToStrLong(tmp.getPayTime()));
                addCell(sheet, j, 9, tmp.getOrderType());
                addCell(sheet, j, 9, tmp.getOrderSource());
                addCell(sheet, j, 10, tmp.getInfoAccess());
                addCell(sheet, j, 10, tmp.getOrderSource());
                addCell(sheet, j, 11, tmp.getInfoAccess());
                j++;
                ii++;
            }

+ 10 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/adv/AdvertisementPuttingAdminEndPoint.java

@ -116,15 +116,22 @@ public class AdvertisementPuttingAdminEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "title", value = "标题")
            @RequestParam(value = "title", required = false) String title,
            @ApiParam(name = "publishLocation", value = "发布位置(0广告位、1banner位、2动态列表)")
            @RequestParam(value = "publishLocation", required = false) Integer publishLocation,
            @ApiParam(name = "categoryCode", value = "广告类型 1视频 2图片")
            @RequestParam(value = "categoryCode", required = false) Integer categoryCode,
            @ApiParam(name = "launchDevice", value = "投放设备(0部分设备,1所有设备)")
            @RequestParam(value = "launchDevice", required = false) Integer launchDevice,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<AdvertisementPuttingAdminDO> list = advrtisementService.search(fields, filters, sorts, page, size);
        int count = (int)advrtisementService.getCount(filters);
        return success(list, count, page, size, AdvertisementPuttingAdminDO.class);
        PageEnvelop list = advrtisementService.list(title, publishLocation, categoryCode, launchDevice, sorts, page, size);
        return list;
    }

+ 7 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineOrderService.java

@ -212,7 +212,7 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
    public JSONObject queryOrderListFullInfo(String content, String orderNum, String equNum, String contact,
                                             String startTime, String endTime, String sellState,
                                             String orderState, String reviewerState, String dispensingWindow, String community, String town,
                                             String userId, int page, int size, String wechatId, String timeSort) throws Exception {
                                             String userId, Integer page, Integer size, String wechatId, String timeSort) throws Exception {
        JSONObject result = new JSONObject();
@ -383,7 +383,12 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
            sencodSql = sencodSql + conditionSql + " order by  t.sell_state asc,t.prescribe_time desc ";
        }
        orderList = hibenateUtils.createSQLQuery(sencodSql, page, size);
        if (page == null) {
            orderList = hibenateUtils.createSQLQuery(sencodSql);
        }else {
            orderList = hibenateUtils.createSQLQuery(sencodSql, page, size);
        }
        String countSql = " select " +
                "     COUNT(DISTINCT (t.id)) as count " +

+ 46 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/advrtisement/AdvrtisementService.java

@ -15,7 +15,9 @@ import com.yihu.jw.entity.adv.AdvertisementPuttingAdminDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.utils.EntityUtils;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.lang.StringUtils;
@ -237,6 +239,50 @@ public class AdvrtisementService extends BaseJpaService<AdvertisementPuttingAdmi
        return "已取消投放";
    }
    public PageEnvelop list(String title, Integer publishLocation, Integer categoryCode, Integer launchDevice, String sorts, int page, int size) {
        String countSql = "select count(a.id)";
        String sql = "SELECT " +
                "a.id, " +
                "a.title, " +
                "a.publish_location, " +
                "a.category_code, " +
                "a.launch_device, " +
                "a.category_name, " +
                "a.url, " +
                "a.del, " +
                "a.launch, " +
                "a.forbidden, " +
                "a.content, " +
                "a.link_url, " +
                "a.sort, " +
                "a.create_time, " +
                "a.create_user, " +
                "a.create_user_name, " +
                "a.update_time, " +
                "a.update_user, " +
                "a.update_user_name, " +
                "a.play_id ";
        String from  = "FROM " +
                "advertisement_putting_admin AS a " +
                "WHERE 1=1 ";
        if (!StringUtils.isEmpty(title)){
            from += " and a.title LIKE '%" + title + "%'";
        }
        if (publishLocation!=null){
            from+=" and a.publish_location = " + publishLocation;
        }
        if (categoryCode!=null){
            from+=" and a.category_code = "+categoryCode;
        }
        if (launchDevice!=null){
            from+=" and a.launch_device = " + launchDevice;
        }
        String orderBy = " ORDER BY a.sort,a.create_time limit "+(page-1)*size+","+size;
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql+from+orderBy);
        Long count = jdbcTemplate.queryForObject(countSql+from,Long.class);
        return PageEnvelop.getSuccessListWithPage("查询成功",list,page,size,count);
    }
//    public AdvertisementPuttingAdminDO saveUpdate(String id,AdvertisementPuttingAdminDO puttingAdminDO) {
//        AdvertisementPuttingAdminDO adminDO=advertisementExist(id);