2 Commits 5f32472390 ... 741800999e

Tác giả SHA1 Thông báo Ngày
  yanliming 741800999e Merge remote-tracking branch 'origin/master' 2 tuần trước cách đây
  yanliming 58f2b9ffe1 后台功能接口提交 2 tuần trước cách đây

+ 3 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/AboutUsDAO.java

@@ -1,6 +1,8 @@
 package com.jpsoft.employment.modules.base.dao;
 
 import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import com.jpsoft.employment.modules.base.entity.AboutUs;
 import java.util.Map;
@@ -14,5 +16,6 @@ public interface AboutUsDAO {
 	AboutUs get(String id);
 	int delete(String id);
 	List<AboutUs> list();
+	List<AboutUs> findBySearchParams(@Param("searchParams") Map<String, Object> searchParams);
 	List<AboutUs> search(Map<String, Object> searchParams, List<Sort> sortList);
 }

+ 12 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/AboutUs.java

@@ -62,4 +62,16 @@ public class AboutUs {
 
 	@ApiModelProperty(value = "客服电话")
 	private String phone;
+
+	@ApiModelProperty(value = "数据代码")
+	private String code;
+
+	@ApiModelProperty(value = "内容")
+	private String content;
+
+	@ApiModelProperty(value = "类型")
+	private String type;
+
+	@ApiModelProperty(value = "标题说明")
+	private String title;
 		}

+ 7 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/CustomerInfo.java

@@ -4,6 +4,9 @@ import java.io.Serializable;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
+import java.util.List;
+
+import org.springframework.data.annotation.Transient;
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
@@ -80,5 +83,9 @@ public class CustomerInfo {
 	@ApiModelProperty(value = "统一社会信用代码")
 	private String businessCode;
 
+	@Transient
+	@ApiModelProperty(value = "营业执照")
+	private List<String> businessLicenseList;
+
 	
 		}

+ 7 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/ReceiveRequire.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;
@@ -58,5 +60,10 @@ public class ReceiveRequire {
 
 	@ApiModelProperty(value = "会员等级")
 	private Integer level;
+
+
+	@Transient
+	@ApiModelProperty(value = "订单发布模式(1:客户自选师傅,2:由师傅抢单)")
+	private String orderModelN;
 	
 		}

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

@@ -13,5 +13,6 @@ public interface AboutUsService {
 	int update(AboutUs model);
 	int delete(String id);
 	List<AboutUs> list();
+	List<AboutUs> findBySearchParams(Map<String, Object> searchParams);
 	Page<AboutUs> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
 }

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

@@ -58,6 +58,11 @@ public class AboutUsServiceImpl implements AboutUsService {
 		// TODO Auto-generated method stub
 		return aboutUsDAO.list();
 	}
+
+	@Override
+	public List<AboutUs> findBySearchParams(Map<String, Object> searchParams){
+		return aboutUsDAO.findBySearchParams(searchParams);
+	}
 		
 	@Override
 	public Page<AboutUs> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {

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

@@ -402,11 +402,41 @@ public class WorkOrderServiceImpl implements WorkOrderService {
                     installationRequirement.setMaterialN(materialN);
                 }
             }
+
+
+            if (StringUtils.isNotEmpty(installationRequirement.getDifficulty())) {
+                String difficultyName = dataDictionaryDAO.findNameByCatalogNameAndValue("施工难度", installationRequirement.getDifficulty());
+                if (StringUtils.isNotEmpty(difficultyName)) {
+                    installationRequirement.setDifficultyName(difficultyName);
+                }
+            }
+
+            if (StringUtils.isNotEmpty(installationRequirement.getEnvironment())) {
+                String getEnvironmentN = dataDictionaryDAO.findNameByCatalogNameAndValue("施工环境", installationRequirement.getEnvironment());
+                if (StringUtils.isNotEmpty(getEnvironmentN)) {
+                    installationRequirement.setEnvironmentName(getEnvironmentN);
+                }
+            }
+
+            if (StringUtils.isNotEmpty(installationRequirement.getConstructionLocation())) {
+                String constructionLocationName = dataDictionaryDAO.findNameByCatalogNameAndValue("施工位置", installationRequirement.getConstructionLocation());
+                if (StringUtils.isNotEmpty(constructionLocationName)) {
+                    installationRequirement.setConstructionLocationName(constructionLocationName);
+                }
+            }
         }
 
         dto.setInstallationRequirement(installationRequirement);
 
         ReceiveRequire receiveRequire = receiveRequireDAO.findByWorkOrderId(id);
