wangliang 9 сар өмнө
parent
commit
c023cd127f

+ 12 - 3
sop-api/src/main/java/com/qmth/sop/server/api/ResourceSecurityReportController.java

@@ -1,7 +1,7 @@
 package com.qmth.sop.server.api;
 package com.qmth.sop.server.api;
 
 
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.constant.ApiConstant;
-import com.qmth.sop.business.bean.report.DeviceSupplierCountReportBean;
+import com.qmth.sop.business.bean.report.SupplierCountReportBean;
 import com.qmth.sop.business.service.ResourceSecurityReportService;
 import com.qmth.sop.business.service.ResourceSecurityReportService;
 import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.util.Result;
 import com.qmth.sop.common.util.Result;
@@ -24,8 +24,17 @@ public class ResourceSecurityReportController {
 
 
     @ApiOperation(value = "设备商供货数量分布")
     @ApiOperation(value = "设备商供货数量分布")
     @RequestMapping(value = "/device_supplier_count/report", method = RequestMethod.POST)
     @RequestMapping(value = "/device_supplier_count/report", method = RequestMethod.POST)
-    @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = DeviceSupplierCountReportBean.class) })
-    public Result deviceSupplierCountReport(@ApiParam(value = "服务单元id", required = true) @RequestParam Long serviceId) {
+    @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = SupplierCountReportBean.class) })
+    public Result deviceSupplierCountReport(
+            @ApiParam(value = "设备商供货数量分布报表", required = true) @RequestParam Long serviceId) {
         return ResultUtil.ok(resourceSecurityReportService.deviceSupplierCountReport(serviceId));
         return ResultUtil.ok(resourceSecurityReportService.deviceSupplierCountReport(serviceId));
     }
     }
+
+    @ApiOperation(value = "人力数量分布")
+    @RequestMapping(value = "/human_supplier_count/report", method = RequestMethod.POST)
+    @ApiResponses({ @ApiResponse(code = 200, message = "返回信息", response = SupplierCountReportBean.class) })
+    public Result humanSupplierCountReport(
+            @ApiParam(value = "人力数量分布报表", required = true) @RequestParam Long serviceId) {
+        return ResultUtil.ok(resourceSecurityReportService.humanSupplierCountReport(serviceId));
+    }
 }
 }

+ 15 - 2
sop-business/src/main/java/com/qmth/sop/business/bean/report/DeviceSupplierCountReportBean.java → sop-business/src/main/java/com/qmth/sop/business/bean/report/SupplierCountReportBean.java

@@ -1,24 +1,37 @@
 package com.qmth.sop.business.bean.report;
 package com.qmth.sop.business.bean.report;
 
 
+import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 
 
 /**
 /**
- * @Description: 设备商供货数量分布报表bean
+ * @Description: 供应商供货数量分布报表bean
  * @Param:
  * @Param:
  * @return:
  * @return:
  * @Author: wangliang
  * @Author: wangliang
  * @Date: 2024/9/18
  * @Date: 2024/9/18
  */
  */
