| | |
| | | private PriSalesService priSalesService; |
| | | |
| | | @Autowired |
| | | private PriQuoteService priQuoteService; |
| | | |
| | | @Autowired |
| | | private CstmrService cstmrService; |
| | | |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | Long deptId = getDeptId(); |
| | | boolean signUserId = false; |
| | | boolean signDeptId = false; |
| | | boolean signHostId = false; |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().equals("dept_id")){ |
| | | signDeptId = true; |
| | | if (String.valueOf(entry.getValue()).equals("19")){ |
| | | signHostId = true; |
| | | } |
| | | } |
| | | } |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | |
| | | } |
| | | if (!signUserId && !signDeptId){ |
| | | wrapper.eq("user_id", getUserId()); |
| | | } |
| | | if (signHostId){ |
| | | wrapper.or().eq("host_id",1); |
| | | } |
| | | } |
| | | |
| | |
| | | return R.error(); |
| | | } |
| | | for (Long id : ids){ |
| | | int priSales = priSalesService.selectCount(new EntityWrapper<PriSales>().eq("pri_online2_id", id)); |
| | | if (priSales!=0){ |
| | | return R.error("存在关联的产品费用明细,禁止删除!!!"); |
| | | int priQuote= priQuoteService.selectCount(new EntityWrapper<PriQuote>().eq("pri_online_id", id)); |
| | | if (priQuote!=0){ |
| | | return R.error("存在关联的报价单,禁止删除!!!"); |
| | | } |
| | | // int priSales = priSalesService.selectCount(new EntityWrapper<PriSales>().eq("pri_online2_id", id)); |
| | | // if (priSales!=0){ |
| | | // return R.error("存在关联的产品费用明细,禁止删除!!!"); |
| | | // } |
| | | } |
| | | for (Long id : ids) { |
| | | PriOnline2 priOnline2 = priOnline2Service.selectById(id); |
| | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2Query2/auth") |
| | | @ManagerAuth |
| | | public R query2(String condition) { |
| | | EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("order_num", condition); |
| | | wrapper.in("user_id", getUserRoleBelongsToUserId("allopen")); |
| | | Page<PriOnline2> page = priOnline2Service.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (PriOnline2 priOnline2 : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", priOnline2.getId()); |
| | | // map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$()); |
| | | // map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getTemplateName()); |
| | | map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$() + "/" + priOnline2.getTemplateName()); |
| | | |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |