|
@@ -17,6 +17,7 @@ import com.platform.service.wechat.model.request.template.WechatTemplateRequest;
|
|
|
import com.platform.service.wechat.service.WeChatConnectService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
@@ -42,13 +43,15 @@ public class IndexController {
|
|
|
|
|
|
/**
|
|
|
* 统计用户的任务
|
|
|
+ * 当日的任务(截止到当前日期未完成的)
|
|
|
+ * 1周的任务
|
|
|
+ * 1个月的任务
|
|
|
*
|
|
|
* @return R
|
|
|
*/
|
|
|
@GetMapping("/gather/task/user")
|
|
|
public R gatherTaskUser() {
|
|
|
UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
- // 根据登录用户的角色来设置周期,使用人员:1周的任务,维修人员1个月的任务
|
|
|
List<String> roleCodes = userInfo.getRoleCodes();
|
|
|
boolean isOperator = false;
|
|
|
for(String roleCode:roleCodes){
|
|
@@ -69,10 +72,40 @@ public class IndexController {
|
|
|
// 维修验收任务
|
|
|
int repairCheckTask = repairApplicationFormService.countTask(null, userInfo.getUserId(), 3);
|
|
|
return R.success(new GatherTaskVO()
|
|
|
- .setLubricationTask2(lubricationTask)
|
|
|
+ .setLubricationTask(lubricationTask)
|
|
|
.setLubricationTaskWeek(lubricationTaskWeek)
|
|
|
.setLubricationTaskMonth(lubricationTaskMonth)
|
|
|
.setRepairTask(repairTask).setRepairCheckTask(repairCheckTask));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据身份统计任务:当日(一直到当天未完成的)
|
|
|
+ * 1:维修人员:自己的任务,关于某一台设备
|
|
|
+ * 2:管理人员:设备所有的任务
|
|
|
+ *
|
|
|
+ * @return R
|
|
|
+ */
|
|
|
+ @GetMapping("/gather/task/role/{sbId}")
|
|
|
+ public R gatherTaskRole(@PathVariable(value = "sbId", required = false) String sbId) {
|
|
|
+ UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+ List<String> roleCodes = userInfo.getRoleCodes();
|
|
|
+ boolean isMM = false;
|
|
|
+ for(String roleCode:roleCodes){
|
|
|
+ System.out.println("roleCode: " + roleCode);
|
|
|
+ if(roleCode.equals(SysRoleCodeEnum.MM.name())){
|
|
|
+ isMM = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 当日,本周,本月待保养任务
|
|
|
+ int lubricationTaskMyDay = checkJobService.countSbUserTask(sbId, userInfo.getUserId(), CheckStandardTypeEnum.POLLING.getValue());
|
|
|
+ int lubricationTaskAllDay = 0;
|
|
|
+ if(isMM){
|
|
|
+ lubricationTaskAllDay = checkJobService.countSbUserTask(sbId, null, CheckStandardTypeEnum.POLLING.getValue());
|
|
|
+ }
|
|
|
+ return R.success(new GatherTaskVO()
|
|
|
+ .setLubricationTaskMyDay(lubricationTaskMyDay).setLubricationTaskAllDay(lubricationTaskAllDay));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|