Browse Source

Merge remote-tracking branch 'origin/dev_bugfix_ljj'

feature/teamB_zz_wgh
yinzuomei 3 years ago
parent
commit
0200fcd5de
  1. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java
  2. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java
  3. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  4. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  5. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  6. 17
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  7. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  8. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml
  9. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml
  10. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java

@ -73,4 +73,6 @@ public interface IcCommunitySelfOrganizationDao extends BaseDao<IcCommunitySelfO
List<CommunitySelfOrganizationListDTO> queryCategoryList(CategorySelfOrgFormDTO formDTO); List<CommunitySelfOrganizationListDTO> queryCategoryList(CategorySelfOrgFormDTO formDTO);
List<CommunitySelfOrganizationListDTO> queryCoordinateList(CategorySelfOrgFormDTO formDTO); List<CommunitySelfOrganizationListDTO> queryCoordinateList(CategorySelfOrgFormDTO formDTO);
List<IcCommunitySelfOrganizationEntity> selectByIds(@Param("communityOrgIds") List<String> communityOrgIds);
} }

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java

@ -19,7 +19,6 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.dto.form.PartyTypepercentFormDTO;
import com.epmet.dto.form.PartyUnitListbriefFormDTO; import com.epmet.dto.form.PartyUnitListbriefFormDTO;
import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyTypepercentResultDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO;
@ -32,7 +31,6 @@ import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 联建单位 * 联建单位
@ -116,4 +114,6 @@ public interface IcPartyUnitDao extends BaseDao<IcPartyUnitEntity> {
*/ */
List<PartyTypepercentResultDTO> getTypepercent(@Param("agencyId") String agencyId, List<PartyTypepercentResultDTO> getTypepercent(@Param("agencyId") String agencyId,
@Param("customerId") String customerId); @Param("customerId") String customerId);
List<IcPartyUnitEntity> selectByIds(@Param("partyUnitIds") List<String> partyUnitIds);
} }

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java

@ -140,4 +140,11 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
List<ServicePointDTO> getServicePoint(@Param("customerId")String customerId, @Param("serviceType")String serviceType); List<ServicePointDTO> getServicePoint(@Param("customerId")String customerId, @Param("serviceType")String serviceType);
List<DemandRecResultDTO> queryServiceList(ServiceListFormDTO formDTO); List<DemandRecResultDTO> queryServiceList(ServiceListFormDTO formDTO);
/**
* 根据服务方id查询已派单的服务记录数
* @param serverId
* @return
*/
Integer selectCountByServerId(String serverId);
} }

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java

