Browse Source

Merge branch 'master' of http://121.42.41.42:7070/r/epmet-cloud into yantai_zhengwu_master

dev
yinzuomei 3 years ago
parent
commit
7e3f9eb03c
  1. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java
  2. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPublicServiceOrgServiceImpl.java
  3. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgDao.xml

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import lombok.extern.slf4j.Slf4j;
@ -57,7 +58,8 @@ public class NoRepeatSubmitAop {
//因为getLock如果获取失败抛异常 所以不做锁状态的判断
}
} catch (Exception e) {
log.warn("noRepeatSubmit key:{},msg:{}", key, e.getMessage());
String error = ExceptionUtils.getErrorStackTrace(e);
log.warn("noRepeatSubmit key:{},msg:{}", key, error);
//"未获取到锁,重复提交了
throw new RenException(EpmetErrorCode.REPEAT_SUBMIT.getCode());
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPublicServiceOrgServiceImpl.java

@ -89,11 +89,11 @@ public class IcPublicServiceOrgServiceImpl extends BaseServiceImpl<IcPublicServi
checkUnqiueName(formDTO.getName(),formDTO.getAgencyId(),formDTO.getId());
IcPublicServiceOrgEntity entity=ConvertUtils.sourceToTarget(formDTO,IcPublicServiceOrgEntity.class);
baseDao.updateById(entity);
//先删除
LambdaQueryWrapper<IcPublicServiceOrgServiceMatterEntity> deleteWrapper=new LambdaQueryWrapper<>();
deleteWrapper.eq(IcPublicServiceOrgServiceMatterEntity::getOrgId,formDTO.getId());
icPublicServiceOrgServiceMatterDao.delete(deleteWrapper);
if(CollectionUtils.isNotEmpty(formDTO.getServiceMatterList())){
//先删除
LambdaQueryWrapper<IcPublicServiceOrgServiceMatterEntity> deleteWrapper=new LambdaQueryWrapper<>();
deleteWrapper.eq(IcPublicServiceOrgServiceMatterEntity::getOrgId,formDTO.getId());
icPublicServiceOrgServiceMatterDao.delete(deleteWrapper);
formDTO.getServiceMatterList().forEach(dto->{
IcPublicServiceOrgServiceMatterEntity serviceOrgServiceMatterEntity=ConvertUtils.sourceToTarget(dto,IcPublicServiceOrgServiceMatterEntity.class);
serviceOrgServiceMatterEntity.setOrgId(entity.getId());

15
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgDao.xml

@ -33,26 +33,21 @@
<result property="contact" column="CONTACT"/>
<result property="contactMobile" column="CONTACT_MOBILE"/>
<result property="remark" column="REMARK"/>
<collection property="serviceMatterList" ofType="com.epmet.dto.IcPublicServiceOrgServiceMatterDTO" >
<result property="categoryId" column="CATEGORY_ID"/>
<result property="categoryCode" column="CATEGORY_CODE"/>
<result property="categoryName" column="CATEGORY_NAME"/>
<collection property="serviceMatterList" ofType="com.epmet.dto.IcPublicServiceOrgServiceMatterDTO"
select="com.epmet.dao.IcPublicServiceOrgServiceMatterDao.selectServiceMatter" column="ID">
</collection>
</resultMap>
<select id="pageList" parameterType="com.epmet.dto.form.IcPublicServiceOrgPageFormDTO" resultMap="IcPublicServiceOrgDetailResDTOMap">
SELECT
o.ID,
distinct o.ID,
o.`NAME`,
o.AGENCY_ID,
o.TYPE,
( CASE WHEN o.type = '1' THEN '实有单位' WHEN o.type = '2' THEN '社会服务组织' WHEN o.type = '3' THEN '志愿团队' end) AS typeName,
o.CONTACT,
o.CONTACT_MOBILE,
o.REMARK,
m.CATEGORY_ID,
m.CATEGORY_CODE,
d.CATEGORY_NAME
o.REMARK
FROM
ic_public_service_org o
LEFT JOIN ic_public_service_org_service_matter m ON ( o.id = m.ORG_ID and m.del_flag='0')
@ -67,7 +62,7 @@
AND o.`NAME` LIKE concat( '%', #{name}, '%' )
</if>
<if test="null != categoryIds and categoryIds.size() > 0">
<foreach collection="categoryIds" item="categoryId" open="AND" separator="" close="">
<foreach collection="categoryIds" item="categoryId" open="AND (" separator="or" close=")">
m.CATEGORY_ID = #{categoryId}
</foreach>
</if>

Loading…
Cancel
Save