Переглянути джерело

移动端接口提交工单接口完善字段

yanliming 3 тижнів тому
батько
коміт
254d1e2674
28 змінених файлів з 533 додано та 45 видалено
  1. 1 0
      common/src/main/java/com/jpsoft/employment/modules/base/dao/ArgonPartnerDAO.java
  2. 1 0
      common/src/main/java/com/jpsoft/employment/modules/base/dao/LaborerInfoDAO.java
  3. 1 0
      common/src/main/java/com/jpsoft/employment/modules/base/dao/TransportationInfoDAO.java
  4. 16 0
      common/src/main/java/com/jpsoft/employment/modules/base/dto/CancelWorkOrderDTO.java
  5. 33 0
      common/src/main/java/com/jpsoft/employment/modules/base/dto/RatingDTO.java
  6. 14 0
      common/src/main/java/com/jpsoft/employment/modules/base/dto/WorkOrderImageDTO.java
  7. 3 0
      common/src/main/java/com/jpsoft/employment/modules/base/dto/WorkOrderSubDataDTO.java
  8. 13 1
      common/src/main/java/com/jpsoft/employment/modules/base/entity/AboutUs.java
  9. 3 0
      common/src/main/java/com/jpsoft/employment/modules/base/entity/CommentInfo.java
  10. 11 0
      common/src/main/java/com/jpsoft/employment/modules/base/entity/InstallationRequirement.java
  11. 6 0
      common/src/main/java/com/jpsoft/employment/modules/base/entity/WorkOrder.java
  12. 1 0
      common/src/main/java/com/jpsoft/employment/modules/base/service/ArgonPartnerService.java
  13. 1 0
      common/src/main/java/com/jpsoft/employment/modules/base/service/LaborerInfoService.java
  14. 1 0
      common/src/main/java/com/jpsoft/employment/modules/base/service/TransportationInfoService.java
  15. 3 1
      common/src/main/java/com/jpsoft/employment/modules/base/service/WorkOrderService.java
  16. 6 0
      common/src/main/java/com/jpsoft/employment/modules/base/service/impl/ArgonPartnerServiceImpl.java
  17. 6 0
      common/src/main/java/com/jpsoft/employment/modules/base/service/impl/LaborerInfoServiceImpl.java
  18. 6 0
      common/src/main/java/com/jpsoft/employment/modules/base/service/impl/TransportationInfoServiceImpl.java
  19. 121 2
      common/src/main/java/com/jpsoft/employment/modules/base/service/impl/WorkOrderServiceImpl.java
  20. 25 5
      common/src/main/resources/mapper/base/AboutUs.xml
  21. 3 0
      common/src/main/resources/mapper/base/ArgonPartner.xml
  22. 8 1
      common/src/main/resources/mapper/base/CommentInfo.xml
  23. 2 2
      common/src/main/resources/mapper/base/InstallationRequirement.xml
  24. 3 0
      common/src/main/resources/mapper/base/LaborerInfo.xml
  25. 3 0
      common/src/main/resources/mapper/base/TransportationInfo.xml
  26. 6 2
      common/src/main/resources/mapper/base/WorkOrder.xml
  27. 6 0
      web/src/main/java/com/jpsoft/employment/modules/base/controller/WorkOrderController.java
  28. 230 31
      web/src/main/java/com/jpsoft/employment/modules/mobile/controller/CustomerInfoApiController.java

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

