Prechádzať zdrojové kódy

工单支付状态接口逻辑修改
工单列表显示修改

yanliming 4 dní pred
rodič
commit
8d730b79f3

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

@@ -15,5 +15,6 @@ public interface CommentInfoDAO {
 	int delete(String id);
 	List<CommentInfo> list();
 	List<CommentInfo> findByWorkOrderId(String workOrderId);
+	List<CommentInfo> findTechnicianId(String technicianId);
 	List<CommentInfo> search(Map<String, Object> searchParams, List<Sort> sortList);
 }

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

@@ -41,4 +41,7 @@ public class WorkOrderListDTO {
 
     @ApiModelProperty(value = "师傅会员等级")
     private Integer technicianLevel;
+
+    @ApiModelProperty(value = "支付状态")
+    private String payStatus;
 }

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

@@ -139,5 +139,14 @@ public class TechnicianInfo {
 	@Transient
 	@ApiModelProperty(value = "合作单数")
 	private Integer cooperationNum;
+
+	@Transient
+	@ApiModelProperty(value = "业务范围翻译")
+	private String businessScopeN;
+
+
+	@Transient
+	@ApiModelProperty(value = "评论平均分,动态计算生成")
+	private BigDecimal score;
 	
 		}

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

@@ -71,7 +71,7 @@ public class WorkOrderServiceImpl implements WorkOrderService {
         workOrder.setId(UUID.randomUUID().toString());
         workOrder.setDelFlag(false);
         workOrder.setCreateBy(createBy);
-        workOrder.setPayStatus("1");
+        workOrder.setPayStatus("0");
         workOrder.setStatus("0");
         workOrder.setPeopleSeenNum(0);
         workOrder.setCompanyId(createBy);
@@ -490,6 +490,20 @@ public class WorkOrderServiceImpl implements WorkOrderService {
         TechnicianInfo technicianInfo = technicianInfoDAO.get(workOrder.getTechnicianId());
 
         if (technicianInfo != null) {
+            //计算评论得分
+            List<CommentInfo> commentInfoList = commentInfoDAO.findTechnicianId(technicianInfo.getId());
+            int count = commentInfoList.size();
+
+            BigDecimal totalScore = BigDecimal.ZERO;
+            for (CommentInfo commentInfo:commentInfoList) {
+                totalScore = totalScore.add(new BigDecimal(commentInfo.getStarRating()));
+            }
+
+            if(count > 0){
+                BigDecimal score = totalScore.divide(new BigDecimal(count));
+                technicianInfo.setScore(score);
+            }
+
             dto.setTechnicianInfo(technicianInfo);
         }
 

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

@@ -109,6 +109,9 @@
 	<select id="findByWorkOrderId" resultMap="CommentInfoMap">
 		select * from base_comment_info where del_flag=false and work_order_id=#{0}
 	</select>
+	<select id="findTechnicianId" resultMap="CommentInfoMap">
+		select * from base_comment_info where del_flag=false and technician_id=#{0}
+	</select>
 	<select id="search" parameterType="hashmap" resultMap="CommentInfoMap">
 		<![CDATA[
 			select * from base_comment_info

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

@@ -273,10 +273,13 @@
                 <if test="searchParams.technicianId != null">
                     and a.technician_id = #{searchParams.technicianId}
                 </if>
+				and a.status_=#{searchParams.status}
 			</if>
             <if test="searchParams.status == null">
                 <if test="searchParams.technicianId != null">
-                    and a.technician_id = #{searchParams.technicianId}
+					<![CDATA[
+                    	and a.technician_id = #{searchParams.technicianId} and status_<> '0' and status_<> '1'
+                    ]]>
                 </if>
             </if>
 			<if test="searchParams.key != null">
@@ -286,7 +289,9 @@
 				and a.create_time = #{searchParams.date}
 			</if>
             <if test="searchParams.isAppoint == false">
-                and a.technician_id is null
+				<if test="searchParams.technicianId == null">
+					and a.technician_id is null
+				</if>
             </if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

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

@@ -155,7 +155,7 @@ public class WorkOrderController {
         try {
             WorkOrder workOrder = workOrderService.get(id);
             workOrder.setStatus("1");//修改已确认状态
-            workOrder.setPayStatusN("2");//修改已支付状态
+            workOrder.setPayStatus("2");//修改已支付状态
             workOrder.setUpdateBy(subject);
             workOrder.setUpdateTime(new Date());
 

+ 33 - 18
web/src/main/java/com/jpsoft/employment/modules/mobile/controller/CustomerInfoApiController.java

@@ -390,6 +390,21 @@ public class CustomerInfoApiController {
                 TechnicianInfo technicianInfo = technicianInfoService.get(technicianId);
 
                 if (technicianInfo != null) {
+                    if (StringUtils.isNotEmpty(technicianInfo.getBusinessScope())) {
+                        String[] businessScopeArr = technicianInfo.getBusinessScope().split(",");
+                        String businessScopeN = "";
+                        for (String item : businessScopeArr) {
+                            String businessScopeStr = dataDictionaryService.findNameByCatalogNameAndValue("水箱材质", item);
+                            if (StringUtils.isNotEmpty(businessScopeStr)) {
+                                businessScopeN += businessScopeStr + ",";
+                            }
+                        }
+                        if (StringUtils.isNotEmpty(businessScopeN)) {
+                            businessScopeN = businessScopeN.substring(0, businessScopeN.lastIndexOf(","));
+                            technicianInfo.setBusinessScopeN(businessScopeN);
+                        }
+                    }
+
                     technicianInfoList.add(technicianInfo);
                 }
             }
@@ -532,6 +547,7 @@ public class CustomerInfoApiController {
                 dto.setTechnicianName(technicianName);
                 dto.setTechnicianImage(technicianImage);
                 dto.setTechnicianLevel(technicianLevel);
+                dto.setPayStatus(workOrder.getPayStatus());
 
                 List<String> tagList = new ArrayList<>();
                 if (StringUtils.isNotEmpty(workOrder.getTag())) {
@@ -650,7 +666,7 @@ public class CustomerInfoApiController {
     @ApiOperation(value = "师傅列表")
     @RequestMapping(value = "technicianPageList", method = RequestMethod.POST)
     public MessageResult<Map> technicianPageList(
-            String name, String businessScope,String token,
+            String name, String businessScope, String token,
             @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
             @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
             HttpServletRequest request) {
@@ -880,9 +896,9 @@ public class CustomerInfoApiController {
     @ApiOperation(value = "问题反馈列表")
     @RequestMapping(value = "feedbackPageList", method = RequestMethod.POST)
     public MessageResult<Map> feedbackPageList(String type,
-            @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
-            @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
-            HttpServletRequest request) {
+                                               @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
+                                               @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
+                                               HttpServletRequest request) {
         String subject = (String) request.getAttribute("subject");
 
         //当前用户ID
@@ -895,11 +911,10 @@ public class CustomerInfoApiController {
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("create_time", "desc"));
 
-        if(type.equals("1")){
-            searchParams.put("companyId",subject);
-        }
-        else if(type.equals("2")){
-            searchParams.put("technicianId",subject);
+        if (type.equals("1")) {
+            searchParams.put("companyId", subject);
+        } else if (type.equals("2")) {
+            searchParams.put("technicianId", subject);
         }
 
         Page<Feedback> page = feedbackService.pageSearch(searchParams, pageIndex, pageSize, true, sortList);
@@ -951,7 +966,7 @@ public class CustomerInfoApiController {
             @ApiImplicitParam(name = "type",
                     value = "account:账号相关", paramType = "form"),
     })
-    public MessageResult<List<Map>> aboutUs(String token, String code, String type,@RequestAttribute String subject) {
+    public MessageResult<List<Map>> aboutUs(String token, String code, String type, @RequestAttribute String subject) {
 
         //当前用户ID
         System.out.println(subject);
@@ -960,23 +975,23 @@ public class CustomerInfoApiController {
 
         Map<String, Object> searchParams = new HashMap<>();
 
-        if(StringUtils.isNotEmpty(code)){
-            searchParams.put("code",code);
+        if (StringUtils.isNotEmpty(code)) {
+            searchParams.put("code", code);
         }
 
-        if(StringUtils.isNotEmpty(type)){
-            searchParams.put("type",type);
+        if (StringUtils.isNotEmpty(type)) {
+            searchParams.put("type", type);
         }
 
         List<AboutUs> aboutUsList = aboutUsService.findBySearchParams(searchParams);
 
         List<Map> mapList = new ArrayList<>();
 
-        for (AboutUs aboutUs:aboutUsList) {
+        for (AboutUs aboutUs : aboutUsList) {
             Map map = new HashMap();
-            map.put("code",aboutUs.getCode());
-            map.put("content",aboutUs.getContent());
-            map.put("title",aboutUs.getTitle());
+            map.put("code", aboutUs.getCode());
+            map.put("content", aboutUs.getContent());
+            map.put("title", aboutUs.getTitle());
 
             mapList.add(map);
         }