大屏展示实时接口

master
anthonywj 1 year ago
parent 61f363a5a1
commit 3ebc40c306

@ -14,6 +14,7 @@ import com.glxp.api.req.basic.*;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.BasicUdiRelResponse;
import com.glxp.api.res.stat.NmapTotalResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.basic.*;
import com.glxp.api.util.udi.FilterUdiUtils;
@ -209,11 +210,22 @@ public class UdiRelController extends BaseController {
basicUdiProductEntity.setMeasname(basicUdiRelRequest.getMeasname());
basicUdiProductEntity.setSpmc(basicUdiRelRequest.getSpmc());
basicUdiProductEntity.setMeasname(basicUdiRelRequest.getMeasname());
basicUdiProductEntity.setManufactory(basicUdiRelRequest.getManufactory());
basicUdiProductEntity.setCategoryLevel(basicUdiRelRequest.getCategoryLevel());
basicUdiProductEntity.setGroupBuy(basicUdiRelRequest.getGroupBuy());
basicUdiProductEntity.setChsType(basicUdiRelRequest.getChsType());
basicUdiProductEntity.setImportType(basicUdiRelRequest.getImportType());
basicUdiProductService.updateByUuid(basicUdiProductEntity);
return ResultVOUtils.success("添加成功!");
}
/**
*
*/
@GetMapping("udi/basic/company/bussinessType/stat")
public BaseResponse insertInitial(Integer bussinessStatus) {
NmapTotalResponse nmapTotalResponse = basicUdiRelService.statBusTypeCount(bussinessStatus);
return ResultVOUtils.success(nmapTotalResponse);
}
}

@ -266,6 +266,8 @@ public class BigVisController extends BaseController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<StatCorpInvEntity> selectlist = statCorpInvService.filterList(statCorpInvRequest);
PageInfo<StatCorpInvEntity> pageInfo;
pageInfo = new PageInfo<>(selectlist);
PageSimpleResponse<StatCorpInvEntity> pageSimpleResponse = new PageSimpleResponse<>();

