Browse Source

商机阶段查询修改,销售订单查询修改

yusm 5 months ago
parent
commit
cc7f04487a

+ 12 - 4
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java

@@ -322,18 +322,26 @@ public class BusinessOpportunityController {
     }
 
     @RequestMapping("getAllByStage")
-    public Object getAllByStage(HttpServletRequest request) {
+    public Object getAllByStage(BusinessOpportunity bo,HttpServletRequest request) {
         User user = userMapper.selectById(request.getHeader("Token"));
+        bo.setIsDelete(0);
+        bo.setCompanyId(user.getCompanyId());
+        bo.setUserId(user.getId());
+        bo.setEndTime(bo.getEndTime() + " 23:59:59");
+        bo.setPageFrom(null);
+        bo.setPageIndex(null);
         List<BusinessOpportunity> list = new ArrayList<>();
         boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部商机");
         boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看负责部门商机");
+        int i = 0;
         if (isAll) {
-            list = boMapper.getAllList(user.getCompanyId());
+            list = bOservice.getAll(bo);
         } else if (isNotAll) {
-            list = boMapper.getAllList1(user);
+            list = bOservice.getAll1(bo, user);
         } else {
-            list = boMapper.getAllList2(user);
+            list = bOservice.getAll2(bo, user);
         }
+
         HttpRespMsg msg = new HttpRespMsg();
         List<Stage> stageList = stageService.list(new QueryWrapper<Stage>().eq("company_id", user.getCompanyId()));
         HashMap<String, Object> map = new HashMap<>();

+ 9 - 8
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SalesOrderController.java

@@ -355,16 +355,17 @@ public class SalesOrderController {
         List<Task> taskList = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getOrderId, id));
         taskList.forEach(p->{
             String executorIds = p.getExecutorId();
-            String[] split = executorIds.split(",");
-            List<String> executorNameList=new ArrayList<>();
-            for (String s : split) {
-                Optional<User> user = userList.stream().filter(u -> u.getId().equals(s)).findFirst();
-                if(user.isPresent()){
-                    executorNameList.add(user.get().getName());
+            if (executorIds!=null && !StringUtils.isEmpty(executorIds)) {
+                String[] split = executorIds.split(",");
+                List<String> executorNameList=new ArrayList<>();
+                for (String s : split) {
+                    Optional<User> user = userList.stream().filter(u -> u.getId().equals(s)).findFirst();
+                    if(user.isPresent()){
+                        executorNameList.add(user.get().getName());
+                    }
                 }
+                p.setExecutorNames(executorNameList);
             }
-//            String collect = executorNameList.stream().map(i -> i).collect(Collectors.joining(","));
-            p.setExecutorNames(executorNameList);
         });
         msg.setData(taskList);
         return msg;

+ 18 - 10
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java

@@ -80,6 +80,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
     private ContractLogMapper contractLogMapper;
     @Resource
     private InformationMapper informationMapper;
+    @Resource
+    private SysDictMapper sysDictMapper;
     @Value(value = "${upload.path}")
     private String path;
     @Autowired
@@ -87,6 +89,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
     @Autowired
     private ContractPayCustomizedMapper contractPayCustomizedMapper;
 
+
+
     /**
      * 分页查询合同
      * @param request
@@ -564,7 +568,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 return msg;
             }
             List<Contract> contractList = contractMapper.selectList(new QueryWrapper<Contract>().eq("company_id", companyId));
-            List<ContractType> typeList = contractTypeMapper.selectList(new QueryWrapper<ContractType>().eq("company_id", companyId));
+//            List<ContractType> typeList = contractTypeMapper.selectList(new QueryWrapper<ContractType>().eq("company_id", companyId));
+            List<SysDict> sysDictList = sysDictMapper.selectList(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCompanyId, companyId).eq(SysDict::getCode, "ContractType").orderByAsc(SysDict::getSeq));
+
             ArrayList<Contract> saveContract = new ArrayList<>();
             int dataIndex = 1;
             for (int rowIndex = 1; rowIndex <= rowNum; rowIndex++) {
@@ -591,10 +597,10 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 }
                 String No = row.getCell(0)==null?null:row.getCell(0).getStringCellValue();
                 String name = row.getCell(1)==null?null:row.getCell(1).getStringCellValue();
-                String startDate = row.getCell(2)==null?null:row.getCell(2).getStringCellValue();
-                String endDate = row.getCell(3)==null?null:row.getCell(3).getStringCellValue();
-                String amounts = row.getCell(4)==null?null:row.getCell(4).getStringCellValue();
-                String type = row.getCell(5)==null?null:row.getCell(5).getStringCellValue();
+                String startDate = row.getCell(4)==null?null:row.getCell(4).getStringCellValue();
+                String endDate = row.getCell(5)==null?null:row.getCell(5).getStringCellValue();
+                String amounts = row.getCell(2)==null?null:row.getCell(2).getStringCellValue();
+                String type = row.getCell(3)==null?null:row.getCell(3).getStringCellValue();
                 String remarks = row.getCell(6)==null?null:row.getCell(6).getStringCellValue();
                 Contract item = new Contract();
                 //检查合同编号是否存在
@@ -622,8 +628,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 //检查合同类型是否存在
                 Integer typeId = null;
                 if (StringUtils.isNotBlank(type)){
-                    for (ContractType contractType : typeList) {
-                        if (contractType.getTypeName().equals(type)){
+                    for (SysDict contractType : sysDictList) {
+                        if (contractType.getName().equals(type)){
                             TypeExists = true;
                             typeId = contractType.getId();
                             break;
@@ -771,7 +777,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 return msg;
             }
             List<Contract> contractList = contractMapper.selectList(new QueryWrapper<Contract>().eq("company_id", companyId));
-            List<ContractType> typeList = contractTypeMapper.selectList(new QueryWrapper<ContractType>().eq("company_id", companyId));
+//            List<ContractType> typeList = contractTypeMapper.selectList(new QueryWrapper<ContractType>().eq("company_id", companyId));
+            List<SysDict> sysDictList = sysDictMapper.selectList(new LambdaQueryWrapper<SysDict>().eq(SysDict::getCompanyId, companyId).eq(SysDict::getCode, "ContractType").orderByAsc(SysDict::getSeq));
+
             //获取二级分类列表
             List<ContractTypeSec> secTypeList = contractTypeSecMapper.selectList(new QueryWrapper<ContractTypeSec>().eq("company_id", companyId));
             ArrayList<Contract> saveContract = new ArrayList<>();
@@ -914,8 +922,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
                 //检查合同类型是否存在
                 Integer typeId = null;
                 if (StringUtils.isNotBlank(type)){
-                    for (ContractType contractType : typeList) {
-                        if (contractType.getTypeName().equals(type)){
+                    for (SysDict contractType : sysDictList) {
+                        if (contractType.getName().equals(type)){
                             TypeExists = true;
                             typeId = contractType.getId();
                             break;

+ 10 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml

@@ -64,7 +64,10 @@
             and id in (select business_id from business_product where product_id = #{productId})
         </if>
         ORDER BY id DESC
-        limit #{pageIndex},#{pageFrom}
+        <if test="pageIndex!=null and pageFrom !=null">
+            limit #{pageIndex},#{pageFrom}
+        </if>
+
     </select>
     <select id="getTotal" resultType="java.lang.Integer">
         select
@@ -131,7 +134,9 @@
             and id in (select business_id from business_product where product_id = #{bo.productId})
         </if>
         ORDER BY id DESC
-        limit #{bo.pageIndex},#{bo.pageFrom}
+        <if test="bo.pageIndex!=null and bo.pageFrom !=null">
+            limit #{bo.pageIndex},#{bo.pageFrom}
+        </if>
     </select>
     <select id="getTotal1" resultType="java.lang.Integer">
         select
@@ -199,7 +204,9 @@
             and id in (select business_id from business_product where product_id =#{bo.productId})
         </if>
         ORDER BY id DESC
-        limit #{bo.pageIndex},#{bo.pageFrom}
+        <if test="bo.pageIndex!=null and bo.pageFrom !=null">
+            limit #{bo.pageIndex},#{bo.pageFrom}
+        </if>
     </select>
     <select id="getTotal2" resultType="java.lang.Integer">
         select

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ContractMapper.xml

@@ -66,7 +66,7 @@
         <if test="customerOrg!=null">
             and cc.customer_org like  CONCAT('%', #{customerOrg}, '%')
         </if>
-        order by contract.number desc
+        order by contract.id desc
         <if test="pageStart!=null and pageSize!=null">
             limit #{pageStart},#{pageSize}
         </if>