Browse Source

tiyixia

master
yinzuomei 3 years ago
parent
commit
783a0868b8
  1. 39
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActOrgController.java
  2. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActOrgDao.java
  3. 24
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/ResiPartymemberAttachmentDao.java
  4. 82
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/ResiPartymemberAttachmentEntity.java
  5. 64
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActOrgService.java
  6. 16
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/ResiPartymemberAttachmentService.java
  7. 65
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActOrgServiceImpl.java
  8. 54
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  9. 29
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/ResiPartymemberAttachmentServiceImpl.java
  10. 8
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActOrgDao.xml
  11. 34
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/ResiPartymemberAttachmentDao.xml

39
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActOrgController.java

@ -28,43 +28,4 @@ public class IcPartyActOrgController {
@Autowired
private IcPartyActOrgService icPartyActOrgService;
@RequestMapping("page")
public Result<PageData<IcPartyActOrgDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcPartyActOrgDTO> page = icPartyActOrgService.page(params);
return new Result<PageData<IcPartyActOrgDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcPartyActOrgDTO> get(@PathVariable("id") String id){
IcPartyActOrgDTO data = icPartyActOrgService.get(id);
return new Result<IcPartyActOrgDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcPartyActOrgDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icPartyActOrgService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcPartyActOrgDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icPartyActOrgService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icPartyActOrgService.delete(ids);
return new Result();
}
}

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActOrgDao.java

@ -3,6 +3,9 @@ package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 参加活动党组织表
@ -12,5 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcPartyActOrgDao extends BaseDao<IcPartyActOrgEntity> {
int deleteByPartyActId(@Param("customerId") String customerId, @Param("icPartyActIds")List<String> icPartyActIds);
}

24
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/ResiPartymemberAttachmentDao.java

@ -0,0 +1,24 @@
package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.ResiPartymemberAttachmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 本库附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-19
*/
@Mapper
public interface ResiPartymemberAttachmentDao extends BaseDao<ResiPartymemberAttachmentEntity> {
/**
*
* @param businessIds
* @return
*/
int deleteByBusinessId(@Param("customerId")String customerId,@Param("businessIds") List<String> businessIds);
}

82
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/ResiPartymemberAttachmentEntity.java

@ -0,0 +1,82 @@
package com.epmet.modules.partyOrg.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 本库附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("resi_partymember_attachment")
public class ResiPartymemberAttachmentEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 业务id
*/
private String businessId;
/**
* 党组织活动ic_party_act
*/
private String attachTo;
/**
* 附件名
*/
private String name;
/**
* 文件格式JPGPNGPDFJPEGBMPMP4WMAM4AMP3DOCDOCXXLS
*/
private String format;
/**
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String type;
/**
* 附件地址
*/
private String url;
/**
* 排序字段
*/
private Integer sort;
/**
* 附件状态审核中auditing
auto_passed: 自动通过
review结果不确定需要人工审核
block: 结果违规
rejected人工审核驳回;
approved人工审核通过
现在图片是同步审核的所以图片只有auto_passed一种状态
*/
private String status;
/**
* 失败原因
*/
private String reason;
/**
* 语音或视频时长,
*/
private Integer duration;
}

64
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActOrgService.java

