中扬CRM客户关系管理系统
LSH
2023-10-09 26ebf71529e5ee4f70c4ad3ed52ea5e59c1b46e5
src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java
@@ -45,6 +45,9 @@
    private PriSalesService priSalesService;
    @Autowired
    private PriQuoteService priQuoteService;
    @Autowired
    private CstmrService cstmrService;
    @Autowired
@@ -91,12 +94,15 @@
    }
    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()){
@@ -118,6 +124,9 @@
        }
        if (!signUserId && !signDeptId){
            wrapper.eq("user_id", getUserId());
        }
        if (signHostId){
            wrapper.or().eq("host_id",1);
        }
    }
@@ -318,10 +327,14 @@
                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);
@@ -366,6 +379,26 @@
        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) {