+        if(receiveRequire!=null){
+            String orderModelN = dataDictionaryDAO.findNameByCatalogNameAndValue("订单发布模式", receiveRequire.getOrderModel());
+            if (StringUtils.isNotEmpty(orderModelN)) {
+                receiveRequire.setOrderModelN(orderModelN);
+            }
+        }
+
+
         dto.setReceiveRequire(receiveRequire);
 
         String customerName = "";
@@ -446,6 +476,13 @@ public class WorkOrderServiceImpl implements WorkOrderService {
             }
         }
 
+        if (StringUtils.isNotEmpty(workOrder.getPayStatus())) {
+            String payStatusN = dataDictionaryDAO.findNameByCatalogNameAndValue("支付状态", workOrder.getPayStatus());
+            if (StringUtils.isNotEmpty(payStatusN)) {
+                workOrder.setPayStatusN(payStatusN);
+            }
+        }
+
         dto.setWorkOrder(workOrder);
 
         TechnicianInfo technicianInfo = technicianInfoDAO.get(workOrder.getTechnicianId());

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

@@ -18,7 +18,10 @@
 			<result property="accountNumber" column="account_number" />
 			<result property="paymentCode" column="payment_code" />
 			<result property="phone" column="phone_" />
-
+			<result property="code" column="code_" />
+			<result property="content" column="content_" />
+			<result property="type" column="type_" />
+			<result property="title" column="title_" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.AboutUs">
 	<!--
