环保任务下派,添加待办提醒

This commit is contained in:
wanggeng888 2021-03-30 13:23:35 +08:00
parent b3e801d6a9
commit 4bbbf2ccaa
4 changed files with 15 additions and 6 deletions

View File

@ -15,6 +15,7 @@ import com.cm.inspection.pojo.dtos.enterprise.checkitem.v2.CheckItemDTO;
import com.cm.inspection.pojo.dtos.enterpriseofgridoperator.EnterpriseOfGridOperatorDTO;
import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemDTO;
import com.cm.inspection.pojo.vos.taskcheck.v2.TaskCheckVO;
import com.cm.inspection.service.BaseService;
import com.cm.inspection.service.enterprise.IEnterpriseService;
import com.cm.inspection.service.enterprise.checkitem.v2.ICheckItemService;
import com.cm.inspection.service.enterpriseofgridoperator.IEnterpriseOfGridOperatorService;
@ -129,7 +130,6 @@ public class TaskCheckSaveRunnable implements Runnable {
countEnterpriseCheckItem++;
}
}
dataSourceTransactionManager.commit(transactionStatus);
publishMsg.append("\n下发任务企业数量").append(taskCheckEnterprise.size());
publishMsg.append("\n无检查项企业数量").append(countNoCheckItems);
publishMsg.append("\n行业检查项数量" + countIndustryCheckItem);
@ -137,6 +137,7 @@ public class TaskCheckSaveRunnable implements Runnable {
publishStatus = 1;
// 发送通知
sendNotice(taskCheckEnterprise);
dataSourceTransactionManager.commit(transactionStatus);
} catch (Exception e) {
publishStatus = -1;
log.error(e.getMessage(), e);
@ -381,6 +382,10 @@ public class TaskCheckSaveRunnable implements Runnable {
notice.put("title", "任务通知");
notice.put("msg", "您有新的任务待处理,请点击查看");
notice.put("target", "GO_TASK");
notice.put("system", BaseService.SYSTEM_NAME);
notice.put("module", BaseService.MODULE_TASK_V2);
notice.put("menu", BaseService.MENU_TASK_V2);
notice.put("serviceId", taskId);
noticeJSONArray.add(notice);
noticeJSONObject.put("noticies", noticeJSONArray);
@ -395,7 +400,7 @@ public class TaskCheckSaveRunnable implements Runnable {
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(noticeJSONObject, httpHeaders);
try {
ResponseEntity<String> responseEntity = restTemplate.postForEntity(noticeUrl + "/resource/message/noticewithtarget?access_token={access_token}", httpEntity, String.class, ClientTokenManager.getInstance().getClientToken().getAccessToken());
ResponseEntity<String> responseEntity = restTemplate.postForEntity(noticeUrl + "/resource/message/noticewithtarget/save?access_token={access_token}", httpEntity, String.class, ClientTokenManager.getInstance().getClientToken().getAccessToken());
String responseBody = responseEntity.getBody();
if (HttpStatus.OK.value() == responseEntity.getStatusCodeValue()) {
log.debug("推送成功");

View File

@ -13,4 +13,9 @@ import com.cm.common.base.AbstractService;
* @Version: 1.0
**/
public class BaseService extends AbstractService {
public static final String SYSTEM_NAME = "inspection";
public static final String MODULE_TASK_V2 = "task_v2";
public static final String MENU_TASK_V2 = "list_task_v2";
}

View File

@ -88,7 +88,7 @@ public class TaskCheckServiceImpl extends BaseService implements ITaskCheckServi
private DataSourceTransactionManager dataSourceTransactionManager;
@Autowired
private IUserService userService;
@Value("${notice-url}")
@Value("${api-path.notice-url}")
private String noticeUrl;
@Override

View File

@ -96,6 +96,7 @@ security:
api-path:
user-center: ${security.oauth2.oauth-server}
notice-url: http://192.168.0.103:7001/usercenter
# 访问控制
access-control:
@ -130,5 +131,3 @@ logging:
level:
root: error
com.cm: debug
notice-url: http://192.168.0.103:7001/usercenter