@ -260,4 +260,6 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @Description 事件评价时同步=评价结果到需求 * @Description 事件评价时同步=评价结果到需求
**/ **/
void icEventComment(IcEventCommentToDemandFromDTO formDTO); void icEventComment(IcEventCommentToDemandFromDTO formDTO);
Integer selectCountByServerId(String serverId);
} }

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -182,7 +182,6 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
orgEntity.setCustomerId(customerId); orgEntity.setCustomerId(customerId);
orgEntity.setOrgId(staffInfo.getAgencyId()); orgEntity.setOrgId(staffInfo.getAgencyId());
orgEntity.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY); orgEntity.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY);
orgEntity.setOrganizationCreatedTime(DateUtils.parse(formDTO.getOrganizationCreatedTime(), DATE_PATTERN));
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId());
if (null == agencyInfo){ if (null == agencyInfo){
throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId()));
@ -190,11 +189,13 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
orgEntity.setPid(agencyInfo.getPid()); orgEntity.setPid(agencyInfo.getPid());
orgEntity.setPids(agencyInfo.getPids()); orgEntity.setPids(agencyInfo.getPids());
// 保持时间统一 // 保持时间统一
if (null == formDTO.getOrganizationCreatedTime()){ if (StringUtils.isBlank(formDTO.getOrganizationCreatedTime())){
Date date = new Date(); Date date = new Date();
orgEntity.setOrganizationCreatedTime(date); orgEntity.setOrganizationCreatedTime(date);
orgEntity.setCreatedTime(date); orgEntity.setCreatedTime(date);
orgEntity.setUpdatedTime(date); orgEntity.setUpdatedTime(date);
}else{
orgEntity.setOrganizationCreatedTime(DateUtils.parse(formDTO.getOrganizationCreatedTime(), DATE_PATTERN));
} }
baseDao.insert(orgEntity); baseDao.insert(orgEntity);
if(CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){ if(CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){
@ -362,6 +363,10 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void delCommunitySelfOrganization(DelCommunitySelfOrganizationFormDTO formDTO) { public void delCommunitySelfOrganization(DelCommunitySelfOrganizationFormDTO formDTO) {
//存在未完成的需求,不能删除
if (icUserDemandRecDao.selectCountByServerId(formDTO.getOrgId()) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除");
}
baseDao.deleteById(formDTO.getOrgId()); baseDao.deleteById(formDTO.getOrgId());
personnelService.deleteByOrgId(formDTO.getOrgId()); personnelService.deleteByOrgId(formDTO.getOrgId());
} }
@ -703,7 +708,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
@Override @Override
public List<IcCommunitySelfOrganizationEntity> queryListById(List<String> communityOrgIds) { public List<IcCommunitySelfOrganizationEntity> queryListById(List<String> communityOrgIds) {
if(CollectionUtils.isNotEmpty(communityOrgIds)){ if(CollectionUtils.isNotEmpty(communityOrgIds)){
return baseDao.selectBatchIds(communityOrgIds); return baseDao.selectByIds(communityOrgIds);
} }
return Collections.EMPTY_LIST; return Collections.EMPTY_LIST;
} }

17
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -41,7 +41,6 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
@ -51,17 +50,9 @@ import com.epmet.constant.UserDemandConstant;
import com.epmet.constants.ImportTaskConstants; import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPartyUnitDao; import com.epmet.dao.IcPartyUnitDao;
import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.PartyUnitListFormDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.*;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.PartyUnitListResultDTO;
import com.epmet.dto.result.PartyUnitListbrieResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.dto.result.demand.ServiceStatDTO;
import com.epmet.entity.IcPartyUnitEntity; import com.epmet.entity.IcPartyUnitEntity;
@ -242,6 +233,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void delete(String id) { public void delete(String id) {
//存在未完成的需求,不能删除
if (icUserDemandRecService.selectCountByServerId(id) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除");
}
// 逻辑删除(@TableLogic 注解) // 逻辑删除(@TableLogic 注解)
baseDao.deleteById(id); baseDao.deleteById(id);
} }
@ -599,7 +594,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Override @Override
public List<IcPartyUnitEntity> queryListById(List<String> partyUnitIds) { public List<IcPartyUnitEntity> queryListById(List<String> partyUnitIds) {
if (CollectionUtils.isNotEmpty(partyUnitIds)) { if (CollectionUtils.isNotEmpty(partyUnitIds)) {
return baseDao.selectBatchIds(partyUnitIds); return baseDao.selectByIds(partyUnitIds);
} }
return Collections.EMPTY_LIST; return Collections.EMPTY_LIST;
} }

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -1810,6 +1810,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
baseDao.updateById(entity); baseDao.updateById(entity);
} }
@Override
public Integer selectCountByServerId(String serverId) {
return baseDao.selectCountByServerId(serverId);
}
} }

9
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml

@ -178,4 +178,13 @@
</if> </if>
ORDER BY so.ORG_ID ASC,so.ORGANIZATION_CREATED_TIME DESC ORDER BY so.ORG_ID ASC,so.ORGANIZATION_CREATED_TIME DESC
</select> </select>
<select id="selectByIds" parameterType="map" resultType="com.epmet.entity.IcCommunitySelfOrganizationEntity">
select c.* from ic_community_self_organization c
where c.ID IN (
<foreach collection="communityOrgIds" item="communityOrgId" separator=",">
#{communityOrgId}
</foreach>
)
</select>
</mapper> </mapper>

10
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml

@ -183,4 +183,14 @@
where del_flag='0' where del_flag='0'
and id=#{partyUnitId} and id=#{partyUnitId}
</update> </update>
<select id="selectByIds" parameterType="map" resultType="com.epmet.entity.IcPartyUnitEntity">
select u.*
from ic_party_unit u
where u.ID IN (
<foreach collection="partyUnitIds" item="partyUnitId" separator=",">
#{partyUnitId}
</foreach>
)
</select>
</mapper> </mapper>

13
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -665,4 +665,17 @@
</foreach> </foreach>
order by r.REPORT_TIME desc order by r.REPORT_TIME desc
</select> </select>
<select id="selectCountByServerId" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT
count( s.ID ) as total
FROM
ic_user_demand_service s
INNER JOIN ic_user_demand_rec r ON ( s.DEMAND_REC_ID = r.ID )
WHERE
s.DEL_FLAG = '0'
AND r.DEL_FLAG = '0'
AND s.SERVER_ID = #{serverId}
AND r.`STATUS` = 'assigned'
</select>
</mapper> </mapper>

Loading…
Cancel
Save