@ -1,12 +1,9 @@
package com.epmet.modules.partyOrg.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity;
import com.epmet.resi.partymember.dto.IcPartyActOrgDTO;
import java.util.List;
import java.util.Map;
/**
* 参加活动党组织表
@ -15,64 +12,5 @@ import java.util.Map;
* @since v1.0.0 2022-08-18
*/
public interface IcPartyActOrgService extends BaseService<IcPartyActOrgEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcPartyActOrgDTO>
* @author generator
* @date 2022-08-18
*/
PageData<IcPartyActOrgDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcPartyActOrgDTO>
* @author generator
* @date 2022-08-18
*/
List<IcPartyActOrgDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcPartyActOrgDTO
* @author generator
* @date 2022-08-18
*/
IcPartyActOrgDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-08-18
*/
void save(IcPartyActOrgDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-08-18
*/
void update(IcPartyActOrgDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-08-18
*/
void delete(String[] ids);
int deleteByPartyActId(String customerId, List<String> icPartyActIds);
}

16
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/ResiPartymemberAttachmentService.java

@ -0,0 +1,16 @@
package com.epmet.modules.partyOrg.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.modules.partyOrg.entity.ResiPartymemberAttachmentEntity;
import java.util.List;
/**
* 本库附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-19
*/
public interface ResiPartymemberAttachmentService extends BaseService<ResiPartymemberAttachmentEntity> {
int deleteByBusinessId(String customerId, List<String> businessIds);
}

65
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActOrgServiceImpl.java

@ -1,22 +1,13 @@
package com.epmet.modules.partyOrg.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.modules.partyOrg.dao.IcPartyActOrgDao;
import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity;
import com.epmet.modules.partyOrg.service.IcPartyActOrgService;
import com.epmet.resi.partymember.dto.IcPartyActOrgDTO;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 参加活动党组织表
@ -28,55 +19,13 @@ import java.util.Map;
public class IcPartyActOrgServiceImpl extends BaseServiceImpl<IcPartyActOrgDao, IcPartyActOrgEntity> implements IcPartyActOrgService {
@Override
public PageData<IcPartyActOrgDTO> page(Map<String, Object> params) {
IPage<IcPartyActOrgEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcPartyActOrgDTO.class);
public int deleteByPartyActId(String customerId, List<String> icPartyActIds) {
if (CollectionUtils.isEmpty(icPartyActIds)) {
return 0;
}
return baseDao.deleteByPartyActId(customerId, icPartyActIds);
}
@Override
public List<IcPartyActOrgDTO> list(Map<String, Object> params) {
List<IcPartyActOrgEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcPartyActOrgDTO.class);
}
private QueryWrapper<IcPartyActOrgEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcPartyActOrgEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcPartyActOrgDTO get(String id) {
IcPartyActOrgEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcPartyActOrgDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcPartyActOrgDTO dto) {
IcPartyActOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyActOrgEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcPartyActOrgDTO dto) {
IcPartyActOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyActOrgEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}
}

54
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java

