Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | private String label; |
| | | |
| | | private String ruleName; |
| | | |
| | | /** |
| | | * 扣分方式 |
| | | */ |
| | |
| | | import com.ycl.platform.mapper.CalculateRuleMapper; |
| | | import com.ycl.platform.mapper.TContractMapper; |
| | | import com.ycl.platform.service.ICalculateRuleService; |
| | | import com.ycl.system.domain.TreeUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import utils.DateUtils; |
| | |
| | | |
| | | @Override |
| | | public List<CalculateRuleCascaderVO> getRuleListByUnitId(Integer unitId) { |
| | | return TreeUtils.build(calculateRuleMapper.getRuleListByUnitId(unitId, DateUtils.getDate()), 0L); |
| | | return calculateRuleMapper.getRuleListByUnitId(unitId, DateUtils.getDate()); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.platform.domain.entity.CalculateRule; |
| | | import com.ycl.platform.domain.entity.ContractScore; |
| | | import com.ycl.platform.mapper.CalculateRuleMapper; |
| | | import com.ycl.platform.mapper.ContractScoreMapper; |
| | |
| | | contractScore.setAuditingStatus(AuditingStatus.WAIT); |
| | | contractScore.setRuleIds(Arrays.stream(contractScore.getRuleIdsArray()).map(String::valueOf).collect(Collectors.joining(","))); |
| | | contractScore.setRuleIdsArray(Arrays.stream(contractScore.getRuleIds().split(",")).map(Long::parseLong).toArray(Long[]::new)); |
| | | List<CalculateRule> list = new LambdaQueryChainWrapper<>(calculateRuleMapper).in(CalculateRule::getId, contractScore.getRuleIdsArray()).list(); |
| | | contractScore.setRuleName(String.join(" / ", new String[]{list.get(0).getRuleName(), list.get(2).getRuleCondition()})); |
| | | return super.save(contractScore); |
| | | } |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="getRuleListByUnitId" resultType="com.ycl.platform.domain.vo.CalculateRuleCascaderVO"> |
| | | <![CDATA[ |
| | | select id, |
| | | rule_name, |
| | | deduct_category, |
| | | calc_fraction, |
| | | calc_unit, |
| | | id as value, |
| | | contract_id, |
| | | if(rule_condition is not null, rule_condition, if(rule_desc is not null, rule_desc, rule_name)) as label, |
| | | parent_id |
| | | rule_condition as label |
| | | from t_calculate_rule |
| | | where deleted = 0 |
| | | and contract_id |
| | | in (select id from t_contract where unit_id = #{unitId} and deleted = 0 and start_time <![CDATA[ <= ]]> #{now} and end_time >= #{now} ) |
| | | in (select id from t_contract where unit_id = #{unitId} and deleted = 0 and start_time <= #{now} and end_time >= #{now}) |
| | | ]]> |
| | | </select> |
| | | |
| | | <insert id="insertDefaultRule" useGeneratedKeys="true" keyProperty="id"> |