@@ -29,7 +32,7 @@
 	<![CDATA[
 		insert into base_about_us
 	    (id_,user_agreement,privacy_policy,disclaimer,create_time,update_time,del_flag,create_by,update_by
-	    ,receiving_account,bank_,account_number,payment_code,phone_)
+	    ,receiving_account,bank_,account_number,payment_code,phone_,code_,content_,type_,title_)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -46,6 +49,10 @@
 ,#{accountNumber,jdbcType=VARCHAR}
 ,#{paymentCode,jdbcType=VARCHAR}
 ,#{phone,jdbcType=VARCHAR}
+,#{code,jdbcType=VARCHAR}
+,#{content,jdbcType=VARCHAR}
+,#{type,jdbcType=VARCHAR}
+,#{title,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -94,6 +101,18 @@
 		<if test="phone!=null">
 			phone_=#{phone,jdbcType=VARCHAR},
 		</if>
+			<if test="code!=null">
+				code_=#{code,jdbcType=VARCHAR},
+			</if>
+			<if test="content!=null">
+				content_=#{content,jdbcType=VARCHAR},
+			</if>
+			<if test="type!=null">
+				type_=#{type,jdbcType=VARCHAR},
+			</if>
+			<if test="title!=null">
+				title_=#{title,jdbcType=VARCHAR},
+			</if>
 		</set>
 	where id_=#{id}
 	</update>
@@ -106,6 +125,18 @@
 	<select id="list" resultMap="AboutUsMap">
 		select * from base_about_us where del_flag=false limit 1
 	</select>
+	<select id="findBySearchParams" resultMap="AboutUsMap">
+		select * from base_about_us
+		<where>
+			del_flag=false
+			<if test="searchParams.code != null">
+				and code_ = #{searchParams.code}
+			</if>
+			<if test="searchParams.type != null">
+				and type_ = #{searchParams.type}
+			</if>
+		</where>
+	</select>
 	<select id="search" parameterType="hashmap" resultMap="AboutUsMap">
 		<![CDATA[
 			select * from base_about_us

+ 0 - 122
common/target/classes/mapper/base/AboutUs.xml

@@ -1,122 +0,0 @@
-<?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">
-<!-- namespace必须指向DAO接口 -->
-<mapper namespace="com.jpsoft.employment.modules.base.dao.AboutUsDAO">
-	<resultMap id="AboutUsMap" type="com.jpsoft.employment.modules.base.entity.AboutUs">
-		<id property="id" column="id_" />
-			<result property="userAgreement" column="user_agreement" />
-			<result property="privacyPolicy" column="privacy_policy" />
-			<result property="disclaimer" column="disclaimer" />
-			<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="receivingAccount" column="receiving_account" />
-			<result property="bank" column="bank_" />
-			<result property="accountNumber" column="account_number" />
-			<result property="paymentCode" column="payment_code" />
-			<result property="phone" column="phone_" />
-
-			</resultMap>
-	<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
-	</selectKey>
-	-->
-	<![CDATA[
-		insert into base_about_us
-	    (id_,user_agreement,privacy_policy,disclaimer,create_time,update_time,del_flag,create_by,update_by
-	    ,receiving_account,bank_,account_number,payment_code,phone_)
-		values
-		(
-#{id,jdbcType=VARCHAR}
-,#{userAgreement,jdbcType=VARCHAR}
-,#{privacyPolicy,jdbcType=VARCHAR}
-,#{disclaimer,jdbcType=VARCHAR}
-,#{createTime,jdbcType= TIMESTAMP }
-,#{updateTime,jdbcType= TIMESTAMP }
-,#{delFlag,jdbcType= NUMERIC }
-,#{createBy,jdbcType=VARCHAR}
-,#{updateBy,jdbcType=VARCHAR}
-,#{receivingAccount,jdbcType=VARCHAR}
-,#{bank,jdbcType=VARCHAR}
-,#{accountNumber,jdbcType=VARCHAR}
-,#{paymentCode,jdbcType=VARCHAR}
-,#{phone,jdbcType=VARCHAR}
-		)
-	]]>
-	</insert>
-	<delete id="delete" parameterType="string">
-		delete from base_about_us where id_=#{id,jdbcType=VARCHAR}
-	</delete>
-	<update id="update" parameterType="com.jpsoft.employment.modules.base.entity.AboutUs">
-		update base_about_us
-		<set>
-				<if test="userAgreement!=null">
-		user_agreement=#{userAgreement,jdbcType=VARCHAR},
-		</if>
-				<if test="privacyPolicy!=null">
-		privacy_policy=#{privacyPolicy,jdbcType=VARCHAR},
-		</if>
-				<if test="disclaimer!=null">
-		disclaimer=#{disclaimer,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="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>
-		<if test="phone!=null">
-			phone_=#{phone,jdbcType=VARCHAR},
-		</if>
-		</set>
-	where id_=#{id}
-	</update>
-	<select id="get" parameterType="string" resultMap="AboutUsMap">
-		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}
-	</select>
-	<select id="list" resultMap="AboutUsMap">
-		select * from base_about_us where del_flag=false limit 1
-	</select>
-	<select id="search" parameterType="hashmap" resultMap="AboutUsMap">
-		<![CDATA[
-			select * from base_about_us
-		]]>
-		<where>
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
-			</if>
-		</where>
-		<foreach item="sort" collection="sortList"  open="order by" separator=",">
-	        ${sort.name} ${sort.order}
-	 	</foreach>
-	</select>
-</mapper>

+ 0 - 11
common/target/classes/mapper/base/RevenueInfo.xml

@@ -98,15 +98,4 @@ id_,amount_,work_order_id,date_time,status_,create_time,update_time,del_flag,cre
 	        ${sort.name} ${sort.order}
 	 	</foreach>
 	</select>
-	<select id="getRevenueAmount" resultType="integer">
-		SELECT SUM(amount_) FROM base_revenue_info a
-		LEFT JOIN base_work_order b ON a.work_order_id = b.id_
-		WHERE a.del_flag = FALSE
-		<if test="paid = true">
-		AND a.status_ = '2'
-		</if>
-		<if test="technicianId != null">
-		AND b.technician_id = #{technicianId}
-		</if>
-	</select>
 </mapper>

+ 0 - 6
common/target/classes/mapper/base/TechnicianInfo.xml

@@ -191,10 +191,4 @@
 		and phone_ = #{0}
 		limit 1
 	</select>
-	<select id="findByOpenid" parameterType="string" resultMap="TechnicianInfoMap">
-		select * from base_technician_info
-		where del_flag = 0
-		and open_id = #{0}
-		limit 1
-	</select>
 </mapper>

+ 2 - 6
common/target/classes/mapper/base/WorkOrder.xml

@@ -36,7 +36,7 @@
 		<result property="peopleSeenNum" column="people_seen_num" />
 		<result property="bak" column="bak_" />
 		<result property="payCertificate" column="pay_certificate" />
-		<result property="finishTime" column="finish_time" />
+
 	</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.WorkOrder">
 		<!--
@@ -47,7 +47,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,bak_,pay_certificate,finish_time)
+	    customer_name,customer_phone,view_num,certificate_,cancel_causes,cancel_reasons,cancel_images,people_seen_num,bak_,pay_certificate)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -82,7 +82,6 @@
 ,#{peopleSeenNum,jdbcType= NUMERIC }
 ,#{bak,jdbcType=VARCHAR}
 ,#{payCertificate,jdbcType=VARCHAR}
