From 2b94e2cf96e9f34f0cc1382fb467a09e2110d27e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Nov 2021 13:21:09 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 2 + .../dto/form/demand/DemandAddFromDTO.java | 5 + .../dto/result/demand/DemandRecResultDTO.java | 17 +- .../epmet/constant/UserDemandConstant.java | 9 ++ .../controller/IcUserDemandRecController.java | 14 ++ .../com/epmet/dao/IcResiDemandDictDao.java | 3 + .../service/IcResiDemandDictService.java | 23 +-- .../epmet/service/IcUserDemandRecService.java | 4 +- .../impl/IcResiDemandDictServiceImpl.java | 24 +-- .../impl/IcUserDemandRecServiceImpl.java | 146 ++++++++++++++++-- .../resources/mapper/IcResiDemandDictDao.xml | 20 +++ .../resources/mapper/IcUserDemandRecDao.xml | 34 ++-- .../com/epmet/dto/IcResiDemandDictDTO.java | 107 ------------- 13 files changed, 238 insertions(+), 170 deletions(-) delete mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDictDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 7f54dd2bb8..ff22940cb5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -87,6 +87,8 @@ public enum EpmetErrorCode { DEMAND_CAN_NOT_ASSIGN(8220, "当前状态,不可指派"), DEMAND_CAN_NOT_FINISH(8221, "当前状态,不能评价"), DEMAND_FINISHED(8222,"需求已完成"), + DEMAND_CAN_NOT_UPDATE(8223,"当前状态,不可更新需求"), + DEMAND_NOT_EXITS(8224,"需求不存在"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java index 8e1afc8143..6f968aad8a 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java @@ -20,6 +20,11 @@ public class DemandAddFromDTO implements Serializable { public interface AddUserShowGroup extends CustomerClientShowGroup { } + public interface UpdateInternalGroup { + } + + @NotBlank(message = "需求id不能为空",groups = UpdateInternalGroup.class) + private String demandRecId; private String customerId; private String currentUserId; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java index a1cba4b0a5..c695a5d026 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java @@ -22,27 +22,34 @@ public class DemandRecResultDTO implements Serializable { private String categoryName; - private String content; - + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help private String reportType; + private String reportTypeName; + + private String content; private String reportUserName; @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date reportTime; - + private String demandUserId; private String demandUser; private String demandUserName; private String demandUserMobile; - @JsonIgnore + //@JsonIgnore private String serviceType; - @JsonIgnore private String serverId; + //@JsonIgnore private String serviceName; + private String serviceShowName; @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private String wantServiceTime; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ private String status; private String statusName; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java index 1f6bd0b578..c28768b30f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java @@ -9,6 +9,13 @@ public interface UserDemandConstant { String MINI_RESI = "mini_resi"; String IC_RESI_USER = "ic_resi_user"; + /** + * 上报类型:社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + */ + String COMMUNITY_REPORT="community"; + String BUILDING_CAPTION_REPORT="building_caption"; + String PARTY_REPORT="party"; + String SELF_HELP_REPORT="self_help"; /** * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished */ @@ -29,8 +36,10 @@ public interface UserDemandConstant { /** * 创建需求:create;撤销需求:cancel;指派:assign;接单:take_order;完成:finish;; + * 更新需求:update */ String CREATE="create"; + String UPDATE="update"; String CANCEL="cancel"; String ASSIGN="assign"; String TAKE_ORDER="take_order"; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 4bac4aeefb..5bd3a3d2a8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -98,6 +98,20 @@ public class IcUserDemandRecController { return new Result().ok(icUserDemandRecService.add(fromDTO)); } + /** + * 更新需求 + * 只有待处理的才可以编辑 + * + * @param tokenDto + * @param fromDTO + * @return + */ + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){ + fromDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.UpdateInternalGroup.class,DemandAddFromDTO.AddUserShowGroup.class); + return new Result().ok(icUserDemandRecService.update(fromDTO)); + } /** * 列表查询 分页 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java index 90c35d1689..cf2625d680 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java @@ -62,4 +62,7 @@ public interface IcResiDemandDictDao extends BaseDao { Integer selectMaxSort(@Param("customerId") String customerId, @Param("level") int level, @Param("parentCode") String parentCode); + + List selectSecondCodes(@Param("customerId") String customerId, @Param("cateogryCodes") List categoryCodes); + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java index 1df5be75af..3836539181 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java @@ -21,14 +21,12 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.IcResiDemandDictDTO; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.demand.DemandPageResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcResiDemandDictEntity; import java.util.List; -import java.util.Map; /** * 居民需求字典表 @@ -42,7 +40,6 @@ public interface IcResiDemandDictService extends BaseService * @author generator * @date 2021-10-27 */ @@ -60,18 +57,6 @@ public interface IcResiDemandDictService extends BaseService - * @author generator - * @date 2021-10-27 - */ - List list(Map params); - - /** * 默认更新 * @@ -116,4 +101,12 @@ public interface IcResiDemandDictService extends BaseService listByCodes(String customerId, List categoryCodes); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index e963ac94df..a0b3799d4e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -76,14 +76,14 @@ public interface IcUserDemandRecService extends BaseService list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, IcResiDemandDictDTO.class); - } - private QueryWrapper getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); @@ -224,5 +212,17 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl listByCodes(String customerId, List categoryCodes) { + return baseDao.selectSecondCodes(customerId,categoryCodes); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index d76ba00374..d0b1d60a1a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -38,12 +38,13 @@ import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.AllGridsByUserIdResultDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.demand.DemandRecResultDTO; -import com.epmet.entity.IcUserDemandOperateLogEntity; -import com.epmet.entity.IcUserDemandRecEntity; -import com.epmet.entity.IcUserDemandSatisfactionEntity; -import com.epmet.entity.IcUserDemandServiceEntity; +import com.epmet.entity.*; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcResiDemandDictService; import com.epmet.service.IcUserDemandRecService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -53,10 +54,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 居民需求记录表 @@ -74,6 +74,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if(!gridInfoRes.success()||null==gridInfoRes.getData()){ + throw new RenException("查询网格信息失败"); + } + IcUserDemandRecEntity updateEntity=ConvertUtils.sourceToTarget(dto,IcUserDemandRecEntity.class); + updateEntity.setAgencyId(gridInfoRes.getData().getPid()); + updateEntity.setGridPids(gridInfoRes.getData().getPids()); + updateEntity.setDemandUserType(UserDemandConstant.IC_RESI_USER); + updateEntity.setStatus(UserDemandConstant.PENDING); + updateEntity.setEvaluateFlag(false); + updateEntity.setId(dto.getDemandRecId()); + baseDao.updateById(updateEntity); + + IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity(); + logEntity.setCustomerId(dto.getCustomerId()); + logEntity.setDemandRecId(dto.getDemandRecId()); + logEntity.setUserType(UserDemandConstant.STAFF); + logEntity.setUserId(dto.getCurrentUserId()); + logEntity.setActionCode(UserDemandConstant.UPDATE); + logEntity.setOperateTime(new Date()); + operateLogDao.insert(logEntity); + DemandRecId resultDto=new DemandRecId(); + resultDto.setDemandRecId(updateEntity.getId()); + return resultDto; } @Override @@ -180,9 +216,87 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl baseDao.pageSelect(formDTO)); List list=pageInfo.getList(); if(CollectionUtils.isNotEmpty(list)){ - /*for(){ + //1、查询网格信息 + List gridIds=list.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList()); + Result> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity())); - }*/ + //2、查询分类名称 + List categoryCodes=list.stream().map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList()); + List dictList=demandDictService.listByCodes(formDTO.getCustomerId(),categoryCodes); + Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); + + //3、查询志愿者 + // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + List userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList()); + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if(CollectionUtils.isEmpty(userIdList)||!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ + throw new RenException("查询志愿者信息异常"); + } + Map userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); + + for(DemandRecResultDTO res:list){ + if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { + res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); + } + + if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) { + res.setCategoryName(dictMap.get(res.getCategoryCode())); + } + + if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) { + res.setServiceName(userInfoMap.get(res.getServerId())); + } + //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help + switch(res.getReportType()){ + case UserDemandConstant.COMMUNITY_REPORT : + res.setReportTypeName("社区帮办"); + break; + case UserDemandConstant.BUILDING_CAPTION_REPORT : + res.setReportTypeName("楼长帮办"); + break; + case UserDemandConstant.PARTY_REPORT : + res.setReportTypeName("党员帮办"); + break; + case UserDemandConstant.SELF_HELP_REPORT : + res.setReportTypeName("自身上报"); + break; + } + //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + switch(res.getStatus()){ + case UserDemandConstant.PENDING : + res.setStatusName("待处理"); + break; + case UserDemandConstant.CANCELED : + res.setStatusName("已取消"); + break; + case UserDemandConstant.ASSIGNED : + res.setStatusName("已指派"); + break; + case UserDemandConstant.HAVE_ORDER : + res.setStatusName("已接单"); + break; + case UserDemandConstant.FINISHED : + res.setStatusName("已完成"); + break; + } + //服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + switch(res.getServiceType()){ + case UserDemandConstant.VOLUNTEER : + res.setServiceShowName(res.getServiceName().concat("(志愿者)")); + break; + case UserDemandConstant.SOCIAL_ORG : + res.setServiceShowName(res.getServiceName().concat("(社会组织)")); + break; + case UserDemandConstant.COMMUNITY_ORG : + res.setServiceShowName(res.getServiceName().concat("(社区自组织")); + break; + case UserDemandConstant.PARTY_UNIT : + res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)")); + break; + } + } } return new PageData<>(list, pageInfo.getTotal()); } @@ -197,7 +311,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 90a203098b..c7126c7070 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -37,20 +37,28 @@ + SELECT + ar.APPOINTMENT_NAME, + ar.APPOINTMENT_PHONE, + ar.REMARK, + ar.TIME_ID, + cm.MATTER_NAME + FROM ic_matter_appointment_record ar + LEFT JOIN ic_party_service_center_matter cm ON (cm.ID = ar.MATTER_ID AND cm.DEL_FLAG = 0) + WHERE ar.DEL_FLAG = 0 + AND ar.MATTER_ID = #{matterId} + AND ar.APPOINTMENT_DATE = #{date} + AND ar.`STATUS` = 'appointing' + \ No newline at end of file From 706f12873ce87fd9895028b8ff66570c5be94814 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 23 Nov 2021 14:59:49 +0800 Subject: [PATCH 05/10] emm --- .../commons/tools/exception/EpmetErrorCode.java | 3 +++ .../impl/IcPartyServiceCenterServiceImpl.java | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index ff22940cb5..f7bef02d54 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -149,6 +149,9 @@ public enum EpmetErrorCode { // 删除可预约事项存在预约记录时提示 MATTER_EXISTS_APPOINTMENT_ERROR(8526, "尚有未履行的预约存在,请确认后操作"), + // 预约某事项在某时间段存在记录时 + APPOINTMENT_TIME_ERROR(8527, "该时间段已被预约,请选择其他时间段"), + // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java index 03344c2a5e..382e65c112 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -231,8 +231,21 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl l = new LambdaQueryWrapper<>(); + l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) + .eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getAppointmentDate()) + .eq(IcMatterAppointmentRecordEntity::getStatus,PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING) + .eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO); + List records = matterAppointmentRecordDao.selectList(l); + if (CollectionUtils.isNotEmpty(records)){ + List timeIds = new ArrayList<>(); + records.forEach(r -> { + timeIds.addAll(Arrays.asList(r.getTimeId().split(","))); + }); + if (timeIds.retainAll(Arrays.asList(formDTO.getTimeId().split(",")))){ + throw new RenException(EpmetErrorCode.APPOINTMENT_TIME_ERROR.getCode()); + } + } CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); if (null == staffInfo){ throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); From fa7191126705c87ef93469bc779045d76ab06d38 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Nov 2021 15:33:56 +0800 Subject: [PATCH 06/10] ceshi xia --- .../commons/tools/exception/EpmetErrorCode.java | 1 + .../epmet/dto/form/demand/DemandAddFromDTO.java | 4 ++-- .../dto/result/demand/DemandRecResultDTO.java | 1 + .../controller/IcUserDemandRecController.java | 4 ++++ .../impl/IcResiDemandDictServiceImpl.java | 3 +++ .../impl/IcUserDemandRecServiceImpl.java | 17 +++++++++++------ .../resources/mapper/IcUserDemandRecDao.xml | 11 +++++++---- 7 files changed, 29 insertions(+), 12 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index ff22940cb5..1b0c172046 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -89,6 +89,7 @@ public enum EpmetErrorCode { DEMAND_FINISHED(8222,"需求已完成"), DEMAND_CAN_NOT_UPDATE(8223,"当前状态,不可更新需求"), DEMAND_NOT_EXITS(8224,"需求不存在"), + DEMAND_SERVICE_NOT_EXITS(8225,"服务记录不存在"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java index 6f968aad8a..f3a1c9ae0c 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java @@ -52,13 +52,13 @@ public class DemandAddFromDTO implements Serializable { /** * 二级需求分类编码 */ - @NotBlank(message = "需求类型不能为空",groups = AddUserShowGroup.class) + @NotBlank(message = "需求类别不能为空",groups = AddUserShowGroup.class) private String categoryCode; /** * 父级需求分类编码 */ - @NotBlank(message = "需求类型不能为空",groups = AddUserShowGroup.class) + @NotBlank(message = "需求类别不能为空",groups = AddUserShowGroup.class) private String parentCode; /** diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java index 85b3b7342e..fd606dc31f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java @@ -69,6 +69,7 @@ public class DemandRecResultDTO implements Serializable { /** 服务情况********************************************************************/ /** 服务情况********************************************************************/ /** 服务情况********************************************************************/ + private String serviceId; /** * 志愿者的姓名 * 社会组织名 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 5bd3a3d2a8..bc517fc654 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -27,6 +27,7 @@ import com.epmet.dto.form.demand.*; import com.epmet.dto.result.demand.DemandRecResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.service.*; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -42,6 +43,7 @@ import java.util.List; * @author generator generator@elink-cn.com * @since v1.0.0 2021-11-19 */ +@Slf4j @RestController @RequestMapping("userdemand") public class IcUserDemandRecController { @@ -94,6 +96,7 @@ public class IcUserDemandRecController { @PostMapping("add") public Result add(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){ fromDTO.setCustomerId(tokenDto.getCustomerId()); + fromDTO.setCurrentUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.AddUserShowGroup.class); return new Result().ok(icUserDemandRecService.add(fromDTO)); } @@ -109,6 +112,7 @@ public class IcUserDemandRecController { @PostMapping("update") public Result update(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){ fromDTO.setCustomerId(tokenDto.getCustomerId()); + fromDTO.setCurrentUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.UpdateInternalGroup.class,DemandAddFromDTO.AddUserShowGroup.class); return new Result().ok(icUserDemandRecService.update(fromDTO)); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java index 98830181ae..4fd9a2b193 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java @@ -97,6 +97,9 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl NumConstant.ZERO) { // 名称唯一 throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index d0b1d60a1a..6b2e6de95d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -229,13 +229,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList()); - Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); - if(CollectionUtils.isEmpty(userIdList)||!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ - throw new RenException("查询志愿者信息异常"); + Map userInfoMap=new HashMap<>(); + List userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(userIdList)){ + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ + throw new RenException("查询志愿者信息异常"); + } + userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); } - Map userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); - for(DemandRecResultDTO res:list){ if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); @@ -416,6 +418,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl AND DATE_FORMAT(r.WANT_SERVICE_TIME,'%Y-%m-%d') #{wantServiceEndDate} + order by r.WANT_SERVICE_TIME desc,r.CREATED_TIME asc \ No newline at end of file From 75d366a4798f379e256418e8317df792a38b403e Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 23 Nov 2021 16:00:38 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=92=8C=E6=B4=BB=E5=8A=A8=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/PartyUnitFormDTO.java | 1 + .../controller/IcPartyActivityController.java | 21 +++++-- .../controller/IcPartyUnitController.java | 27 +++++++-- .../com/epmet/excel/IcPartyActivityExcel.java | 58 ++----------------- .../com/epmet/excel/IcPartyUnitExcel.java | 53 ++--------------- .../epmet/service/IcPartyActivityService.java | 5 +- .../com/epmet/service/IcPartyUnitService.java | 5 +- .../impl/IcPartyActivityServiceImpl.java | 23 +++++++- .../service/impl/IcPartyUnitServiceImpl.java | 45 +++++++++++--- 9 files changed, 112 insertions(+), 126 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java index 683cee2803..cf7841d93e 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java @@ -15,6 +15,7 @@ import java.io.Serializable; public class PartyUnitFormDTO implements Serializable { private static final long serialVersionUID = 1256798619648265622L; + private String customerId; private String agencyId; private String unitName; private String serviceMatter; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java index 85fb59ec7b..05c8e2d10a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java @@ -32,7 +32,8 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; -import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; /** @@ -75,9 +76,19 @@ public class IcPartyActivityController { } @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = icPartyActivityService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, IcPartyActivityExcel.class); + public void export(@RequestBody PartyActivityFormDTO formDTO, HttpServletResponse response) throws Exception { + List list = icPartyActivityService.list(formDTO); + AtomicInteger i = new AtomicInteger(0); + List excelList = list.stream().map(item -> { + IcPartyActivityExcel excel = new IcPartyActivityExcel(); + excel.setIndex(i.getAndIncrement()); + excel.setUnitName(item.getUnitName()); + excel.setTitle(item.getTitle()); + excel.setAddress(item.getAddress()); + excel.setPeopleCount(item.getPeopleCount()); + excel.setActivityTime(item.getActivityTime()); + return excel; + }).collect(Collectors.toList()); + ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyActivityExcel.class); } - } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index 3a8fcf0142..1daacc73c7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -37,7 +37,8 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; -import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; /** @@ -54,7 +55,8 @@ public class IcPartyUnitController { private IcPartyUnitService icPartyUnitService; @PostMapping("list") - public Result> search(@RequestBody PartyUnitFormDTO formDTO){ + public Result> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); PageData page = icPartyUnitService.search(formDTO); return new Result>().ok(page); } @@ -83,9 +85,24 @@ public class IcPartyUnitController { } @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = icPartyUnitService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, IcPartyUnitExcel.class); + public void export(@RequestBody PartyUnitFormDTO formDTO, HttpServletResponse response) throws Exception { + List list = icPartyUnitService.list(formDTO); + AtomicInteger i = new AtomicInteger(0); + List excelList = list.stream().map(item -> { + IcPartyUnitExcel excel = new IcPartyUnitExcel(); + excel.setIndex(i.getAndIncrement()); + excel.setUnitName(item.getUnitName()); + excel.setContact(item.getContact()); + excel.setContactMobile(item.getContactMobile()); + excel.setType(item.getType()); + excel.setMemberCount(item.getMemberCount()); + excel.setRemark(item.getRemark()); + excel.setSatisfaction(item.getSatisfaction()); + excel.setServiceMatter(String.join(String.valueOf((char)10), item.getServiceMatterList())); + return excel; + }).collect(Collectors.toList()); + + ExcelUtils.exportExcelToTarget(response, null, excelList, IcPartyUnitExcel.class); } /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java index 4dd9c4d87c..f2b54f5a36 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyActivityExcel.java @@ -31,32 +31,17 @@ import java.util.Date; @Data public class IcPartyActivityExcel { - @Excel(name = "主键") - private String id; + @Excel(name = "序号") + private Integer index; - @Excel(name = "客户id") - private String customerId; - - @Excel(name = "组织ID") - private String agencyId; - - @Excel(name = "组织的所有上级") - private String pids; - - @Excel(name = "单位ID") - private String unitId; - - @Excel(name = "服务事项") - private String serviceMatter; + @Excel(name = "单位名称") + private String unitName; @Excel(name = "活动标题") private String title; - @Excel(name = "活动目标") - private String target; - - @Excel(name = "活动内容") - private String content; + @Excel(name = "活动地址") + private String address; @Excel(name = "服务人数") private Integer peopleCount; @@ -64,35 +49,4 @@ public class IcPartyActivityExcel { @Excel(name = "活动时间") private Date activityTime; - @Excel(name = "活动地址") - private String address; - - @Excel(name = "活动地址经度") - private String longitude; - - @Excel(name = "活动地址纬度") - private String latitude; - - @Excel(name = "活动结果") - private String result; - - @Excel(name = "删除标识 0未删除、1已删除") - private String delFlag; - - @Excel(name = "乐观锁") - private Integer revision; - - @Excel(name = "创建人") - private String createdBy; - - @Excel(name = "创建时间") - private Date createdTime; - - @Excel(name = "更新人") - private String updatedBy; - - @Excel(name = "更新时间") - private Date updatedTime; - - } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java index ace9eff6b0..652542ef62 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcPartyUnitExcel.java @@ -20,8 +20,6 @@ package com.epmet.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import lombok.Data; -import java.util.Date; - /** * 联建单位 * @@ -31,28 +29,16 @@ import java.util.Date; @Data public class IcPartyUnitExcel { - @Excel(name = "主键") - private String id; - - @Excel(name = "客户id") - private String customerId; - - @Excel(name = "组织ID") - private String agencyId; - - @Excel(name = "网格ID") - private String gridId; - - @Excel(name = "") - private String pids; + @Excel(name = "序号") + private Integer index; @Excel(name = "单位名称") private String unitName; - @Excel(name = "分类 楼宇党建 两新组织 区域单位党建 机关直属部门 其他") + @Excel(name = "分类") private String type; - @Excel(name = "服务事项 多选逗号隔开") + @Excel(name = "服务事项") private String serviceMatter; @Excel(name = "联系人") @@ -61,41 +47,12 @@ public class IcPartyUnitExcel { @Excel(name = "联系电话") private String contactMobile; - @Excel(name = "在职党员数") + @Excel(name = "在职党员") private Integer memberCount; - @Excel(name = "地址") - private String address; - - @Excel(name = "中心位置经度") - private String longitude; - - @Excel(name = "中心位置纬度") - private String latitude; - @Excel(name = "群众满意度") private String satisfaction; @Excel(name = "备注") private String remark; - - @Excel(name = "删除标识 0未删除、1已删除") - private String delFlag; - - @Excel(name = "乐观锁") - private Integer revision; - - @Excel(name = "创建人") - private String createdBy; - - @Excel(name = "创建时间") - private Date createdTime; - - @Excel(name = "更新人") - private String updatedBy; - - @Excel(name = "更新时间") - private Date updatedTime; - - } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java index def86c6c60..322201808e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java @@ -24,7 +24,6 @@ import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.entity.IcPartyActivityEntity; import java.util.List; -import java.util.Map; /** * 联建活动 @@ -47,12 +46,12 @@ public interface IcPartyActivityService extends BaseService * @author generator * @date 2021-11-19 */ - List list(Map params); + List list(PartyActivityFormDTO formDTO); /** * 单条查询 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java index de50d62319..c0bde53fb9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java @@ -26,7 +26,6 @@ import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyUnitEntity; import java.util.List; -import java.util.Map; /** * 联建单位 @@ -49,12 +48,12 @@ public interface IcPartyUnitService extends BaseService { /** * 默认查询 * - * @param params + * @param formDTO * @return java.util.List * @author generator * @date 2021-11-19 */ - List list(Map params); + List list(PartyUnitFormDTO formDTO); /** * 单条查询 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index bbf89dc290..2d3c6c81b2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -83,10 +83,27 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); + public List list(PartyActivityFormDTO formDTO) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcPartyActivityEntity::getUnitId, formDTO.getUnitId()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.like(StringUtils.isNotBlank(formDTO.getTitle()), IcPartyActivityEntity::getTitle, formDTO.getTitle()); + wrapper.between(IcPartyActivityEntity::getActivityTime, formDTO.getStartTime(), formDTO.getEndTime()); + wrapper.orderByDesc(IcPartyActivityEntity::getUpdatedTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); + + IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); + unitDTO.setAgencyId(formDTO.getAgencyId()); + if (CollectionUtils.isNotEmpty(dtoList)) { + Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(dto -> { + dto.setUnitName(option.get(dto.getUnitId())); + }); + } - return ConvertUtils.sourceToTarget(entityList, IcPartyActivityDTO.class); + return dtoList; } private QueryWrapper getWrapper(Map params){ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 7de26379e3..4c28cbbe90 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -33,16 +33,17 @@ import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.PartyUnitFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyUnitEntity; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.service.IcPartyUnitService; +import com.epmet.service.IcResiDemandDictService; import com.epmet.service.IcUserDemandRecService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -61,8 +62,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(formDTO.getCustomerId()); + codeFormDTO.setParentCategoryCode("1010"); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); dtoList.forEach(item -> { item.setType(unitTypeMap.getData().get(item.getType())); - //TODO 服务事项 if (StringUtils.isNotBlank(item.getServiceMatter())) { List matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA)); + item.setServiceMatterList(matters.stream().map(categoryMap::get).collect(Collectors.toList())); + } else { + item.setServiceMatterList(new ArrayList<>()); } }); PageInfo pageInfo = new PageInfo<>(dtoList); @@ -91,10 +100,32 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, IcPartyUnitDTO.class); + public List list(PartyUnitFormDTO formDTO) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyUnitEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.like(StringUtils.isNotBlank(formDTO.getUnitName()), IcPartyUnitEntity::getUnitName, formDTO.getUnitName()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, formDTO.getServiceMatter()); + wrapper.eq(StringUtils.isNotBlank(formDTO.getType()), IcPartyUnitEntity::getType, formDTO.getType()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContact()), IcPartyUnitEntity::getContact, formDTO.getContact()); + wrapper.like(StringUtils.isNotBlank(formDTO.getContactMobile()), IcPartyUnitEntity::getContactMobile, formDTO.getContactMobile()); + wrapper.orderByDesc(IcPartyUnitEntity::getUpdatedTime); + List list = baseDao.selectList(wrapper); + List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); + codeFormDTO.setCustomerId(formDTO.getCustomerId()); + codeFormDTO.setParentCategoryCode("1010"); + Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(item -> { + item.setType(unitTypeMap.getData().get(item.getType())); + if (StringUtils.isNotBlank(item.getServiceMatter())) { + List matters = Arrays.asList(item.getServiceMatter().split(StrConstant.COMMA)); + item.setServiceMatterList(matters.stream().map(categoryMap::get).collect(Collectors.toList())); + } else { + item.setServiceMatterList(new ArrayList<>()); + } + }); + return dtoList; } private QueryWrapper getWrapper(Map params){ From 1a80dc2dbfe3fbafa80b91e81caca2fc1b47baab Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 23 Nov 2021 16:27:41 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 2 ++ .../form/EditPartyServiceCenterFormDTO.java | 7 ++++- .../AppointmentExistRecordResultDTO.java | 28 +++++++++++++++++++ .../dao/IcMatterAppointmentRecordDao.java | 9 ++++++ .../impl/IcPartyServiceCenterServiceImpl.java | 19 ++++++++++++- .../mapper/IcMatterAppointmentRecordDao.xml | 16 +++++++++++ 6 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 9035d81861..c65750548c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -153,6 +153,8 @@ public enum EpmetErrorCode { // 预约某事项在某时间段存在记录时 APPOINTMENT_TIME_ERROR(8527, "该时间段已被预约,请选择其他时间段"), + APPOINTMENT_ERROR(8528, "%s尚有未履行的预约存在,请确认后操作"), + // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java index 1bdb9886c3..d292fa6ae2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPartyServiceCenterFormDTO.java @@ -80,7 +80,12 @@ public class EditPartyServiceCenterFormDTO implements Serializable { private String partyServiceCenterId; /** - * 可预约事项 + * 新增的可预约事项 */ private List matterList; + + /** + * 要删除的事项 + */ + private List delMatterList; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java new file mode 100644 index 0000000000..ffb4d74c20 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentExistRecordResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/23 10:45 上午 + * @DESC + */ +@Data +public class AppointmentExistRecordResultDTO implements Serializable { + + private static final long serialVersionUID = 6651436509788141940L; + + /** + * 事项名 + */ + private String matterName; + + private String matterId; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java index f8c02d5429..f349032024 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.AppointmentExistRecordResultDTO; import com.epmet.dto.result.AppointmentRecordResultDTO; import com.epmet.entity.IcMatterAppointmentRecordEntity; import org.apache.ibatis.annotations.Mapper; @@ -43,4 +44,12 @@ public interface IcMatterAppointmentRecordDao extends BaseDao appointmentRecord(@Param("matterId")String matterId,@Param("date")String date); + /** + * @Description 查询事项是不是存在预约记录 + * @param matterIds + * @author zxc + * @date 2021/11/23 3:48 下午 + */ + List appointmentExistRecord(@Param("matterIds")List matterIds); + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java index 382e65c112..6fd12822f0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -39,6 +39,7 @@ import com.epmet.dao.IcPartyServiceCenterDao; import com.epmet.dto.IcPartyServiceCenterDTO; import com.epmet.dto.TimeDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.AppointmentExistRecordResultDTO; import com.epmet.dto.result.AppointmentRecordResultDTO; import com.epmet.dto.result.AppointmentTimeResultDTO; import com.epmet.dto.result.PartyServiceCenterListResultDTO; @@ -200,6 +201,22 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl delMatterList = formDTO.getDelMatterList(); + List existRecord = matterAppointmentRecordDao.appointmentExistRecord(delMatterList); + if (CollectionUtils.isNotEmpty(existRecord)){ + StringBuffer sb = new StringBuffer(); + existRecord.forEach(e -> { + sb.append(e.getMatterName()).append(","); + }); + String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE); + EpmetErrorCode.APPOINTMENT_ERROR.setMsg(String.format(EpmetErrorCode.APPOINTMENT_ERROR.getMsg(),copywriter)); + throw new RenException(EpmetErrorCode.APPOINTMENT_ERROR.getCode()); + }else { + matterService.deleteBatchIds(delMatterList); + } + } } /** @@ -242,7 +259,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl { timeIds.addAll(Arrays.asList(r.getTimeId().split(","))); }); - if (timeIds.retainAll(Arrays.asList(formDTO.getTimeId().split(",")))){ + if (timeIds.containsAll(Arrays.asList(formDTO.getTimeId().split(",")))){ throw new RenException(EpmetErrorCode.APPOINTMENT_TIME_ERROR.getCode()); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml index c77ebceca6..0cdf818653 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml @@ -18,4 +18,20 @@ AND ar.APPOINTMENT_DATE = #{date} AND ar.`STATUS` = 'appointing' + + + \ No newline at end of file From 21a6d87dd5e154f109cb1e0689559f6cb33008a6 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 23 Nov 2021 17:08:26 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/AddPlacePatrolTeamFormDTO.java | 4 ++-- .../dto/form/EditPlacePatrolTeamFormDTO.java | 7 ++++++- ...GetListPlacePatrolReviewRecordFormDTO.java | 2 +- .../IcPlacePatrolTeamController.java | 3 ++- .../epmet/dao/IcPlacePatrolTeamStaffDao.java | 6 ++++++ .../service/IcPlacePatrolTeamService.java | 2 +- .../IcPlacePatrolTeamStaffService.java | 6 ++++++ .../impl/IcPlacePatrolRecordServiceImpl.java | 21 ++++++++++++++++--- .../IcPlacePatrolReviewRecordServiceImpl.java | 4 ++-- .../impl/IcPlacePatrolTeamServiceImpl.java | 11 +++++----- .../IcPlacePatrolTeamStaffServiceImpl.java | 13 ++++++++++++ .../main/resources/mapper/IcPlaceOrgDao.xml | 6 +++--- .../mapper/IcPlacePatrolRecordDao.xml | 10 +++++---- .../resources/mapper/IcPlacePatrolTeamDao.xml | 6 +++--- .../mapper/IcPlacePatrolTeamStaffDao.xml | 11 ++++++++++ 15 files changed, 86 insertions(+), 26 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java index b4767e0315..a0ece62eb1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java @@ -106,7 +106,7 @@ public class AddPlacePatrolTeamFormDTO implements Serializable { * 分队成员信息 */ @Valid - @NotEmpty(message = "成员列表不能为空") + @NotEmpty(message = "成员列表不能为空", groups = {Add.class}) private List memberList; //token中userId @@ -115,7 +115,7 @@ public class AddPlacePatrolTeamFormDTO implements Serializable { public interface Add { } @Data - public class Member { + public static class Member { //姓名 private String name; //联系电话 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java index 8036d2dd12..4509c6f443 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java @@ -35,6 +35,11 @@ import java.util.List; public class EditPlacePatrolTeamFormDTO implements Serializable { private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; /** * 分队Id */ @@ -99,7 +104,7 @@ public class EditPlacePatrolTeamFormDTO implements Serializable { } @Data - public class Member { + public static class Member { //姓名 private String name; //联系电话 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java index 596bad17d4..225962bb89 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java @@ -32,9 +32,9 @@ import java.io.Serializable; public class GetListPlacePatrolReviewRecordFormDTO implements Serializable { private static final long serialVersionUID = 1L; //巡查记录Id + @NotBlank(message = "巡查记录Id不能为空", groups = {GetData.class}) private String placePatrolRecordId; //复查记录Id - @NotBlank(message = "复查记录Id不能为空", groups = {GetData.class}) private String placePatrolReviewRecordId; //页码 @Min(1) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java index 6d62a5f951..815505c2e9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java @@ -68,6 +68,7 @@ public class IcPlacePatrolTeamController { @PostMapping("edit") public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Edit.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); placePatrolTeamService.edit(formDTO); return new Result(); } @@ -79,7 +80,7 @@ public class IcPlacePatrolTeamController { @PostMapping("del") public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Del.class); - placePatrolTeamService.del(formDTO.getTeamId()); + placePatrolTeamService.del(tokenDto.getUserId(), formDTO.getTeamId()); return new Result(); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java index 56dee8582f..8f8df8c9dd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java @@ -51,4 +51,10 @@ public interface IcPlacePatrolTeamStaffDao extends BaseDao selectByTeamIds(@Param("teamIds") List teamIds); + + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + int upByTeamId(@Param("staffId") String staffId, @Param("teamId") String teamId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java index 2c17403e80..6ec9cf1a96 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java @@ -49,7 +49,7 @@ public interface IcPlacePatrolTeamService extends BaseService getList(String teamId); + + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + void upByTeamId(String staffId, String teamId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java index ab8d20776f..7cbc07b966 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java @@ -112,7 +112,7 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl result = baseDao.getList(dto); @@ -127,12 +127,27 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl teamIds = new ArrayList<>(); + teamIds.add(resultDTO.getPlacePatrolTeamId()); + List teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds); + + //4.封装九小场所、分队成员数据 for (OptionResultDTO n : nineList.getData()){ if(resultDTO.getNinePlaceVal().equals(n.getValue())){ resultDTO.setNinePlaceName(n.getLabel()); } } + //分队成员 + StringBuffer inspectorsNames = new StringBuffer(""); + for (String str : resultDTO.getInspectors().split(",")) { + teamDTOList.forEach(r -> { + if (str.equals(r.getId())) { + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); + } + }); + } + resultDTO.setInspectorsNames(inspectorsNames.toString()); return resultDTO; } @@ -175,7 +190,7 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { - inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName()); + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); } }); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java index ae5463de04..7341c0012a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java @@ -153,7 +153,7 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { - inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName()); + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); } }); } @@ -189,7 +189,7 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { - inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName()); + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); } }); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java index 4a73f3b5e0..c3e5ff7fa5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java @@ -119,6 +119,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl%s", teamId)); } - //2.删除分队成员字表数据 - placePatrolTeamStaffService.delByTeamId(teamId); + //2.逻辑删除分队成员字表数据 + placePatrolTeamStaffService.upByTeamId(staffId, teamId); } /** @@ -174,7 +175,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl { - if (str.equals(r.getGridName())) { + if (str.equals(r.getId())) { gridNames.append("".equals(gridNames) ? r.getGridName() : "," + r.getGridName()); } }); @@ -230,7 +231,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl { - if (str.equals(r.getGridName())) { + if (str.equals(r.getId())) { gridNames.append("".equals(gridNames) ? r.getGridName() : "," + r.getGridName()); } }); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java index f8ca6fc890..8f26db929e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java @@ -48,9 +48,22 @@ public class IcPlacePatrolTeamStaffServiceImpl extends BaseServiceImpl getList(String teamId) { return baseDao.getByTeamId(teamId); } + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + @Override + public void upByTeamId(String staffId, String teamId) { + baseDao.upByTeamId(staffId, teamId); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml index 4d04a72530..27514baefe 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml @@ -8,7 +8,7 @@ a.id placeOrgId, a.grid_id gridId, b.grid_name gridName, - a.nine_place_val ninePlaceVale, + a.nine_place_val ninePlaceVal, a.place_org_name placeOrgName, a.address address, a.scale scale, @@ -28,8 +28,8 @@ AND a.grid_id = #{gridId} - - AND a.nine_place_val = #{ninePlacsVal} + + AND a.nine_place_val = #{ninePlaceVal} AND a.place_org_name LIKE CONCAT('%', #{placeOrgName}, '%') diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml index efde00da1e..597a62e186 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml @@ -13,7 +13,7 @@ c.place_org_name placeOrgName, a.place_patrol_team_id placePatrolTeamId, d.team_name placePatrolTeamName, - a.nine_placs_val ninePlaceVal, + a.nine_place_val ninePlaceVal, a.inspectors inspectors, a.first_time firstTime, a.first_result firstResult, @@ -28,15 +28,17 @@ LEFT JOIN ic_place_patrol_team d ON a.place_patrol_team_id = d.id WHERE a.del_flag = '0' - AND a.customer_id = '' + + AND a.id = #{placePatrolRecordId} + AND a.customer_id = #{customerId} AND a.grid_id = #{gridId} - - AND a.nine_place_val = #{ninePlacsVal} + + AND a.nine_place_val = #{ninePlaceVal} AND a.place_org_id IN (select id from ic_place_org where place_org_name like concat('%', #{placeOrgName}, '%')) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml index 99bbcb7886..a218d4f050 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml @@ -6,7 +6,7 @@ - + @@ -30,8 +30,8 @@ AND grid_ids LIKE CONCAT('%', #{gridId}, '%') - - AND nine_placs_vals LIKE CONCAT('%', #{ninePlacsVal}, '%') + + AND nine_place_vals LIKE CONCAT('%', #{ninePlaceVal}, '%') AND person_in_charge LIKE CONCAT('%', #{personInCharge}, '%') diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml index 7dddc8e731..06d8285f21 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml @@ -36,4 +36,15 @@ place_patrol_team_id ASC + + UPDATE + ic_place_patrol_team_staff + SET + del_flag = '1', + updated_by = #{staffId}, + updated_time = NOW() + WHERE + place_patrol_team_id = #{teamId} + + \ No newline at end of file From 212f8eacb4a7d16c4a1041e222c100bbba575dda Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 23 Nov 2021 17:47:31 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E7=BB=B4=E5=BA=A6=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=A0=B9=E4=B9=8B=E5=89=8D=E4=B8=80?= =?UTF-8?q?=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcSocietyOrgDTO.java | 2 +- .../src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java | 2 +- .../src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java | 2 +- .../java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java | 2 +- .../main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java | 2 +- .../src/main/java/com/epmet/entity/IcSocietyOrgEntity.java | 2 +- .../src/main/java/com/epmet/excel/IcSocietyOrgExcel.java | 2 +- .../src/main/resources/mapper/IcSocietyOrgDao.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java index 36ffcbe8a0..898b01df9d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java @@ -101,7 +101,7 @@ public class IcSocietyOrgDTO implements Serializable { /** * 维度 */ - private String dimension; + private String latitude; /** * 备注 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java index c839c78a78..a1a12c71e6 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java @@ -96,7 +96,7 @@ public class AddSocietyOrgFormDTO implements Serializable { /** * 维度 */ - private String dimension; + private String latitude; //token中userId private String staffId; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java index 83c1523800..2acad633c0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java @@ -85,7 +85,7 @@ public class EditSocietyOrgFormDTO implements Serializable { /** * 维度 */ - private String dimension; + private String latitude; //token中userId private String staffId; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java index a7139bdc1d..376078ab10 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java @@ -67,7 +67,7 @@ public class GetListSocietyOrgResultDTO implements Serializable { //经度 private String longitude; //维度 - private String dimension; + private String latitude; } } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java index 30b23d3ed6..277238e78d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java @@ -56,6 +56,6 @@ public class SocietyOrgListResultDTO implements Serializable { //经度 private String longitude; //维度 - private String dimension; + private String latitude; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java index 3c564349cb..569156783f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java @@ -101,7 +101,7 @@ public class IcSocietyOrgEntity extends BaseEpmetEntity { /** * 维度 */ - private String dimension; + private String latitude; /** * 备注 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java index 4d9089fa35..5f3d464dfb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java @@ -71,7 +71,7 @@ public class IcSocietyOrgExcel { private String longitude; @Excel(name = "维度") - private String dimension; + private String latitude; @Excel(name = "备注") private String remarks; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml index 4c91e2e3e7..a4685af4ce 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml @@ -16,7 +16,7 @@ admin_staff_id adminStaffId, address address, longitude longitude, - dimension dimension + latitude latitude FROM ic_society_org WHERE