-public class DeviceSupplierCountReportBean implements Serializable {
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class SupplierCountReportBean implements Serializable {
 
 
     @ApiModelProperty(value = "设备商名称")
     @ApiModelProperty(value = "设备商名称")
     String deviceSupplierName;
     String deviceSupplierName;
 
 
+    @ApiModelProperty(value = "人力商名称")
+    String humanSupplierName;
+
     @ApiModelProperty(value = "设备商数量")
     @ApiModelProperty(value = "设备商数量")
     Integer count;
     Integer count;
 
 
+    public String getHumanSupplierName() {
+        return humanSupplierName;
+    }
+
+    public void setHumanSupplierName(String humanSupplierName) {
+        this.humanSupplierName = humanSupplierName;
+    }
+
     public String getDeviceSupplierName() {
     public String getDeviceSupplierName() {
         return deviceSupplierName;
         return deviceSupplierName;
     }
     }

+ 10 - 2
sop-business/src/main/java/com/qmth/sop/business/mapper/ResourceSecurityReportMapper.java

@@ -1,7 +1,7 @@
 package com.qmth.sop.business.mapper;
 package com.qmth.sop.business.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.qmth.sop.business.bean.report.DeviceSupplierCountReportBean;
+import com.qmth.sop.business.bean.report.SupplierCountReportBean;
 import com.qmth.sop.business.entity.TBService;
 import com.qmth.sop.business.entity.TBService;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -22,5 +22,13 @@ public interface ResourceSecurityReportMapper extends BaseMapper<TBService> {
      * @param serviceId
      * @param serviceId
      * @return
      * @return
      */
      */
-    List<DeviceSupplierCountReportBean> deviceSupplierCountReport(@Param("serviceId") Long serviceId);
+    List<SupplierCountReportBean> deviceSupplierCountReport(@Param("serviceId") Long serviceId);
+
+    /**
+     * 人力商供货数量分布
+     *
+     * @param serviceId
+     * @return
+     */
+    List<SupplierCountReportBean> humanSupplierCountReport(@Param("serviceId") Long serviceId);
 }
 }

+ 10 - 2
sop-business/src/main/java/com/qmth/sop/business/service/ResourceSecurityReportService.java

@@ -1,7 +1,7 @@
 package com.qmth.sop.business.service;
 package com.qmth.sop.business.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.sop.business.bean.report.DeviceSupplierCountReportBean;
+import com.qmth.sop.business.bean.report.SupplierCountReportBean;
 import com.qmth.sop.business.entity.TBService;
 import com.qmth.sop.business.entity.TBService;
 
 
 import java.util.List;
 import java.util.List;
@@ -21,5 +21,13 @@ public interface ResourceSecurityReportService extends IService<TBService> {
      * @param serviceId
      * @param serviceId
      * @return
      * @return
      */
      */
-    List<DeviceSupplierCountReportBean> deviceSupplierCountReport(Long serviceId);
+    List<SupplierCountReportBean> deviceSupplierCountReport(Long serviceId);
+
+    /**
+     * 人力商供货数量分布
+     *
+     * @param serviceId
+     * @return
+     */
+    List<SupplierCountReportBean> humanSupplierCountReport(Long serviceId);
 }
 }

+ 13 - 2
sop-business/src/main/java/com/qmth/sop/business/service/impl/ResourceSecurityReportServiceImpl.java

@@ -1,7 +1,7 @@
 package com.qmth.sop.business.service.impl;
 package com.qmth.sop.business.service.impl;
 
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.sop.business.bean.report.DeviceSupplierCountReportBean;
+import com.qmth.sop.business.bean.report.SupplierCountReportBean;
 import com.qmth.sop.business.entity.TBService;
 import com.qmth.sop.business.entity.TBService;
 import com.qmth.sop.business.mapper.ResourceSecurityReportMapper;
 import com.qmth.sop.business.mapper.ResourceSecurityReportMapper;
 import com.qmth.sop.business.service.ResourceSecurityReportService;
 import com.qmth.sop.business.service.ResourceSecurityReportService;
@@ -27,7 +27,18 @@ public class ResourceSecurityReportServiceImpl extends ServiceImpl<ResourceSecur
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public List<DeviceSupplierCountReportBean> deviceSupplierCountReport(Long serviceId) {
+    public List<SupplierCountReportBean> deviceSupplierCountReport(Long serviceId) {
         return this.baseMapper.deviceSupplierCountReport(serviceId);
         return this.baseMapper.deviceSupplierCountReport(serviceId);
     }
     }
+
+    /**
+     * 人力商供货数量分布
+     *
+     * @param serviceId
+     * @return
+     */
+    @Override
+    public List<SupplierCountReportBean> humanSupplierCountReport(Long serviceId) {
+        return this.baseMapper.humanSupplierCountReport(serviceId);
+    }
 }
 }

+ 34 - 1
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -349,4 +349,37 @@ SET code='TEXT', `type`='TABLE', form_id='school_job', form_name='school_job', t
 WHERE id=115;
 WHERE id=115;
 UPDATE t_d_form_widget
 UPDATE t_d_form_widget
 SET code='TEXT', `type`='TABLE', form_id='school_tel', form_name='school_tel', title='项目联系人表格_电话输入框', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=3, sub_title=NULL, `options`=NULL, flow_type='CLOUD_MARK_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=28
 SET code='TEXT', `type`='TABLE', form_id='school_tel', form_name='school_tel', title='项目联系人表格_电话输入框', input_type='STRING', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=NULL, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=3, sub_title=NULL, `options`=NULL, flow_type='CLOUD_MARK_SOP_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=28