-,#{finishTime,jdbcType= TIMESTAMP }
 		)
 	]]>
 	</insert>
@@ -185,9 +184,6 @@
 			<if test="payCertificate!=null">
 				pay_certificate=#{payCertificate,jdbcType=VARCHAR},
 			</if>
-			<if test="finishTime!=null">
-				finish_time=#{finishTime,jdbcType= TIMESTAMP },
-			</if>
 		</set>
 		where id_=#{id}
 	</update>

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

@@ -79,6 +79,18 @@ public class CustomerInfoController {
             CustomerInfo customerInfo = customerInfoService.get(id);
 
             if (customerInfo != null) {
+
+                List<String> businessLicenseList = new ArrayList<>();
+                if(StringUtils.isNotEmpty(customerInfo.getBusinessLicense())){
+                    String[] businessLicenseArr = customerInfo.getBusinessLicense().split(",");
+
+                    for (String item:businessLicenseArr) {
+                        businessLicenseList.add(item);
+                    }
+                }
+
+                customerInfo.setBusinessLicenseList(businessLicenseList);
+
                 msgResult.setResult(true);
                 msgResult.setData(customerInfo);
             } else {

+ 25 - 20
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/CustomerInfoApiController.java

@@ -938,38 +938,43 @@ public class CustomerInfoApiController {
     @ApiOperation(value = "关于我们")
     @RequestMapping(value = "aboutUs", method = RequestMethod.POST)
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "type", value = "类型(1:用户协议,2:隐私协议,3:免责条款,4:客服电话)", paramType = "form"),
+            @ApiImplicitParam(name = "code",
+                    value = "数据代码(YHXY:用户协议,YSNR:隐私政策,MZTK:免责条款,SKR:收款人,YH:银行,SKZH:收款账户,SKM:收款码,KFDH:客户电话)", paramType = "form"),
+            @ApiImplicitParam(name = "type",
+                    value = "account:账号相关", paramType = "form"),
     })
-    public MessageResult<Map> aboutUs(String token, String type, @RequestAttribute String subject) {
+    public MessageResult<List<Map>> aboutUs(String token, String code, String type,@RequestAttribute String subject) {
 
         //当前用户ID
         System.out.println(subject);
 
-        MessageResult<Map> msgResult = new MessageResult<>();
-
-        List<AboutUs> aboutUsList = aboutUsService.list();
+        MessageResult<List<Map>> msgResult = new MessageResult<>();
 
-        Map map = new HashMap();
+        Map<String, Object> searchParams = new HashMap<>();
 
-        String content = "";
+        if(StringUtils.isNotEmpty(code)){
+            searchParams.put("code",code);
+        }
 
-        if (aboutUsList != null) {
-            AboutUs aboutUs = aboutUsList.get(0);
-            if ("1".equals(type)) {
-                content = aboutUs.getUserAgreement();
-            } else if ("2".equals(type)) {
-                content = aboutUs.getPrivacyPolicy();
-            } else if ("3".equals(type)) {
-                content = aboutUs.getDisclaimer();
-            } else if ("4".equals(type)) {
-                content = aboutUs.getPhone();
-            }
+        if(StringUtils.isNotEmpty(type)){
+            searchParams.put("type",type);
         }
 
-        map.put("content", content);
+        List<AboutUs> aboutUsList = aboutUsService.findBySearchParams(searchParams);
+
+        List<Map> mapList = new ArrayList<>();
+
+        for (AboutUs aboutUs:aboutUsList) {
+            Map map = new HashMap();
+            map.put("code",aboutUs.getCode());
+            map.put("content",aboutUs.getContent());
+            map.put("title",aboutUs.getTitle());
+
+            mapList.add(map);
+        }
 
         msgResult.setResult(true);
-        msgResult.setData(map);
+        msgResult.setData(mapList);
 
         return msgResult;
     }