yuanchao 1 сар өмнө
parent
commit
47e21e4b61

+ 1 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotopeationfill/IotOpeationFillMapper.java

@@ -56,6 +56,7 @@ public interface IotOpeationFillMapper extends BaseMapperX<IotOpeationFillDO> {
     @TenantIgnore
     List<IotOpeationFillDO> getFillDevices1(@Param("deviceIds") List<Long> deviceIds);
     List<IotModelTemplateAttrsDO> getAttrsById(IotModelTemplateAttrsRespVO vo);
+    @TenantIgnore
     int insertFill(List<IotOpeationFillDO> vo);
     int insertFillOrder(List<IotOpeationFillDO> vo);
     @TenantIgnore

+ 5 - 5
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/job/IotOperationFillJob.java

@@ -73,7 +73,7 @@ public class IotOperationFillJob implements JobHandler {
             boolean exists = rhList.stream()
                     .anyMatch(rh -> rh.getId().equals(pd.getDeptId()));
             if(exists){
-                fillDO.setOrderName("瑞恒兴域"+LocalDate.now()+"运行记录填报");
+                fillDO.setOrderName(pd.getOrgName()+"/"+LocalDate.now()+"运行记录填报");
                 fillDO.setDeptId(pd.getDeptId());
                 fillDO.setOrderStatus(0);
                 fillDO.setCreateTime(LocalDateTime.now());
@@ -87,7 +87,7 @@ public class IotOperationFillJob implements JobHandler {
                     .anyMatch(rd -> rd.getId().equals(pd.getDeptId()));
 
             if(exists1){
-                fillDO.setOrderName("瑞都石油"+LocalDate.now()+"运行记录填报");
+                fillDO.setOrderName(pd.getOrgName()+"/"+LocalDate.now()+"运行记录填报");
                 fillDO.setDeptId(pd.getDeptId());
                 fillDO.setOrderStatus(0);
                 fillDO.setCreateTime(LocalDateTime.now());
@@ -101,7 +101,7 @@ public class IotOperationFillJob implements JobHandler {
                     .anyMatch(ry -> ry.getId().equals(pd.getDeptId()));
 
             if(exists2){
-                fillDO.setOrderName("瑞鹰国际"+LocalDate.now()+"运行记录填报");
+                fillDO.setOrderName(pd.getOrgName()+"/"+LocalDate.now()+"运行记录填报");
                 fillDO.setDeptId(pd.getDeptId());
                 fillDO.setOrderStatus(0);
                 fillDO.setCreateTime(LocalDateTime.now());
@@ -160,8 +160,8 @@ public class IotOperationFillJob implements JobHandler {
 
 
         System.out.println("*****************插入运行记录设备表***********************");
-        IotOpeationFillPageReqVO vo = new IotOpeationFillPageReqVO();
-        List<IotOpeationFillDO> fillList = iotOpeationFillMapper.fillList(vo);
+        ///IotOpeationFillPageReqVO vo = new IotOpeationFillPageReqVO();
+        //List<IotOpeationFillDO> fillList = iotOpeationFillMapper.fillList(vo);
 
         for (IotOpeationFillDO re:deviceList) {
             re.setDeviceId(re.getId());

+ 42 - 36
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/IotOpeationFillMapper.xml

@@ -15,10 +15,10 @@
             b.device_category_id,
             d.person_id user_id
         from
-            rqiot.rq_iot_model_template a,
-            rqiot.rq_iot_model_template_attrs b,
-            rqiot.rq_iot_device c,
-            rqiot.rq_iot_device_person d
+            rq_iot_model_template a,
+            rq_iot_model_template_attrs b,
+            rq_iot_device c,
+            rq_iot_device_person d
         where
             a.device_category_id = b.device_category_id
           and
@@ -37,7 +37,7 @@
 
     <select id="getFillById" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO"
             resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
-        select * from rqiot.rq_iot_opeation_fill_order where id = #{id}
+        select * from rq_iot_opeation_fill_order where id = #{id}
     </select>
 
 
@@ -53,10 +53,10 @@
             b.device_category_id,
             d.person_id user_id
         from
-            rqiot.rq_iot_model_template a,
-            rqiot.rq_iot_model_template_attrs b,
-            rqiot.rq_iot_device c,
-            rqiot.rq_iot_device_person d
+            rq_iot_model_template a,
+            rq_iot_model_template_attrs b,
+            rq_iot_device c,
+            rq_iot_device_person d
         where
             a.device_category_id = b.device_category_id
           and
@@ -76,7 +76,7 @@
 
     <insert id="insertFill"
     parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
-       insert into rqiot.rq_iot_opeation_fill(device_id,device_code,device_name,device_category_id,create_time,dept_id,order_id)
+       insert into rq_iot_opeation_fill(device_id,device_code,device_name,device_category_id,create_time,dept_id,order_id)
            values
         <foreach collection="list" item="item" separator=",">
             (#{item.deviceId},#{item.deviceCode},#{item.deviceName},
@@ -86,7 +86,7 @@
 
     <insert id="insertFillOrder"
             parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
-        insert into rqiot.rq_iot_opeation_fill_order(dept_id,order_name,
+        insert into rq_iot_opeation_fill_order(dept_id,order_name,
         order_status,create_time,order_type,user_name,user_id)
         values
         <foreach collection="list" item="item" separator=",">
@@ -98,7 +98,7 @@
 
     <insert id="insertLog"
             parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
-        insert into rqiot.rq_iot_device_run_log
+        insert into rq_iot_device_run_log
             (dept_id,device_id,device_code,point_code,fill_content,create_time,point_name,total_run_time)
         values
         <foreach collection="list" item="item" separator=",">
@@ -111,7 +111,7 @@
    <!-- <select id="fillList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
     resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
         SELECT * FROM
-            rqiot.rq_iot_opeation_fill
+            rq_iot_opeation_fill
         WHERE DATE(create_time) = CURDATE()
         <if test="deptId != null  and deptId != ''">
         and dept_id in (SELECT d1.id
@@ -125,18 +125,18 @@
     <select id="fillList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
             resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
         SELECT * FROM
-        rqiot.rq_iot_opeation_fill
+        rq_iot_opeation_fill
         WHERE DATE(create_time) = CURDATE()
         <if test="userId != null  and userId != ''">
             and device_id in (select device_id from
-            rqiot.rq_iot_device_person where person_id = #{userId})
+            rq_iot_device_person where person_id = #{userId})
         </if>
     </select>
 
     <select id="fills" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
             resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
         SELECT * FROM
-        rqiot.rq_iot_opeation_fill
+        rq_iot_opeation_fill
         WHERE 1=1
         <if test="deviceIds != null and !deviceIds.isEmpty()">
             and device_id  in
@@ -147,7 +147,7 @@
     </select>
 
     <update id="upFill" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
-        update rqiot.rq_iot_opeation_fill set dept_id = #{deptId} where 1=1
+        update rq_iot_opeation_fill set dept_id = #{deptId} where 1=1
         <if test="deviceIds != null and !deviceIds.isEmpty()">
             and device_id  in
             <foreach collection="deviceIds" item="id" open="(" separator="," close=")">
@@ -160,7 +160,7 @@
     <select id="deviceList" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
             resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
         select device_id from
-            rqiot.rq_iot_device_person where person_id = #{userId}
+            rq_iot_device_person where person_id = #{userId}
     </select>
 
     <select id="fillListByUserId" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
@@ -171,7 +171,7 @@
         FROM
         rq_iot_opeation_fill a
         JOIN system_dept b ON a.dept_id = b.id
-        JOIN rqiot.rq_iot_model_template_attrs c ON a.device_category_id = c.device_category_id
+        JOIN rq_iot_model_template_attrs c ON a.device_category_id = c.device_category_id
         JOIN rq_iot_opeation_fill_order d ON a.order_id = d.id
         WHERE
         a.dept_id IN (
@@ -240,7 +240,7 @@
         from
         rq_iot_opeation_fill a,
         system_dept b,
-        rqiot.rq_iot_model_template_attrs c
+        rq_iot_model_template_attrs c
         where
         a.dept_id = b.id
         and
@@ -338,7 +338,7 @@
           AND @parent_id := concat(@parent_id, ',', id)
         UNION
         SELECT id, name, parent_id
-        FROM rqiot.rq_iot_product_classify
+        FROM rq_iot_product_classify
         WHERE id = #{id}
         ORDER BY id;
     </select>
@@ -347,21 +347,27 @@
     <select id="pdList" resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
         select
             distinct
-            a.id user_id,
-            a.nickname user_name,
-            a.dept_id,
-            a.mobile
+            b.id user_id,
+            b.nickname user_name,
+            c.id dept_id,
+            b.mobile,
+            c.name orgName
         from
-            system_users a,
-            rq_iot_device_person b
-        where
-            a.id = b.person_id
+            rq_iot_device_person a
+                left join
+            system_users b
+            on
+                a.person_id = b.id
+                left join
+            system_dept c
+            on
+                b.dept_id = c.id
     </select>
 
     <select id="fillList1" parameterType="cn.iocoder.yudao.module.pms.controller.admin.iotopeationfill.vo.IotOpeationFillRespVO"
             resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotopeationfill.IotOpeationFillDO">
         SELECT * FROM
-        rqiot.rq_iot_opeation_fill_order
+        rq_iot_opeation_fill_order
         WHERE 1=1
         <if test="deptId != null  and deptId != ''">
             and dept_id = #{deptId}
@@ -377,13 +383,13 @@
             model_attr,
             is_sum
         from
-            rqiot.rq_iot_model_template_attrs
+            rq_iot_model_template_attrs
         where
             device_category_id = #{deviceCategoryId} and deleted = 0
     </select>
 
     <update id="updateFill"  parameterType="cn.iocoder.yudao.module.pms.controller.admin.vo.IotOpeationModelPageReqVO">
-        update  rqiot.rq_iot_opeation_fill
+        update  rq_iot_opeation_fill
          set is_fill = '1'
         where device_id = #{deviceId}
         and DATE(create_time) = DATE(#{createTime})
@@ -463,20 +469,20 @@
     </select>
 
     <update id="updateFillOrder" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
-        update rqiot.rq_iot_opeation_fill_order set order_status = 1,update_time = NOW()  where id = #{id}
+        update rq_iot_opeation_fill_order set order_status = 1,update_time = NOW()  where id = #{id}
     </update>
     <update id="updateFillOrder1" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
-        update rqiot.rq_iot_opeation_fill_order set order_status = 0 where id = #{id}
+        update rq_iot_opeation_fill_order set order_status = 0 where id = #{id}
     </update>
 
     <update id="updateFillOrder2" parameterType="cn.iocoder.yudao.module.pms.dal.dataobject.iotdevicerunlog.IotDeviceRunLogDO">
-        update rqiot.rq_iot_opeation_fill_order set order_status = 2,update_time = NOW() where id = #{id}
+        update rq_iot_opeation_fill_order set order_status = 2,update_time = NOW() where id = #{id}
     </update>
 
 
     <select id="carList"
             resultType="cn.iocoder.yudao.module.pms.dal.dataobject.iotZHBD.DeviceZHBDDO">
-        select distinct device_code ,car_id  from rqiot.rq_iot_car_zhbd
+        select distinct device_code ,car_id  from rq_iot_car_zhbd
     </select>
 
     <update id="upLocation"