| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @ApiParam(value = "客户") @RequestParam String cusId, |
| | | @ApiParam(value = "关键字") @RequestParam(required = false) String keyWord, |
| | | @ApiParam(value = "结果值") @RequestParam(required = false) BigDecimal keyNum) { |
| | | |
| | | List<TjRules> res = new ArrayList<>(); |
| | | if (proId==null){ |
| | | return AjaxResult.success(res); |
| | | } |
| | | if (cusId==null){ |
| | | return AjaxResult.success(res); |
| | | } |
| | | TjCustomer byId = customerService.getById(cusId); |
| | | if(byId==null){ |
| | | return AjaxResult.success(res); |
| | | } |
| | | LambdaQueryWrapper<TjRules> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjRules::getProId, proId); |
| | | wq.lt(TjRules::getAgeLt, MatchUtils.getAgeByIdCard(byId.getCusIdcard())); |
| | | wq.gt(TjRules::getAgeGt, MatchUtils.getAgeByIdCard(byId.getCusIdcard())); |
| | | wq.in(TjRules::getSex, 0, byId.getCusSex()); |
| | | // wq.in(TjRules::getSex, 0, byId.getCusSex()); |
| | | final List<TjRules> list = tjRulesService.list(wq); |
| | | if (list==null){ |
| | | return AjaxResult.success(res); |
| | | } |
| | | for (TjRules tjRules : list) { |
| | | //判断规则类型:数值/文字 |
| | | if ("2".equals(tjRules.getRuleType())) { |
| | |
| | | |
| | | } |
| | | } |
| | | if (res.size() > 0) { |
| | | if (!res.isEmpty()) { |
| | | //建议赋值 |
| | | for (TjRules re : res) { |
| | | LambdaQueryWrapper<TjRuleAdvice> wq1 = new LambdaQueryWrapper<>(); |