9 changed files with 599 additions and 0 deletions
@ -0,0 +1,114 @@ |
|||
package com.epmet.resi.partymember.dto.partymember; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 党员量化积分表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-17 |
|||
*/ |
|||
@Data |
|||
public class IcPartyMemberPointDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id (customer.id) |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 党员ID |
|||
*/ |
|||
private String partyMemberId; |
|||
|
|||
/** |
|||
* 年 |
|||
*/ |
|||
private String year; |
|||
|
|||
/** |
|||
* 季度 |
|||
*/ |
|||
private String quarter; |
|||
|
|||
/** |
|||
* 基础积分分值 |
|||
*/ |
|||
private Integer basePoint; |
|||
|
|||
/** |
|||
* 基础积分选项 英文逗号隔开 |
|||
*/ |
|||
private String baseOptions; |
|||
|
|||
/** |
|||
* 民主评议积分分值 |
|||
*/ |
|||
private Integer reviewPoint; |
|||
|
|||
/** |
|||
* 民主评议积分选项 |
|||
*/ |
|||
private String reviewOptions; |
|||
|
|||
/** |
|||
* 激励积分分值 |
|||
*/ |
|||
private Integer inspirePoint; |
|||
|
|||
/** |
|||
* 激励积分选项 |
|||
*/ |
|||
private String inspireOptions; |
|||
|
|||
/** |
|||
* 警示扣分分值 |
|||
*/ |
|||
private Integer warnPoint; |
|||
|
|||
/** |
|||
* 警示扣分选项 |
|||
*/ |
|||
private String warnOptions; |
|||
|
|||
/** |
|||
* 删除标识:0.未删除 1.已删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,83 @@ |
|||
package com.epmet.modules.partymember.controller; |
|||
|
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ExcelUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
|
|||
import com.epmet.modules.partymember.excel.IcPartyMemberPointExcel; |
|||
import com.epmet.modules.partymember.service.IcPartyMemberPointService; |
|||
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 党员量化积分表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-17 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("icPartyMemberPoint") |
|||
public class IcPartyMemberPointController { |
|||
|
|||
@Autowired |
|||
private IcPartyMemberPointService icPartyMemberPointService; |
|||
|
|||
@RequestMapping("page") |
|||
public Result<PageData<IcPartyMemberPointDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<IcPartyMemberPointDTO> page = icPartyMemberPointService.page(params); |
|||
return new Result<PageData<IcPartyMemberPointDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<IcPartyMemberPointDTO> get(@PathVariable("id") String id){ |
|||
IcPartyMemberPointDTO data = icPartyMemberPointService.get(id); |
|||
return new Result<IcPartyMemberPointDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody IcPartyMemberPointDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
icPartyMemberPointService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("update") |
|||
public Result update(@RequestBody IcPartyMemberPointDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
icPartyMemberPointService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("delete") |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
icPartyMemberPointService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<IcPartyMemberPointDTO> list = icPartyMemberPointService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, IcPartyMemberPointExcel.class); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.epmet.modules.partymember.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
|
|||
import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 党员量化积分表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-17 |
|||
*/ |
|||
@Mapper |
|||
public interface IcPartyMemberPointDao extends BaseDao<IcPartyMemberPointEntity> { |
|||
|
|||
} |
@ -0,0 +1,84 @@ |
|||
package com.epmet.modules.partymember.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 党员量化积分表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-17 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("ic_party_member_point") |
|||
public class IcPartyMemberPointEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id (customer.id) |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 党员ID |
|||
*/ |
|||
private String partyMemberId; |
|||
|
|||
/** |
|||
* 年 |
|||
*/ |
|||
private String year; |
|||
|
|||
/** |
|||
* 季度 |
|||
*/ |
|||
private String quarter; |
|||
|
|||
/** |
|||
* 基础积分分值 |
|||
*/ |
|||
private Integer basePoint; |
|||
|
|||
/** |
|||
* 基础积分选项 英文逗号隔开 |
|||
*/ |
|||
private String baseOptions; |
|||
|
|||
/** |
|||
* 民主评议积分分值 |
|||
*/ |
|||
private Integer reviewPoint; |
|||
|
|||
/** |
|||
* 民主评议积分选项 |
|||
*/ |
|||
private String reviewOptions; |
|||
|
|||
/** |
|||
* 激励积分分值 |
|||
*/ |
|||
private Integer inspirePoint; |
|||
|
|||
/** |
|||
* 激励积分选项 |
|||
*/ |
|||
private String inspireOptions; |
|||
|
|||
/** |
|||
* 警示扣分分值 |
|||
*/ |
|||
private Integer warnPoint; |
|||
|
|||
/** |
|||
* 警示扣分选项 |
|||
*/ |
|||
private String warnOptions; |
|||
|
|||
} |
@ -0,0 +1,75 @@ |
|||
package com.epmet.modules.partymember.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 党员量化积分表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-17 |
|||
*/ |
|||
@Data |
|||
public class IcPartyMemberPointExcel { |
|||
|
|||
@Excel(name = "唯一标识") |
|||
private String id; |
|||
|
|||
@Excel(name = "客户Id (customer.id)") |
|||
private String customerId; |
|||
|
|||
@Excel(name = "党员ID") |
|||
private String partyMemberId; |
|||
|
|||
@Excel(name = "年") |
|||
private String year; |
|||
|
|||
@Excel(name = "季度") |
|||
private String quarter; |
|||
|
|||
@Excel(name = "基础积分分值") |
|||
private Integer basePoint; |
|||
|
|||
@Excel(name = "基础积分选项 英文逗号隔开") |
|||
private String baseOptions; |
|||
|
|||
@Excel(name = "民主评议积分分值") |
|||
private Integer reviewPoint; |
|||
|
|||
@Excel(name = "民主评议积分选项") |
|||
private String reviewOptions; |
|||
|
|||
@Excel(name = "激励积分分值") |
|||
private Integer inspirePoint; |
|||
|
|||
@Excel(name = "激励积分选项") |
|||
private String inspireOptions; |
|||
|
|||
@Excel(name = "警示扣分分值") |
|||
private Integer warnPoint; |
|||
|
|||
@Excel(name = "警示扣分选项") |
|||
private String warnOptions; |
|||
|
|||
@Excel(name = "删除标识:0.未删除 1.已删除") |
|||
private Integer 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; |
|||
|
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.modules.partymember.redis; |
|||
|
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 党员量化积分表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-17 |
|||
*/ |
|||
@Component |
|||
public class IcPartyMemberPointRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,79 @@ |
|||
package com.epmet.modules.partymember.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; |
|||
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; |
|||
|
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 党员量化积分表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-17 |
|||
*/ |
|||
public interface IcPartyMemberPointService extends BaseService<IcPartyMemberPointEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<IcPartyMemberPointDTO> |
|||
* @author generator |
|||
* @date 2022-05-17 |
|||
*/ |
|||
PageData<IcPartyMemberPointDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<IcPartyMemberPointDTO> |
|||
* @author generator |
|||
* @date 2022-05-17 |
|||
*/ |
|||
List<IcPartyMemberPointDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return IcPartyMemberPointDTO |
|||
* @author generator |
|||
* @date 2022-05-17 |
|||
*/ |
|||
IcPartyMemberPointDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-17 |
|||
*/ |
|||
void save(IcPartyMemberPointDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-17 |
|||
*/ |
|||
void update(IcPartyMemberPointDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-17 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
@ -0,0 +1,88 @@ |
|||
package com.epmet.modules.partymember.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.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
|
|||
import com.epmet.modules.partymember.dao.IcPartyMemberPointDao; |
|||
import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; |
|||
import com.epmet.modules.partymember.redis.IcPartyMemberPointRedis; |
|||
import com.epmet.modules.partymember.service.IcPartyMemberPointService; |
|||
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
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.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 党员量化积分表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-17 |
|||
*/ |
|||
@Service |
|||
public class IcPartyMemberPointServiceImpl extends BaseServiceImpl<IcPartyMemberPointDao, IcPartyMemberPointEntity> implements IcPartyMemberPointService { |
|||
|
|||
@Autowired |
|||
private IcPartyMemberPointRedis icPartyMemberPointRedis; |
|||
|
|||
@Override |
|||
public PageData<IcPartyMemberPointDTO> page(Map<String, Object> params) { |
|||
IPage<IcPartyMemberPointEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, IcPartyMemberPointDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<IcPartyMemberPointDTO> list(Map<String, Object> params) { |
|||
List<IcPartyMemberPointEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, IcPartyMemberPointDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<IcPartyMemberPointEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<IcPartyMemberPointEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public IcPartyMemberPointDTO get(String id) { |
|||
IcPartyMemberPointEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, IcPartyMemberPointDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(IcPartyMemberPointDTO dto) { |
|||
IcPartyMemberPointEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPointEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(IcPartyMemberPointDTO dto) { |
|||
IcPartyMemberPointEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPointEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
<?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.partymember.dao.IcPartyMemberPointDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.IcPartyMemberPointEntity" id="icPartyMemberPointMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="partyMemberId" column="PARTY_MEMBER_ID"/> |
|||
<result property="year" column="YEAR"/> |
|||
<result property="quarter" column="QUARTER"/> |
|||
<result property="basePoint" column="BASE_POINT"/> |
|||
<result property="baseOptions" column="BASE_OPTIONS"/> |
|||
<result property="reviewPoint" column="REVIEW_POINT"/> |
|||
<result property="reviewOptions" column="REVIEW_OPTIONS"/> |
|||
<result property="inspirePoint" column="INSPIRE_POINT"/> |
|||
<result property="inspireOptions" column="INSPIRE_OPTIONS"/> |
|||
<result property="warnPoint" column="WARN_POINT"/> |
|||
<result property="warnOptions" column="WARN_OPTIONS"/> |
|||
<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> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue