| | |
| | | import com.doumee.dao.business.join.SolutionWorktypeJoinMapper; |
| | | import com.doumee.dao.business.join.SolutionsJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.CompanyService; |
| | | import com.doumee.service.business.SolutionsService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | ); |
| | | solutionsMapper.update(null,new UpdateWrapper<Solutions>() |
| | | .lambda() |
| | | .ne(Solutions::getId,newModel.getId()) |
| | | .eq(Solutions::getBaseId,solutions.getId()) |
| | | .eq(Solutions::getDataType,Constants.TWO) |
| | | .set(Solutions::getDataType,Constants.ONE) |
| | |
| | | @Override |
| | | public List<Solutions> findList(Solutions solutions) { |
| | | solutions.setIsdeleted(Constants.ZERO); |
| | | solutions.setDataType(Constants.TWO); |
| | | if(solutions.getDataType() == null){ |
| | | solutions.setDataType(Constants.TWO); |
| | | } |
| | | QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions); |
| | | return solutionsMapper.selectList(wrapper); |
| | | } |
| | |
| | | } |
| | | } |
| | | PageData<Solutions> pageData = PageData.from(solutionsJoinMapper.selectJoinPage(page,Solutions.class, queryWrapper)); |
| | | |
| | | return pageData; |
| | | } |
| | | @Override |
| | |
| | | return PageData.from(solutionsMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Solutions> findListForCompany() { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | List<Solutions> solutionsList = solutionsJoinMapper.selectJoinList(Solutions.class,new MPJLambdaWrapper<Solutions>() |
| | | .selectAll(Solutions.class) |
| | | .leftJoin(CompanySolution.class,CompanySolution::getSolutionBaseId,Solutions::getId) |
| | | .eq(Solutions::getIsdeleted,Constants.ZERO) |
| | | .eq(Solutions::getDataType,Constants.TWO) |
| | | .eq(CompanySolution::getIsdeleted,Constants.ZERO) |
| | | .eq(CompanySolution::getCompanyId,user.getCompanyId()) |
| | | .orderByAsc(Solutions::getSortnum) |
| | | ); |
| | | |
| | | // solutionsList.forEach(i->{ |
| | | // //保险时间单位 与 最小投保周期时间单位 规则相同 或者 最小投保周期时间单位 规则为 天时 默认金额 |
| | | // if(i.getTimeUnit().equals(i.getInsureCycleUnit())||i.getInsureCycleUnit().equals(Constants.ZERO)){ |
| | | // i.setCyclePrice(i.getPrice()); |
| | | // }else{ |
| | | // if(i.getInsureCycleUnit().equals(Constants.ONE)){ |
| | | // //最小投保周期时间单位为半月 |
| | | // i.setCyclePrice(i.getPrice().multiply(new BigDecimal(15))); |
| | | // }else if(i.getInsureCycleUnit().equals(Constants.TWO)){ |
| | | // //最小投保周期时间单位为月 则计算当月多少天 |
| | | // if( ){ |
| | | // |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | return solutionsList; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public long count(Solutions solutions) { |
| | | QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions); |