@@ -14,6 +14,7 @@ public interface ArgonPartnerDAO {
 	ArgonPartner get(String id);
 	int delete(String id);
 	List<ArgonPartner> list();
+	List<ArgonPartner> listByIndex(int index);
 	List<ArgonPartner> findByCustomerId(String customerId);
 	List<ArgonPartner> search(Map<String, Object> searchParams, List<Sort> sortList);
 	List<ArgonPartner> searchMobile(Map<String, Object> searchParams, List<Sort> sortList);

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

@@ -14,6 +14,7 @@ public interface LaborerInfoDAO {
 	LaborerInfo get(String id);
 	int delete(String id);
 	List<LaborerInfo> list();
+	List<LaborerInfo> listByIndex(int index);
 	List<LaborerInfo> findByCustomerId(String customerId);
 	List<LaborerInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
 	List<LaborerInfo> searchMobile(Map<String, Object> searchParams, List<Sort> sortList);

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

@@ -14,6 +14,7 @@ public interface TransportationInfoDAO {
 	TransportationInfo get(String id);
 	int delete(String id);
 	List<TransportationInfo> list();
+	List<TransportationInfo> listByIndex(int index);
 	List<TransportationInfo> findByCustomerId(String customerId);
 	List<TransportationInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
 	List<TransportationInfo> searchMobile(Map<String, Object> searchParams, List<Sort> sortList);

+ 16 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dto/CancelWorkOrderDTO.java

@@ -0,0 +1,16 @@
+package com.jpsoft.employment.modules.base.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class CancelWorkOrderDTO {
+    @ApiModelProperty(value = "ID")
+    private String id;
+
+    @ApiModelProperty(value = "取消理由")
+    private String cancelCauses;
+
+    @ApiModelProperty(value = "取消原因")
+    private String reason;
+}

+ 33 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dto/RatingDTO.java

@@ -0,0 +1,33 @@
+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 RatingDTO {
+    @ApiModelProperty(value = "工单ID")
+    private String id;
+
+    @ApiModelProperty(value = "星级")
+    private String starRating;
+
+    @ApiModelProperty(value = "内容")
+    private String content;
+
+    @ApiModelProperty(value = "图片集")
+    private List<String> imageList;
+
+    @ApiModelProperty(value = "评论时间")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    private Date dateTime;
+
+    @ApiModelProperty(value = "是否公开")
+    private Boolean isOpen;
+
+}

+ 14 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dto/WorkOrderImageDTO.java

@@ -0,0 +1,14 @@
+package com.jpsoft.employment.modules.base.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class WorkOrderImageDTO {
+
+    @ApiModelProperty(value = "ID")
+    private String id;
+
+    @ApiModelProperty(value = "图片集")
+    private String image;
+}

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

@@ -94,4 +94,7 @@ public class WorkOrderSubDataDTO {
 
     @ApiModelProperty(value = "订单发布模式(1:客户自选师傅,2:由师傅抢单)")
     private String orderModel;
+
+    @ApiModelProperty(value = "报价")
+    private BigDecimal price;
 }

+ 13 - 1
common/src/main/java/com/jpsoft/employment/modules/base/entity/AboutUs.java

@@ -46,5 +46,17 @@ public class AboutUs {
 	
 				@ApiModelProperty(value = "更新人")
 	private String updateBy;
-	
+
+
+	@ApiModelProperty(value = "收款账户")
+	private String receivingAccount;
+
+	@ApiModelProperty(value = "开户银行")
+	private String bank;
+
+	@ApiModelProperty(value = "收款账号")
+	private String accountNumber;
+
+	@ApiModelProperty(value = "收款码")
+	private String paymentCode;
 		}

+ 3 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/CommentInfo.java

@@ -63,6 +63,9 @@ public class CommentInfo {
 	@ApiModelProperty(value = "师傅ID")
 	private String technicianId;
 
+	@ApiModelProperty(value = "是否公开")
+	private Boolean isOpen;
+
 				@Transient
 	@ApiModelProperty(value = "评价客户")
 	private String companyName;

+ 11 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/InstallationRequirement.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;
@@ -137,5 +139,14 @@ public class InstallationRequirement {
 	@JsonFormat(pattern = "yyyy-MM-dd",timezone ="GMT+8")
 	private Date latestCompletionDate;
 
+
+	@Transient
+	@ApiModelProperty(value = "水箱尺寸单位翻译")
+	private String sizeUnitN;
+
+	@Transient
+	@ApiModelProperty(value = "水箱材质翻译")
+	private String materialN;
+
 	
 		}

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

@@ -114,6 +114,8 @@ public class WorkOrder {
 	@ApiModelProperty(value = "多少师傅看过")
 	private Integer peopleSeenNum;
 
+	@ApiModelProperty(value = "备注")
+	private String bak;
 
 	@Transient
 	@ApiModelProperty(value = "支付状态")
@@ -122,5 +124,9 @@ public class WorkOrder {
 	@Transient
 	@ApiModelProperty(value = "发起客户")
 	private String companyName;
+
+	@Transient
+	@ApiModelProperty(value = "工单状态翻译")
+	private String statusN;
 	
 		}

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/ArgonPartnerService.java

@@ -13,6 +13,7 @@ public interface ArgonPartnerService {
 	int update(ArgonPartner model);
 	int delete(String id);
 	List<ArgonPartner> list();
+	List<ArgonPartner> listByIndex(int index);
 	List<ArgonPartner> findByCustomerId(String customerId);
 	Page<ArgonPartner> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 	Page<ArgonPartner> pageSearchMobile(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/LaborerInfoService.java

@@ -13,6 +13,7 @@ public interface LaborerInfoService {
 	int update(LaborerInfo model);
 	int delete(String id);
 	List<LaborerInfo> list();
+	List<LaborerInfo> listByIndex(int index);
 	List<LaborerInfo> findByCustomerId(String customerId);
 	Page<LaborerInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 	Page<LaborerInfo> pageSearchMobile(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);

+ 1 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/TransportationInfoService.java

@@ -14,6 +14,7 @@ public interface TransportationInfoService {
 	int update(TransportationInfo model);
 	int delete(String id);
 	List<TransportationInfo> list();
+	List<TransportationInfo> listByIndex(int index);
 	List<TransportationInfo> findByCustomerId(String customerId);
 	Page<TransportationInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 	Page<TransportationInfo> pageSearchMobile(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);

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

@@ -15,8 +15,9 @@ public interface WorkOrderService {
 	int insert(WorkOrder model);
 	String insertDTO(WorkOrderSubDataDTO dto,String createBy);
 	int update(WorkOrder model);
+	String updateDTO(WorkOrderSubDataDTO dto,String createBy);
 	int updateAndProgress(WorkOrder model);
-	int cancelWorkOrder(WorkOrder model,String subject);
+	int updateWorkOrderStatus(WorkOrder model,String status,String subject);
 	int delete(String id);
 	List<WorkOrder> list();
 	List<String> findTopByCustomerId(String customerId);
@@ -25,4 +26,5 @@ public interface WorkOrderService {
 	Page<WorkOrder> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
 	Map countByCustomerId(Map<String, Object> searchParams);
 	Integer countByTechnicianId(Map<String, Object> searchParams);
+
 }

+ 6 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/impl/ArgonPartnerServiceImpl.java

@@ -60,6 +60,12 @@ public class ArgonPartnerServiceImpl implements ArgonPartnerService {
 	}
 
 
+	@Override
+	public List<ArgonPartner> listByIndex(int index){
+		return argonPartnerDAO.listByIndex(index);
+	}
+
+
 	@Override
 	public List<ArgonPartner> findByCustomerId(String customerId){
 		return argonPartnerDAO.findByCustomerId(customerId);

+ 6 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/impl/LaborerInfoServiceImpl.java

@@ -60,6 +60,12 @@ public class LaborerInfoServiceImpl implements LaborerInfoService {
 	}
 
 
+	@Override
+	public List<LaborerInfo> listByIndex(int index){
+		return laborerInfoDAO.listByIndex(index);
+	}
+
+
 	@Override
 	public List<LaborerInfo> findByCustomerId(String customerId){
 		return laborerInfoDAO.findByCustomerId(customerId);

+ 6 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/impl/TransportationInfoServiceImpl.java

@@ -59,6 +59,12 @@ public class TransportationInfoServiceImpl implements TransportationInfoService
 		return transportationInfoDAO.list();
 	}
 
+
+	@Override
+	public List<TransportationInfo> listByIndex(int index){
+		return transportationInfoDAO.listByIndex(index);
+	}
+
 	@Override
 	public List<TransportationInfo> findByCustomerId(String customerId){
 		return transportationInfoDAO.findByCustomerId(customerId);

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

@@ -10,6 +10,7 @@ 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 com.jpsoft.employment.modules.sys.entity.DataDictionary;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
@@ -76,6 +77,7 @@ public class WorkOrderServiceImpl implements WorkOrderService {
         workOrder.setCompanyId(createBy);
         workOrder.setTitle(dto.getTitle());
         workOrder.setDate(now);
+        workOrder.setPrice(dto.getPrice());
 
         String tag = getTag(dto);
         workOrder.setTag(tag);
@@ -161,6 +163,8 @@ public class WorkOrderServiceImpl implements WorkOrderService {
             constructionProgress.setDelFlag(false);
             constructionProgress.setCreateTime(now);
             constructionProgress.setIndex(1);
+            constructionProgress.setSubmitType("1");
+            constructionProgress.setSubmitBy(createBy);
             constructionProgress.setTitle("发布了工单");
             constructionProgress.setWorkOrderId(workOrder.getId());
             constructionProgressDAO.insert(constructionProgress);
@@ -171,6 +175,77 @@ public class WorkOrderServiceImpl implements WorkOrderService {
         return returnId;
     }
 
+
+
+    @Override
+    public String updateDTO(WorkOrderSubDataDTO dto, String createBy) {
+        // TODO Auto-generated method stub
+        //model.setId(UUID.randomUUID().toString());
+
+        WorkOrder workOrder = workOrderDAO.get(dto.getId());
+        Date now = new Date();
+        workOrder.setUpdateBy(createBy);
+        workOrder.setUpdateTime(now);
+        workOrder.setPeopleSeenNum(0);
+        workOrder.setTitle(dto.getTitle());
+
+        String tag = getTag(dto);
+        workOrder.setTag(tag);
+
+        int affectCount = workOrderDAO.update(workOrder);
+
+        String returnId = "";
+
+        if (affectCount > 0) {
+            //水箱需求
+            InstallationRequirement installationRequirement = installationRequirementDAO.findByWorkOrderId(dto.getId());
+
+            if(installationRequirement!=null) {
+                installationRequirement.setUpdateBy(createBy);
+                installationRequirement.setUpdateTime(now);
+                installationRequirement.setTitle(dto.getTitle());
+                installationRequirement.setLocation(dto.getLocation());
+                installationRequirement.setImage(dto.getImage());
+                installationRequirement.setConstructionLocation(dto.getConstructionLocation());
+                installationRequirement.setEnvironment(dto.getEnvironment());
+                installationRequirement.setMaterial(dto.getMaterial());
+                installationRequirement.setSizeUnit(dto.getSizeUnit());
+                installationRequirement.setSize(dto.getSize());
+                installationRequirement.setIsIrregular(dto.getIsIrregular());
+                installationRequirement.setDifficulty(dto.getDifficulty());
+                installationRequirement.setBudget(dto.getBudget());
+                installationRequirement.setLatestEntryDate(dto.getLatestEntryDate());
+                installationRequirement.setTerminationPeriod(dto.getTerminationPeriod());
+                installationRequirement.setLatestCompletionDate(dto.getLatestCompletionDate());
+                installationRequirement.setIsSubsidy(dto.getIsSubsidy());
+                installationRequirement.setAmount(dto.getAmount());
+                installationRequirement.setRequirement(dto.getRequirement());
+                installationRequirement.setStageRequirements(dto.getStageRequirements());
+                installationRequirement.setAcceptanceCriteria(dto.getAcceptanceCriteria());
+                installationRequirement.setSalesRequirement(dto.getSalesRequirement());
+                installationRequirement.setLongitude(dto.getLongitude());
+                installationRequirement.setLatitude(dto.getLatitude());
+
+                installationRequirementDAO.update(installationRequirement);
+            }
+
+            //接单要求
+            ReceiveRequire receiveRequire = receiveRequireDAO.findByWorkOrderId(dto.getId());
+            if(receiveRequire!=null) {
+                receiveRequire.setUpdateBy(createBy);
+                receiveRequire.setUpdateTime(now);
+                receiveRequire.setLevel(dto.getLevel());
+                receiveRequire.setCompletedNum(dto.getCompletedNum());
+                receiveRequire.setOrderModel(dto.getOrderModel());
+                receiveRequireDAO.update(receiveRequire);
+            }
+
+            returnId = workOrder.getId();
+        }
+
+        return returnId;
+    }
+
     private String getTag(WorkOrderSubDataDTO dto) {
         String tag = "";
         //所在地区
@@ -236,12 +311,12 @@ public class WorkOrderServiceImpl implements WorkOrderService {
 
 
     @Override
-    public int cancelWorkOrder(WorkOrder model,String subject) {
+    public int updateWorkOrderStatus(WorkOrder model,String status,String subject) {
         // TODO Auto-generated method stub
         Date now=new Date();
         model.setUpdateTime(new Date());
         model.setUpdateBy(subject);
-        model.setStatus("7");
+        model.setStatus(status);
 
         int affectCount = workOrderDAO.update(model);
         if(affectCount > 0){
@@ -251,6 +326,8 @@ public class WorkOrderServiceImpl implements WorkOrderService {
             item.setCreateTime(now);
             item.setCreateBy(subject);
             item.setWorkOrderId(model.getId());
+            item.setSubmitType("1");
+            item.setSubmitBy(subject);
             ConstructionProgress constructionProgress = constructionProgressDAO.findLastByWorkOrderId(model.getId());
             if(constructionProgress!=null){
                 item.setIndex(constructionProgress.getIndex()+1);
@@ -291,6 +368,25 @@ public class WorkOrderServiceImpl implements WorkOrderService {
         WorkOrderAllDataDTO dto = new WorkOrderAllDataDTO();
 
         InstallationRequirement installationRequirement = installationRequirementDAO.findByWorkOrderId(workOrder.getId());
+
+        if(installationRequirement!=null){
+            String sizeUnit;
+            //平方:0,立方:1
+            if ("0".equals(installationRequirement.getSizeUnit())) {
+                sizeUnit = "㎡";
+            } else {
+                sizeUnit = "m³";
+            }
+            installationRequirement.setSizeUnitN(sizeUnit);
+
+            if(StringUtils.isNotEmpty(installationRequirement.getMaterial())){
+                String materialN = dataDictionaryDAO.findNameByCatalogNameAndValue("水箱材质",installationRequirement.getMaterial());
+                if(StringUtils.isNotEmpty(materialN)){
+                    installationRequirement.setMaterialN(materialN);
+                }
+            }
+        }
+
         dto.setInstallationRequirement(installationRequirement);
 
         ReceiveRequire receiveRequire = receiveRequireDAO.findByWorkOrderId(id);
@@ -316,6 +412,13 @@ public class WorkOrderServiceImpl implements WorkOrderService {
 
         dto.setImageList(imageList);
 
+        if(StringUtils.isNotEmpty(workOrder.getStatus())){
+            String statusN = dataDictionaryDAO.findNameByCatalogNameAndValue("工单状态",workOrder.getStatus());
+            if(StringUtils.isNotEmpty(statusN)){
+                workOrder.setStatusN(statusN);
+            }
+        }
+
         dto.setWorkOrder(workOrder);
 
         TechnicianInfo technicianInfo = technicianInfoDAO.get(workOrder.getTechnicianId());
@@ -362,6 +465,22 @@ public class WorkOrderServiceImpl implements WorkOrderService {
             if (constructionProgress.getSubmitTime() != null) {
                 constructionProgress.setSubmitDate(sdf.format(constructionProgress.getSubmitTime()));
             }
+
+
+            if("1".equals(constructionProgress.getSubmitType())){
+                //客户
+                CustomerInfo customerInfo = customerInfoDAO.get(constructionProgress.getSubmitType());
+                if(customerInfo!=null){
+                    constructionProgress.setSubmitByN(customerInfo.getCompanyName());
+                }
+            }
+            else if("2".equals(constructionProgress.getSubmitType())){
+                //师傅
+                TechnicianInfo technicianInfo1 = technicianInfoDAO.get(constructionProgress.getSubmitType());
+                if(technicianInfo1!=null){
+                    constructionProgress.setSubmitByN(technicianInfo1.getRealName());
+                }
+            }
         }
 
         dto.setConstructionProgressList(ConstructionProgressList);

+ 25 - 5
common/src/main/resources/mapper/base/AboutUs.xml

@@ -13,8 +13,12 @@
 			<result property="delFlag" column="del_flag" />
 			<result property="createBy" column="create_by" />
 			<result property="updateBy" column="update_by" />
+			<result property="receivingAccount" column="receiving_account" />
+			<result property="bank" column="bank_" />
+			<result property="accountNumber" column="account_number" />
+			<result property="paymentCode" column="payment_code" />
 			</resultMap>
-	<insert id="insert" parameterType="AboutUs">
+	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.AboutUs">
 	<!--
 	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
 		select sys_guid() from dual
@@ -22,7 +26,8 @@
 	-->
 	<![CDATA[
 		insert into base_about_us
-	    (id_,user_agreement,privacy_policy,disclaimer,create_time,update_time,del_flag,create_by,update_by)
+	    (id_,user_agreement,privacy_policy,disclaimer,create_time,update_time,del_flag,create_by,update_by
+	    ,receiving_account,bank_,account_number,payment_code)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -34,13 +39,17 @@
 ,#{delFlag,jdbcType= NUMERIC }
 ,#{createBy,jdbcType=VARCHAR}
 ,#{updateBy,jdbcType=VARCHAR}
+,#{receivingAccount,jdbcType=VARCHAR}
+,#{bank,jdbcType=VARCHAR}
+,#{accountNumber,jdbcType=VARCHAR}
+,#{paymentCode,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
 	<delete id="delete" parameterType="string">
 		delete from base_about_us where id_=#{id,jdbcType=VARCHAR}
 	</delete>
-	<update id="update" parameterType="AboutUs">
+	<update id="update" parameterType="com.jpsoft.employment.modules.base.entity.AboutUs">
 		update base_about_us
 		<set>
 				<if test="userAgreement!=null">
@@ -67,12 +76,23 @@
 				<if test="updateBy!=null">
 		update_by=#{updateBy,jdbcType=VARCHAR},
 		</if>
+		<if test="receivingAccount!=null">
+			receiving_account=#{receivingAccount,jdbcType=VARCHAR},
+		</if>
+		<if test="bank!=null">
+			bank_=#{bank,jdbcType=VARCHAR},
+		</if>
+		<if test="accountNumber!=null">
+			account_number=#{accountNumber,jdbcType=VARCHAR},
+		</if>
+		<if test="paymentCode!=null">
+			payment_code=#{paymentCode,jdbcType=VARCHAR},
+		</if>
 		</set>
 	where id_=#{id}
 	</update>
 	<select id="get" parameterType="string" resultMap="AboutUsMap">
-		select 
-id_,user_agreement,privacy_policy,disclaimer,create_time,update_time,del_flag,create_by,update_by		from base_about_us where id_=#{0}
+		select * from base_about_us where id_=#{0}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_about_us where id_=#{0}

+ 3 - 0
common/src/main/resources/mapper/base/ArgonPartner.xml

@@ -89,6 +89,9 @@
 	<select id="list" resultMap="ArgonPartnerMap">
 		select * from base_argon_partner where del_flag=false order by create_time desc
 	</select>
+	<select id="listByIndex" resultMap="ArgonPartnerMap">
+		select * from base_argon_partner where del_flag=false order by create_time desc limit #{0}
+	</select>
 	<select id="findByCustomerId" resultMap="ArgonPartnerMap">
 		select * from base_argon_partner where del_flag=false and customer_id=#{0}
 	</select>

+ 8 - 1
common/src/main/resources/mapper/base/CommentInfo.xml

@@ -17,6 +17,9 @@
 			<result property="createBy" column="create_by" />
 			<result property="updateBy" column="update_by" />
 			<result property="technicianId" column="technician_id" />
+			<result property="isOpen" column="is_open" />
+
+
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.CommentInfo">
 	<!--
@@ -26,7 +29,7 @@
 	-->
 	<![CDATA[
 		insert into base_comment_info
-	    (id_,company_id,work_order_id,star_rating,content_,image_,date_time,create_time,update_time,del_flag,create_by,update_by,technician_id)
+	    (id_,company_id,work_order_id,star_rating,content_,image_,date_time,create_time,update_time,del_flag,create_by,update_by,technician_id,is_open)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -42,6 +45,7 @@
 ,#{createBy,jdbcType=VARCHAR}
 ,#{updateBy,jdbcType=VARCHAR}
 ,#{technicianId,jdbcType=VARCHAR}
+,#{isOpen,jdbcType= NUMERIC }
 		)
 	]]>
 	</insert>
@@ -87,6 +91,9 @@
 			<if test="technicianId!=null">
 				technician_id=#{technicianId,jdbcType=VARCHAR},
 			</if>
+			<if test="isOpen!=null">
+				is_open=#{isOpen,jdbcType= NUMERIC },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 2 - 2
common/src/main/resources/mapper/base/InstallationRequirement.xml

@@ -156,8 +156,8 @@
 				<if test="stageRequirements!=null">
 		stage_requirements=#{stageRequirements,jdbcType=VARCHAR},
 		</if>
-				<if test="acceptance Criteria!=null">
-		acceptance _criteria=#{acceptance Criteria,jdbcType=VARCHAR},
+				<if test="acceptanceCriteria!=null">
+		acceptance_criteria=#{acceptanceCriteria,jdbcType=VARCHAR},
 		</if>
 				<if test="salesRequirement!=null">
 		sales_requirement=#{salesRequirement,jdbcType=VARCHAR},

+ 3 - 0
common/src/main/resources/mapper/base/LaborerInfo.xml

@@ -91,6 +91,9 @@
 	<select id="list" resultMap="LaborerInfoMap">
 		select * from base_laborer_info where del_flag=false order by create_time desc
 	</select>
+	<select id="listByIndex" resultMap="LaborerInfoMap">
+		select * from base_laborer_info where del_flag=false order by create_time desc limit #{0}
+	</select>
 	<select id="findByCustomerId" resultMap="LaborerInfoMap">
 		select * from base_laborer_info where del_flag=false and customer_id=#{0}
 	</select>

+ 3 - 0
common/src/main/resources/mapper/base/TransportationInfo.xml

@@ -84,6 +84,9 @@
 	<select id="list" resultMap="TransportationInfoMap">
 		select * from base_transportation_info where del_flag=false order by create_time desc
 	</select>
+	<select id="listByIndex" resultMap="TransportationInfoMap">
+		select * from base_transportation_info where del_flag=false order by create_time desc limit #{0}
+	</select>
 	<select id="findByCustomerId" resultMap="TransportationInfoMap">
 		select * from base_transportation_info where del_flag=false and customer_id=#{0}
 	</select>

+ 6 - 2
common/src/main/resources/mapper/base/WorkOrder.xml

@@ -34,7 +34,7 @@
 		<result property="cancelReasons" column="cancel_reasons" />
 		<result property="cancelImages" column="cancel_images" />
 		<result property="peopleSeenNum" column="people_seen_num" />
-
+		<result property="bak" column="bak_" />
 	</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.WorkOrder">
 		<!--
@@ -45,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,people_seen_num)
+	    customer_name,customer_phone,view_num,certificate_,cancel_causes,cancel_reasons,cancel_images,people_seen_num,bak_)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -78,6 +78,7 @@
 ,#{cancelReasons,jdbcType=VARCHAR}
 ,#{cancelImages,jdbcType=VARCHAR}
 ,#{peopleSeenNum,jdbcType= NUMERIC }
+,#{bak,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -174,6 +175,9 @@
 			<if test="peopleSeenNum!=null">
 				people_seen_num=#{peopleSeenNum,jdbcType= NUMERIC },
 			</if>
+			<if test="bak!=null">
+				bak_=#{bak,jdbcType=VARCHAR},
+			</if>
 		</set>
 		where id_=#{id}
 	</update>

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

@@ -271,6 +271,11 @@ public class WorkOrderController {
             CustomerInfo customerInfo = customerInfoService.get(workOrder.getCompanyId());
             if (customerInfo != null) {
                 workOrder.setCompanyName(customerInfo.getRealName());
+                String statusN = dataDictionaryService.findNameByCatalogNameAndValue("工单状态",workOrder.getStatus());
+                if(StringUtils.isNotEmpty(statusN)){
+                    workOrder.setStatusN(statusN);
+                }
+
             }
         }
 
@@ -280,4 +285,5 @@ public class WorkOrderController {
 
         return msgResult;
     }
+
 }

+ 230 - 31
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/CustomerInfoApiController.java

@@ -305,7 +305,7 @@ public class CustomerInfoApiController {
 
     @ApiOperation(value = "主页")
     @RequestMapping(value = "main", method = RequestMethod.POST)
-    public MessageResult<Map<String, Object>> main(String token, @RequestAttribute String subject) {
+    public MessageResult<Map<String, Object>> main(int index,String token, @RequestAttribute String subject) {
         MessageResult<Map<String, Object>> msgResult = new MessageResult<>();
 
         CustomerInfo customerInfo = customerInfoService.get(subject);
@@ -341,7 +341,7 @@ public class CustomerInfoApiController {
             }
 
             //施工中
-            searchParams.put("status", "2");
+            searchParams.put("status", "3");
 
             Map map2 = workOrderService.countByCustomerId(searchParams);
 
@@ -353,7 +353,7 @@ public class CustomerInfoApiController {
 
 
             //待验收
-            searchParams.put("status", "3");
+            searchParams.put("status", "4");
 
             Map map3 = workOrderService.countByCustomerId(searchParams);
 
@@ -365,7 +365,7 @@ public class CustomerInfoApiController {
 
 
             //待验收
-            searchParams.put("status", "4");
+            searchParams.put("status", "5");
 
             Map map4 = workOrderService.countByCustomerId(searchParams);
 
@@ -375,11 +375,11 @@ public class CustomerInfoApiController {
                 count4 = Integer.parseInt(map4.get("count_").toString());
             }
 
-            List<ArgonPartner> argonPartnerList = argonPartnerService.list();
+            List<ArgonPartner> argonPartnerList = argonPartnerService.listByIndex(index);
 
-            List<LaborerInfo> laborerInfoList = laborerInfoService.list();
+            List<LaborerInfo> laborerInfoList = laborerInfoService.listByIndex(index);
 
-            List<TransportationInfo> transportationInfoList = transportationInfoService.list();
+            List<TransportationInfo> transportationInfoList = transportationInfoService.listByIndex(index);
 
 
             List<String> technicianIdList = workOrderService.findTopByCustomerId(customerInfo.getId());
@@ -428,7 +428,7 @@ public class CustomerInfoApiController {
             @ApiImplicitParam(name = "date", value = "日期", paramType = "form"),
     })
     public MessageResult<Map> workOrderPageList(
-            String title, String status, String date,String token,
+            String title, String status, String date, String token,
             @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
             @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
             @RequestAttribute String subject) {
@@ -462,7 +462,7 @@ public class CustomerInfoApiController {
             if (StringUtils.isNotEmpty(date)) {
                 Calendar calendar = Calendar.getInstance();
                 calendar.setTime(sdf.parse(date));
-                calendar.add(Calendar.DATE,1);
+                calendar.add(Calendar.DATE, 1);
 
                 String endDate = sdf.format(calendar.getTime());
 
@@ -554,8 +554,7 @@ public class CustomerInfoApiController {
 
             msgResult.setResult(true);
             msgResult.setData(dataMap);
-        }
-        catch (Exception ex) {
+        } catch (Exception ex) {
             logger.error(ex.getMessage(), ex);
 
             msgResult.setResult(false);
@@ -568,7 +567,7 @@ public class CustomerInfoApiController {
 
     @ApiOperation(value = "获取工单详情")
     @GetMapping("workOrderEdit/{id}")
-    public MessageResult<WorkOrderAllDataDTO> workOrderEdit(String token,@PathVariable("id") String id) {
+    public MessageResult<WorkOrderAllDataDTO> workOrderEdit(String token, @PathVariable("id") String id) {
         MessageResult<WorkOrderAllDataDTO> msgResult = new MessageResult<>();
 
         try {
@@ -621,10 +620,37 @@ public class CustomerInfoApiController {
     }
 
 
+    @ApiOperation(value = "工单修改提交")
+    @PostMapping("workOrderUpdate")
+    public MessageResult<String> workOrderUpdate(@RequestBody WorkOrderSubDataDTO dto, String token, @RequestAttribute String subject) {
+        MessageResult<String> msgResult = new MessageResult<>();
+
+        try {
+
+            String id = workOrderService.updateDTO(dto, subject);
+
+            if (StringUtils.isNotEmpty(id)) {
+                msgResult.setResult(true);
+                msgResult.setData(id);
+            } 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 = "technicianPageList", method = RequestMethod.POST)
     public MessageResult<Map> technicianPageList(
-            String name,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) {
@@ -645,15 +671,15 @@ public class CustomerInfoApiController {
         }
 
         if (StringUtils.isNotEmpty(name)) {
-            searchParams.put("name", "%"+name+"%");
+            searchParams.put("name", "%" + name + "%");
         }
 
 
         Page<TechnicianInfo> page = technicianInfoService.pageSearchMobile(searchParams, pageIndex, pageSize, true, sortList);
 
-        for (TechnicianInfo technicianInfo:page) {
+        for (TechnicianInfo technicianInfo : page) {
             Map<String, Object> searchParams1 = new HashMap<>();
-            searchParams.put("technicianId", technicianInfo.getId());
+            searchParams1.put("technicianId", technicianInfo.getId());
             Integer completeOrderNum = workOrderService.countByTechnicianId(searchParams1);
             technicianInfo.setCompleteOrderNum(completeOrderNum);
 
@@ -671,7 +697,7 @@ public class CustomerInfoApiController {
 
     @ApiOperation(value = "主页师傅详情")
     @GetMapping("technicianDetail/{id}")
-    public MessageResult<TechnicianDTO> technicianDetail(String token,@PathVariable("id") String id) {
+    public MessageResult<TechnicianDTO> technicianDetail(String token, @PathVariable("id") String id) {
         MessageResult<TechnicianDTO> msgResult = new MessageResult<>();
 
         try {
@@ -715,7 +741,7 @@ public class CustomerInfoApiController {
     @ApiOperation(value = "师傅主页评价列表")
     @RequestMapping(value = "commentPageList", method = RequestMethod.POST)
     public MessageResult<Map> commentPageList(
-            String technicianid,String token,
+            String technicianid, String token,
             @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
             @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
             HttpServletRequest request) {
@@ -732,14 +758,14 @@ public class CustomerInfoApiController {
         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);
 
-        for (CommentInfo commentInfo:page) {
+        for (CommentInfo commentInfo : page) {
             CustomerInfo customerInfo = customerInfoService.get(commentInfo.getCompanyId());
-            if(customerInfo!=null){
+            if (customerInfo != null) {
                 commentInfo.setCompanyName(customerInfo.getCompanyName());
             }
         }
@@ -991,8 +1017,8 @@ public class CustomerInfoApiController {
 
         for (DataDictionary item : dataDictionaryList) {
             Map map = new HashMap();
-            map.put("name",item.getName());
-            map.put("value",item.getValue());
+            map.put("name", item.getName());
+            map.put("value", item.getValue());
             mapList.add(map);
         }
 
@@ -1004,16 +1030,18 @@ public class CustomerInfoApiController {
 
 
     @ApiOperation(value = "取消工单")
-    @GetMapping("cancelWorkOrder/{id}")
-    public MessageResult<Integer> cancelWorkOrder(String token,@PathVariable("id") String id,@RequestAttribute String subject) {
+    @PostMapping("cancelWorkOrder")
+    public MessageResult<Integer> cancelWorkOrder(@RequestBody CancelWorkOrderDTO dto, String token, @RequestAttribute String subject) {
         MessageResult<Integer> msgResult = new MessageResult<>();
 
         try {
-            WorkOrder workOrder = workOrderService.get(id);
+            WorkOrder workOrder = workOrderService.get(dto.getId());
+            workOrder.setCancelReasons(dto.getReason());
+            workOrder.setCancelCauses(dto.getCancelCauses());
 
             if (workOrder != null) {
 
-                int affectCount = workOrderService.cancelWorkOrder(workOrder,subject);
+                int affectCount = workOrderService.updateWorkOrderStatus(workOrder, "7", subject);
 
                 msgResult.setResult(true);
                 msgResult.setData(affectCount);
@@ -1038,13 +1066,13 @@ public class CustomerInfoApiController {
             @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) {
+    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){
+            if (workOrder != null) {
                 workOrder.setUpdateBy(subject);
                 workOrder.setUpdateTime(new Date());
                 workOrder.setTechnicianId(technicianId);
@@ -1053,8 +1081,7 @@ public class CustomerInfoApiController {
 
                 messageResult.setResult(true);
                 messageResult.setData(affectCount);
-            }
-            else{
+            } else {
                 messageResult.setResult(false);
                 messageResult.setMessage("数据库不存在该记录!");
             }
@@ -1068,4 +1095,176 @@ public class CustomerInfoApiController {
         return messageResult;
     }
 
+
+    @ApiOperation(value = "工单验收")
+    @PostMapping("acceptanceWorkOrder")
+    public MessageResult<Integer> acceptanceWorkOrder(String id, String token, @RequestAttribute String subject) {
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            WorkOrder workOrder = workOrderService.get(id);
+
+            if (workOrder != null) {
+                int affectCount = workOrderService.updateWorkOrderStatus(workOrder, "5", 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 = "施工评分")
+    @PostMapping("rating")
+    public MessageResult<Integer> rating(@RequestBody RatingDTO dto, String token, @RequestAttribute String subject) {
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            WorkOrder workOrder = workOrderService.get(dto.getId());
+
+            if (workOrder != null) {
+                Date now = new Date();
+                CommentInfo commentInfo = new CommentInfo();
+                commentInfo.setId(UUID.randomUUID().toString());
+                commentInfo.setDelFlag(false);
+                commentInfo.setCreateBy(subject);
+                commentInfo.setCreateTime(now);
+                commentInfo.setCompanyId(workOrder.getCompanyId());
+                commentInfo.setContent(dto.getContent());
+                commentInfo.setStarRating(dto.getStarRating());
+                commentInfo.setDateTime(now);
+                String images = "";
+                if (dto.getImageList() != null && dto.getImageList().size() > 0) {
+                    for (String image : dto.getImageList()) {
+                        images += image + ",";
+                    }
+                }
+                if (StringUtils.isNotEmpty(images)) {
+                    images = images.substring(0, images.lastIndexOf(","));
+                }
+                commentInfo.setImage(images);
+                commentInfo.setIsOpen(dto.getIsOpen());
+
+                int affectCount = commentInfoService.insert(commentInfo);
+
+                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 = "paymentAccountInfo", method = RequestMethod.POST)
+    public MessageResult<Map> paymentAccountInfo(String token, @RequestAttribute String subject) {
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+
+        List<AboutUs> aboutUsList = aboutUsService.list();
+
+        Map map = new HashMap();
+
+        if(aboutUsList.size() > 0){
+            AboutUs aboutUs = aboutUsList.get(0);
+            map.put("receivingAccount", aboutUs.getReceivingAccount());
+            map.put("bank", aboutUs.getBank());
+            map.put("accountNumber", aboutUs.getAccountNumber());
+            map.put("paymentCode", aboutUs.getPaymentCode());
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(map);
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value = "增加备注信息")
+    @PostMapping("bakAdd")
+    public MessageResult<WorkOrder> bakAdd(String id,String bak, @RequestAttribute String subject) {
+        MessageResult<WorkOrder> msgResult = new MessageResult<>();
+
+        try {
+            WorkOrder workOrder = workOrderService.get(id);
+            workOrder.setBak(bak);
+            workOrder.setUpdateTime(new Date());
+            workOrder.setUpdateBy(subject);
+
+            int affectCount = workOrderService.update(workOrder);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(workOrder);
+            } 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("updateImage")
+    public MessageResult<WorkOrder> updateImage(@RequestBody WorkOrderImageDTO dto, @RequestAttribute String subject) {
+        MessageResult<WorkOrder> msgResult = new MessageResult<>();
+
+        try {
+            WorkOrder workOrder = workOrderService.get(dto.getId());
+
+            if(workOrder!=null){
+                workOrder.setUpdateBy(subject);
+                workOrder.setUpdateTime(new Date());
+                workOrder.setImage(dto.getImage());
+            }
+
+            int affectCount = workOrderService.update(workOrder);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(workOrder);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        } catch (Exception ex) {
+            logger.error(ex.getMessage(), ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
 }