Browse Source

技术服务评价导出新增所有评价备注

anderx 1 year ago
parent
commit
eb8555e912

+ 2 - 0
src/main/java/com/goafanti/common/dao/TaskScoreMapper.java

@@ -86,5 +86,7 @@ public interface TaskScoreMapper {
     TaskScore queryByTid(Integer tid);
 
     List<OutAdminTaskScore> findAdminTaskScoreList(InputTaskScore in);
+
+    List<TaskScore> selectRemarkByAid(String id);
 }
 

+ 5 - 0
src/main/java/com/goafanti/common/mapper/TaskScoreMapper.xml

@@ -253,6 +253,11 @@
         from task_score
         where tid = #{tid}
     </select>
+    <select id="selectRemarkByAid" resultMap="TaskScoreMap">
+        select b.*
+        from t_order_task a right join task_score b on a.id =b.tid
+        where a.task_receiver= #{aid}
+    </select>
 
 </mapper>
 

+ 13 - 0
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -14,6 +14,7 @@ import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Attachment;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.User;
+import com.goafanti.common.model.UserMid;
 import com.goafanti.common.utils.*;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -1672,4 +1673,16 @@ public class AdminCustomerApiController extends BaseApiController{
 		res.setData(customerService.selectUserLevel());
 		return res;
 	}
+
+	/**
+	 * 修改用户标签
+	 * @param in
+	 * @return
+	 */
+	@PostMapping("/updateMid")
+	public Result updateMid(UserMid in) {
+		Result res = new Result();
+		res.data(customerService.updateMid(in));
+		return res;
+	}
 }

+ 3 - 4
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -3,10 +3,7 @@ package com.goafanti.customer.service;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.bo.userDaysBo;
 import com.goafanti.common.error.BusinessException;
-import com.goafanti.common.model.Admin;
-import com.goafanti.common.model.AdminUserCount;
-import com.goafanti.common.model.OrganizationContactBook;
-import com.goafanti.common.model.User;
+import com.goafanti.common.model.*;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.customer.bo.*;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -601,4 +598,6 @@ public interface CustomerService {
 	void updateUserShareType(List<LockingReleaseBo> newList);
 
 	Object selectUserLevel();
+
+    Object updateMid(UserMid in);
 }

+ 6 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -3151,8 +3151,13 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return userMapper.selectUserLevel(TokenManager.getAdminId());
     }
 
+	@Override
+	public Object updateMid(UserMid in) {
+		return userMidMapper.updateByUid(in);
+	}
+
 
-    private List<InputExcelUser> pushUserName(List<InputExcelUser> list) {
+	private List<InputExcelUser> pushUserName(List<InputExcelUser> list) {
 		List<InputExcelUser> res=new ArrayList<>();
 		List<InputExcelUser> list2=new ArrayList<>();
 		int i = 0;

+ 10 - 0
src/main/java/com/goafanti/order/bo/TaskScore/OutAdminTaskScore.java

@@ -77,6 +77,16 @@ public class OutAdminTaskScore {
     @Excel(name = "最后登录时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date lastLoginTime;
 
+    @Excel(name = "备注")
+    private String remarks;
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
 
     public int getHtSatCount() {
         return htSatCount;

+ 16 - 1
src/main/java/com/goafanti/order/service/impl/TaskScoreServiceImpl.java

@@ -247,9 +247,24 @@ public class TaskScoreServiceImpl extends BaseMybatisDao<TaskScoreMapper> implem
     @Override
     public Result listExport(InputTaskScore params) {
         List<OutAdminTaskScore> list = (List<OutAdminTaskScore>) findList("findAdminTaskScoreList",params, 1, 99999);
-
+        pushRemarks(list);
         NewExcelUtil excel = new NewExcelUtil(OutAdminTaskScore.class);
         return excel.exportExcel(list, "人员评分列表", uploadPath);
     }
 
+    private void pushRemarks(List<OutAdminTaskScore> list) {
+        for (OutAdminTaskScore e : list) {
+            List<TaskScore> taskScores = taskScoreMapper.selectRemarkByAid(e.getId());
+            StringBuilder remark=new StringBuilder();
+            if (!taskScores.isEmpty()){
+                for (TaskScore e2 : taskScores) {
+                    if (e2.getRemarks()!=null){
+                        remark.append(e2.getRemarks()).append("\r\n");
+                    }
+                }
+            }
+            e.setRemarks(remark.toString());
+        }
+    }
+
 }