| | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.write.merge.LoopMergeStrategy; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.handler.CommentWriteHandler; |
| | | import com.ycl.handler.CustomSheetWriteHandler; |
| | | import com.ycl.platform.domain.entity.CalculateMoneyRule; |
| | | import com.ycl.platform.domain.entity.CalculateRule; |
| | | import com.ycl.platform.domain.entity.TContract; |
| | | import com.ycl.platform.mapper.TContractMapper; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 【请填写功能名称】Service业务层处理 |
| | |
| | | public class TContractServiceImpl extends ServiceImpl<TContractMapper, TContract> implements ITContractService { |
| | | |
| | | private final ICalculateRuleService calculateRuleService; |
| | | private final CalculateMoneyRuleServiceImpl calculateMoneyRuleService; |
| | | private final YwUnitServiceImpl ywUnitService; |
| | | |
| | | @Override |
| | |
| | | } |
| | | // 批量保存规则 |
| | | calculateRuleService.saveBatch(calculateRulesToSave); |
| | | //批量保存考核结果应用规则 |
| | | calculateMoneyRuleService.saveBatch(JSON.parseArray(tContract.getRuleList(), CalculateMoneyRule.class).stream().peek( |
| | | calculateMoneyRule -> calculateMoneyRule.setContractId(tContract.getId().intValue()) |
| | | ).collect(Collectors.toList())); |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | |
| | |
| | | tContract -> tContract.setUnitName(ywUnitService.getById(tContract.getUnitId()).getUnitName()) |
| | | ).toList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<CalculateMoneyRule> selectMoneyRules(Integer contractId) { |
| | | return calculateMoneyRuleService.selectMoneyRules(contractId); |
| | | } |
| | | } |