diff --git a/src/main/java/com/glxp/api/controller/stat/IoStatOrderEntityController.java b/src/main/java/com/glxp/api/controller/stat/IoStatOrderEntityController.java index 9b4be5b..b9a983a 100644 --- a/src/main/java/com/glxp/api/controller/stat/IoStatOrderEntityController.java +++ b/src/main/java/com/glxp/api/controller/stat/IoStatOrderEntityController.java @@ -52,7 +52,7 @@ public class IoStatOrderEntityController extends BaseController { } int offset = (request.getPage() - 1) * request.getLimit(); Page pages = PageHelper.offsetPage(offset, request.getLimit()); - List list = ioStatOrderService.list(getQueryWrapper(request)); + List list = ioStatOrderService.filterList(getQueryWrapper(request)); PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pages.getTotal()); pageSimpleResponse.setList(list); @@ -121,9 +121,16 @@ public class IoStatOrderEntityController extends BaseController { } public static QueryWrapper getQueryWrapper(IoStatOrderEntityRequest request) { - IoStatOrderEntity entity = new IoStatOrderEntity(); - BeanCopyUtils.copy(request, entity); - QueryWrapper queryWrapper = new QueryWrapper(entity); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.like(StringUtils.isNotEmpty(request.getTitle()),"title",request.getTitle()); + queryWrapper.eq(request.getCompanyIdFk() != null,"companyIdFk",request.getCompanyIdFk()); + queryWrapper.eq(StringUtils.isNotEmpty(request.getCompanyType()),"uc.bussinessStatus",request.getCompanyType()); + if(StringUtils.isNotBlank(request.getEndTime())){ + queryWrapper.le("o.updateTime",request.getEndTime()); + } + if(StringUtils.isNotBlank(request.getStartTime())){ + queryWrapper.ge("o.updateTime",request.getStartTime()); + } return queryWrapper; } diff --git a/src/main/java/com/glxp/api/controller/stat/IoStatSetController.java b/src/main/java/com/glxp/api/controller/stat/IoStatSetController.java index ebfd9ad..02385f4 100644 --- a/src/main/java/com/glxp/api/controller/stat/IoStatSetController.java +++ b/src/main/java/com/glxp/api/controller/stat/IoStatSetController.java @@ -1,6 +1,7 @@ package com.glxp.api.controller.stat; +import cn.hutool.core.collection.CollectionUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; @@ -13,12 +14,14 @@ import com.glxp.api.constant.BusinessType; import com.glxp.api.controller.BaseController; import com.glxp.api.dto.DictDto; import com.glxp.api.entity.stat.AnncmntManuEntity; +import com.glxp.api.entity.stat.IoStatSetDetailEntity; import com.glxp.api.entity.stat.IoStatSetEntity; import com.glxp.api.req.anno.AnncmntManuEntityRequest; import com.glxp.api.req.stat.IoStatSetEntityRequest; import com.glxp.api.req.system.DeleteRequest; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.service.stat.AnncmntManuService; +import com.glxp.api.service.stat.IoStatSetDetailService; import com.glxp.api.service.stat.IoStatSetService; import com.glxp.api.util.BeanCopyUtils; import com.glxp.api.util.GennerOrderUtils; @@ -51,6 +54,9 @@ public class IoStatSetController extends BaseController { @Resource GennerOrderUtils gennerOrderUtils; + @Resource + IoStatSetDetailService ioStatSetDetailService; + @GetMapping("/list") public BaseResponse list(IoStatSetEntityRequest request, BindingResult bindingResult) { @@ -129,10 +135,30 @@ public class IoStatSetController extends BaseController { return ResultVOUtils.success(); } - public static QueryWrapper getQueryWrapper(IoStatSetEntityRequest request) { - IoStatSetEntity entity = new IoStatSetEntity(); - BeanCopyUtils.copy(request, entity); - QueryWrapper queryWrapper = new QueryWrapper(entity); + public QueryWrapper getQueryWrapper(IoStatSetEntityRequest request) { + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.like(StringUtils.isNotEmpty(request.getTitle()),"title",request.getTitle()); + if(StringUtils.isNotBlank(request.getEndTime())){ + queryWrapper.le("createTime",request.getEndTime()); + } + if(StringUtils.isNotBlank(request.getStartTime())){ + queryWrapper.ge("createTime",request.getStartTime()); + } + if(StringUtils.isNotEmpty(request.getCpmctymc()) || StringUtils.isNotEmpty(request.getGgxh()) || + StringUtils.isNotEmpty(request.getZczbhhzbapzbh()) || StringUtils.isNotEmpty(request.getCompanyName())){ + QueryWrapper detailQ = new QueryWrapper(); + detailQ.eq(StringUtils.isNotEmpty(request.getCpmctymc()),"cpmctymc",request.getCpmctymc()); + detailQ.eq(StringUtils.isNotEmpty(request.getGgxh()),"ggxh",request.getGgxh()); + detailQ.eq(StringUtils.isNotEmpty(request.getZczbhhzbapzbh()),"zczbhhzbapzbh",request.getZczbhhzbapzbh()); + detailQ.eq(StringUtils.isNotEmpty(request.getCompanyName()),"companyName",request.getCompanyName()); + List list = ioStatSetDetailService.list(detailQ); + List idList = list.stream().map(s->s.getSetFk()).collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(list)){ + queryWrapper.in("id",idList); + }else{ + queryWrapper.eq("id","-1"); + } + } return queryWrapper; } diff --git a/src/main/java/com/glxp/api/dao/stat/IoStatOrderMapper.java b/src/main/java/com/glxp/api/dao/stat/IoStatOrderMapper.java index 8088dc5..a393a59 100644 --- a/src/main/java/com/glxp/api/dao/stat/IoStatOrderMapper.java +++ b/src/main/java/com/glxp/api/dao/stat/IoStatOrderMapper.java @@ -1,9 +1,22 @@ package com.glxp.api.dao.stat; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; import com.glxp.api.entity.stat.IoStatOrderEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; @Mapper public interface IoStatOrderMapper extends BaseMapper { + + /** + * + * @param queryWrapper + * @return + */ + List filterList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); } diff --git a/src/main/java/com/glxp/api/entity/stat/IoStatOrderEntity.java b/src/main/java/com/glxp/api/entity/stat/IoStatOrderEntity.java index 296ba91..a31dbe9 100644 --- a/src/main/java/com/glxp/api/entity/stat/IoStatOrderEntity.java +++ b/src/main/java/com/glxp/api/entity/stat/IoStatOrderEntity.java @@ -86,5 +86,17 @@ public class IoStatOrderEntity implements Serializable { @TableField(value = "statType") private Integer statType; + + @TableField(value = "companyIdFk") + private Long companyIdFk; + + + @TableField(exist = false) + private String companyName; + + + @TableField(exist = false) + private String companyType; + private static final long serialVersionUID = 1L; } diff --git a/src/main/java/com/glxp/api/req/stat/IoStatOrderEntityRequest.java b/src/main/java/com/glxp/api/req/stat/IoStatOrderEntityRequest.java index 9bca121..bdefe8d 100644 --- a/src/main/java/com/glxp/api/req/stat/IoStatOrderEntityRequest.java +++ b/src/main/java/com/glxp/api/req/stat/IoStatOrderEntityRequest.java @@ -45,16 +45,15 @@ public class IoStatOrderEntityRequest extends ListPageRequest { private String invCode; private String deptCode; - /** - * 汇总开始时间 + * 开始时间 */ - private Date startDate; + private String startTime; /** - * 汇总结束时间 + * 结束时间 */ - private Date endDate; + private String endTime; /** * 汇总状态:1:已完成;2.生成中;3:生成失败 @@ -62,4 +61,9 @@ public class IoStatOrderEntityRequest extends ListPageRequest { private Integer status; private Integer statType; + + + private Long companyIdFk; + + private String companyType; } diff --git a/src/main/java/com/glxp/api/req/stat/IoStatSetDetailEntityRequest.java b/src/main/java/com/glxp/api/req/stat/IoStatSetDetailEntityRequest.java index 4f47b8e..d50f18a 100644 --- a/src/main/java/com/glxp/api/req/stat/IoStatSetDetailEntityRequest.java +++ b/src/main/java/com/glxp/api/req/stat/IoStatSetDetailEntityRequest.java @@ -12,6 +12,11 @@ import java.util.Date; public class IoStatSetDetailEntityRequest extends ListPageRequest { private Integer id; + /** + * 设置关联ID + */ + private Integer setFk; + /** * 品种名称 */ diff --git a/src/main/java/com/glxp/api/req/stat/IoStatSetEntityRequest.java b/src/main/java/com/glxp/api/req/stat/IoStatSetEntityRequest.java index 4a181e7..c3b8f32 100644 --- a/src/main/java/com/glxp/api/req/stat/IoStatSetEntityRequest.java +++ b/src/main/java/com/glxp/api/req/stat/IoStatSetEntityRequest.java @@ -64,4 +64,45 @@ public class IoStatSetEntityRequest extends ListPageRequest { * 备注 */ private String remark; + + /** + * 开始时间 + */ + private String startTime; + + /** + * 结束时间 + */ + private String endTime; + + + /** + * 品种名称 + */ + private String cpmctymc; + + /** + * 规格型号 + */ + private String ggxh; + + /** + * 注册/备案号 + */ + private String zczbhhzbapzbh; + + /** + * 医疗器械注册人 + */ + private String ylqxzcrbarmc; + + /** + * 企业类型 + */ + private Byte bussinessType; + + /** + * 注册企业名称 + */ + private String companyName; } diff --git a/src/main/java/com/glxp/api/service/stat/IoStatOrderService.java b/src/main/java/com/glxp/api/service/stat/IoStatOrderService.java index c62ebfc..83cbd81 100644 --- a/src/main/java/com/glxp/api/service/stat/IoStatOrderService.java +++ b/src/main/java/com/glxp/api/service/stat/IoStatOrderService.java @@ -1,10 +1,20 @@ package com.glxp.api.service.stat; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.glxp.api.entity.stat.IoStatOrderEntity; import com.glxp.api.dao.stat.IoStatOrderMapper; + +import java.util.List; + @Service public class IoStatOrderService extends ServiceImpl { + + public List filterList(QueryWrapper queryWrapper){ + return this.baseMapper.filterList(queryWrapper); + } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 505ae3b..f81f703 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -36,8 +36,8 @@ spring: rabbitmq: host: 127.0.0.1 port: 5672 - username: guest - password: guest + username: cpt + password: 123456 virtual-host: / publisher-confirms: false connection-timeout: 15000 diff --git a/src/main/resources/mybatis/mapper/stat/IoStatOrderMapper.xml b/src/main/resources/mybatis/mapper/stat/IoStatOrderMapper.xml index ec0a036..4453fe3 100644 --- a/src/main/resources/mybatis/mapper/stat/IoStatOrderMapper.xml +++ b/src/main/resources/mybatis/mapper/stat/IoStatOrderMapper.xml @@ -23,4 +23,13 @@ id, recordKey, `date`, `type`, updateTime, title, remark, invCode, deptCode, startDate, endDate, `status`, statType + +