@ -4,21 +4,24 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.modules.partyOrg.dao.IcPartyActDao;
import com.epmet.modules.partyOrg.dao.IcScheduleDao;
import com.epmet.modules.partyOrg.dao.IcPartyActOrgDao;
import com.epmet.modules.partyOrg.dao.IcScheduleDao;
import com.epmet.modules.partyOrg.dao.ResiPartymemberAttachmentDao;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity;
import com.epmet.modules.partyOrg.entity.ResiPartymemberAttachmentEntity;
import com.epmet.modules.partyOrg.service.IcPartyActOrgService;
import com.epmet.modules.partyOrg.service.IcPartyActService;
import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.modules.partyOrg.service.ResiPartymemberAttachmentService;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO;
@ -34,10 +37,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 党建组织活动
@ -54,7 +54,8 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
private IcPartyOrgService partyOrgService;
@Autowired
private IcPartyActOrgDao icPartyActOrgDao;
@Autowired
private ResiPartymemberAttachmentDao resiPartymemberAttachmentDao;
/**
* 活动类型列表
*
@ -135,24 +136,47 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
@Override
@Transactional(rollbackFor = Exception.class)
public Map<String, String> addOrUpdate(IcPartyActAddOrUpdateFormDTO formDTO) {
IcPartyActEntity icPartyActEntity= ConvertUtils.sourceToTarget(formDTO,IcPartyActEntity.class);
icPartyActEntity.setAutoPublicTime(DateUtils.calDateBaseDay(formDTO.getHoldTime(),formDTO.getAutoPublicType()));
CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getPublishStaffId());
if (null == staffInfo) {
String msg = "查询工作人员信息异常";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg);
}
IcPartyActEntity icPartyActEntity= ConvertUtils.sourceToTarget(formDTO,IcPartyActEntity.class);
icPartyActEntity.setAutoPublicTime(DateUtils.calDateBaseDay(formDTO.getHoldTime(),formDTO.getAutoPublicType()));
icPartyActEntity.setPublishStaffName(staffInfo.getRealName());
icPartyActEntity.setOrgId(staffInfo.getAgencyId());
icPartyActEntity.setPid(staffInfo.getParentAgency().getId());
icPartyActEntity.setOrgIdPath(staffInfo.getAgencyPIds());
if(StringUtils.isNotBlank(formDTO.getIcPartyActId())){
icPartyActEntity.setId(formDTO.getIcPartyActId());
//删除附件、删除参加组织
SpringContextUtils.getBean(ResiPartymemberAttachmentService.class).deleteByBusinessId(formDTO.getCustomerId(), Arrays.asList(formDTO.getIcPartyActId()));
SpringContextUtils.getBean(IcPartyActOrgService.class).deleteByPartyActId(formDTO.getCustomerId(), Arrays.asList(formDTO.getIcPartyActId()));
baseDao.updateById(icPartyActEntity);
}else{
baseDao.insert(icPartyActEntity);
}
return null;
//新增参加参加活动党组织
List<IcPartyActOrgEntity> orgList=ConvertUtils.sourceToTarget(formDTO.getJoinOrgList(),IcPartyActOrgEntity.class);
orgList.forEach(joinOrg->{
joinOrg.setCustomerId(formDTO.getCustomerId());
joinOrg.setIcPartyActId(icPartyActEntity.getId());
icPartyActOrgDao.insert(joinOrg);
});
//批量新增附件
List<ResiPartymemberAttachmentEntity> attachmentEntityList=ConvertUtils.sourceToTarget(formDTO.getAttachmentList(),ResiPartymemberAttachmentEntity.class);
int attSort = 1;
for (ResiPartymemberAttachmentEntity att : attachmentEntityList) {
att.setCustomerId(formDTO.getCustomerId());
att.setBusinessId(icPartyActEntity.getId());
att.setAttachTo("ic_party_act");
att.setSort(attSort);
attSort++;
resiPartymemberAttachmentDao.insert(att);
}
Map<String, String> map=new HashMap<>();
map.put("icPartyActId",icPartyActEntity.getId());
return map;
}

29
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/ResiPartymemberAttachmentServiceImpl.java

@ -0,0 +1,29 @@
package com.epmet.modules.partyOrg.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.modules.partyOrg.dao.ResiPartymemberAttachmentDao;
import com.epmet.modules.partyOrg.entity.ResiPartymemberAttachmentEntity;
import com.epmet.modules.partyOrg.service.ResiPartymemberAttachmentService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 本库附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-08-19
*/
@Service
public class ResiPartymemberAttachmentServiceImpl extends BaseServiceImpl<ResiPartymemberAttachmentDao, ResiPartymemberAttachmentEntity> implements ResiPartymemberAttachmentService {
@Override
public int deleteByBusinessId(String customerId, List<String> businessIds) {
if(CollectionUtils.isEmpty(businessIds)){
return 0;
}
return baseDao.deleteByBusinessId(customerId,businessIds);
}
}

8
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActOrgDao.xml

@ -2,5 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.modules.partyOrg.dao.IcPartyActOrgDao">
<delete id="deleteByPartyActId" parameterType="map">
delete from ic_party_act_org
where customer_id = #{customerId}
<foreach collection="icPartyActIds" item="icPartyActId" open="AND (" separator="OR" close=")">
IC_PARTY_ACT_ID = #{icPartyActId}
</foreach>
</delete>
</mapper>

34
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/ResiPartymemberAttachmentDao.xml

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.modules.partyOrg.dao.ResiPartymemberAttachmentDao">
<resultMap type="com.epmet.modules.partyOrg.entity.ResiPartymemberAttachmentEntity" id="resiPartymemberAttachmentMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="businessId" column="BUSINESS_ID"/>
<result property="attachTo" column="ATTACH_TO"/>
<result property="name" column="NAME"/>
<result property="format" column="FORMAT"/>
<result property="type" column="TYPE"/>
<result property="url" column="URL"/>
<result property="sort" column="SORT"/>
<result property="status" column="STATUS"/>
<result property="reason" column="REASON"/>
<result property="duration" column="DURATION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByBusinessId" parameterType="map">
delete from resi_partymember_attachment
where customer_id=#{customerId}
<foreach collection="businessIds" item="businessId" open="AND (" separator="OR" close=")">
BUSINESS_ID = #{businessId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save