|
@ -7,6 +7,7 @@ import com.epmet.common.enu.PointAddRuleEnum; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
@ -284,4 +285,161 @@ public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveR |
|
|
return new Result().ok("修改成功!"); |
|
|
return new Result().ok("修改成功!"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 客户初始化党建活动积分规则 |
|
|
|
|
|
* |
|
|
|
|
|
* @param customerIdList |
|
|
|
|
|
* @Param customerIdList |
|
|
|
|
|
* @Return |
|
|
|
|
|
* @Author zhaoqifeng |
|
|
|
|
|
* @Date 2022/8/26 13:40 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public void initPartyBuilidingRole(List<String> customerIdList) { |
|
|
|
|
|
customerIdList.forEach(customerId -> { |
|
|
|
|
|
//党建积分
|
|
|
|
|
|
LambdaQueryWrapper<PointAdditiveRuleEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "党建积分"); |
|
|
|
|
|
PointAdditiveRuleEntity djjf = baseDao.selectOne(wrapper); |
|
|
|
|
|
if (null == djjf) { |
|
|
|
|
|
djjf = new PointAdditiveRuleEntity(); |
|
|
|
|
|
djjf.setCustomerId(customerId); |
|
|
|
|
|
djjf.setType("category"); |
|
|
|
|
|
djjf.setApplyFlag(NumConstant.ONE_STR); |
|
|
|
|
|
djjf.setCategoryCode("party_building"); |
|
|
|
|
|
djjf.setCategoryName("党建积分"); |
|
|
|
|
|
djjf.setPid(NumConstant.ZERO_STR); |
|
|
|
|
|
djjf.setPids(""); |
|
|
|
|
|
baseDao.insert(djjf); |
|
|
|
|
|
} |
|
|
|
|
|
//党建活动
|
|
|
|
|
|
wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "党建活动"); |
|
|
|
|
|
PointAdditiveRuleEntity djhd = baseDao.selectOne(wrapper); |
|
|
|
|
|
if (null == djhd) { |
|
|
|
|
|
djhd = new PointAdditiveRuleEntity(); |
|
|
|
|
|
djhd.setCustomerId(customerId); |
|
|
|
|
|
djhd.setType("category"); |
|
|
|
|
|
djhd.setApplyFlag(NumConstant.ONE_STR); |
|
|
|
|
|
djhd.setCategoryCode("party_building"); |
|
|
|
|
|
djhd.setCategoryName("党建活动"); |
|
|
|
|
|
djhd.setPid(djjf.getId()); |
|
|
|
|
|
djhd.setPids(djjf.getId()); |
|
|
|
|
|
baseDao.insert(djhd); |
|
|
|
|
|
} |
|
|
|
|
|
//支部委员会
|
|
|
|
|
|
wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "支部委员会"); |
|
|
|
|
|
PointAdditiveRuleEntity zbdyh = baseDao.selectOne(wrapper); |
|
|
|
|
|
if (null == zbdyh) { |
|
|
|
|
|
zbdyh = new PointAdditiveRuleEntity(); |
|
|
|
|
|
zbdyh.setCustomerId(customerId); |
|
|
|
|
|
zbdyh.setType("rule"); |
|
|
|
|
|
zbdyh.setApplyFlag(NumConstant.ONE_STR); |
|
|
|
|
|
zbdyh.setCategoryCode("party_building"); |
|
|
|
|
|
zbdyh.setRuleName("支部委员会"); |
|
|
|
|
|
zbdyh.setPid(djhd.getId()); |
|
|
|
|
|
zbdyh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); |
|
|
|
|
|
zbdyh.setPointValue(10); |
|
|
|
|
|
baseDao.insert(zbdyh); |
|
|
|
|
|
} |
|
|
|
|
|
//支部党员大会
|
|
|
|
|
|
wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "支部党员大会"); |
|
|
|
|
|
PointAdditiveRuleEntity zbdydh = baseDao.selectOne(wrapper); |
|
|
|
|
|
if (null == zbdydh) { |
|
|
|
|
|
zbdydh = new PointAdditiveRuleEntity(); |
|
|
|
|
|
zbdydh.setCustomerId(customerId); |
|
|
|
|
|
zbdydh.setType("rule"); |
|
|
|
|
|
zbdydh.setApplyFlag(NumConstant.ONE_STR); |
|
|
|
|
|
zbdydh.setCategoryCode("party_building"); |
|
|
|
|
|
zbdydh.setRuleName("支部党员大会"); |
|
|
|
|
|
zbdydh.setPid(djhd.getId()); |
|
|
|
|
|
zbdydh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); |
|
|
|
|
|
zbdydh.setPointValue(20); |
|
|
|
|
|
baseDao.insert(zbdydh); |
|
|
|
|
|
} |
|
|
|
|
|
//党小组会
|
|
|
|
|
|
wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "党小组会"); |
|
|
|
|
|
PointAdditiveRuleEntity dxzh = baseDao.selectOne(wrapper); |
|
|
|
|
|
if (null == dxzh) { |
|
|
|
|
|
dxzh = new PointAdditiveRuleEntity(); |
|
|
|
|
|
dxzh.setCustomerId(customerId); |
|
|
|
|
|
dxzh.setType("rule"); |
|
|
|
|
|
dxzh.setApplyFlag(NumConstant.ONE_STR); |
|
|
|
|
|
dxzh.setCategoryCode("party_building"); |
|
|
|
|
|
dxzh.setRuleName("党小组会"); |
|
|
|
|
|
dxzh.setPid(djhd.getId()); |
|
|
|
|
|
dxzh.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); |
|
|
|
|
|
dxzh.setPointValue(10); |
|
|
|
|
|
baseDao.insert(dxzh); |
|
|
|
|
|
} |
|
|
|
|
|
//党课
|
|
|
|
|
|
wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "党课"); |
|
|
|
|
|
PointAdditiveRuleEntity dk = baseDao.selectOne(wrapper); |
|
|
|
|
|
if (null == dk) { |
|
|
|
|
|
dk = new PointAdditiveRuleEntity(); |
|
|
|
|
|
dk.setCustomerId(customerId); |
|
|
|
|
|
dk.setType("rule"); |
|
|
|
|
|
dk.setApplyFlag(NumConstant.ONE_STR); |
|
|
|
|
|
dk.setCategoryCode("party_building"); |
|
|
|
|
|
dk.setRuleName("党课"); |
|
|
|
|
|
dk.setPid(djhd.getId()); |
|
|
|
|
|
dk.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); |
|
|
|
|
|
dk.setPointValue(15); |
|
|
|
|
|
baseDao.insert(dk); |
|
|
|
|
|
} |
|
|
|
|
|
//主题党日
|
|
|
|
|
|
wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "主题党日"); |
|
|
|
|
|
PointAdditiveRuleEntity ztdr = baseDao.selectOne(wrapper); |
|
|
|
|
|
if (null == ztdr) { |
|
|
|
|
|
ztdr = new PointAdditiveRuleEntity(); |
|
|
|
|
|
ztdr.setCustomerId(customerId); |
|
|
|
|
|
ztdr.setType("rule"); |
|
|
|
|
|
ztdr.setApplyFlag(NumConstant.ONE_STR); |
|
|
|
|
|
ztdr.setCategoryCode("party_building"); |
|
|
|
|
|
ztdr.setRuleName("主题党日"); |
|
|
|
|
|
ztdr.setPid(djhd.getId()); |
|
|
|
|
|
ztdr.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); |
|
|
|
|
|
ztdr.setPointValue(15); |
|
|
|
|
|
baseDao.insert(ztdr); |
|
|
|
|
|
} |
|
|
|
|
|
//为民服务活动
|
|
|
|
|
|
wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCustomerId, customerId); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryCode, "party_building"); |
|
|
|
|
|
wrapper.eq(PointAdditiveRuleEntity::getCategoryName, "为民服务活动"); |
|
|
|
|
|
PointAdditiveRuleEntity wmfwhd = baseDao.selectOne(wrapper); |
|
|
|
|
|
if (null == wmfwhd) { |
|
|
|
|
|
wmfwhd = new PointAdditiveRuleEntity(); |
|
|
|
|
|
wmfwhd.setCustomerId(customerId); |
|
|
|
|
|
wmfwhd.setType("rule"); |
|
|
|
|
|
wmfwhd.setApplyFlag(NumConstant.ONE_STR); |
|
|
|
|
|
wmfwhd.setCategoryCode("party_building"); |
|
|
|
|
|
wmfwhd.setRuleName("为民服务活动"); |
|
|
|
|
|
wmfwhd.setPid(djhd.getId()); |
|
|
|
|
|
wmfwhd.setPids(djhd.getPids().concat(StrConstant.COLON).concat(djhd.getId())); |
|
|
|
|
|
wmfwhd.setPointValue(15); |
|
|
|
|
|
baseDao.insert(wmfwhd); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|