浏览代码

客户主页后台提交工单接口修改
工单取消接口
工单提交逻辑修改
邀请师傅接口

yanliming 4 周之前
父节点
当前提交
5df89f7044
共有 22 个文件被更改,包括 776 次插入201 次删除
  1. 1 0
      common/src/main/java/com/jpsoft/employment/modules/base/dao/ConstructionProgressDAO.java
  2. 0 2
      common/src/main/java/com/jpsoft/employment/modules/base/dto/EnterCertificationDTO.java
  3. 3 0
      common/src/main/java/com/jpsoft/employment/modules/base/dto/EnterInfoDTO.java
  4. 13 0
      common/src/main/java/com/jpsoft/employment/modules/base/dto/PayWorkOrderDTO.java
  5. 6 0
      common/src/main/java/com/jpsoft/employment/modules/base/dto/TechnicianDTO.java
  6. 44 0
      common/src/main/java/com/jpsoft/employment/modules/base/dto/WorkOrderListDTO.java
  7. 11 0
      common/src/main/java/com/jpsoft/employment/modules/base/entity/TechnicianInfo.java
  8. 6 3
      common/src/main/java/com/jpsoft/employment/modules/base/entity/WorkOrder.java
  9. 3 1
      common/src/main/java/com/jpsoft/employment/modules/base/service/WorkOrderService.java
  10. 117 8
      common/src/main/java/com/jpsoft/employment/modules/base/service/impl/WorkOrderServiceImpl.java
  11. 7 1
      common/src/main/resources/mapper/base/ConstructionProgress.xml
  12. 7 1
      common/src/main/resources/mapper/base/TechnicianInfo.xml
  13. 122 103
      common/src/main/resources/mapper/base/WorkOrder.xml
  14. 二进制
      common/target/classes/com/jpsoft/employment/modules/base/dao/ConstructionProgressDAO.class
  15. 二进制
      common/target/classes/com/jpsoft/employment/modules/base/entity/WorkOrder.class
  16. 二进制
      common/target/classes/com/jpsoft/employment/modules/base/service/WorkOrderService.class
  17. 二进制
      common/target/classes/com/jpsoft/employment/modules/base/service/impl/WorkOrderServiceImpl.class
  18. 7 1
      common/target/classes/mapper/base/ConstructionProgress.xml
  19. 20 1
      common/target/classes/mapper/base/WorkOrder.xml
  20. 31 0
      web/src/main/java/com/jpsoft/employment/modules/base/controller/CustomerInfoController.java
  21. 30 0
      web/src/main/java/com/jpsoft/employment/modules/base/controller/WorkOrderController.java
  22. 348 80
      web/src/main/java/com/jpsoft/employment/modules/mobile/controller/CustomerInfoApiController.java

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/ConstructionProgressDAO.java

@@ -15,6 +15,7 @@ public interface ConstructionProgressDAO {
 	int delete(String id);
 	List<ConstructionProgress> list();
 	List<ConstructionProgress> findByWorkOrderId(String workOrderId);
+	ConstructionProgress findLastByWorkOrderId(String workOrderId);
 	List<ConstructionProgress> search(Map<String, Object> searchParams, List<Sort> sortList);
 	int getIndex(String workOrderId);
 }

+ 0 - 2
common/src/main/java/com/jpsoft/employment/modules/base/dto/EnterCertificationDTO.java

@@ -5,8 +5,6 @@ import lombok.Data;
 
 @Data
 public class EnterCertificationDTO {
-    @ApiModelProperty(value = "企业Id")
-    private String id;
 
     @ApiModelProperty(value = "企业名称")
     private String companyName;

+ 3 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dto/EnterInfoDTO.java

@@ -26,4 +26,7 @@ public class EnterInfoDTO {
 
     @ApiModelProperty(value = "电话")
     private String phone;
+
+    @ApiModelProperty(value = "营业执照")
+    private String businessLicense;
 }

+ 13 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dto/PayWorkOrderDTO.java

@@ -0,0 +1,13 @@
+package com.jpsoft.employment.modules.base.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class PayWorkOrderDTO {
+    @ApiModelProperty(value = "ID")
+    private String id;
+
+    @ApiModelProperty(value = "凭证")
+    private String certificate;
+}

+ 6 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dto/TechnicianDTO.java

@@ -34,4 +34,10 @@ public class TechnicianDTO {
     @ApiModelProperty(value = "服务信息")
     private String serviceInfo;
 
+    @ApiModelProperty(value = "头像")
+    private String image;
+
+    @ApiModelProperty(value = "业务范围")
+    private String businessScope;
+
 }

+ 44 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dto/WorkOrderListDTO.java

@@ -0,0 +1,44 @@
+package com.jpsoft.employment.modules.base.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class WorkOrderListDTO {
+    @ApiModelProperty(value = "ID")
+    private String id;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "标签")
+    private List<String> tagList;
+
+    @ApiModelProperty(value = "日期")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
+    private Date date;
+
+    @ApiModelProperty(value = "工单状态(0:待确认,1:待接单,2:待入场,3:施工中,4:待验收,5:质保中,6:已出保,7:已取消)")
+    private String status;
+
+    @ApiModelProperty(value = "工单状态翻译字符串")
+    private String statusN;
+
+    @ApiModelProperty(value = "备注")
+    private String bak;
+
+    @ApiModelProperty(value = "师傅姓名")
+    private String technicianName;
+
+    @ApiModelProperty(value = "师傅头像")
+    private String technicianImage;
+
+    @ApiModelProperty(value = "师傅会员等级")
+    private Integer technicianLevel;
+}

+ 11 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/TechnicianInfo.java

@@ -4,6 +4,8 @@ import java.io.Serializable;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
+
+import org.springframework.data.annotation.Transient;
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
@@ -89,5 +91,14 @@ public class TechnicianInfo {
 
 	@ApiModelProperty(value = "会员等级")
 	private Integer level;
+
+
+	@Transient
+	@ApiModelProperty(value = "完成单数")
+	private Integer completeOrderNum;
+
+	@Transient
+	@ApiModelProperty(value = "合作单数")
+	private Integer cooperationNum;
 	
 		}

+ 6 - 3
common/src/main/java/com/jpsoft/employment/modules/base/entity/WorkOrder.java