@ -21,11 +21,15 @@ import com.glxp.api.req.auth.loginmobileRequest;
import com.glxp.api.req.purchase.certRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.auth.registComPerResponse;
import com.glxp.api.res.stat.NmapTotalResponse;
import com.glxp.api.service.basic.BasicCorpService;
import com.glxp.api.service.basic.BasicUdiRelService;
import com.glxp.api.service.purchase.IEmailService;
import com.glxp.api.service.purchase.SupCompanyService;
import com.glxp.api.service.sup.*;
import com.glxp.api.service.trace.RabbitPushService;
import com.glxp.api.service.trace.RabbitQueueService;
import com.glxp.api.util.IntUtil;
import com.glxp.api.util.UuidUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -231,6 +235,11 @@ public class UserRegisterController extends BaseController {
}
@Resource
BasicUdiRelService basicUdiRelService;
@Resource
BasicCorpService basicCorpService;
@ApiOperation(value = "查询注册人列表", response = registComPerResponse.class)
@PostMapping("/admin/auth/register/list")
public BaseResponse selectReslist(@RequestBody UserRegisterFilterRequest userRegisterFilterRequest, BindingResult bindingResult) {
@ -238,6 +247,25 @@ public class UserRegisterController extends BaseController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
List<registComPerResponse> selectlist = userRegisterService.selectlist(userRegisterFilterRequest);
for (registComPerResponse response : selectlist) {
NmapTotalResponse nmapTotalResponse = basicUdiRelService.statCompanyProuctCount(response.getCompanyId() + "");
response.setProductCount(IntUtil.value(nmapTotalResponse.getProductCount()) + "");
response.setTagCodeCount(IntUtil.value(nmapTotalResponse.getTagCount()));
response.setUnTagCodeCount(IntUtil.value(nmapTotalResponse.getUnTagCount()));
response.setQixieCount(IntUtil.value(nmapTotalResponse.getQxCount()));
response.setShijiCount(IntUtil.value(nmapTotalResponse.getSjCount()));
response.setImportCount(IntUtil.value(nmapTotalResponse.getImportCount()));
response.setUnImportCount(IntUtil.value(nmapTotalResponse.getUnImportCount()));
response.setMipCount(IntUtil.value(nmapTotalResponse.getChsCount()));
response.setUnMipCount(IntUtil.value(nmapTotalResponse.getUnChsCount()));
NmapTotalResponse corp = basicCorpService.statCompanyCorpCount(response.getCompanyId() + "");
response.setCusCount(corp.getCustomCount());
response.setSupCount(corp.getSupCount());
}
PageInfo<registComPerResponse> pageInfo;
pageInfo = new PageInfo<>(selectlist);
PageSimpleResponse<registComPerResponse> pageSimpleResponse = new PageSimpleResponse<>();

@ -16,6 +16,7 @@ public interface BasicUdiRelMapper extends BaseMapper<BasicUdiRelEntity> {
List<BasicUdiRelResponse> filterList(FilterUdiRelRequest filterUdiRelRequest);
List<BasicUdiRelResponse> filterBasicList(FilterUdiRelRequest filterUdiRelRequest);
List<BasicUdiRelResponse> filterCompanyList(FilterUdiRelRequest filterUdiRelRequest);
@ -29,5 +30,9 @@ public interface BasicUdiRelMapper extends BaseMapper<BasicUdiRelEntity> {
List<String> findDiList(@Param("uuid") String uuid);
List<String> findDiListByProduct(FilterUdiRelRequest filterUdiRelRequest);
List<BasicUdiRelResponse> statCompanyCount(String companyIdFk);
List<BasicUdiRelResponse> statBusTypeCount(Integer bussinessStatus);
}

@ -0,0 +1,16 @@
package com.glxp.api.dao.stat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.stat.IoStatMonthEntity;
import com.glxp.api.req.stat.StatCorpInvRequest;
import com.glxp.api.res.basic.BasicUdiRelResponse;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface IoStatMonthMapper extends BaseMapper<IoStatMonthEntity> {
List<BasicUdiRelResponse> statCompanyCount(StatCorpInvRequest statCorpInvRequest);
}

@ -0,0 +1,9 @@
package com.glxp.api.dao.stat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.stat.IoStatOrderEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface IoStatOrderMapper extends BaseMapper<IoStatOrderEntity> {
}

@ -280,9 +280,9 @@ public class BasicUdiProductEntity implements Serializable {
private Date updateTime;
/**
*
*
*/
@ApiModelProperty(value = "产品类型")
@ApiModelProperty(value = "器械类别")
@TableField(value = "cplx")
private String cplx;
@ -374,9 +374,37 @@ public class BasicUdiProductEntity implements Serializable {
* 1./2./3.
*/
@ApiModelProperty(value = "生产数据对接方1.生产企业/2.代理商/3.购买方)")
@TableField(exist = false)
private Integer companyType;
/**
*
*/
@TableField(value = "categoryLevel")
private String categoryLevel;
/**
* 1:2
*/
@TableField(value = "groupBuy")
private Integer groupBuy;
/**
* 1:2
*/
@TableField(value = "chsType")
private Integer chsType;
/**
* 1:2
*/
@TableField(value = "importType")
private Integer importType;
/**
* 123
*/
@TableField(value = "purchaseType")
private Integer purchaseType;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,183 @@
package com.glxp.api.entity.stat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "io_stat_month")
public class IoStatMonthEntity implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
*
*/
@TableField(value = "recordKeyFk")
private String recordKeyFk;
/**
*
*/
@TableField(value = "`year`")
private Integer year;
/**
*
*/
@TableField(value = "quarter")
private Integer quarter;
/**
*
*/
@TableField(value = "`month`")
private Integer month;
/**
*
*/
@TableField(value = "relIdFk")
private String relIdFk;
/**
* DI
*/
@TableField(value = "nameCode")
private String nameCode;
/**
*
*/
@TableField(value = "productName")
private String productName;
/**
*
*/
@TableField(value = "ggxh")
private String ggxh;
/**
*
*/
@TableField(value = "batchNo")
private String batchNo;
/**
*
*/
@TableField(value = "beginCount")
private Integer beginCount;
/**
*
*/
@TableField(value = "beginPrice")
private BigDecimal beginPrice;
/**
*
*/
@TableField(value = "beginAmount")
private BigDecimal beginAmount;
/**
*
*/
@TableField(value = "inCount")
private Integer inCount;
/**
*
*/
@TableField(value = "inPrice")
private BigDecimal inPrice;
/**
*
*/
@TableField(value = "inAmount")
private BigDecimal inAmount;
/**
*
*/
@TableField(value = "outCount")
private Integer outCount;
/**
*
*/
@TableField(value = "outPrice")
private BigDecimal outPrice;
/**
*
*/
@TableField(value = "outAmount")
private BigDecimal outAmount;
/**
*
*/
@TableField(value = "balanceCount")
private Integer balanceCount;
/**
*
*/
@TableField(value = "balancePrice")
private BigDecimal balancePrice;
/**
*
*/
@TableField(value = "balanceAmount")
private BigDecimal balanceAmount;
/**
*
*/
@TableField(value = "remark")
private String remark;
/**
*
*/
@TableField(value = "updateTime")
private Date updateTime;
@TableField(value = "deptCode")
private String deptCode;
/**
* ID
*/
@TableField(value = "companyIdFk")
private Long companyIdFk;
/**
*
*/
@TableField(value = "invCode")
private String invCode;
@TableField(exist = false)
private String deptName;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,90 @@
package com.glxp.api.entity.stat;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "io_stat_order")
public class IoStatOrderEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
private Integer id;
/**
*
*/
@TableField(value = "recordKey")
private String recordKey;
/**
*
*/
@TableField(value = "`date`")
private Date date;
/**
* 1:2.345.
*/
@TableField(value = "`type`")
private Integer type;
/**
*
*/
@TableField(value = "updateTime")
private Date updateTime;
/**
*
*/
@TableField(value = "title")
private String title;
/**
*
*/
@TableField(value = "remark")
private String remark;
@TableField(value = "invCode")
private String invCode;
@TableField(value = "deptCode")
private String deptCode;
/**
*
*/
@TableField(value = "startDate")
private Date startDate;
/**
*
*/
@TableField(value = "endDate")
private Date endDate;
/**
* 12.3
*/
@TableField(value = "`status`")
private Integer status;
@TableField(value = "statType")
private Integer statType;
private static final long serialVersionUID = 1L;
}

@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@ApiModel("基本 UDI 关联请求")
@Data
public class BasicUdiRelRequest {
@ -67,4 +68,27 @@ public class BasicUdiRelRequest {
private String spmc;
/**
*
*/
private String categoryLevel;
/**
* 1:2
*/
private Integer groupBuy;
/**
* 1:2
*/
private Integer chsType;
/**
* 1:2
*/
private Integer importType;
/**
* 123
*/
private Integer purchaseType;
}

@ -34,4 +34,7 @@ public class StatCorpInvRequest extends ListPageRequest {
private Date updateTime;
private Integer uploadFlag;
private Date lastUploadTime;
private Long companyId;
private Long bussinessStatus;
}

@ -130,6 +130,18 @@ public class registComPerResponse {
private Integer shijiCount;
private Integer supCount;
private Integer cusCount;
/**
*
*/
private Integer purNormal;
/**
*
*/
private Integer purPreIn;
/**
*
*/
private Integer purPre;
private Long companyId;

@ -7,6 +7,7 @@ import lombok.Data;
import java.time.LocalDate;
import java.util.Date;
@ApiModel("基本UDI关联响应")
@Data
public class BasicUdiRelResponse {
@ -128,7 +129,7 @@ public class BasicUdiRelResponse {
@ApiModelProperty(value = "是否是最新记录")
private Boolean isNewest;
@ApiModelProperty(value = "产品类型")
@ApiModelProperty(value = "器械类别")
private String cplx;
@ApiModelProperty(value = "产品类别")
private String hchzsb;
@ -166,7 +167,6 @@ public class BasicUdiRelResponse {
private String manufacturerId;
/**
*
*/
@ -174,7 +174,6 @@ public class BasicUdiRelResponse {
private String creditCode;
/**
*
*/
@ -255,7 +254,7 @@ public class BasicUdiRelResponse {
/**
*
/
* /
*/
@TableField("productionRecordSection")
private String productionRecordSection;
@ -291,7 +290,6 @@ public class BasicUdiRelResponse {
private String auditComment;
/**
*
*/
@ -305,7 +303,6 @@ public class BasicUdiRelResponse {
private Date createTime;
@TableField("agentName")
private String agentName;
@ -317,4 +314,29 @@ public class BasicUdiRelResponse {
private String passCout;
private String burId;
/**
*
*/
private String categoryLevel;
/**
* 1:2
*/
private Integer groupBuy;
/**
* 1:2
*/
private Integer chsType;
/**
* 1:2
*/
private Integer importType;
/**
* 123
*/
private Integer purchaseType;
}

@ -0,0 +1,117 @@
package com.glxp.api.res.stat;
import lombok.Data;
@Data
public class InvStatTotalResponse {
/**
*
*/
private int qxCount;
/**
*
*/
private int sjCount;
/**
*
*/
private int productCount;
/**
*
*/
private int levelOneCount;
/**
*
*/
private int levelTwoCount;
/**
*
*/
private int levelthreeCount;
/**
*
*/
private int groupBuyCount;
/**
*
*/
private int unGroupCount;
/**
*
*/
private int chsCount;
/**
*
*/
private int unChsCount;
/**
*
*/
private int importCount;
/**
*
*/
private int unImportCount;
/**
*
*/
private int tagCount;
/**
*
*/
private int unTagCount;
/**
*
*/
private int supCount;
/**
*
*/
private int customCount;
/**
*
*/
private int purNormal;
/**
*
*/
private int purPreIn;
/**
*
*/
private int purPre;
/**
*
*/
private int levelOneTagCount;
/**
*
*/
private int levelTwoTagCount;
/**
*
*/
private int levelthreeTagCount;
}

@ -7,10 +7,111 @@ public class NmapTotalResponse {
/**
*
*/
private Integer qxCount;
private int qxCount;
/**
*
*/
private Integer sjCount;
private int sjCount;
/**
*
*/
private int productCount;
/**
*
*/
private int levelOneCount;
/**
*
*/
private int levelTwoCount;
/**
*
*/
private int levelthreeCount;
/**
*
*/
private int groupBuyCount;
/**
*
*/
private int unGroupCount;
/**
*
*/
private int chsCount;
/**
*
*/
private int unChsCount;
/**
*
*/
private int importCount;
/**
*
*/
private int unImportCount;
/**
*
*/
private int tagCount;
/**
*
*/
private int unTagCount;
/**
*
*/
private int supCount;
/**
*
*/
private int customCount;
/**
*
*/
private int purNormal;
/**
*
*/
private int purPreIn;
/**
*
*/
private int purPre;
/**
*
*/
private int levelOneTagCount;
/**
*
*/
private int levelTwoTagCount;
/**
*
*/
private int levelthreeTagCount;
}

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.res.basic.BasicCorpResponse;
import com.glxp.api.res.stat.NmapTotalResponse;
import java.util.List;
@ -49,4 +50,6 @@ public interface BasicCorpService extends IService<BasicCorpEntity> {
* @return
*/
boolean verifyExists(BasicCorpEntity basicCorpEntity);
NmapTotalResponse statCompanyCorpCount(String companyId);
}

@ -7,6 +7,7 @@ import com.github.pagehelper.PageHelper;
import com.glxp.api.entity.sup.UserCompanyEntity;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.res.basic.BasicUdiRelResponse;
import com.glxp.api.res.stat.NmapTotalResponse;
import com.glxp.api.res.sup.UserCompanyResponse;
import com.glxp.api.util.IntUtil;
import org.springframework.stereotype.Service;
@ -36,6 +37,7 @@ public class BasicUdiRelService extends ServiceImpl<BasicUdiRelMapper, BasicUdiR
return basicUdiRelMapper.filterBasicList(filterUdiRelRequest);
// return basicUdiRelMapper.filterList(filterUdiRelRequest);
}
public List<BasicUdiRelResponse> filtersList(FilterUdiRelRequest filterUdiRelRequest) {
if (null != filterUdiRelRequest.getPage() && null != filterUdiRelRequest.getLimit()) {
PageHelper.offsetPage((filterUdiRelRequest.getPage() - 1) * filterUdiRelRequest.getLimit(), filterUdiRelRequest.getLimit());
@ -109,4 +111,221 @@ public class BasicUdiRelService extends ServiceImpl<BasicUdiRelMapper, BasicUdiR
}
}
/**
*
*/
public NmapTotalResponse statCompanyProuctCount(String companyId) {
List<BasicUdiRelResponse> basicUdiRelResponses = basicUdiRelMapper.statCompanyCount(companyId);
NmapTotalResponse nmapTotalResponse = new NmapTotalResponse();
if (CollUtil.isNotEmpty(basicUdiRelResponses)) {
nmapTotalResponse.setProductCount(basicUdiRelResponses.size());
for (BasicUdiRelResponse item : basicUdiRelResponses) {
if (item != null) {
//统计一类医疗器械数量
if (StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("一类")) {
nmapTotalResponse.setLevelOneCount(IntUtil.value(nmapTotalResponse.getLevelOneCount()) + 1);
}
//统计二类医疗器械数量
if (StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("二类")) {
nmapTotalResponse.setLevelTwoCount(IntUtil.value(nmapTotalResponse.getLevelTwoCount()) + 1);
}
//统计三类医疗器械数量
if (StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("三类")) {
nmapTotalResponse.setLevelthreeCount(IntUtil.value(nmapTotalResponse.getLevelthreeCount()) + 1);
}
//统计集采数量
if (IntUtil.value(item.getGroupBuy()) == 1) {
nmapTotalResponse.setGroupBuyCount(IntUtil.value(nmapTotalResponse.getGroupBuyCount()) + 1);
}
//统计非集采数量
if (IntUtil.value(item.getGroupBuy()) == 2) {
nmapTotalResponse.setUnGroupCount(IntUtil.value(nmapTotalResponse.getUnGroupCount()) + 1);
}
//统计医保数量
if (IntUtil.value(item.getChsType()) == 1) {
nmapTotalResponse.setChsCount(IntUtil.value(nmapTotalResponse.getChsCount()) + 1);
}
//统计非医保数量
if (IntUtil.value(item.getChsType()) == 2) {
nmapTotalResponse.setUnChsCount(IntUtil.value(nmapTotalResponse.getUnChsCount()) + 1);
}
//统计赋码数量
if (StrUtil.isNotEmpty(item.getNameCode())) {
nmapTotalResponse.setTagCount(IntUtil.value(nmapTotalResponse.getTagCount()) + 1);
} else {
nmapTotalResponse.setUnTagCount(IntUtil.value(nmapTotalResponse.getUnTagCount()) + 1);
}
//器械类数量
if (StrUtil.isNotEmpty(item.getCplx()) && item.getCplx().equals("器械")) {
nmapTotalResponse.setQxCount(IntUtil.value(nmapTotalResponse.getQxCount()) + 1);
} else {
nmapTotalResponse.setSjCount(IntUtil.value(nmapTotalResponse.getSjCount()) + 1);
}
//采购方式
if (IntUtil.value(item.getPurchaseType()) == 1) {
nmapTotalResponse.setPurNormal(IntUtil.value(nmapTotalResponse.getPurNormal()) + 1);
}
if (IntUtil.value(item.getPurchaseType()) == 2) {
nmapTotalResponse.setPurPreIn(IntUtil.value(nmapTotalResponse.getPurPreIn()) + 1);
}
if (IntUtil.value(item.getPurchaseType()) == 3) {
nmapTotalResponse.setPurPre(IntUtil.value(nmapTotalResponse.getPurPre()) + 1);
}
}
}
//
// //统计一类医疗器械数量
// nmapTotalResponse.setLevelOneCount((int) basicUdiRelResponses.stream()
// .filter(item ->
// StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("一类")
// ).count());
// //统计二类医疗器械数量
// nmapTotalResponse.setLevelTwoCount((int) basicUdiRelResponses.stream()
// .filter(item ->
// StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("二类")
// ).count());
// //统计三类医疗器械数量
// nmapTotalResponse.setLevelthreeCount((int) basicUdiRelResponses.stream()
// .filter(item ->
// StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("三类")
// ).count());
// //统计集采数量
// nmapTotalResponse.setGroupBuyCount((int) basicUdiRelResponses.stream()
// .filter(item -> IntUtil.value(item.getGroupBuy()) == 1
// ).count());
// //统计非集采数量
// nmapTotalResponse.setUnGroupCount((int) basicUdiRelResponses.stream()
// .filter(item ->
// IntUtil.value(item.getGroupBuy()) == 2
// ).count());
// //统计医保数量
// nmapTotalResponse.setChsCount((int) basicUdiRelResponses.stream()
// .filter(item -> IntUtil.value(item.getChsType()) == 1
// ).count());
// //统计非医保数量
// nmapTotalResponse.setUnChsCount((int) basicUdiRelResponses.stream()
// .filter(item ->
// IntUtil.value(item.getChsType()) == 2
// ).count());
// //统计进口数量
// nmapTotalResponse.setImportCount((int) basicUdiRelResponses.stream()
// .filter(item -> IntUtil.value(item.getImportType()) == 1
// ).count());
// //统计非进口数量
// nmapTotalResponse.setUnImportCount((int) basicUdiRelResponses.stream()
// .filter(item ->
// IntUtil.value(item.getImportType()) == 2
// ).count());
//
// //统计赋码数量
// nmapTotalResponse.setTagCount((int) basicUdiRelResponses.stream()
// .filter(item -> StrUtil.isNotEmpty(item.getNameCode())
// ).count());
// //统计未赋码数量
// nmapTotalResponse.setUnTagCount((int) basicUdiRelResponses.stream()
// .filter(item ->
// StrUtil.isEmpty(item.getNameCode())
// ).count());
}
return nmapTotalResponse;
}
/**
*
*/
public NmapTotalResponse statBusTypeCount(Integer bussinessStatus) {
List<BasicUdiRelResponse> basicUdiRelResponses = basicUdiRelMapper.statBusTypeCount(bussinessStatus);
NmapTotalResponse nmapTotalResponse = new NmapTotalResponse();
if (CollUtil.isNotEmpty(basicUdiRelResponses)) {
nmapTotalResponse.setProductCount(basicUdiRelResponses.size());
for (BasicUdiRelResponse item : basicUdiRelResponses) {
if (item != null) {
//统计一类医疗器械数量
if (StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("一类")) {
nmapTotalResponse.setLevelOneCount(IntUtil.value(nmapTotalResponse.getLevelOneCount()) + 1);
if (StrUtil.isNotEmpty(item.getNameCode())) {
nmapTotalResponse.setLevelOneTagCount(IntUtil.value(nmapTotalResponse.getLevelOneTagCount()) + 1);
}
}
//统计二类医疗器械数量
if (StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("二类")) {
nmapTotalResponse.setLevelTwoCount(IntUtil.value(nmapTotalResponse.getLevelTwoCount()) + 1);
if (StrUtil.isNotEmpty(item.getNameCode())) {
nmapTotalResponse.setLevelTwoCount(IntUtil.value(nmapTotalResponse.getLevelTwoTagCount()) + 1);
}
}
//统计三类医疗器械数量
if (StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("三类")) {
nmapTotalResponse.setLevelthreeCount(IntUtil.value(nmapTotalResponse.getLevelthreeCount()) + 1);
if (StrUtil.isNotEmpty(item.getNameCode())) {
nmapTotalResponse.setLevelthreeTagCount(IntUtil.value(nmapTotalResponse.getLevelthreeTagCount()) + 1);
}
}
//统计集采数量
if (IntUtil.value(item.getGroupBuy()) == 1) {
nmapTotalResponse.setGroupBuyCount(IntUtil.value(nmapTotalResponse.getGroupBuyCount()) + 1);
}
//统计非集采数量
if (IntUtil.value(item.getGroupBuy()) == 2) {
nmapTotalResponse.setUnGroupCount(IntUtil.value(nmapTotalResponse.getUnGroupCount()) + 1);
}
//统计医保数量
if (IntUtil.value(item.getChsType()) == 1) {
nmapTotalResponse.setChsCount(IntUtil.value(nmapTotalResponse.getChsCount()) + 1);
}
//统计非医保数量
if (IntUtil.value(item.getChsType()) == 2) {
nmapTotalResponse.setUnChsCount(IntUtil.value(nmapTotalResponse.getUnChsCount()) + 1);
}
//统计赋码数量
if (StrUtil.isNotEmpty(item.getNameCode())) {
nmapTotalResponse.setTagCount(IntUtil.value(nmapTotalResponse.getTagCount()) + 1);
} else {
nmapTotalResponse.setUnTagCount(IntUtil.value(nmapTotalResponse.getUnTagCount()) + 1);
}
//器械类数量
if (StrUtil.isNotEmpty(item.getCplx()) && item.getCplx().equals("器械")) {
nmapTotalResponse.setQxCount(IntUtil.value(nmapTotalResponse.getQxCount()) + 1);
} else {
nmapTotalResponse.setSjCount(IntUtil.value(nmapTotalResponse.getSjCount()) + 1);
}
//采购方式
if (IntUtil.value(item.getPurchaseType()) == 1) {
nmapTotalResponse.setPurNormal(IntUtil.value(nmapTotalResponse.getPurNormal()) + 1);
}
if (IntUtil.value(item.getPurchaseType()) == 2) {
nmapTotalResponse.setPurPreIn(IntUtil.value(nmapTotalResponse.getPurPreIn()) + 1);
}
if (IntUtil.value(item.getPurchaseType()) == 3) {
nmapTotalResponse.setPurPre(IntUtil.value(nmapTotalResponse.getPurPre()) + 1);
}
}
}
}
return nmapTotalResponse;
}
}

@ -1,12 +1,14 @@
package com.glxp.api.service.basic.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.BasicCorpDao;
import com.glxp.api.entity.basic.BasicCorpEntity;
import com.glxp.api.req.basic.BasicUnitMaintainFilterRequest;
import com.glxp.api.res.basic.BasicCorpResponse;
import com.glxp.api.res.stat.NmapTotalResponse;
import com.glxp.api.res.thrsys.ThrUnitMaintainResponse;
import com.glxp.api.service.basic.BasicCorpService;
import org.springframework.stereotype.Service;
@ -117,6 +119,16 @@ public class BasicCorpServiceImpl extends ServiceImpl<BasicCorpDao, BasicCorpEnt
return false;
}
@Override
public NmapTotalResponse statCompanyCorpCount(String companyId) {
Long supCount = basicCorpDao.selectCount(new QueryWrapper<BasicCorpEntity>().eq("corpType", 1).eq("companyIdFk", companyId));
Long customCount = basicCorpDao.selectCount(new QueryWrapper<BasicCorpEntity>().eq("corpType", 2).eq("companyIdFk", companyId));
NmapTotalResponse nmapTotalResponse = new NmapTotalResponse();
nmapTotalResponse.setSupCount(supCount.intValue());
nmapTotalResponse.setCustomCount(customCount.intValue());
return nmapTotalResponse;
}
@Override
public BasicCorpEntity selectById(String id) {
return basicCorpDao.selectEntityById(id);

@ -0,0 +1,89 @@
package com.glxp.api.service.stat;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.req.stat.StatCorpInvRequest;
import com.glxp.api.res.basic.BasicUdiRelResponse;
import com.glxp.api.res.stat.InvStatTotalResponse;
import com.glxp.api.util.IntUtil;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.stat.IoStatMonthMapper;
import com.glxp.api.entity.stat.IoStatMonthEntity;
import javax.annotation.Resource;
import java.util.List;
@Service
public class IoStatMonthService extends ServiceImpl<IoStatMonthMapper, IoStatMonthEntity> {
@Resource
IoStatMonthMapper statMonthMapper;
InvStatTotalResponse statCompanyCount(StatCorpInvRequest statCorpInvRequest) {
List<BasicUdiRelResponse> basicUdiRelResponses = statMonthMapper.statCompanyCount(statCorpInvRequest);
InvStatTotalResponse nmapTotalResponse = new InvStatTotalResponse();
for (BasicUdiRelResponse item : basicUdiRelResponses) {
if (item != null) {
//统计一类医疗器械数量
if (StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("一类")) {
nmapTotalResponse.setLevelOneCount(IntUtil.value(nmapTotalResponse.getLevelOneCount()) + 1);
}
//统计二类医疗器械数量
if (StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("二类")) {
nmapTotalResponse.setLevelTwoCount(IntUtil.value(nmapTotalResponse.getLevelTwoCount()) + 1);
}
//统计三类医疗器械数量
if (StrUtil.isNotEmpty(item.getCategoryLevel()) && item.getCategoryLevel().equals("三类")) {
nmapTotalResponse.setLevelthreeCount(IntUtil.value(nmapTotalResponse.getLevelthreeCount()) + 1);
}
//统计集采数量
if (IntUtil.value(item.getGroupBuy()) == 1) {
nmapTotalResponse.setGroupBuyCount(IntUtil.value(nmapTotalResponse.getGroupBuyCount()) + 1);
}
//统计非集采数量
if (IntUtil.value(item.getGroupBuy()) == 2) {
nmapTotalResponse.setUnGroupCount(IntUtil.value(nmapTotalResponse.getUnGroupCount()) + 1);
}
//统计医保数量
if (IntUtil.value(item.getChsType()) == 1) {
nmapTotalResponse.setChsCount(IntUtil.value(nmapTotalResponse.getChsCount()) + 1);
}
//统计非医保数量
if (IntUtil.value(item.getChsType()) == 2) {
nmapTotalResponse.setUnChsCount(IntUtil.value(nmapTotalResponse.getUnChsCount()) + 1);
}
//统计赋码数量
if (StrUtil.isNotEmpty(item.getNameCode())) {
nmapTotalResponse.setTagCount(IntUtil.value(nmapTotalResponse.getTagCount()) + 1);
} else {
nmapTotalResponse.setUnTagCount(IntUtil.value(nmapTotalResponse.getUnTagCount()) + 1);
}
//器械类数量
if (StrUtil.isNotEmpty(item.getCplx()) && item.getCplx().equals("器械")) {
nmapTotalResponse.setQxCount(IntUtil.value(nmapTotalResponse.getQxCount()) + 1);
} else {
nmapTotalResponse.setSjCount(IntUtil.value(nmapTotalResponse.getSjCount()) + 1);
}
//采购方式
if (IntUtil.value(item.getPurchaseType()) == 1) {
nmapTotalResponse.setPurNormal(IntUtil.value(nmapTotalResponse.getPurNormal()) + 1);
}
if (IntUtil.value(item.getPurchaseType()) == 2) {
nmapTotalResponse.setPurPreIn(IntUtil.value(nmapTotalResponse.getPurPreIn()) + 1);
}
if (IntUtil.value(item.getPurchaseType()) == 3) {
nmapTotalResponse.setPurPre(IntUtil.value(nmapTotalResponse.getPurPre()) + 1);
}
}
}
return nmapTotalResponse;
}
}

@ -0,0 +1,10 @@
package com.glxp.api.service.stat;
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;
@Service
public class IoStatOrderService extends ServiceImpl<IoStatOrderMapper, IoStatOrderEntity> {
}

@ -19,6 +19,7 @@ public class StatCorpInvService extends ServiceImpl<StatCorpInvMapper, StatCorpI
@Resource
StatCorpInvMapper statCorpInvMapper;
public List<StatCorpInvEntity> filterList(StatCorpInvRequest statCorpInvRequest) {
if (statCorpInvRequest == null) {
return Collections.emptyList();
@ -27,4 +28,14 @@ public class StatCorpInvService extends ServiceImpl<StatCorpInvMapper, StatCorpI
PageHelper.offsetPage(offset, statCorpInvRequest.getLimit());
return statCorpInvMapper.filterList(statCorpInvRequest);
}
/**
*
*/
public void statCompanyInvCount(String companyId) {
}
}

@ -51,7 +51,11 @@
qtxxdwzlj,
mjfs,
p.measname,
p.manufactory
p.manufactory,
p.categoryLevel,
p.groupBuy,
p.chsType,
p.importType
FROM basic_udi_rel bur
left JOIN basic_udi_product p on bur.uuid = p.uuid
left join user_company uc on bur.companyIdFk = uc.id
@ -168,7 +172,11 @@
qtxxdwzlj,
mjfs,
p.measname,
p.manufactory
p.manufactory,
p.categoryLevel,
p.groupBuy,
p.chsType,
p.importType
FROM basic_udi_rel bur
left JOIN basic_udi_product p on bur.uuid = p.uuid
left join user_company uc on bur.companyIdFk = uc.id
@ -285,7 +293,6 @@
</select>
<select id="findDiListByProduct"
resultType="java.lang.String">
select nameCode
@ -294,4 +301,23 @@
and basic_udi_product.cpmctymc = #{cpmctymc}
and basic_udi_product.ggxh = #{ggxh}
</select>
<select id="statCompanyCount" parameterType="java.lang.String"
resultType="com.glxp.api.res.basic.BasicUdiRelResponse">
select cplx, categoryLevel, groupBuy, chsType, importType, nameCode
FROM basic_udi_rel bur
left JOIN basic_udi_product p on bur.uuid = p.uuid
where bur.companyIdFk = #{companyIdFk}
</select>
<select id="statBusTypeCount" parameterType="java.lang.String"
resultType="com.glxp.api.res.basic.BasicUdiRelResponse">
select cplx, categoryLevel, groupBuy, chsType, importType, nameCode
FROM basic_udi_rel bur
left JOIN basic_udi_product p on bur.uuid = p.uuid
left join user_company uc on bur.companyIdFk = uc.id
where bur.companyIdFk = #{companyIdFk}
</select>
</mapper>

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.stat.IoStatMonthMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.stat.IoStatMonthEntity">
<!--@mbg.generated-->
<!--@Table io_stat_month-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="recordKeyFk" jdbcType="VARCHAR" property="recordKeyFk"/>
<result column="year" jdbcType="INTEGER" property="year"/>
<result column="quarter" jdbcType="TINYINT" property="quarter"/>
<result column="month" jdbcType="TINYINT" property="month"/>
<result column="relIdFk" jdbcType="VARCHAR" property="relIdFk"/>
<result column="nameCode" jdbcType="VARCHAR" property="nameCode"/>
<result column="productName" jdbcType="VARCHAR" property="productName"/>
<result column="ggxh" jdbcType="VARCHAR" property="ggxh"/>
<result column="batchNo" jdbcType="VARCHAR" property="batchNo"/>
<result column="beginCount" jdbcType="INTEGER" property="beginCount"/>
<result column="beginPrice" jdbcType="DECIMAL" property="beginPrice"/>
<result column="beginAmount" jdbcType="DECIMAL" property="beginAmount"/>
<result column="inCount" jdbcType="VARCHAR" property="inCount"/>
<result column="inPrice" jdbcType="DECIMAL" property="inPrice"/>
<result column="inAmount" jdbcType="VARCHAR" property="inAmount"/>
<result column="outCount" jdbcType="VARCHAR" property="outCount"/>
<result column="outPrice" jdbcType="DECIMAL" property="outPrice"/>
<result column="outAmount" jdbcType="VARCHAR" property="outAmount"/>
<result column="balanceCount" jdbcType="VARCHAR" property="balanceCount"/>
<result column="balancePrice" jdbcType="DECIMAL" property="balancePrice"/>
<result column="balanceAmount" jdbcType="VARCHAR" property="balanceAmount"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="deptCode" jdbcType="VARCHAR" property="deptCode"/>
<result column="invCode" jdbcType="VARCHAR" property="invCode"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, recordKeyFk, `year`, quarter, `month`, relIdFk, nameCode, productName, ggxh,
batchNo, beginCount, beginPrice, beginAmount, inCount, inPrice, inAmount, outCount,
outPrice, outAmount, balanceCount, balancePrice, balanceAmount, remark, updateTime,
deptCode, invCode
</sql>
<select id="statCompanyCount" parameterType="com.glxp.api.req.stat.StatCorpInvRequest"
resultType="com.glxp.api.res.basic.BasicUdiRelResponse">
select cplx, categoryLevel, groupBuy, chsType, importType, nameCode
from io_stat_month ism
left join basic_udi_rel bur on ism.companyIdFk = bur.companyIdFk
left JOIN basic_udi_product p on bur.uuid = p.uuid
left join user_company uc on bur.companyIdFk = uc.id
<where>
<if test="companyId != '' and companyId != null">
AND companyIdFk = #{companyId}
</if>
<if test="bussinessStatus != '' and bussinessStatus != null">
AND uc.bussinessStatus = #{bussinessStatus}
</if>
</where>
group by bur.uuid
</select>
</mapper>

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.stat.IoStatOrderMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.stat.IoStatOrderEntity">
<!--@mbg.generated-->
<!--@Table io_stat_order-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="recordKey" jdbcType="VARCHAR" property="recordKey" />
<result column="date" jdbcType="TIMESTAMP" property="date" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="invCode" jdbcType="VARCHAR" property="invCode" />
<result column="deptCode" jdbcType="VARCHAR" property="deptCode" />
<result column="startDate" jdbcType="TIMESTAMP" property="startDate" />
<result column="endDate" jdbcType="TIMESTAMP" property="endDate" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="statType" jdbcType="TINYINT" property="statType" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, recordKey, `date`, `type`, updateTime, title, remark, invCode, deptCode, startDate,
endDate, `status`, statType
</sql>
</mapper>

@ -20,6 +20,11 @@ CALL Pro_Temp_ColumnWork('sup_cert', 'companyIdFk', 'bigInt', 1);
CALL Pro_Temp_ColumnWork('basic_udi_product', 'categoryLevel', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_udi_product', 'groupBuy', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_udi_product', 'chsType', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_udi_product', 'importType', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_udi_product', 'purchaseType', 'tinyint', 1);

Loading…
Cancel
Save