Browse Source

安检维修

wangzhe 7 months ago
parent
commit
31fec38393

+ 82 - 16
ruoyi-yiqi/src/main/java/com/ruoyi/yiqi/entity/YqGOrder.java

@@ -1,10 +1,16 @@
 package com.ruoyi.yiqi.entity;
 
 import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.core.domain.BaseEntity;
+import com.ruoyi.common.core.validate.AddGroup;
+import com.ruoyi.common.core.validate.EditGroup;
 import lombok.Data;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.util.Date;
 import java.util.List;
 
@@ -21,77 +27,137 @@ public class YqGOrder extends BaseEntity {
 
     private static final long serialVersionUID=1L;
 
-    private String value;
-
-    private List<String> photoList;
     /**
      * 主键id
      */
-    @TableId(value = "id")
+    // @ApiModelProperty(value = "主键id")
     private Long id;
+    private Long areaId;
+    private String areaName;
+    private Long buildingId;
+    private String buildingName;
+    private Long unitId;
+    private String unitName;
+    private Long foremanId;
+    private Long workerId;
+    private Long parentId;
+    private String value;
+    private String house;
+    private String userName;
+
+
+
+
     /**
      * 订单号
      */
+    // @ApiModelProperty(value = "订单号")
     private String orderNum;
+
     /**
      * 服务类别
      * 字典 :001 上门未遇 002 正常施工 003 不符合规定
      * 非字典 004安检 005维修  006开栓
      */
+    // @ApiModelProperty(value = "服务类别", required = true)
+    @NotBlank(message = "服务类别不能为空", groups = { AddGroup.class, EditGroup.class })
     private String serviceType;
 
     /**
      * 工人id
      */
+    // @ApiModelProperty(value = "工人id", required = true)
+    @NotNull(message = "工人id不能为空", groups = { AddGroup.class, EditGroup.class })
     private Long userId;
 
-    private Long areaId;
-    private String areaName;
-    private Long buildingId;
-    private String buildingName;
-    private Long unitId;
-    private String unitName;
     /**
      * 房屋id
      */
+    // @ApiModelProperty(value = "房屋id")
     private Long houseId;
     private String houseName;
+
     /**
      * 管子长度
      */
+    // @ApiModelProperty("管子长度")
     private String pipeLength;
-    private String valveType;
-
     /**
      * 管子类别
      */
+    // @ApiModelProperty("管子类别")
     private String pipeType;
+    // @ApiModelProperty("自闭阀类型")
+    private String valveType;
     /**
      * 订单状态
      */
+    // @ApiModelProperty(value = "订单状态", required = true)
     private String orderStatus;
+
     /**
      * 审核状态
      */
+    // @ApiModelProperty(value = "审核状态", required = true)
     private String examineStatus;
+
     /**
      * 备注
      */
+    // @ApiModelProperty(value = "备注")
     private String remark;
     /**
      * 审核意见
      */
     private String reason;
+
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    // @ApiModelProperty("时间")
     private Date time;
+
+
+//    /**
+//     * 分页大小
+//     */
+//    // @ApiModelProperty("分页大小")
+//    private Integer pageSize;
+//
+//    /**
+//     * 当前页数
+//     */
+//    // @ApiModelProperty("当前页数")
+//    private Integer pageNum;
+
+    /**
+     * 排序列
+     */
+    // @ApiModelProperty("排序列")
+    private String orderByColumn;
+
+    /**
+     * 排序的方向desc或者asc
+     */
+    // @ApiModelProperty(value = "排序的方向", example = "asc,desc")
+    private String isAsc;
+
+    private List<String> photoList;
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    // @ApiModelProperty("时间")
+    private Date starTime;
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    // @ApiModelProperty("时间")
+    private Date endTime;
     /**
-     * 删除标志
+     * 工号前四位
      */
-    @TableLogic
-    private String delFlag;
+    private String jobNum;
 
-    @Version
     private Integer version;
     private String whether;
+    private String district;
 
     /**
      * 分页大小

+ 83 - 83
ruoyi-yiqi/src/main/resources/mapper/YqGOrderMapper.xml

@@ -37,7 +37,7 @@
         c.NAME,
         '-',
         b.NAME
-        ) is null,null,(select go.id from g_order go where go.house_id = a.house_id and go.del_flag='0' and go.service_type='004' order by go.time desc LIMIT 1)) as anjianId,
+        ) is null,null,(select go.id from yq_g_order go where go.house_id = a.house_id and go.del_flag='0' and go.service_type='004' order by go.time desc LIMIT 1)) as anjianId,
         a.id as id,
         a.service_type as serviceType,
         u.name as userName,
@@ -51,13 +51,13 @@
         a.whether as whether,
         a.version as version,
         CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
-        from g_order a
-        left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
-        left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
-        left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
-        left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
+        from yq_g_order a
+        left join yq_g_house b on ( a.house_id = b.id and b.del_flag = '0')
+        left join yq_g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
+        left join yq_g_building d on ( c.building_id = d.id and d.del_flag = '0')
+        left join yq_g_area e on ( d.area_id = e.id and e.del_flag = '0')
         left join sys_dict_data f on ( e.district = f.dict_value and f.dict_type='district')
-        left join g_user u on a.user_id = u.id
+        left join yq_g_user u on a.user_id = u.id
         where a.del_flag = '0'
         and a.service_type not in ('004','005','006')
 
@@ -115,13 +115,13 @@
         a.version as version,
         a.house_id as houseId,
         a.reason as reason
-        from g_order a
-        left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
-        left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
-        left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
-        left join g_area e on ( d.area_id = e.id  and e.del_flag = '0')
+        from yq_g_order a
+        left join yq_g_house b on ( a.house_id = b.id and b.del_flag = '0')
+        left join yq_g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
+        left join yq_g_building d on ( c.building_id = d.id and d.del_flag = '0')
+        left join yq_g_area e on ( d.area_id = e.id  and e.del_flag = '0')
         left join sys_dict_data f on e.district = f.dict_value
-        left join g_user u on a.user_id = u.id
+        left join yq_g_user u on a.user_id = u.id
         where a.del_flag = '0'
         and a.service_type not in ('004','005','006')
         and f.dict_type='district'
@@ -177,13 +177,13 @@
         a.whether as whether,
         a.version as version,
         CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
-        from g_order a
-        left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
-        left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
-        left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
-        left join g_area e on ( d.area_id = e.id  and e.del_flag = '0')
+        from yq_g_order a
+        left join yq_g_house b on ( a.house_id = b.id and b.del_flag = '0')
+        left join yq_g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
+        left join yq_g_building d on ( c.building_id = d.id and d.del_flag = '0')
+        left join yq_g_area e on ( d.area_id = e.id  and e.del_flag = '0')
         left join sys_dict_data f on ( e.district = f.dict_value and f.dict_type='district')
-        left join g_user u on a.user_id = u.id
+        left join yq_g_user u on a.user_id = u.id
         where a.del_flag = '0' and a.order_status = '001'
         and a.service_type not in ('004','005','006')
         <if test="p.serviceType != null  and p.serviceType != ''">
@@ -207,23 +207,23 @@
         order by time desc
     </select>
     <select id="getById" resultType="com.ruoyi.yiqi.entity.YqGOrder">
-        select * from g_order a
-                              left join g_house b on a.house_id = b.id
-                              left join g_unit c on b.unit_id = c.id
-                              left join g_building d on c.building_id = d.id
+        select * from yq_g_order a
+                              left join yq_g_house b on a.house_id = b.id
+                              left join yq_g_unit c on b.unit_id = c.id
+                              left join yq_g_building d on c.building_id = d.id
         where a.id = #{id} and a.del_flag = '0'
     </select>
     <select id="getByIdAndVersion" resultType="java.lang.Long">
-        select count(*) from g_order
+        select count(*) from yq_g_order
         where id = #{id} and del_flag = '0' and version = #{version}
     </select>
     <select id="getCount" resultType="java.lang.Integer">
         select count(DISTINCT o.house_id)
-        from g_order o
-                     left join g_house a on ( o.house_id = a.id and a.del_flag = '0')
-                     left join g_unit b on ( a.unit_id = b.id and b.del_flag = '0')
-                     left join g_building c on ( b.building_id = c.id and c.del_flag = '0')
-                     left join g_area d on ( c.area_id = d.id and d.del_flag = '0')
+        from yq_g_order o
+                     left join yq_g_house a on ( o.house_id = a.id and a.del_flag = '0')
+                     left join yq_g_unit b on ( a.unit_id = b.id and b.del_flag = '0')
+                     left join yq_g_building c on ( b.building_id = c.id and c.del_flag = '0')
+                     left join yq_g_area d on ( c.area_id = d.id and d.del_flag = '0')
         where d.id = #{id}
           and o.del_flag = '0'
           and o.order_status = '002'
@@ -232,11 +232,11 @@
     <select id="getExaminePipeType" resultType="com.ruoyi.yiqi.entity.YqGCensusVo">
         select count(DISTINCT o.id) as value,
             o.pipe_type as name
-        from g_order o
-                left join g_house a on ( o.house_id = a.id and a.del_flag = '0')
-                left join g_unit b on ( a.unit_id = b.id and b.del_flag = '0')
-                left join g_building c on ( b.building_id = c.id and c.del_flag = '0')
-                left join g_area d on ( c.area_id = d.id and d.del_flag = '0')
+        from yq_g_order o
+                left join yq_g_house a on ( o.house_id = a.id and a.del_flag = '0')
+                left join yq_g_unit b on ( a.unit_id = b.id and b.del_flag = '0')
+                left join yq_g_building c on ( b.building_id = c.id and c.del_flag = '0')
+                left join yq_g_area d on ( c.area_id = d.id and d.del_flag = '0')
         where o.service_type = '002'
         and o.del_flag = '0'
         <if test="id != null  and id != ''">
@@ -247,11 +247,11 @@
     <select id="getExaminePipeLength" resultType="com.ruoyi.yiqi.entity.YqGCensusVo">
         select count(DISTINCT o.id) as value,
             o.pipe_length as name
-        from g_order o
-                left join g_house a on ( o.house_id = a.id and a.del_flag = '0')
-                left join g_unit b on ( a.unit_id = b.id  and b.del_flag = '0')
-                left join g_building c on ( b.building_id = c.id  and c.del_flag = '0')
-                left join g_area d on ( c.area_id = d.id  and d.del_flag = '0')
+        from yq_g_order o
+                left join yq_g_house a on ( o.house_id = a.id and a.del_flag = '0')
+                left join yq_g_unit b on ( a.unit_id = b.id  and b.del_flag = '0')
+                left join yq_g_building c on ( b.building_id = c.id  and c.del_flag = '0')
+                left join yq_g_area d on ( c.area_id = d.id  and d.del_flag = '0')
         where
         o.service_type = '002'
           and o.del_flag = '0'
@@ -263,11 +263,11 @@
     <select id="getExamineValveType" resultType="com.ruoyi.yiqi.entity.YqGCensusVo">
         select count(DISTINCT o.id) as value,
         o.valve_type as name
-        from g_order o
-        left join g_house a on ( o.house_id = a.id and a.del_flag = '0')
-        left join g_unit b on ( a.unit_id = b.id and b.del_flag = '0')
-        left join g_building c on ( b.building_id = c.id and c.del_flag = '0')
-        left join g_area d on ( c.area_id = d.id and d.del_flag = '0')
+        from yq_g_order o
+        left join yq_g_house a on ( o.house_id = a.id and a.del_flag = '0')
+        left join yq_g_unit b on ( a.unit_id = b.id and b.del_flag = '0')
+        left join yq_g_building c on ( b.building_id = c.id and c.del_flag = '0')
+        left join yq_g_area d on ( c.area_id = d.id and d.del_flag = '0')
         where o.service_type = '002'
         and o.del_flag = '0'
         <if test="id != null  and id != ''">
@@ -276,7 +276,7 @@
         group by o.valve_type
     </select>
     <select id="getOrderForStatus" resultType="com.ruoyi.yiqi.entity.YqGOrder">
-        select * from g_order
+        select * from yq_g_order
         where house_id= #{houseId}
         and del_flag = '0'
             and service_type ='002'
@@ -302,11 +302,11 @@
         a.whether as whether,
         a.version as version,
         CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
-        from g_order a
-        left join g_house b on a.house_id = b.id
-        left join g_unit c on b.unit_id = c.id
-        left join g_building d on c.building_id = d.id
-        left join g_area e on d.area_id = e.id
+        from yq_g_order a
+        left join yq_g_house b on a.house_id = b.id
+        left join yq_g_unit c on b.unit_id = c.id
+        left join yq_g_building d on c.building_id = d.id
+        left join yq_g_area e on d.area_id = e.id
         left join sys_dict_data f on e.district = f.dict_value
         where a.del_flag = '0'
         and a.service_type not in ('004','005','006')
@@ -334,12 +334,12 @@
         a.whether as whether,
         a.version as version,
         CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
-        from g_order a
-        left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
-        left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
-        left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
-        left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
-        left join g_user u on a.user_id = u.id
+        from yq_g_order a
+        left join yq_g_house b on ( a.house_id = b.id and b.del_flag = '0')
+        left join yq_g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
+        left join yq_g_building d on ( c.building_id = d.id and d.del_flag = '0')
+        left join yq_g_area e on ( d.area_id = e.id and e.del_flag = '0')
+        left join yq_g_user u on a.user_id = u.id
         left join sys_dict_data f on ( e.district = f.dict_value and f.dict_type='district')
         where a.del_flag = '0' and a.service_type ='004'
         <if test="p.userId != null  and p.userId != ''">
@@ -379,12 +379,12 @@
         a.update_time as updateTime,
         CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house,
         a.whether as whether
-        from g_order a
-        left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
-        left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
-        left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
-        left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
-        left join g_user u on a.user_id = u.id
+        from yq_g_order a
+        left join yq_g_house b on ( a.house_id = b.id and b.del_flag = '0')
+        left join yq_g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
+        left join yq_g_building d on ( c.building_id = d.id and d.del_flag = '0')
+        left join yq_g_area e on ( d.area_id = e.id and e.del_flag = '0')
+        left join yq_g_user u on a.user_id = u.id
         left join sys_dict_data f on e.district = f.dict_value
         where a.del_flag = '0'
         and a.service_type ='004'
@@ -427,13 +427,13 @@
         a.whether as whether,
         a.version as version,
         CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
-        from g_order a
-        left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
-        left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
-        left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
-        left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
+        from yq_g_order a
+        left join yq_g_house b on ( a.house_id = b.id and b.del_flag = '0')
+        left join yq_g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
+        left join yq_g_building d on ( c.building_id = d.id and d.del_flag = '0')
+        left join yq_g_area e on ( d.area_id = e.id and e.del_flag = '0')
         left join sys_dict_data f on ( e.district = f.dict_value AND f.dict_type='district')
-        left join g_user u on a.user_id = u.id
+        left join yq_g_user u on a.user_id = u.id
         where a.service_type ='005' and a.del_flag = '0'
         <if test="p.userId != null  and p.userId != ''">
             and a.user_id = #{p.userId}
@@ -472,13 +472,13 @@
         a.update_time as updateTime,
         CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house,
         a.whether as whether
-        from g_order a
-        left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
-        left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
-        left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
-        left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
+        from yq_g_order a
+        left join yq_g_house b on ( a.house_id = b.id and b.del_flag = '0')
+        left join yq_g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
+        left join yq_g_building d on ( c.building_id = d.id and d.del_flag = '0')
+        left join yq_g_area e on ( d.area_id = e.id and e.del_flag = '0')
         left join sys_dict_data f on e.district = f.dict_value
-        left join g_user u on a.user_id = u.id
+        left join yq_g_user u on a.user_id = u.id
         where a.del_flag = '0'
         and a.service_type ='005'
         and f.dict_type='district'
@@ -518,13 +518,13 @@
         a.time as time,
         a.update_time as updateTime,
         CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
-        from g_order a
-        left join g_house b on ( a.house_id = b.id and b.del_flag = '0')
-        left join g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
-        left join g_building d on ( c.building_id = d.id and d.del_flag = '0')
-        left join g_area e on ( d.area_id = e.id and e.del_flag = '0')
+        from yq_g_order a
+        left join yq_g_house b on ( a.house_id = b.id and b.del_flag = '0')
+        left join yq_g_unit c on ( b.unit_id = c.id and c.del_flag = '0')
+        left join yq_g_building d on ( c.building_id = d.id and d.del_flag = '0')
+        left join yq_g_area e on ( d.area_id = e.id and e.del_flag = '0')
         left join sys_dict_data f on e.district = f.dict_value
-        left join g_user u on a.user_id = u.id
+        left join yq_g_user u on a.user_id = u.id
         where a.del_flag = '0'
         and a.service_type ='006'
         and f.dict_type='district'
@@ -558,16 +558,16 @@
         order by a.update_time desc
     </select>
     <select id="getByHouseId" resultType="com.ruoyi.yiqi.entity.YqGOrder">
-        select * from g_order
+        select * from yq_g_order
         where house_id = #{houseId}
             and service_type = "002"
           and del_flag = '0'
     </select>
     <update id="updateOrderByHouseId" parameterType="java.lang.Long">
-        update g_order set examine_status='001', order_status='002' where house_id=#{houseId} and service_type='002'
+        update yq_g_order set examine_status='001', order_status='002' where house_id=#{houseId} and service_type='002'
     </update>
 
     <update id="updateHouseId" parameterType="java.lang.Long">
-        update g_order set house_id=#{xhouseId} where house_id=#{yhouseId}
+        update yq_g_order set house_id=#{xhouseId} where house_id=#{yhouseId}
     </update>
 </mapper>

+ 3 - 3
ruoyi-yiqi/src/main/resources/mapper/YqGOrderPhotoMapper.xml

@@ -16,7 +16,7 @@
     </resultMap>
     <select id="getPicUrl" resultType="java.lang.String">
         select pic_url
-        from g_order_photo
+        from yq_g_order_photo
         where order_id = #{orderId}
           and del_flag = '0'
     </select>
@@ -26,7 +26,7 @@
         d.name as unit,
         e.name as building,
         f.name as area
-        from g_order_photo a
+        from yq_g_order_photo a
         left join g_order b on a.order_id = b.id
         left join g_house c on b.house_id = c.id
         left join g_unit d on c.unit_id = d.id
@@ -40,7 +40,7 @@
         and b.del_flag = '0'
     </select>
     <delete id="deleteByUrl" parameterType="String">
-        delete from g_order_photo where order_id = #{orderId}
+        delete from yq_g_order_photo where order_id = #{orderId}
         and pic_url in
         <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
             #{item}