From e3c72ee83aa8b857d17d0e79a43c89d3c267f9f9 Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期一, 20 十一月 2023 16:29:40 +0800
Subject: [PATCH] 商城订单模块
---
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 150 insertions(+), 8 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java
index daeec0b..b3cf77c 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java
@@ -1,27 +1,30 @@
package com.panzhihua.service_dangjian.service.impl;
+import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.panzhihua.common.enums.ComPbCheckUnitTypeEnum;
+import com.panzhihua.common.model.dtos.common.AddComPbCheckUnitDto;
+import com.panzhihua.common.model.dtos.common.EditComPbCheckUnitDto;
+import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto;
+import com.panzhihua.common.model.dtos.common.PagePbCheckUnitCommonDto;
+import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo;
-import com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO;
import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO;
import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO;
import com.panzhihua.common.utlis.StringUtils;
+import com.panzhihua.service_dangjian.dao.ComPbCheckUnitMapper;
import com.panzhihua.service_dangjian.dao.ComPbMemberDAO;
import com.panzhihua.service_dangjian.dao.ComPbMemberRoleDAO;
import com.panzhihua.service_dangjian.entity.ComPbCheckUnit;
-import com.panzhihua.service_dangjian.dao.ComPbCheckUnitMapper;
import com.panzhihua.service_dangjian.model.dos.ComPbMemberDO;
import com.panzhihua.service_dangjian.model.dos.ComPbMemberRoleDO;
import com.panzhihua.service_dangjian.service.ComPbCheckUnitService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
-import com.panzhihua.common.model.dtos.common.*;
-import com.panzhihua.common.model.vos.R;
import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
@@ -47,6 +50,7 @@
@Resource
private ComPbMemberRoleDAO comPbMemberRoleDAO;
+
/**
* description queryByPage 分页查询
*
@@ -57,6 +61,16 @@
*/
@Override
public R queryByPage(PageComPbCheckUnitDto comPbCheckUnit) {
+
+ Long communityId = comPbCheckUnit.getCommunityId();
+ if (communityId != null){
+ List<Long> communityIds = comPbMemberDAO.selectIds(communityId);
+ if (CollUtil.isEmpty(communityIds)) {
+ communityIds = new ArrayList<>();
+ communityIds.add(communityId);
+ }
+ comPbCheckUnit.setCommunityIds(communityIds);
+ }
IPage<ComPbCheckUnitVo> checkUnitVoPage= this.baseMapper.queryAllByLimit(comPbCheckUnit, new Page(comPbCheckUnit.getPageNum(), comPbCheckUnit.getPageSize()));
checkUnitVoPage.getRecords().forEach(checkUnit -> {
if(StringUtils.isEmpty(checkUnit.getOrgName())){
@@ -75,9 +89,14 @@
* @date 2022-02-16 16:22:26
*/
@Override
+ @Transactional
public R insert(AddComPbCheckUnitDto comPbCheckUnit) {
+ Long communityId=this.baseMapper.selectCommunityId(comPbCheckUnit.getHelpCommunityName().split(",")[0],comPbCheckUnit.getHelpCommunityName().split(",")[1],comPbCheckUnit.getHelpCommunityName().split(",")[2]);
ComPbCheckUnit entity = new ComPbCheckUnit();
BeanUtils.copyProperties(comPbCheckUnit, entity);
+ if(communityId!=null){
+ entity.setCommunityId(communityId);
+ }
if (this.baseMapper.insert(entity) > 0) {
return R.ok();
}
@@ -161,10 +180,28 @@
*/
@Override
public R queryByList(PageComPbCheckUnitDto comPbCheckUnit) {
- List<ComPbCheckUnitVo> checkUnitList = this.baseMapper.queryAllByList(comPbCheckUnit);
- checkUnitList.forEach(checkUnit -> {
+ Long communityId = comPbCheckUnit.getCommunityId();
+ if (communityId != null){
+ List<Long> communityIds = comPbMemberDAO.selectIds(communityId);
+ if (CollUtil.isEmpty(communityIds)) {
+ communityIds = new ArrayList<>();
+ communityIds.add(communityId);
+ }
+ comPbCheckUnit.setCommunityIds(communityIds);
+ }
+ IPage<ComPbCheckUnitVo> checkUnitList = this.baseMapper.queryAllByLimit(comPbCheckUnit,new Page(comPbCheckUnit.getPageNum(),comPbCheckUnit.getPageSize()));
+ checkUnitList.getRecords().forEach(checkUnit -> {
if(StringUtils.isEmpty(checkUnit.getOrgName())){
checkUnit.setOrgName("待编辑党支部");
+ }
+ if(StringUtils.isNotEmpty(checkUnit.getAreaCode())){
+ switch (checkUnit.getAreaCode()){
+ case "510423": checkUnit.setAreaName("西区"); break;
+ case "510402": checkUnit.setAreaName("东区"); break;
+ case "510411": checkUnit.setAreaName("仁和区"); break;
+ case "510421": checkUnit.setAreaName("米易县"); break;
+ case "510422": checkUnit.setAreaName("盐边"); break;
+ }
}
});
return R.ok(checkUnitList);
@@ -211,4 +248,109 @@
}
return R.ok();
}
+
+ @Override
+ public R detailByPhone(String phone) {
+ List<ComPbCheckUnit> comPbCheckUnits=this.baseMapper.selectList(new QueryWrapper<ComPbCheckUnit>().lambda().eq(ComPbCheckUnit::getAdminPhone,phone));
+ if(!comPbCheckUnits.isEmpty()){
+ return R.ok(comPbCheckUnits.get(0));
+ }
+ return R.ok();
+ }
+
+ /**
+ * 报到单位统计-顶部数据
+ * @param communityId
+ * @param belongTo
+ * @param choice
+ * @return
+ */
+ @Override
+ public R unitStatisticsTop(Long communityId, String belongTo, String choice,Long[] unitIds) {
+ List<Long> communityIds = new ArrayList<>();
+ if (null != communityId){
+ communityIds = comPbMemberDAO.selectIds(communityId);
+ if (CollUtil.isEmpty(communityIds)) {
+ communityIds.add(communityId);
+ }
+ }
+
+ return R.ok(this.baseMapper.unitStatisticsTop(communityIds, belongTo, choice,unitIds));
+ }
+
+ /**
+ * 报到单位统计
+ * @param commonDto
+ * @return
+ */
+ @Override
+ public R unitStatistics(PagePbCheckUnitCommonDto commonDto) {
+ Long communityId = commonDto.getCommunityId();
+ if (null != communityId) {
+ List<Long> communityIds = comPbMemberDAO.selectIds(communityId);
+ if (CollUtil.isEmpty(communityIds)) {
+ communityIds = new ArrayList<>();
+ communityIds.add(communityId);
+ }
+ commonDto.setCommunityIds(communityIds);
+ }
+ return R.ok(this.baseMapper.unitStatistics(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize())));
+ }
+
+ /**
+ * 报到党员统计-顶部数据
+ * @param communityId
+ * @param belongTo
+ * @param choice
+ * @param checkUnitId
+ * @return
+ */
+ @Override
+ public R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId,Long[] unitIds) {
+
+ List<Long> communityIds = new ArrayList<>();
+ if (null != communityId){
+ communityIds = comPbMemberDAO.selectIds(communityId);
+ if (CollUtil.isEmpty(communityIds)) {
+ communityIds.add(communityId);
+ }
+ }
+ return R.ok(this.baseMapper.pbStatisticsTop(communityIds, belongTo, choice, checkUnitId,unitIds));
+ }
+
+ /**
+ * 报到党员统计-按单位归属统计
+ * @param commonDto
+ * @return
+ */
+ @Override
+ public R pbStatisticsBelong(PagePbCheckUnitCommonDto commonDto) {
+ Long communityId = commonDto.getCommunityId();
+ if (null != communityId) {
+ List<Long> communityIds = comPbMemberDAO.selectIds(communityId);
+ if (CollUtil.isEmpty(communityIds)) {
+ communityIds = new ArrayList<>();
+ communityIds.add(communityId);
+ }
+ commonDto.setCommunityIds(communityIds);
+ }
+ return R.ok(this.baseMapper.pbStatisticsBelong(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize())));
+ }
+
+ /**
+ * 报到党员统计-按单位统计
+ * @param commonDto
+ * @return
+ */
+ @Override
+ public R pbStatisticsUnit(PagePbCheckUnitCommonDto commonDto) {
+ Long communityId = commonDto.getCommunityId();
+ List<Long> communityIds = comPbMemberDAO.selectIds(communityId);
+ if (CollUtil.isEmpty(communityIds)) {
+ communityIds = new ArrayList<>();
+ communityIds.add(communityId);
+ }
+ commonDto.setCommunityIds(communityIds);
+ return R.ok(this.baseMapper.pbStatisticsUnit(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize())));
+ }
}
--
Gitblit v1.7.1