hanfucheng před 8 měsíci
rodič
revize
068857ce9a

+ 54 - 1
data-ui/src/views/data/housingconstruction/steelcylinder/index.vue

@@ -119,7 +119,7 @@
               </el-dropdown-item>
               <el-dropdown-item>
                 <router-link :to="'/center-data/data/housingconstruction/steelcylinderLog/index/' + scope.row.id">
-                 运营数据
+                  运营数据
                 </router-link>
               </el-dropdown-item>
             </el-dropdown-menu>
@@ -283,6 +283,37 @@
     <!--运营-->
     <el-dialog :title="title" :visible.sync="open1" :width="width" class="form-style">
       <el-form ref="form" :model="form" :rules="rules" :label-width="labelWidth">
+        <template v-if="title == '检查'">
+          <el-row :gutter="20">
+            <el-form-item label="检查员" prop="inspectorId">
+              <el-select v-model="form.inspectorId" filterable placeholder="请选择检查员">
+                <el-option
+                  v-for="dict in practitioner"
+                  :key="dict.id"
+                  :label="dict.staffName"
+                  :value="dict.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-row>
+          <el-row :gutter="20">
+            <el-form-item label="检查时间" prop="inspectorTime">
+              <el-date-picker clearable
+                              v-model="form.inspectorTime"
+                              type="date"
+                              value-format="yyyy-MM-dd"
+                              placeholder="选择检查时间">
+              </el-date-picker>
+            </el-form-item>
+          </el-row>
+          <el-row :gutter="20">
+            <el-form-item label="图片" prop="picture">
+              <ImageUpload ref="ImageUpload" :limit="2" :fileType="['png', 'jpg', 'jpeg']"
+                           :value="form.picture"
+                           @input="getPicture"></ImageUpload>
+            </el-form-item>
+          </el-row>
+        </template>
         <template v-if="title == '充装'">
           <el-form-item label="充装介质" prop="fillingMedium">
             <el-input v-model="form.fillingMedium" placeholder="请输入充装介质" maxlength="20"/>
@@ -620,6 +651,12 @@ export default {
         environment: [
           {required: true, message: "环境检查不能为空", trigger: "blur"},
         ],
+        inspectorId: [
+          {required: true, message: "检查员不能为空", trigger: "blur"},
+        ],
+        inspectorTime: [
+          {required: true, message: "检查时间不能为空", trigger: "blur"},
+        ],
       },
     };
   },
