汇总上报功能提交

20240109-yw
yuanwei 1 year ago
parent 58a9080bcf
commit 7fdc875bf6

@ -52,7 +52,7 @@ public class IoStatOrderEntityController extends BaseController {
}
int offset = (request.getPage() - 1) * request.getLimit();
Page<IoStatOrderEntity> pages = PageHelper.offsetPage(offset, request.getLimit());
List<IoStatOrderEntity> list = ioStatOrderService.list(getQueryWrapper(request));
List<IoStatOrderEntity> list = ioStatOrderService.filterList(getQueryWrapper(request));
PageSimpleResponse<IoStatOrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pages.getTotal());
pageSimpleResponse.setList(list);
@ -121,9 +121,16 @@ public class IoStatOrderEntityController extends BaseController {
}
public static QueryWrapper<IoStatOrderEntity> 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;
}

@ -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<IoStatSetEntity> getQueryWrapper(IoStatSetEntityRequest request) {
IoStatSetEntity entity = new IoStatSetEntity();
BeanCopyUtils.copy(request, entity);
QueryWrapper queryWrapper = new QueryWrapper(entity);
public QueryWrapper<IoStatSetEntity> 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<IoStatSetDetailEntity> list = ioStatSetDetailService.list(detailQ);
List<Integer> 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;
}

@ -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<IoStatOrderEntity> {
/**
*
* @param queryWrapper
* @return
*/
List<IoStatOrderEntity> filterList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper);
}

@ -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;
}

@ -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;
/**
* 12.3
@ -62,4 +61,9 @@ public class IoStatOrderEntityRequest extends ListPageRequest {
private Integer status;
private Integer statType;
private Long companyIdFk;
private String companyType;
}

@ -12,6 +12,11 @@ import java.util.Date;
public class IoStatSetDetailEntityRequest extends ListPageRequest {
private Integer id;
/**
* ID
*/
private Integer setFk;
/**
*
*/

@ -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;
}

@ -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<IoStatOrderMapper, IoStatOrderEntity> {
public List<IoStatOrderEntity> filterList(QueryWrapper queryWrapper){
return this.baseMapper.filterList(queryWrapper);
}
}

@ -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

@ -23,4 +23,13 @@
id, recordKey, `date`, `type`, updateTime, title, remark, invCode, deptCode, startDate,
endDate, `status`, statType
</sql>
<select id="filterList"
resultType="com.glxp.api.entity.stat.IoStatOrderEntity">
SELECT O.*,uc.companyName,uc.bussinessStatus as companyType
FROM io_stat_order o left join user_company uc on o.companyIdFk = uc.id
<where>
${ew.sqlSegment}
</where>
</select>
</mapper>

Loading…
Cancel
Save