-WHERE id=116;
+WHERE id=116;
+
+-- 2024-09-18
+UPDATE sys_privilege
+SET name='数据驾驶舱', url='dataCockpit', `type`='MENU', parent_id=NULL, `sequence`=11, property=NULL, related=NULL, enable=1, default_auth=0, front_display=1
+WHERE id=1100;
+UPDATE sys_privilege
+SET name='智能客服', url='aiCustomerManage', `type`='MENU', parent_id=NULL, `sequence`=12, property=NULL, related=NULL, enable=1, default_auth=0, front_display=1
+WHERE id=2053;
+UPDATE sys_privilege
+SET name='流程检查统计', url='FlowCheck', `type`='MENU', parent_id=1100, `sequence`=3, property=NULL, related=NULL, enable=1, default_auth=0, front_display=1
+WHERE id=1101;
+UPDATE sys_privilege
+SET name='服务单元分析', url='serviceAnalyse', `type`='MENU', parent_id=1100, `sequence`=1, property=NULL, related=NULL, enable=1, default_auth=0, front_display=1
+WHERE id=1102;
+UPDATE sys_privilege
+SET name='SOP预警监控', url='sopAnalyse', `type`='MENU', parent_id=1100, `sequence`=4, property=NULL, related=NULL, enable=1, default_auth=0, front_display=1
+WHERE id=1103;
+UPDATE sys_privilege
+SET name='项目进度分析', url='sopSchedule', `type`='MENU', parent_id=1100, `sequence`=2, property=NULL, related=NULL, enable=1, default_auth=0, front_display=1
+WHERE id=1104;
+UPDATE sys_privilege
+SET name='资源保障分析', url='deviceMonitor', `type`='MENU', parent_id=1100, `sequence`=5, property=NULL, related='1107,1108', enable=1, default_auth=0, front_display=1
+WHERE id=1105;
+UPDATE sys_privilege
+SET name='质量监控分析', url='qualityAnalyse', `type`='MENU', parent_id=1100, `sequence`=6, property=NULL, related=NULL, enable=1, default_auth=0, front_display=1
+WHERE id=1106;
+
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(1107, '设备商供货数量分布接口', '/api/admin/resource/security/device_supplier_count/report', 'URL', 1105, 1, 'AUTH', NULL, 1, 1, 1);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(1108, '人力数量分布接口', '/api/admin/resource/security/human_supplier_count/report', 'URL', 1105, 1, 'AUTH', NULL, 1, 1, 1);

+ 19 - 1
sop-business/src/main/resources/mapper/ResourceSecurityReportMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qmth.sop.business.mapper.ResourceSecurityReportMapper">
 <mapper namespace="com.qmth.sop.business.mapper.ResourceSecurityReportMapper">
 
 
-    <select id="deviceSupplierCountReport" resultType="com.qmth.sop.business.bean.report.DeviceSupplierCountReportBean">
+    <select id="deviceSupplierCountReport" resultType="com.qmth.sop.business.bean.report.SupplierCountReportBean">
         select ss.name as deviceSupplierName,count(distinct tbdd.id) as count from t_b_service tbs
         select ss.name as deviceSupplierName,count(distinct tbdd.id) as count from t_b_service tbs
         left join t_b_sop_info tbsi on tbsi.service_id = tbs.id
         left join t_b_sop_info tbsi on tbsi.service_id = tbs.id
         left join t_b_device_delivery tbdd on tbdd.crm_no = tbsi.crm_no
         left join t_b_device_delivery tbdd on tbdd.crm_no = tbsi.crm_no
@@ -14,4 +14,22 @@
         group by ss.name
         group by ss.name
         order by ss.name
         order by ss.name
     </select>
     </select>
+
+    <select id="humanSupplierCountReport" resultType="com.qmth.sop.business.bean.report.SupplierCountReportBean">
+        select ss.name as humanSupplierName,count(distinct tbuas.user_archives_id) as count from t_b_service tbs
+        left join t_b_sop_info tbsi on tbsi.service_id = tbs.id
+        left join t_b_crm_detail tbcd on tbcd.sop_no = tbsi.sop_no
+        left join t_f_custom_flow_entity tfcfe on tfcfe.code = tbcd.sop_no
+        left join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
+        left join t_b_user_archives_allocation tbuaa on tbuaa.crm_detail_id = tbcd.id
+        left join t_b_user_archives_supplier tbuas on tbuas.user_archives_id = tbuaa.archives_id
+        left join sys_supplier ss on ss.id = tbuas.supplier_id
+        where tbs.id = #{serviceId}
+        and ss.`type` = 'HUMAN'
+        and tbcd.status = 'PUBLISH'
+        and tbs.status <![CDATA[ <> ]]> 'CANCEL'
+        and tffa.status <![CDATA[ <> ]]> 'END'
+        group by ss.name
+        order by ss.name
+    </select>
 </mapper>
 </mapper>