@@ -31,8 +31,8 @@ public class WorkOrder {
 	private String address;
 	
 					@ApiModelProperty(value = "日期")
-	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
-	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
 	private Date date;
 	
 			@ApiModelProperty(value = "标签")
@@ -41,7 +41,7 @@ public class WorkOrder {
 				@ApiModelProperty(value = "图片")
 	private String image;
 	
-				@ApiModelProperty(value = "工单状态(1:接单,2:拒绝)")
+				@ApiModelProperty(value = "工单状态(0:待确认,1:待接单,2:待入场,3:施工中,4:待验收,5:质保中,6:已出保,7:已取消)")
 	private String status;
 	
 				@ApiModelProperty(value = "报价")
@@ -111,6 +111,9 @@ public class WorkOrder {
 	@ApiModelProperty(value = "取消凭证")
 	private String cancelImages;
 
+	@ApiModelProperty(value = "多少师傅看过")
+	private Integer peopleSeenNum;
+
 
 	@Transient
 	@ApiModelProperty(value = "支付状态")

+ 3 - 1
common/src/main/java/com/jpsoft/employment/modules/base/service/WorkOrderService.java

@@ -13,8 +13,10 @@ public interface WorkOrderService {
 	WorkOrder get(String id);
 	boolean exist(String id);
 	int insert(WorkOrder model);
-	int insertDTO(WorkOrderSubDataDTO dto,String createBy);
+	String insertDTO(WorkOrderSubDataDTO dto,String createBy);
 	int update(WorkOrder model);
+	int updateAndProgress(WorkOrder model);
+	int cancelWorkOrder(WorkOrder model,String subject);
 	int delete(String id);
 	List<WorkOrder> list();
 	List<String> findTopByCustomerId(String customerId);

+ 117 - 8
common/src/main/java/com/jpsoft/employment/modules/base/service/impl/WorkOrderServiceImpl.java

@@ -1,5 +1,6 @@
 package com.jpsoft.employment.modules.base.service.impl;
 
+import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import javax.annotation.Resource;
@@ -8,6 +9,7 @@ import com.jpsoft.employment.modules.base.dao.*;
 import com.jpsoft.employment.modules.base.dto.WorkOrderAllDataDTO;
 import com.jpsoft.employment.modules.base.dto.WorkOrderSubDataDTO;
 import com.jpsoft.employment.modules.base.entity.*;
+import com.jpsoft.employment.modules.sys.dao.DataDictionaryDAO;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
@@ -40,6 +42,9 @@ public class WorkOrderServiceImpl implements WorkOrderService {
     @Resource(name = "constructionProgressDAO")
     private ConstructionProgressDAO constructionProgressDAO;
 
+    @Resource(name = "dataDictionaryDAO")
+    private DataDictionaryDAO dataDictionaryDAO;
+
     @Override
     public WorkOrder get(String id) {
         // TODO Auto-generated method stub
@@ -55,9 +60,10 @@ public class WorkOrderServiceImpl implements WorkOrderService {
     }
 
     @Override
-    public int insertDTO(WorkOrderSubDataDTO dto, String createBy) {
+    public String insertDTO(WorkOrderSubDataDTO dto, String createBy) {
         // TODO Auto-generated method stub
         //model.setId(UUID.randomUUID().toString());
+
         WorkOrder workOrder = new WorkOrder();
         Date now = new Date();
         workOrder.setCreateTime(now);
@@ -65,8 +71,14 @@ public class WorkOrderServiceImpl implements WorkOrderService {
         workOrder.setDelFlag(false);
         workOrder.setCreateBy(createBy);
         workOrder.setPayStatus("0");
-        workOrder.setStatus("1");
+        workOrder.setStatus("0");
+        workOrder.setPeopleSeenNum(0);
         workOrder.setCompanyId(createBy);
+        workOrder.setTitle(dto.getTitle());
+        workOrder.setDate(now);
+
+        String tag = getTag(dto);
+        workOrder.setTag(tag);
 
         //生成工单号
         SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
@@ -83,7 +95,7 @@ public class WorkOrderServiceImpl implements WorkOrderService {
             if (curDate.equals(yearMonthDay)) {
                 int tail = Integer.parseInt(lastNumber.substring(8));
                 tail += 1;
-                number = curDate + String.valueOf(tail);
+                number = curDate + String.format("%04d", tail);
             } else {
                 number = curDate + "0001";
             }
@@ -95,6 +107,8 @@ public class WorkOrderServiceImpl implements WorkOrderService {
 
         int affectCount = workOrderDAO.insert(workOrder);
 
+        String returnId = "";
+
         if (affectCount > 0) {
             //水箱需求
             InstallationRequirement installationRequirement = new InstallationRequirement();
@@ -150,9 +164,45 @@ public class WorkOrderServiceImpl implements WorkOrderService {
             constructionProgress.setTitle("发布了工单");
             constructionProgress.setWorkOrderId(workOrder.getId());
             constructionProgressDAO.insert(constructionProgress);
+
+            returnId = workOrder.getId();
         }
 
-        return affectCount;
+        return returnId;
+    }
+
+    private String getTag(WorkOrderSubDataDTO dto) {
+        String tag = "";
+        //所在地区
+
+
+        //施工环境
+        String name = dataDictionaryDAO.findNameByCatalogNameAndValue("施工环境", dto.getEnvironment());
+        if (StringUtils.isNotEmpty(name)) {
+            tag += name + ",";
+        }
+
+        //平方:0,立方:1
+        String sizeUnit;
+        if ("0".equals(dto.getSizeUnit())) {
+            sizeUnit = "㎡";
+        } else {
+            sizeUnit = "m³";
+        }
+        String sizeStr = String.valueOf(dto.getSize());
+        tag += sizeStr + sizeUnit + ",";
+
+        //是否有补贴
+        Boolean isSubsidy = dto.getIsSubsidy();
+        if (isSubsidy) {
+            tag += "有补贴" + ",";
+        }
+
+        if (StringUtils.isNotEmpty(tag)) {
+            tag = tag.substring(0, tag.lastIndexOf(","));
+        }
+
+        return tag;
     }
 
 
@@ -162,6 +212,55 @@ public class WorkOrderServiceImpl implements WorkOrderService {
         return workOrderDAO.update(model);
     }
 
+    @Override
+    public int updateAndProgress(WorkOrder model) {
+        // TODO Auto-generated method stub
+        int affectCount = workOrderDAO.update(model);
+        if (affectCount > 0) {
+            ConstructionProgress constructionProgress = new ConstructionProgress();
+            constructionProgress.setId(UUID.randomUUID().toString());
+            constructionProgress.setWorkOrderId(model.getId());
+            constructionProgress.setTitle("确认了工单");
+            constructionProgress.setDelFlag(false);
+            constructionProgress.setCreateBy(model.getUpdateBy());
+            constructionProgress.setCreateTime(new Date());
+
+            ConstructionProgress lastItem = constructionProgressDAO.findLastByWorkOrderId(model.getId());
+            if (lastItem != null) {
+                constructionProgress.setIndex(lastItem.getIndex() + 1);
+            }
+            constructionProgressDAO.insert(constructionProgress);
+        }
+        return affectCount;
+    }
+
+
+    @Override
+    public int cancelWorkOrder(WorkOrder model,String subject) {
+        // TODO Auto-generated method stub
+        Date now=new Date();
+        model.setUpdateTime(new Date());
+        model.setUpdateBy(subject);
+        model.setStatus("7");
+
+        int affectCount = workOrderDAO.update(model);
+        if(affectCount > 0){
+            ConstructionProgress item = new ConstructionProgress();
+            item.setId(UUID.randomUUID().toString());
+            item.setDelFlag(false);
+            item.setCreateTime(now);
+            item.setCreateBy(subject);
+            item.setWorkOrderId(model.getId());
+            ConstructionProgress constructionProgress = constructionProgressDAO.findLastByWorkOrderId(model.getId());
+            if(constructionProgress!=null){
+                item.setIndex(constructionProgress.getIndex()+1);
+            }
+            constructionProgressDAO.insert(item);
+        }
+
+        return workOrderDAO.update(model);
+    }
+
     @Override
     public int delete(String id) {
         // TODO Auto-generated method stub
@@ -197,8 +296,16 @@ public class WorkOrderServiceImpl implements WorkOrderService {
         ReceiveRequire receiveRequire = receiveRequireDAO.findByWorkOrderId(id);
         dto.setReceiveRequire(receiveRequire);
 
-        dto.setCustomerName(workOrder.getCustomerName());
-        dto.setCustomerPhone(workOrder.getCustomerPhone());
+        String customerName = "";
+        String customerPhone = "";
+        CustomerInfo customerItem = customerInfoDAO.get(workOrder.getCompanyId());
+        if(customerItem!=null){
+            customerName = customerItem.getCompanyName();
+            customerPhone = customerItem.getPhone();
+        }
+
+        dto.setCustomerName(customerName);
+        dto.setCustomerPhone(customerPhone);
 
         List<String> imageList = new ArrayList<>();
 
@@ -252,7 +359,9 @@ public class WorkOrderServiceImpl implements WorkOrderService {
                 }
             }
 
-            constructionProgress.setSubmitDate(sdf.format(constructionProgress.getSubmitTime()));
+            if (constructionProgress.getSubmitTime() != null) {
+                constructionProgress.setSubmitDate(sdf.format(constructionProgress.getSubmitTime()));
+            }
         }
 
         dto.setConstructionProgressList(ConstructionProgressList);
@@ -287,7 +396,7 @@ public class WorkOrderServiceImpl implements WorkOrderService {
     }
 
     @Override
-    public Integer countByTechnicianId(Map<String, Object> searchParams){
+    public Integer countByTechnicianId(Map<String, Object> searchParams) {
         return workOrderDAO.countByTechnicianId(searchParams);
     }
 

+ 7 - 1
common/src/main/resources/mapper/base/ConstructionProgress.xml

@@ -103,7 +103,13 @@ id_,title_,image_,submit_by,submit_type,submit_time,work_order_id,index_,create_
 	<select id="findByWorkOrderId" resultMap="ConstructionProgressMap">
 		select * from base_construction_progress where del_flag=false and work_order_id=#{0}
 	</select>
-
+	<select id="findLastByWorkOrderId" resultMap="ConstructionProgressMap">
+		select * from base_construction_progress
+		where del_flag=false
+		and work_order_id=#{0}
+		order by create_time desc
+		limit 1
+	</select>
 	<select id="search" parameterType="hashmap" resultMap="ConstructionProgressMap">
 		<![CDATA[
 			select * from base_construction_progress

+ 7 - 1
common/src/main/resources/mapper/base/TechnicianInfo.xml

@@ -157,8 +157,11 @@
 			select * from base_technician_info
 		]]>
 		<where>
+			<if test="searchParams.status != null">
+				and status_ = #{searchParams.status}
+			</if>
 			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+				and real_name like #{searchParams.id}
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
@@ -174,6 +177,9 @@
 			<if test="searchParams.id != null">
 				and ID_ like #{searchParams.id}
 			</if>
+			<if test="searchParams.name != null">
+				and ID_ like #{searchParams.name}
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 			${sort.name} ${sort.order}

+ 122 - 103
common/src/main/resources/mapper/base/WorkOrder.xml

@@ -1,49 +1,51 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!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">
 <!-- namespace必须指向DAO接口 -->
 <mapper namespace="com.jpsoft.employment.modules.base.dao.WorkOrderDAO">
 	<resultMap id="WorkOrderMap" type="com.jpsoft.employment.modules.base.entity.WorkOrder">
 		<id property="id" column="id_" />
-			<result property="number" column="number_" />
-			<result property="title" column="title_" />
-			<result property="address" column="address_" />
-			<result property="date" column="date_" />
-			<result property="tag" column="tag_" />
-			<result property="image" column="image_" />
-			<result property="status" column="status_" />
-			<result property="price" column="price_" />
-			<result property="location" column="location_" />
-			<result property="companyId" column="company_id" />
-			<result property="map" column="map_" />
-			<result property="constructionLocation" column="construction_location" />
-			<result property="environment" column="environment" />
-			<result property="volume" column="volume_" />
-			<result property="technicianId" column="technician_id" />
-			<result property="payStatus" column="pay_status" />
-			<result property="createTime" column="create_time" />
-			<result property="updateTime" column="update_time" />
-			<result property="delFlag" column="del_flag" />
-			<result property="createBy" column="create_by" />
-			<result property="updateBy" column="update_by" />
-			<result property="customerName" column="customer_name" />
-			<result property="customerPhone" column="customer_phone" />
-			<result property="viewNum" column="view_num" />
-			<result property="certificate" column="certificate_" />
-			<result property="cancelCauses" column="cancel_causes" />
-			<result property="cancelReasons" column="cancel_reasons" />
-			<result property="cancelImages" column="cancel_images" />
+		<result property="number" column="number_" />
+		<result property="title" column="title_" />
+		<result property="address" column="address_" />
+		<result property="date" column="date_" />
+		<result property="tag" column="tag_" />
+		<result property="image" column="image_" />
+		<result property="status" column="status_" />
+		<result property="price" column="price_" />
+		<result property="location" column="location_" />
+		<result property="companyId" column="company_id" />
+		<result property="map" column="map_" />
+		<result property="constructionLocation" column="construction_location" />
+		<result property="environment" column="environment" />
+		<result property="volume" column="volume_" />
+		<result property="technicianId" column="technician_id" />
+		<result property="payStatus" column="pay_status" />
+		<result property="createTime" column="create_time" />
+		<result property="updateTime" column="update_time" />
+		<result property="delFlag" column="del_flag" />
+		<result property="createBy" column="create_by" />
+		<result property="updateBy" column="update_by" />
+		<result property="customerName" column="customer_name" />
+		<result property="customerPhone" column="customer_phone" />
+		<result property="viewNum" column="view_num" />
+		<result property="certificate" column="certificate_" />
+		<result property="cancelCauses" column="cancel_causes" />
+		<result property="cancelReasons" column="cancel_reasons" />
+		<result property="cancelImages" column="cancel_images" />
+		<result property="peopleSeenNum" column="people_seen_num" />
+
 	</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.WorkOrder">
-	<!--
-	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
-		select sys_guid() from dual
-	</selectKey>
-	-->
-	<![CDATA[
+		<!--
+        <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+            select sys_guid() from dual
+        </selectKey>
+        -->
+		<![CDATA[
 		insert into base_work_order
 	    (id_,number_,title_,address_,date_,tag_,image_,status_,price_,location_,company_id,map_,construction_location,environment,volume_,technician_id,pay_status,create_time,update_time,del_flag,create_by,update_by,
-	    customer_name,customer_phone,view_num,certificate_,cancel_causes,cancel_reasons,cancel_images)
+	    customer_name,customer_phone,view_num,certificate_,cancel_causes,cancel_reasons,cancel_images,people_seen_num)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -75,6 +77,7 @@
 ,#{cancelCauses,jdbcType=VARCHAR}
 ,#{cancelReasons,jdbcType=VARCHAR}
 ,#{cancelImages,jdbcType=VARCHAR}
+,#{peopleSeenNum,jdbcType= NUMERIC }
 		)
 	]]>
 	</insert>
@@ -84,69 +87,69 @@
 	<update id="update" parameterType="com.jpsoft.employment.modules.base.entity.WorkOrder">
 		update base_work_order
 		<set>
-				<if test="number!=null">
-		number_=#{number,jdbcType=VARCHAR},
-		</if>
-				<if test="title!=null">
-		title_=#{title,jdbcType=VARCHAR},
-		</if>
-				<if test="address!=null">
-		address_=#{address,jdbcType=VARCHAR},
-		</if>
-				<if test="date!=null">
-		date_=#{date,jdbcType= TIMESTAMP },
-		</if>
-				<if test="tag!=null">
-		tag_=#{tag,jdbcType=VARCHAR},
-		</if>
-				<if test="image!=null">
-		image_=#{image,jdbcType=VARCHAR},
-		</if>
-				<if test="status!=null">
-		status_=#{status,jdbcType=VARCHAR},
-		</if>
-				<if test="price!=null">
-		price_=#{price,jdbcType= NUMERIC },
-		</if>
-				<if test="location!=null">
-		location_=#{location,jdbcType=VARCHAR},
-		</if>
-				<if test="companyId!=null">
-		company_id=#{companyId,jdbcType=VARCHAR},
-		</if>
-				<if test="map!=null">
-		map_=#{map,jdbcType=VARCHAR},
-		</if>
-				<if test="constructionLocation!=null">
-		construction_location=#{constructionLocation,jdbcType=VARCHAR},
-		</if>
-				<if test="environment!=null">
-		environment=#{environment,jdbcType=VARCHAR},
-		</if>
-				<if test="volume!=null">
-		volume_=#{volume,jdbcType= NUMERIC },
-		</if>
-				<if test="technicianId!=null">
-		technician_id=#{technicianId,jdbcType=VARCHAR},
-		</if>
-				<if test="payStatus!=null">
-		pay_status=#{payStatus,jdbcType=VARCHAR},
-		</if>
-				<if test="createTime!=null">
-		create_time=#{createTime,jdbcType= TIMESTAMP },
-		</if>
-				<if test="updateTime!=null">
-		update_time=#{updateTime,jdbcType= TIMESTAMP },
-		</if>
-				<if test="delFlag!=null">
-		del_flag=#{delFlag,jdbcType= NUMERIC },
-		</if>
-				<if test="createBy!=null">
-		create_by=#{createBy,jdbcType=VARCHAR},
-		</if>
-				<if test="updateBy!=null">
-		update_by=#{updateBy,jdbcType=VARCHAR},
-		</if>
+			<if test="number!=null">
+				number_=#{number,jdbcType=VARCHAR},
+			</if>
+			<if test="title!=null">
+				title_=#{title,jdbcType=VARCHAR},
+			</if>
+			<if test="address!=null">
+				address_=#{address,jdbcType=VARCHAR},
+			</if>
+			<if test="date!=null">
+				date_=#{date,jdbcType= TIMESTAMP },
+			</if>
+			<if test="tag!=null">
+				tag_=#{tag,jdbcType=VARCHAR},
+			</if>
+			<if test="image!=null">
+				image_=#{image,jdbcType=VARCHAR},
+			</if>
+			<if test="status!=null">
+				status_=#{status,jdbcType=VARCHAR},
+			</if>
+			<if test="price!=null">
+				price_=#{price,jdbcType= NUMERIC },
+			</if>
+			<if test="location!=null">
+				location_=#{location,jdbcType=VARCHAR},
+			</if>
+			<if test="companyId!=null">
+				company_id=#{companyId,jdbcType=VARCHAR},
+			</if>
+			<if test="map!=null">
+				map_=#{map,jdbcType=VARCHAR},
+			</if>
+			<if test="constructionLocation!=null">
+				construction_location=#{constructionLocation,jdbcType=VARCHAR},
+			</if>
+			<if test="environment!=null">
+				environment=#{environment,jdbcType=VARCHAR},
+			</if>
+			<if test="volume!=null">
+				volume_=#{volume,jdbcType= NUMERIC },
+			</if>
+			<if test="technicianId!=null">
+				technician_id=#{technicianId,jdbcType=VARCHAR},
+			</if>
+			<if test="payStatus!=null">
+				pay_status=#{payStatus,jdbcType=VARCHAR},
+			</if>
+			<if test="createTime!=null">
+				create_time=#{createTime,jdbcType= TIMESTAMP },
+			</if>
+			<if test="updateTime!=null">
+				update_time=#{updateTime,jdbcType= TIMESTAMP },
+			</if>
+			<if test="delFlag!=null">
+				del_flag=#{delFlag,jdbcType= NUMERIC },
+			</if>
+			<if test="createBy!=null">
+				create_by=#{createBy,jdbcType=VARCHAR},
+			</if>
+			<if test="updateBy!=null">
+				update_by=#{updateBy,jdbcType=VARCHAR},
+			</if>
 			<if test="customerName!=null">
 				customer_name=#{customerName,jdbcType=VARCHAR},
 			</if>
@@ -168,8 +171,11 @@
 			<if test="cancelImages!=null">
 				cancel_images=#{cancelImages,jdbcType=VARCHAR},
 			</if>
+			<if test="peopleSeenNum!=null">
+				people_seen_num=#{peopleSeenNum,jdbcType= NUMERIC },
+			</if>
 		</set>
-	where id_=#{id}
+		where id_=#{id}
 	</update>
 	<select id="get" parameterType="string" resultMap="WorkOrderMap">
 		select * from base_work_order where id_=#{0}
@@ -226,8 +232,8 @@
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
-	        ${sort.name} ${sort.order}
-	 	</foreach>
+			${sort.name} ${sort.order}
+		</foreach>
 	</select>
 
 	<select id="searchMobile" parameterType="hashmap" resultMap="WorkOrderMap">
@@ -236,9 +242,22 @@
 		]]>
 		<where>
 			del_flag = false
+			<if test="searchParams.title != null">
+				and title_ like #{searchParams.title}
+			</if>
 			<if test="searchParams.status != null">
 				and status_ = #{searchParams.status}
 			</if>
+			<if test="searchParams.startDate != null">
+				<![CDATA[
+					and date_ >= #{searchParams.startDate}
+				]]>
+			</if>
+			<if test="searchParams.endDate != null">
+				<![CDATA[
+					and date_ < #{searchParams.endDate}
+				]]>
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 			${sort.name} ${sort.order}

二进制
common/target/classes/com/jpsoft/employment/modules/base/dao/ConstructionProgressDAO.class


二进制
common/target/classes/com/jpsoft/employment/modules/base/entity/WorkOrder.class


二进制
common/target/classes/com/jpsoft/employment/modules/base/service/WorkOrderService.class


二进制
common/target/classes/com/jpsoft/employment/modules/base/service/impl/WorkOrderServiceImpl.class


+ 7 - 1
common/target/classes/mapper/base/ConstructionProgress.xml

@@ -103,7 +103,13 @@ id_,title_,image_,submit_by,submit_type,submit_time,work_order_id,index_,create_
 	<select id="findByWorkOrderId" resultMap="ConstructionProgressMap">
 		select * from base_construction_progress where del_flag=false and work_order_id=#{0}
 	</select>
-
+	<select id="findLastByWorkOrderId" resultMap="ConstructionProgressMap">
+		select * from base_construction_progress
+		where del_flag=false
+		and work_order_id=#{0}
+		order by create_time desc
+		limit 1
+	</select>
 	<select id="search" parameterType="hashmap" resultMap="ConstructionProgressMap">
 		<![CDATA[
 			select * from base_construction_progress

+ 20 - 1
common/target/classes/mapper/base/WorkOrder.xml

@@ -33,6 +33,8 @@
 			<result property="cancelCauses" column="cancel_causes" />
 			<result property="cancelReasons" column="cancel_reasons" />
 			<result property="cancelImages" column="cancel_images" />
+			<result property="peopleSeenNum" column="people_seen_num" />
+
 	</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.WorkOrder">
 	<!--
@@ -43,7 +45,7 @@
 	<![CDATA[
 		insert into base_work_order
 	    (id_,number_,title_,address_,date_,tag_,image_,status_,price_,location_,company_id,map_,construction_location,environment,volume_,technician_id,pay_status,create_time,update_time,del_flag,create_by,update_by,
-	    customer_name,customer_phone,view_num,certificate_,cancel_causes,cancel_reasons,cancel_images)
+	    customer_name,customer_phone,view_num,certificate_,cancel_causes,cancel_reasons,cancel_images,people_seen_num)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -75,6 +77,7 @@
 ,#{cancelCauses,jdbcType=VARCHAR}
 ,#{cancelReasons,jdbcType=VARCHAR}
 ,#{cancelImages,jdbcType=VARCHAR}
+,#{peopleSeenNum,jdbcType= NUMERIC }
 		)
 	]]>
 	</insert>
@@ -168,6 +171,9 @@
 			<if test="cancelImages!=null">
 				cancel_images=#{cancelImages,jdbcType=VARCHAR},
 			</if>
+			<if test="peopleSeenNum!=null">
+				people_seen_num=#{peopleSeenNum,jdbcType= NUMERIC },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>
@@ -236,9 +242,22 @@
 		]]>
 		<where>
 			del_flag = false
+			<if test="searchParams.title != null">
+				and title_ like #{searchParams.title}
+			</if>
 			<if test="searchParams.status != null">
 				and status_ = #{searchParams.status}
 			</if>
+			<if test="searchParams.startDate != null">
+				<![CDATA[
+					and date_ >= #{searchParams.startDate}
+				]]>
+			</if>
+			<if test="searchParams.endDate != null">
+				<![CDATA[
+					and date_ < #{searchParams.endDate}
+				]]>
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 			${sort.name} ${sort.order}

+ 31 - 0
web/src/main/java/com/jpsoft/employment/modules/base/controller/CustomerInfoController.java

@@ -157,6 +157,37 @@ public class CustomerInfoController {
     }
 
 
+    @ApiOperation(value="审核用户")
+    @PostMapping("checked/{id}")
+    public MessageResult<CustomerInfo> checked(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<CustomerInfo> msgResult = new MessageResult<>();
+
+        try {
+
+            CustomerInfo customerInfo = customerInfoService.get(id);
+            customerInfo.setStatus("1");
+            customerInfo.setUpdateBy(subject);
+            customerInfo.setUpdateTime(new Date());
+
+            int affectCount = customerInfoService.update(customerInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("审核失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
     @ApiOperation(value="批量删除")
     @PostMapping("batchDelete")
     public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){

+ 30 - 0
web/src/main/java/com/jpsoft/employment/modules/base/controller/WorkOrderController.java

@@ -146,6 +146,36 @@ public class WorkOrderController {
         return msgResult;
     }
 
+
+    @ApiOperation(value = "确认工单")
+    @PostMapping("confirm/{id}")
+    public MessageResult<WorkOrder> confirm(@PathVariable("id") String id, @RequestAttribute String subject) {
+        MessageResult<WorkOrder> msgResult = new MessageResult<>();
+
+        try {
+            WorkOrder workOrder = workOrderService.get(id);
+            workOrder.setStatus("1");
+            workOrder.setUpdateBy(subject);
+            workOrder.setUpdateTime(new Date());
+
+            int affectCount = workOrderService.updateAndProgress(workOrder);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库删除失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
     @ApiOperation(value = "删除用户")
     @PostMapping("delete/{id}")
     public MessageResult<WorkOrder> delete(@PathVariable("id") String id, @RequestAttribute String subject) {

+ 348 - 80
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/CustomerInfoApiController.java

@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
+import org.joda.time.Days;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -69,6 +71,9 @@ public class CustomerInfoApiController {
     @Autowired
     private AboutUsService aboutUsService;
 
+    @Autowired
+    private InstallationRequirementService installationRequirementService;
+
     @ApiOperation(value = "个人中心")
     @RequestMapping(value = "personalCenter", method = RequestMethod.POST)
     @ApiImplicitParams({
@@ -222,6 +227,7 @@ public class CustomerInfoApiController {
                 dto.setRegion(customerInfo.getRegion());
                 dto.setBusinessCode(customerInfo.getBusinessCode());
                 dto.setCompanyName(customerInfo.getCompanyName());
+                dto.setBusinessLicense(customerInfo.getBusinessLicense());
 
                 msgResult.setResult(true);
                 msgResult.setData(dto);
@@ -261,20 +267,39 @@ public class CustomerInfoApiController {
         return messageResult;
     }
 
-
     @ApiOperation(value = "消息列表")
-    @RequestMapping(value = "messageList", method = RequestMethod.POST)
-    public MessageResult<List<MessageInfo>> messageTypeList(String type, String token, @RequestAttribute String subject) {
-        MessageResult<List<MessageInfo>> messageResult = new MessageResult<>();
+    @RequestMapping(value = "messagePageList", method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String type,
+            @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
+            @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
+            @RequestAttribute String subject) {
 
-        CustomerInfo customerInfo = customerInfoService.get(subject);
+        //当前用户ID
+        System.out.println(subject);
 
-        List<MessageInfo> messageInfoList = messageInfoService.findByRecipientIdAndType(customerInfo.getId(), type);
+        MessageResult<Map> msgResult = new MessageResult<>();
 
-        messageResult.setData(messageInfoList);
-        messageResult.setResult(true);
+        Map<String, Object> searchParams = new HashMap<>();
 
-        return messageResult;
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_time", "desc"));
+
+        if (StringUtils.isNotEmpty(subject)) {
+            searchParams.put("recipientId", subject);
+        }
+
+        if (StringUtils.isNotEmpty(type)) {
+            searchParams.put("type", type);
+        }
+
+        Page<MessageInfo> page = messageInfoService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
+
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
     }
 
 
@@ -395,45 +420,147 @@ public class CustomerInfoApiController {
     }
 
 
-
-
-
     @ApiOperation(value = "工单列表")
     @RequestMapping(value = "workOrderPageList", method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "title", value = "工单标题", paramType = "form"),
+            @ApiImplicitParam(name = "status", value = "工单状态(0:待确认,1:待接单,2:施工中,3:待验收,4:完结待结算,5:质保中,6:已出保,7:已取消)", paramType = "form"),
+            @ApiImplicitParam(name = "date", value = "日期", paramType = "form"),
+    })
     public MessageResult<Map> workOrderPageList(
-            String status,
+            String title, String status, String date,String token,
             @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
             @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
-            HttpServletRequest request) {
-        String subject = (String) request.getAttribute("subject");
+            @RequestAttribute String subject) {
 
         //当前用户ID
         System.out.println(subject);
 
         MessageResult<Map> msgResult = new MessageResult<>();
 
-        Map<String, Object> searchParams = new HashMap<>();
+        try {
 
-        List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("create_time", "desc"));
+            Map<String, Object> dataMap = new HashMap<>();
 
-        if (StringUtils.isNotEmpty(status)) {
-            searchParams.put("status", status);
-        }
+            Map<String, Object> searchParams = new HashMap<>();
 
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 
-        Page<WorkOrder> page = workOrderService.pageSearchMobile(searchParams, pageIndex, pageSize, true, sortList);
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_time", "desc"));
 
-        for (WorkOrder workOrder : page) {
-            CustomerInfo customerInfo = customerInfoService.get(workOrder.getCompanyId());
-            if (customerInfo != null) {
-                workOrder.setCompanyName(customerInfo.getRealName());
+            searchParams.put("companyId", subject);
+
+            if (StringUtils.isNotEmpty(title)) {
+                searchParams.put("title", "%" + title + "%");
+            }
+
+            if (StringUtils.isNotEmpty(status)) {
+                searchParams.put("status", status);
             }
-        }
 
+            if (StringUtils.isNotEmpty(date)) {
+                Calendar calendar = Calendar.getInstance();
+                calendar.setTime(sdf.parse(date));
+                calendar.add(Calendar.DATE,1);
 
-        msgResult.setResult(true);
-        msgResult.setData(PojoUtils.pageWrapper(page));
+                String endDate = sdf.format(calendar.getTime());
+
+                searchParams.put("startDate", date);
+                searchParams.put("endDate", endDate);
+            }
+
+            Page<WorkOrder> page = workOrderService.pageSearchMobile(searchParams, pageIndex, pageSize, true, sortList);
+
+            List<WorkOrderListDTO> list = new ArrayList<>();
+
+            for (WorkOrder workOrder : page) {
+                WorkOrderListDTO dto = new WorkOrderListDTO();
+                dto.setTitle(workOrder.getTitle());
+                dto.setDate(workOrder.getDate());
+                dto.setId(workOrder.getId());
+                String statusStr = workOrder.getStatus();
+                dto.setStatus(statusStr);
+                String statusN = dataDictionaryService.findNameByCatalogNameAndValue("工单状态", statusStr);
+                if (StringUtils.isNotEmpty(statusN)) {
+                    dto.setStatusN(statusN);
+                }
+
+                String bak = "";
+                if ("0".equals(statusStr) || "1".equals(statusStr)) {
+                    //待确认&待接单
+                    int num = workOrder.getPeopleSeenNum();
+                    bak = "共有" + String.valueOf(num) + "师傅看过";
+                } else if ("2".equals(statusStr)) {
+                    //待入场
+                    InstallationRequirement installationRequirement = installationRequirementService.findByWorkOrderId(workOrder.getId());
+                    if (installationRequirement != null &&
+                            installationRequirement.getLatestEntryDate() != null) {
+                        bak = "最晚入场日期:" + sdf.format(installationRequirement.getLatestEntryDate());
+                    }
+                } else if ("4".equals(statusStr)) {
+                    //待验收
+                    bak = "提交了验收申请";
+                } else if ("5".equals(statusStr)) {
+                    //质保中
+                    bak = "质保期至:";
+                } else if ("7".equals(statusStr)) {
+                    //已取消
+                    bak = "原因:" + workOrder.getCancelReasons();
+                }
+
+                dto.setBak(bak);
+
+                String technicianName = "";
+
+                String technicianImage = "";
+
+                Integer technicianLevel = null;
+
+                if (StringUtils.isNotEmpty(workOrder.getTechnicianId())) {
+                    //待验收和质保中时候才查师傅的信息
+                    if ("4".equals(statusStr) || "5".equals(statusStr)) {
+                        TechnicianInfo technicianInfo = technicianInfoService.get(workOrder.getTechnicianId());
+                        if (technicianInfo != null) {
+                            technicianName = technicianInfo.getRealName();
+                            technicianImage = technicianInfo.getImage();
+                            technicianLevel = technicianInfo.getLevel();
+                        }
+                    }
+                }
+
+                dto.setTechnicianName(technicianName);
+                dto.setTechnicianImage(technicianImage);
+                dto.setTechnicianLevel(technicianLevel);
+
+                List<String> tagList = new ArrayList<>();
+                if (StringUtils.isNotEmpty(workOrder.getTag())) {
+                    String[] tagArr = workOrder.getTag().split(",");
+                    for (String tag : tagArr) {
+                        tagList.add(tag);
+                    }
+                }
+
+                dto.setTagList(tagList);
+
+                list.add(dto);
+            }
+
+            dataMap.put("recordsTotal", page.getTotal());
+            dataMap.put("totalPage", page.getPages());
+            dataMap.put("data", list);
+            dataMap.put("pageNumber", pageIndex);
+            dataMap.put("pageSize", pageSize);
+
+            msgResult.setResult(true);
+            msgResult.setData(dataMap);
+        }
+        catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
 
         return msgResult;
     }
@@ -441,7 +568,7 @@ public class CustomerInfoApiController {
 
     @ApiOperation(value = "获取工单详情")
     @GetMapping("workOrderEdit/{id}")
-    public MessageResult<WorkOrderAllDataDTO> workOrderEdit(@PathVariable("id") String id) {
+    public MessageResult<WorkOrderAllDataDTO> workOrderEdit(String token,@PathVariable("id") String id) {
         MessageResult<WorkOrderAllDataDTO> msgResult = new MessageResult<>();
 
         try {
@@ -469,16 +596,16 @@ public class CustomerInfoApiController {
 
     @ApiOperation(value = "工单提交")
     @PostMapping("workOrderAdd")
-    public MessageResult<Integer> workOrderAdd(@RequestBody WorkOrderSubDataDTO dto, String token, @RequestAttribute String subject) {
-        MessageResult<Integer> msgResult = new MessageResult<>();
+    public MessageResult<String> workOrderAdd(@RequestBody WorkOrderSubDataDTO dto, String token, @RequestAttribute String subject) {
+        MessageResult<String> msgResult = new MessageResult<>();
 
         try {
 
-            int affectCount = workOrderService.insertDTO(dto, subject);
+            String id = workOrderService.insertDTO(dto, subject);
 
-            if (affectCount > 0) {
+            if (StringUtils.isNotEmpty(id)) {
                 msgResult.setResult(true);
-                msgResult.setData(affectCount);
+                msgResult.setData(id);
             } else {
                 msgResult.setResult(false);
                 msgResult.setMessage("数据库添加失败");
@@ -497,7 +624,7 @@ public class CustomerInfoApiController {
     @ApiOperation(value = "师傅列表")
     @RequestMapping(value = "technicianPageList", method = RequestMethod.POST)
     public MessageResult<Map> technicianPageList(
-            String status,String token,
+            String name,String status, String token,
             @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
             @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
             HttpServletRequest request) {
@@ -517,9 +644,23 @@ public class CustomerInfoApiController {
             searchParams.put("status", status);
         }
 
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name", "%"+name+"%");
+        }
+
 
         Page<TechnicianInfo> page = technicianInfoService.pageSearchMobile(searchParams, pageIndex, pageSize, true, sortList);
 
+        for (TechnicianInfo technicianInfo:page) {
+            Map<String, Object> searchParams1 = new HashMap<>();
+            searchParams.put("technicianId", technicianInfo.getId());
+            Integer completeOrderNum = workOrderService.countByTechnicianId(searchParams1);
+            technicianInfo.setCompleteOrderNum(completeOrderNum);
+
+            //最近合作的单数
+            technicianInfo.setCooperationNum(0);
+        }
+
 
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));
@@ -528,10 +669,9 @@ public class CustomerInfoApiController {
     }
 
 
-
     @ApiOperation(value = "主页师傅详情")
     @GetMapping("technicianDetail/{id}")
-    public MessageResult<TechnicianDTO> technicianDetail(@PathVariable("id") String id) {
+    public MessageResult<TechnicianDTO> technicianDetail(String token,@PathVariable("id") String id) {
         MessageResult<TechnicianDTO> msgResult = new MessageResult<>();
 
         try {
@@ -545,11 +685,13 @@ public class CustomerInfoApiController {
                 dto.setRegion(technicianInfo.getRegion());
                 dto.setIsVerified(technicianInfo.getIsVerified());
                 dto.setServiceInfo(technicianInfo.getServiceInfo());
+                dto.setBusinessScope(technicianInfo.getBusinessScope());
+                dto.setImage(technicianInfo.getImage());
 
                 Map<String, Object> searchParams = new HashMap<>();
-                searchParams.put("technicianId",id);
+                searchParams.put("technicianId", id);
 
-                Integer completeOrderNum =  workOrderService.countByTechnicianId(searchParams);
+                Integer completeOrderNum = workOrderService.countByTechnicianId(searchParams);
 
                 dto.setCompleteOrderNum(completeOrderNum);
 
@@ -570,30 +712,37 @@ public class CustomerInfoApiController {
     }
 
 
-    @ApiOperation(value="师傅主页评价列表")
-    @RequestMapping(value = "commentPageList",method = RequestMethod.POST)
+    @ApiOperation(value = "师傅主页评价列表")
+    @RequestMapping(value = "commentPageList", method = RequestMethod.POST)
     public MessageResult<Map> commentPageList(
-            String technicianid,
-            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
-            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
-            HttpServletRequest request){
-        String subject = (String)request.getAttribute("subject");
+            String technicianid,String token,
+            @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
+            @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
+            HttpServletRequest request) {
+        String subject = (String) request.getAttribute("subject");
 
         //当前用户ID
         System.out.println(subject);
 
         MessageResult<Map> msgResult = new MessageResult<>();
 
-        Map<String,Object> searchParams = new HashMap<>();
+        Map<String, Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("create_time","desc"));
+        sortList.add(new Sort("create_time", "desc"));
 
         if (StringUtils.isNotEmpty(technicianid)) {
-            searchParams.put("technicianid",technicianid);
+            searchParams.put("technicianid", technicianid);
         }
 
-        Page<CommentInfo> page = commentInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+        Page<CommentInfo> page = commentInfoService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
+
+        for (CommentInfo commentInfo:page) {
+            CustomerInfo customerInfo = customerInfoService.get(commentInfo.getCompanyId());
+            if(customerInfo!=null){
+                commentInfo.setCompanyName(customerInfo.getCompanyName());
+            }
+        }
 
 
         msgResult.setResult(true);
@@ -638,7 +787,7 @@ public class CustomerInfoApiController {
 
     @ApiOperation(value = "水箱材质列表")
     @RequestMapping(value = "materialList", method = RequestMethod.POST)
-    public MessageResult<List<Map<String, String>>> materialList(String token,HttpServletRequest request) {
+    public MessageResult<List<Map<String, String>>> materialList(String token, HttpServletRequest request) {
         String subject = (String) request.getAttribute("subject");
 
         //当前用户ID
@@ -652,8 +801,8 @@ public class CustomerInfoApiController {
 
         for (DataDictionary dataDictionary : dataDictionaryList) {
             Map<String, String> map = new HashMap<>();
-            map.put("value",dataDictionary.getValue());
-            map.put("name",dataDictionary.getName());
+            map.put("value", dataDictionary.getValue());
+            map.put("name", dataDictionary.getName());
 
             list.add(map);
         }
@@ -665,14 +814,13 @@ public class CustomerInfoApiController {
     }
 
 
-
     @ApiOperation(value = "企业认证")
     @PostMapping("enterCertification")
     public MessageResult<CustomerInfo> enterCertification(@RequestBody EnterCertificationDTO dto, @RequestAttribute String subject) {
         MessageResult<CustomerInfo> msgResult = new MessageResult<>();
 
         try {
-            CustomerInfo customerInfo = customerInfoService.get(dto.getId());
+            CustomerInfo customerInfo = customerInfoService.get(subject);
             customerInfo.setUpdateBy(subject);
             customerInfo.setUpdateTime(new Date());
             customerInfo.setCompanyName(dto.getCompanyName());
@@ -699,27 +847,26 @@ public class CustomerInfoApiController {
     }
 
 
-
-    @ApiOperation(value="问题反馈列表")
-    @RequestMapping(value = "feedbackPageList",method = RequestMethod.POST)
+    @ApiOperation(value = "问题反馈列表")
+    @RequestMapping(value = "feedbackPageList", method = RequestMethod.POST)
     public MessageResult<Map> feedbackPageList(
-            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
-            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
-            HttpServletRequest request){
-        String subject = (String)request.getAttribute("subject");
+            @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
+            @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
+            HttpServletRequest request) {
+        String subject = (String) request.getAttribute("subject");
 
         //当前用户ID
         System.out.println(subject);
 
         MessageResult<Map> msgResult = new MessageResult<>();
 
-        Map<String,Object> searchParams = new HashMap<>();
+        Map<String, Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("create_time","desc"));
+        sortList.add(new Sort("create_time", "desc"));
 
 
-        Page<Feedback> page = feedbackService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+        Page<Feedback> page = feedbackService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
 
 
         msgResult.setResult(true);
@@ -729,9 +876,9 @@ public class CustomerInfoApiController {
     }
 
 
-    @ApiOperation(value="意见反馈提交")
+    @ApiOperation(value = "意见反馈提交")
     @PostMapping("feedbackSubmit")
-    public MessageResult<Feedback> feedbackSubmit(@RequestBody Feedback feedback,@RequestAttribute String subject){
+    public MessageResult<Feedback> feedbackSubmit(@RequestBody Feedback feedback, @RequestAttribute String subject) {
         MessageResult<Feedback> msgResult = new MessageResult<>();
 
         try {
@@ -749,9 +896,8 @@ public class CustomerInfoApiController {
                 msgResult.setResult(false);
                 msgResult.setMessage("数据库添加失败");
             }
-        }
-        catch(Exception ex){
-            logger.error(ex.getMessage(),ex);
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
 
             msgResult.setResult(false);
             msgResult.setMessage(ex.getMessage());
@@ -766,7 +912,7 @@ public class CustomerInfoApiController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "type", value = "类型(1:用户协议,2:隐私协议,3:免责条款)", paramType = "form"),
     })
-    public MessageResult<Map> aboutUs(String token,String type,@RequestAttribute String subject) {
+    public MessageResult<Map> aboutUs(String token, String type, @RequestAttribute String subject) {
 
         //当前用户ID
         System.out.println(subject);
@@ -777,22 +923,20 @@ public class CustomerInfoApiController {
 
         Map map = new HashMap();
 
-        String content="";
+        String content = "";
 
-        if(aboutUsList!=null){
+        if (aboutUsList != null) {
             AboutUs aboutUs = aboutUsList.get(0);
-            if("1".equals(type)){
+            if ("1".equals(type)) {
                 content = aboutUs.getUserAgreement();
-            }
-            else if("2".equals(type)){
+            } else if ("2".equals(type)) {
                 content = aboutUs.getPrivacyPolicy();
-            }
-            else if("3".equals(type)){
+            } else if ("3".equals(type)) {
                 content = aboutUs.getDisclaimer();
             }
         }
 
-        map.put("content",content);
+        map.put("content", content);
 
         msgResult.setResult(true);
         msgResult.setData(map);
@@ -800,4 +944,128 @@ public class CustomerInfoApiController {
         return msgResult;
     }
 
+
+    @ApiOperation(value = "支付提交")
+    @PostMapping("paySubmit")
+    public MessageResult<Integer> paySubmit(@RequestBody PayWorkOrderDTO dto, @RequestAttribute String subject) {
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            WorkOrder workOrder = workOrderService.get(dto.getId());
+            workOrder.setCertificate(dto.getCertificate());
+            workOrder.setPayStatus("1");
+            workOrder.setCreateBy(subject);
+            workOrder.setCreateTime(new Date());
+
+            int affectCount = workOrderService.update(workOrder);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库提交失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value = "工单状态列表")
+    @RequestMapping(value = "statusList", method = RequestMethod.POST)
+    public MessageResult<List<Map>> statusList(String token, @RequestAttribute String subject) {
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<List<Map>> msgResult = new MessageResult<>();
+
+        List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("工单状态");
+
+        List<Map> mapList = new ArrayList<>();
+
+        for (DataDictionary item : dataDictionaryList) {
+            Map map = new HashMap();
+            map.put("name",item.getName());
+            map.put("value",item.getValue());
+            mapList.add(map);
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(mapList);
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value = "取消工单")
+    @GetMapping("cancelWorkOrder/{id}")
+    public MessageResult<Integer> cancelWorkOrder(String token,@PathVariable("id") String id,@RequestAttribute String subject) {
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            WorkOrder workOrder = workOrderService.get(id);
+
+            if (workOrder != null) {
+
+                int affectCount = workOrderService.cancelWorkOrder(workOrder,subject);
+
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value = "邀请师傅")
+    @RequestMapping(value = "inviteTechnician", method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "workOrderId", value = "工单ID", paramType = "form"),
+            @ApiImplicitParam(name = "technicianId", value = "师傅ID", paramType = "form"),
+    })
+    public MessageResult<Integer> inviteTechnician(String workOrderId,String technicianId,String token, @RequestAttribute String subject) {
+        MessageResult<Integer> messageResult = new MessageResult<>();
+
+        try {
+            WorkOrder workOrder = workOrderService.get(workOrderId);
+
+            if(workOrder!=null){
+                workOrder.setUpdateBy(subject);
+                workOrder.setUpdateTime(new Date());
+                workOrder.setTechnicianId(technicianId);
+
+                int affectCount = workOrderService.update(workOrder);
+
+                messageResult.setResult(true);
+                messageResult.setData(affectCount);
+            }
+            else{
+                messageResult.setResult(false);
+                messageResult.setMessage("数据库不存在该记录!");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
 }