package com.matrix.system.hive.service; import cn.hutool.json.JSONUtil; import com.matrix.system.hive.bean.AchieveRule; import com.matrix.system.hive.dao.AchieveRuleDao; import com.matrix.system.hiveErp.pojo.AchieveRuleItem; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; /** * 业绩规则服务 * @author JIANGYOUYAO * @date 2021/6/3 0003 */ @Service @AllArgsConstructor public class AchieveRuleService { AchieveRuleDao achieveRuleDao; /** * 根据id查询 AchieveRule * @param id * @return */ public AchieveRule selectById(Long id){ AchieveRule achieveRule = achieveRuleDao.selectById(id); achieveRule.setRuleItemList(JSONUtil.toList(JSONUtil.parseArray(achieveRule.getRules()), AchieveRuleItem.class)); return achieveRule; } }