jiangping
2024-06-20 09da100729793848bc01b51f7b05ca3f1e7ec64f
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
@@ -82,6 +82,10 @@
        solutions.setVersion(UUID.randomUUID().toString());//版本号
        solutions.setDataType(Constants.ZERO);
        solutions.setStatus(Constants.ZERO);
        //2024年6月17日15:56:18 仅支持替换模式下,批增日期 等于 批减日期
        if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){
            solutions.setAddValidDays(solutions.getDelValidDays());
        }
        solutionsMapper.insert(solutions);//基础版本
        //如果有工种,则产生一个新的有效历史版本 ~
@@ -165,7 +169,10 @@
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        if(!(Constants.equalsInteger(solutions.getInsureCycleUnit(),Constants.ZERO)
                ||Constants.equalsInteger(solutions.getInsureCycleUnit(),solutions.getInsureCycleUnit()))){
            solutions.setDelOnlyReplace(Constants.ZERO);
        }
    }
    @Override
@@ -210,6 +217,11 @@
        solutions.setEditor(user.getId());
        solutions.setVersion(UUID.randomUUID().toString());
        solutions.setEditDate(new Date());
        //2024年6月17日15:56:18 仅支持替换模式下,批增日期 等于 批减日期
        if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){
            solutions.setAddValidDays(solutions.getDelValidDays());
        }
        solutionsMapper.updateById(solutions);
        Solutions oldVersion = solutionsMapper.selectOne(new QueryWrapper<Solutions>()
@@ -488,13 +500,14 @@
        if (pageWrap.getModel().getBaseId() != null) {
            queryWrapper.eq(Solutions::getBaseId, pageWrap.getModel().getBaseId());
        }
        for(PageWrap.SortData sortData: pageWrap.getSorts()) {
            if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
                queryWrapper.orderByDesc(sortData.getProperty());
            } else {
                queryWrapper.orderByAsc(sortData.getProperty());
            }
        }
        queryWrapper.orderByDesc(Solutions::getCreateDate);
//        for(PageWrap.SortData sortData: pageWrap.getSorts()) {
//            if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
//                queryWrapper.orderByDesc(sortData.getProperty());
//            } else {
//                queryWrapper.orderByAsc(sortData.getProperty());
//            }
//        }
        PageData<Solutions> pageData = PageData.from(solutionsJoinMapper.selectJoinPage(page,Solutions.class, queryWrapper));
        return pageData;
@@ -546,7 +559,7 @@
                .eq(Company::getStatus,Constants.ZERO)
                .eq(Insurance::getIsdeleted,Constants.ZERO)
                .eq(Insurance::getStatus,Constants.ZERO)
                .orderByAsc(Solutions::getSortnum)
                .orderByDesc(Solutions::getCreateDate)
        );
        return solutionsList;
    }
@@ -585,5 +598,18 @@
    }
    @Override
    public BigDecimal testSolutionAddMoney(Integer id, BigDecimal fee, Date start,Date end,Date newDate,Date newEndTime){
        return Constants.addFee(solutionsMapper.selectById(id),fee,start,end,newDate,newEndTime);
    }
    @Override
    public BigDecimal testSolutionReduceMoney(Integer id, BigDecimal fee, Date start,Date end,Date reduceStartTime,Date reduceEndTime){
        return Constants.reduceFee(solutionsMapper.selectById(id),fee,start,end,reduceStartTime,reduceEndTime);
    }
    @Override
    public BigDecimal testSolutionProduceMoney(Integer id, BigDecimal fee, Date start,Date end,Date produceStart){
        return Constants.produceFee(solutionsMapper.selectById(id),fee,start,end,produceStart);
    }
}