@@ -714,6 +751,9 @@ export default {
     getEnvironment(url) {
       this.form.environment = url
     },
+    getPicture(url) {
+      this.form.picture = url
+    },
     /** 查询钢瓶基础数据列表 */
     getList() {
       this.loading = true;
@@ -764,8 +804,10 @@ export default {
         state: null,
         threshold: null,
         fillingMedium: null,
+        inspectorTime: null,
         fillingTime: null,
         operatorId: null,
+        inspectorId: null,
         operatorName: null,
         carId: null,
         carNumber: null,
@@ -860,6 +902,12 @@ export default {
       this.form.steelcylinderName = row.name
       this.open1 = true;
       if (row.state == "state_1" || row.state == "state_5") {
+        this.title = "检查";
+        this.form.state = "state_6";
+        this.width = "580px"
+        this.getPractitioner(row.enterpriseId);
+      }
+      if (row.state == "state_6") {
         this.title = "充装";
         this.form.state = "state_2";
         this.getPractitioner(row.enterpriseId);
@@ -888,6 +936,11 @@ export default {
     submitForm1() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+          if (this.form.inspectorId != null) {
+            this.form.inspectorName = this.practitioner.filter((item) => {
+              return this.form.inspectorId == item.id;
+            })[0].staffName;
+          }
           if (this.form.operatorId != null) {
             this.form.operatorName = this.practitioner.filter((item) => {
               return this.form.operatorId == item.id;

+ 2 - 0
data-ui/src/views/data/housingconstruction/steelcylinderLog/index.vue

@@ -21,6 +21,8 @@
       <el-table-column label="钢瓶名称" align="center" prop="steelcylinderName"/>
       <el-table-column label="企业名称" align="center" prop="enterpriseName"/>
       <el-table-column label="入库时间" align="center" prop="joinWarehouseTime"/>
+      <el-table-column label="检查员" align="center" prop="inspectorName"/>
+      <el-table-column label="检查时间" align="center" prop="inspectorTime"/>
       <el-table-column label="充装介质" align="center" prop="fillingMedium"/>
       <el-table-column label="充装时间" align="center" prop="fillingTime"/>
       <el-table-column label="操作员名称" align="center" prop="operatorName"/>

+ 21 - 5
src/main/java/com/sooka/sponest/data/housingconstruction/controller/CenterdataTHousingconstructionSteelcylinderLogController.java

@@ -1,6 +1,7 @@
 package com.sooka.sponest.data.housingconstruction.controller;
 
 import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.page.TableDataInfo;
@@ -98,16 +99,22 @@ public class CenterdataTHousingconstructionSteelcylinderLogController extends Ba
         centerdataTHousingconstructionSteelcylinderService.updateCenterdataTHousingconstructionSteelcylinder(centerdataTHousingconstructionSteelcylinder);
         //按钢瓶id查询最新日志
         CenterdataTHousingconstructionSteelcylinderLog log = centerdataTHousingconstructionSteelcylinderLogService.selectBySteelcylinderId(steelcylinderLog.getSteelcylinderId());
-        //当流转状态为入户时新增附件
-        extracted(steelcylinderLog, log);
         if (log ==null){
+            steelcylinderLog.setId(IdUtils.fastSimpleUUID());
+            //当流转状态为检查或者入户时新增附件
+            extracted(steelcylinderLog, steelcylinderLog);
             return toAjax(centerdataTHousingconstructionSteelcylinderLogService.insertCenterdataTHousingconstructionSteelcylinderLog(steelcylinderLog));
         }else {
-            //当钢瓶状态为回收或流转状态为充装时新增一条日志
-            if (steelcylinder.getState().equals("state_5")&&steelcylinderLog.getState().equals("state_2")){
+            //当钢瓶状态为回收或流转状态为检查时新增一条日志
+            if (steelcylinder.getState().equals("state_5")&&steelcylinderLog.getState().equals("state_6")){
+                steelcylinderLog.setId(IdUtils.fastSimpleUUID());
+                //当流转状态为检查或者入户时新增附件
+                extracted(steelcylinderLog, steelcylinderLog);
                 steelcylinderLog.setJoinWarehouseTime(log.getJoinWarehouseTime());
                 return toAjax(centerdataTHousingconstructionSteelcylinderLogService.insertCenterdataTHousingconstructionSteelcylinderLog(steelcylinderLog));
             }else {
+                //当流转状态为检查或者入户时新增附件
+                extracted(steelcylinderLog, log);
                 steelcylinderLog.setId(log.getId());
                 return toAjax(centerdataTHousingconstructionSteelcylinderLogService.updateCenterdataTHousingconstructionSteelcylinderLog(steelcylinderLog));
             }
@@ -115,8 +122,17 @@ public class CenterdataTHousingconstructionSteelcylinderLogController extends Ba
     }
 
     private void extracted(CenterdataTHousingconstructionSteelcylinderLog steelcylinderLog, CenterdataTHousingconstructionSteelcylinderLog log) {
-        if (steelcylinderLog.getState().equals("state_4")){
+        if (steelcylinderLog.getState().equals("state_4")|| steelcylinderLog.getState().equals("state_6")){
             List<Map<String,Object>> list = new ArrayList<>();
+            if (StringUtils.isNotEmpty(steelcylinderLog.getPicture())) {
+                String[] paths = steelcylinderLog.getPicture().split(",");
+                for (String part : paths) {
+                    Map<String,Object> photo = new HashMap<>();
+                    photo.put("key","picture");
+                    photo.put("value", part);
+                    list.add(photo);
+                }
+            }
             if (StringUtils.isNotEmpty(steelcylinderLog.getWorkCard())) {
                 Map<String,Object> photo = new HashMap<>();
                 photo.put("key","workCard");

+ 9 - 0
src/main/java/com/sooka/sponest/data/housingconstruction/domain/CenterdataTHousingconstructionSteelcylinderLog.java

@@ -45,6 +45,15 @@ public class CenterdataTHousingconstructionSteelcylinderLog extends BaseBusiness
     @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date joinWarehouseTime;
 
+    private String inspectorId;//检查员id
+    @Excel(name = "检查员")
+    private String inspectorName;//检查员
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "检查时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date inspectorTime;//检查时间
+    private String picture;
+
     /**
      * 充装介质
      */

+ 4 - 3
src/main/java/com/sooka/sponest/data/housingconstruction/service/impl/CenterdataTHousingconstructionAttachServiceImpl.java

@@ -169,12 +169,13 @@ public class CenterdataTHousingconstructionAttachServiceImpl implements ICenterd
     @Override
     public int addAttach(List<Map<String, Object>> attachList, String busId) {
         List<CenterdataTHousingconstructionAttach> dataList = new ArrayList<>();
-        attachList.forEach(map -> {
+        long index = 0L;
+        for (Map<String, Object> map : attachList) {
             String path = MapUtils.getString(map, "value");
             String type = MapUtils.getString(map, "key");
             String[] split = path.split("/");
-            dataList.add(new CenterdataTHousingconstructionAttach(busId, type, null, path, split[split.length - 1], 0L));
-        });
+            dataList.add(new CenterdataTHousingconstructionAttach(busId, type, null, path, split[split.length - 1], index++));
+        }
         return addAttach(dataList);
     }
 

+ 0 - 1
src/main/java/com/sooka/sponest/data/housingconstruction/service/impl/CenterdataTHousingconstructionSteelcylinderLogServiceImpl.java

@@ -55,7 +55,6 @@ public class CenterdataTHousingconstructionSteelcylinderLogServiceImpl extends B
      */
     @Override
     public int insertCenterdataTHousingconstructionSteelcylinderLog(CenterdataTHousingconstructionSteelcylinderLog centerdataTHousingconstructionSteelcylinderLog) {
-        centerdataTHousingconstructionSteelcylinderLog.setId(IdUtils.fastSimpleUUID());
         centerdataTHousingconstructionSteelcylinderLog.setUpdateTime(DateUtils.getNowDate());
         return centerdataTHousingconstructionSteelcylinderLogMapper.insertCenterdataTHousingconstructionSteelcylinderLog(centerdataTHousingconstructionSteelcylinderLog);
     }

+ 14 - 1
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionSteelcylinderLogMapper.xml

@@ -24,6 +24,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="recyclingName"    column="recycling_name"    />
         <result property="recyclingTime"    column="recycling_time"    />
         <result property="enterpriseName"    column="enterprise_name"    />
+        <result property="inspectorId"    column="inspector_id"    />
+        <result property="inspectorName"    column="inspector_name"    />
+        <result property="inspectorTime"    column="inspector_time"    />
     </resultMap>
 
     <sql id="selectCenterdataTHousingconstructionSteelcylinderLogVo">
@@ -33,7 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCenterdataTHousingconstructionSteelcylinderLogList" parameterType="CenterdataTHousingconstructionSteelcylinderLog" resultMap="CenterdataTHousingconstructionSteelcylinderLogResult">
         select a.id, a.steelcylinder_id, a.steelcylinder_name, a.join_warehouse_time, a.filling_medium, a.filling_time, a.operator_id, a.operator_name, a.car_id,b.enterprise_name,
-        a.car_number, a.delivery_time, a.delivery_id, a.delivery_name, a.sign_time, a.join_house_id, a.join_house_name, a.recycling_name, a.recycling_time from centerdata_t_housingconstruction_steelcylinder_log a
+        a.car_number, a.delivery_time, a.delivery_id, a.delivery_name, a.sign_time, a.join_house_id, a.join_house_name, a.recycling_name,
+        a.recycling_time,a.inspector_id,a.inspector_name,a.inspector_time from centerdata_t_housingconstruction_steelcylinder_log a
         left join centerdata_t_housingconstruction_steelcylinder b on a.steelcylinder_id = b.id
         left  join ${database_system}.sys_dept d on b.dept_id = d.dept_id
         <where>
@@ -70,6 +74,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="recyclingName != null">recycling_name,</if>
             <if test="recyclingTime != null">recycling_time,</if>
             <if test="updateTime != null">update_time,</if>
+            <if test="inspectorId != null">inspector_id,</if>
+            <if test="inspectorName != null">inspector_name,</if>
+            <if test="inspectorTime != null">inspector_time,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null and id != ''">#{id},</if>
@@ -91,6 +98,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="recyclingName != null">#{recyclingName},</if>
             <if test="recyclingTime != null">#{recyclingTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
+            <if test="inspectorId != null">#{inspectorId},</if>
+            <if test="inspectorName != null">#{inspectorName},</if>
+            <if test="inspectorTime != null">#{inspectorTime},</if>
          </trim>
     </insert>
 
@@ -115,6 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="recyclingName != null">recycling_name = #{recyclingName},</if>
             <if test="recyclingTime != null">recycling_time = #{recyclingTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="inspectorId != null">inspector_id = #{inspectorId},</if>
+            <if test="inspectorName != null">inspector_name = #{inspectorName},</if>
+            <if test="inspectorTime != null">inspector_time = #{inspectorTime},</if>
         </trim>
         where id = #{id}
     </update>

+ 32 - 3
src/main/resources/mapper/housingconstruction/CenterdataTHousingconstructionViewMapper.xml

@@ -138,6 +138,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="enterpriseId != null  and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
           and DATE_FORMAT(a.account_open_time, '%Y-%m-%d') >= DATE_SUB( CURRENT_DATE, INTERVAL 30 DAY )
             ${params.dataScope}
+        UNION ALL
+        SELECT
+            'realnameuser' type,
+            count( a.id ) num
+        FROM
+            centerdata_t_housingconstruction_realnameuser a
+            LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
+        WHERE a.license_code IS NOT NULL
+        <if test="enterpriseId != null  and enterpriseId != ''"> and enterprise_id = #{enterpriseId}</if>
+        ${params.dataScope}
     </select>
 
     <select id="getSteelcylinderList" parameterType="CenterdataTHousingconstructionSteelcylinder" resultType="map">
@@ -274,6 +284,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             IFNULL(b.num ,0) num
         FROM
             ${database_system}.sys_dict_data a
+        LEFT JOIN (
+            SELECT
+                a.post,
+                count( a.id ) num
+            FROM
+            centerdata_t_housingconstruction_delivery_personnel a
+            LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
+            <where>
+                ${params.dataScope}
+            </where>
+            GROUP BY a.post
+        ) b ON a.dict_value = b.post
+        WHERE a.dict_type = 'personnel_post' union all
+        SELECT
+            a.dict_label type,
+            IFNULL(b.num ,0) num
+        FROM
+            ${database_system}.sys_dict_data a
             LEFT JOIN (
             SELECT
                 a.post,
@@ -281,9 +309,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             FROM
                 centerdata_t_housingconstruction_practitioner a
                     LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
-        <where>
-            ${params.dataScope}
-        </where>
+            <where>
+                ${params.dataScope}
+            </where>
             GROUP BY a.post
             ) b ON a.dict_value = b.post
         WHERE a.dict_type = 'practitioner_post'
@@ -443,6 +471,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             SUBSTRING_INDEX( GROUP_CONCAT( l.steelcylinder_name ORDER BY sign_time DESC ), ',', 1 ) steelcylinderName,
             u.longitude,
             u.latitude,
+            u.user_name userName,
             u.gas_address gasAddress,
             d.address,
             a.dept_name deptName,