Browse Source

党建积分规则初始化

dev
zhaoqifeng 3 years ago
parent
commit
40b64d2711
  1. 29
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java

29
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java

@ -13,6 +13,7 @@ import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SystemMessageType;
import com.epmet.dao.PointAdditiveRuleDao; import com.epmet.dao.PointAdditiveRuleDao;
import com.epmet.dao.PointApplyDao; import com.epmet.dao.PointApplyDao;
import com.epmet.dto.CategorydetailResultDTO; import com.epmet.dto.CategorydetailResultDTO;
@ -212,11 +213,15 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
List<PointAdditiveRuleDTO> result = baseDao.selectList4tree(dto); List<PointAdditiveRuleDTO> result = baseDao.selectList4tree(dto);
if (CollectionUtils.isNotEmpty(result)) { if (CollectionUtils.isNotEmpty(result)) {
result.forEach(item -> { result.forEach(item -> {
if (null != rule) {
if (item.getId().equals(rule.getId()) || item.getPid().equals(rule.getId())) { if (item.getId().equals(rule.getId()) || item.getPid().equals(rule.getId())) {
item.setEditFlag(NumConstant.ZERO_STR); item.setEditFlag(NumConstant.ZERO_STR);
} else { } else {
item.setEditFlag(NumConstant.ONE_STR); item.setEditFlag(NumConstant.ONE_STR);
} }
} else {
item.setEditFlag(NumConstant.ONE_STR);
}
}); });
} }
return new Result<List<PointAdditiveRuleDTO>>().ok(result); return new Result<List<PointAdditiveRuleDTO>>().ok(result);
@ -335,7 +340,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
wrapper = new LambdaQueryWrapper<>(); wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "支部委员会"); wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.ZBWYH);
PointAdditiveRuleEntity zbdyh = baseDao.selectOne(wrapper); PointAdditiveRuleEntity zbdyh = baseDao.selectOne(wrapper);
if (null == zbdyh) { if (null == zbdyh) {
zbdyh = new PointAdditiveRuleEntity(); zbdyh = new PointAdditiveRuleEntity();
@ -343,7 +348,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
zbdyh.setType("rule"); zbdyh.setType("rule");
zbdyh.setApplyFlag(NumConstant.ONE_STR); zbdyh.setApplyFlag(NumConstant.ONE_STR);
zbdyh.setCategoryCode("party_building"); zbdyh.setCategoryCode("party_building");
zbdyh.setRuleName("支部委员会"); zbdyh.setRuleName(SystemMessageType.ZBWYH);
zbdyh.setPid(djhd.getId()); zbdyh.setPid(djhd.getId());
zbdyh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); zbdyh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
zbdyh.setPointValue(10); zbdyh.setPointValue(10);
@ -353,7 +358,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
wrapper = new LambdaQueryWrapper<>(); wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "支部党员大会"); wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.ZBDYDH);
PointAdditiveRuleEntity zbdydh = baseDao.selectOne(wrapper); PointAdditiveRuleEntity zbdydh = baseDao.selectOne(wrapper);
if (null == zbdydh) { if (null == zbdydh) {
zbdydh = new PointAdditiveRuleEntity(); zbdydh = new PointAdditiveRuleEntity();
@ -361,7 +366,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
zbdydh.setType("rule"); zbdydh.setType("rule");
zbdydh.setApplyFlag(NumConstant.ONE_STR); zbdydh.setApplyFlag(NumConstant.ONE_STR);
zbdydh.setCategoryCode("party_building"); zbdydh.setCategoryCode("party_building");
zbdydh.setRuleName("支部党员大会"); zbdydh.setRuleName(SystemMessageType.ZBDYDH);
zbdydh.setPid(djhd.getId()); zbdydh.setPid(djhd.getId());
zbdydh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); zbdydh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
zbdydh.setPointValue(20); zbdydh.setPointValue(20);
@ -371,7 +376,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
wrapper = new LambdaQueryWrapper<>(); wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "党小组会"); wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.DXZH);
PointAdditiveRuleEntity dxzh = baseDao.selectOne(wrapper); PointAdditiveRuleEntity dxzh = baseDao.selectOne(wrapper);
if (null == dxzh) { if (null == dxzh) {
dxzh = new PointAdditiveRuleEntity(); dxzh = new PointAdditiveRuleEntity();
@ -379,7 +384,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
dxzh.setType("rule"); dxzh.setType("rule");
dxzh.setApplyFlag(NumConstant.ONE_STR); dxzh.setApplyFlag(NumConstant.ONE_STR);
dxzh.setCategoryCode("party_building"); dxzh.setCategoryCode("party_building");
dxzh.setRuleName("党小组会"); dxzh.setRuleName(SystemMessageType.DXZH);
dxzh.setPid(djhd.getId()); dxzh.setPid(djhd.getId());
dxzh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); dxzh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
dxzh.setPointValue(10); dxzh.setPointValue(10);
@ -389,7 +394,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
wrapper = new LambdaQueryWrapper<>(); wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "党课"); wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.DANGKE);
PointAdditiveRuleEntity dk = baseDao.selectOne(wrapper); PointAdditiveRuleEntity dk = baseDao.selectOne(wrapper);
if (null == dk) { if (null == dk) {
dk = new PointAdditiveRuleEntity(); dk = new PointAdditiveRuleEntity();
@ -397,7 +402,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
dk.setType("rule"); dk.setType("rule");
dk.setApplyFlag(NumConstant.ONE_STR); dk.setApplyFlag(NumConstant.ONE_STR);
dk.setCategoryCode("party_building"); dk.setCategoryCode("party_building");
dk.setRuleName("党课"); dk.setRuleName(SystemMessageType.DANGKE);
dk.setPid(djhd.getId()); dk.setPid(djhd.getId());
dk.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); dk.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
dk.setPointValue(15); dk.setPointValue(15);
@ -407,7 +412,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
wrapper = new LambdaQueryWrapper<>(); wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "主题党日"); wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.ZTDR);
PointAdditiveRuleEntity ztdr = baseDao.selectOne(wrapper); PointAdditiveRuleEntity ztdr = baseDao.selectOne(wrapper);
if (null == ztdr) { if (null == ztdr) {
ztdr = new PointAdditiveRuleEntity(); ztdr = new PointAdditiveRuleEntity();
@ -415,7 +420,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
ztdr.setType("rule"); ztdr.setType("rule");
ztdr.setApplyFlag(NumConstant.ONE_STR); ztdr.setApplyFlag(NumConstant.ONE_STR);
ztdr.setCategoryCode("party_building"); ztdr.setCategoryCode("party_building");
ztdr.setRuleName("主题党日"); ztdr.setRuleName(SystemMessageType.ZTDR);
ztdr.setPid(djhd.getId()); ztdr.setPid(djhd.getId());
ztdr.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); ztdr.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
ztdr.setPointValue(15); ztdr.setPointValue(15);
@ -425,7 +430,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
wrapper = new LambdaQueryWrapper<>(); wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId);
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building");
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "为民服务活动"); wrapper.eq(PointAdditiveRuleEntity::getCategoryName, SystemMessageType.WMFWHD);
PointAdditiveRuleEntity wmfwhd = baseDao.selectOne(wrapper); PointAdditiveRuleEntity wmfwhd = baseDao.selectOne(wrapper);
if (null == wmfwhd) { if (null == wmfwhd) {
wmfwhd = new PointAdditiveRuleEntity(); wmfwhd = new PointAdditiveRuleEntity();
@ -433,7 +438,7 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR
wmfwhd.setType("rule"); wmfwhd.setType("rule");
wmfwhd.setApplyFlag(NumConstant.ONE_STR); wmfwhd.setApplyFlag(NumConstant.ONE_STR);
wmfwhd.setCategoryCode("party_building"); wmfwhd.setCategoryCode("party_building");
wmfwhd.setRuleName("为民服务活动"); wmfwhd.setRuleName(SystemMessageType.WMFWHD);
wmfwhd.setPid(djhd.getId()); wmfwhd.setPid(djhd.getId());
wmfwhd.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); wmfwhd.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId()));
wmfwhd.setPointValue(15); wmfwhd.setPointValue(15);

Loading…
Cancel
Save