Browse Source

积分审核修改

master
zhaoqifeng 3 years ago
parent
commit
9c72469971
  1. 9
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointApplyServiceImpl.java
  2. 2
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml

9
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointApplyServiceImpl.java

@ -154,6 +154,7 @@ public class PointApplyServiceImpl extends BaseServiceImpl<PointApplyDao, PointA
* @Date 2022/6/14 14:14 * @Date 2022/6/14 14:14
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void submit(PointApplyFormDTO formDTO) { public void submit(PointApplyFormDTO formDTO) {
PointApplyEntity entity = ConvertUtils.sourceToTarget(formDTO, PointApplyEntity.class); PointApplyEntity entity = ConvertUtils.sourceToTarget(formDTO, PointApplyEntity.class);
//从缓存获取网格信息 //从缓存获取网格信息
@ -214,6 +215,7 @@ public class PointApplyServiceImpl extends BaseServiceImpl<PointApplyDao, PointA
* @Date 2022/6/15 15:20 * @Date 2022/6/15 15:20
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void audit(TokenDto tokenDto, PointAuditFormDTO formDTO) { public void audit(TokenDto tokenDto, PointAuditFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getId()) && CollectionUtils.isEmpty(formDTO.getIds())) { if (StringUtils.isBlank(formDTO.getId()) && CollectionUtils.isEmpty(formDTO.getIds())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "请选择待审核的申请", "请选择待审核的申请"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "请选择待审核的申请", "请选择待审核的申请");
@ -230,6 +232,7 @@ public class PointApplyServiceImpl extends BaseServiceImpl<PointApplyDao, PointA
if (NumConstant.ZERO_STR.equals(dto.getStatus())) { if (NumConstant.ZERO_STR.equals(dto.getStatus())) {
//更新审核状态 //更新审核状态
PointApplyEntity entity = ConvertUtils.sourceToTarget(formDTO, PointApplyEntity.class); PointApplyEntity entity = ConvertUtils.sourceToTarget(formDTO, PointApplyEntity.class);
entity.setId(id);
baseDao.updateById(entity); baseDao.updateById(entity);
String subjectId; String subjectId;
@ -244,12 +247,17 @@ public class PointApplyServiceImpl extends BaseServiceImpl<PointApplyDao, PointA
record.setCustomerId(tokenDto.getCustomerId()); record.setCustomerId(tokenDto.getCustomerId());
record.setTitle(dto.getTitle()); record.setTitle(dto.getTitle());
record.setStatement(dto.getStatement()); record.setStatement(dto.getStatement());
if (NumConstant.TWO_STR.equals(formDTO.getStatus())) {
record.setPointValue(dto.getPointValue()); record.setPointValue(dto.getPointValue());
} else {
record.setPointValue(NumConstant.ZERO);
}
record.setCategoryCode(dto.getCategoryCode()); record.setCategoryCode(dto.getCategoryCode());
record.setSubjectId(subjectId); record.setSubjectId(subjectId);
record.setBusinessId(dto.getId()); record.setBusinessId(dto.getId());
record.setBusinessCode(CommonConstant.POINT_APPLY); record.setBusinessCode(CommonConstant.POINT_APPLY);
pointAditiveRecordDao.insert(record); pointAditiveRecordDao.insert(record);
if (NumConstant.TWO_STR.equals(formDTO.getStatus())) {
//重新计算总分 //重新计算总分
LambdaQueryWrapper<PointAditiveCalcEntity> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PointAditiveCalcEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAditiveCalcEntity::getCustomerId, tokenDto.getCustomerId()); wrapper.eq(PointAditiveCalcEntity::getCustomerId, tokenDto.getCustomerId());
@ -271,6 +279,7 @@ public class PointApplyServiceImpl extends BaseServiceImpl<PointApplyDao, PointA
pointAditiveCalcDao.insert(calc); pointAditiveCalcDao.insert(calc);
} }
} }
}
}); });

2
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml

@ -51,7 +51,7 @@
<result property="userId" column="USER_ID"/> <result property="userId" column="USER_ID"/>
<result property="createdTime" column="CREATED_TIME"/> <result property="createdTime" column="CREATED_TIME"/>
<result property="ruleName" column="RULE_NAME"/> <result property="ruleName" column="RULE_NAME"/>
<result property="pointValue" column="POINT"/> <result property="pointValue" column="POINT_VALUE"/>
<collection property="annexList" ofType="java.lang.String"> <collection property="annexList" ofType="java.lang.String">
<result column="URL"/> <result column="URL"/>
</collection> </collection>

Loading…
Cancel
Save