环保任务下派,添加待办提醒
This commit is contained in:
parent
b3e801d6a9
commit
4bbbf2ccaa
@ -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.enterpriseofgridoperator.EnterpriseOfGridOperatorDTO;
|
||||||
import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemDTO;
|
import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemDTO;
|
||||||
import com.cm.inspection.pojo.vos.taskcheck.v2.TaskCheckVO;
|
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.IEnterpriseService;
|
||||||
import com.cm.inspection.service.enterprise.checkitem.v2.ICheckItemService;
|
import com.cm.inspection.service.enterprise.checkitem.v2.ICheckItemService;
|
||||||
import com.cm.inspection.service.enterpriseofgridoperator.IEnterpriseOfGridOperatorService;
|
import com.cm.inspection.service.enterpriseofgridoperator.IEnterpriseOfGridOperatorService;
|
||||||
@ -129,7 +130,6 @@ public class TaskCheckSaveRunnable implements Runnable {
|
|||||||
countEnterpriseCheckItem++;
|
countEnterpriseCheckItem++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dataSourceTransactionManager.commit(transactionStatus);
|
|
||||||
publishMsg.append("\n下发任务企业数量:").append(taskCheckEnterprise.size());
|
publishMsg.append("\n下发任务企业数量:").append(taskCheckEnterprise.size());
|
||||||
publishMsg.append("\n无检查项企业数量:").append(countNoCheckItems);
|
publishMsg.append("\n无检查项企业数量:").append(countNoCheckItems);
|
||||||
publishMsg.append("\n行业检查项数量:" + countIndustryCheckItem);
|
publishMsg.append("\n行业检查项数量:" + countIndustryCheckItem);
|
||||||
@ -137,6 +137,7 @@ public class TaskCheckSaveRunnable implements Runnable {
|
|||||||
publishStatus = 1;
|
publishStatus = 1;
|
||||||
// 发送通知
|
// 发送通知
|
||||||
sendNotice(taskCheckEnterprise);
|
sendNotice(taskCheckEnterprise);
|
||||||
|
dataSourceTransactionManager.commit(transactionStatus);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
publishStatus = -1;
|
publishStatus = -1;
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
@ -381,6 +382,10 @@ public class TaskCheckSaveRunnable implements Runnable {
|
|||||||
notice.put("title", "任务通知");
|
notice.put("title", "任务通知");
|
||||||
notice.put("msg", "您有新的任务待处理,请点击查看");
|
notice.put("msg", "您有新的任务待处理,请点击查看");
|
||||||
notice.put("target", "GO_TASK");
|
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);
|
noticeJSONArray.add(notice);
|
||||||
noticeJSONObject.put("noticies", noticeJSONArray);
|
noticeJSONObject.put("noticies", noticeJSONArray);
|
||||||
|
|
||||||
@ -395,7 +400,7 @@ public class TaskCheckSaveRunnable implements Runnable {
|
|||||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(noticeJSONObject, httpHeaders);
|
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(noticeJSONObject, httpHeaders);
|
||||||
|
|
||||||
try {
|
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();
|
String responseBody = responseEntity.getBody();
|
||||||
if (HttpStatus.OK.value() == responseEntity.getStatusCodeValue()) {
|
if (HttpStatus.OK.value() == responseEntity.getStatusCodeValue()) {
|
||||||
log.debug("推送成功");
|
log.debug("推送成功");
|
||||||
|
@ -13,4 +13,9 @@ import com.cm.common.base.AbstractService;
|
|||||||
* @Version: 1.0
|
* @Version: 1.0
|
||||||
**/
|
**/
|
||||||
public class BaseService extends AbstractService {
|
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";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ public class TaskCheckServiceImpl extends BaseService implements ITaskCheckServi
|
|||||||
private DataSourceTransactionManager dataSourceTransactionManager;
|
private DataSourceTransactionManager dataSourceTransactionManager;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IUserService userService;
|
private IUserService userService;
|
||||||
@Value("${notice-url}")
|
@Value("${api-path.notice-url}")
|
||||||
private String noticeUrl;
|
private String noticeUrl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -96,6 +96,7 @@ security:
|
|||||||
|
|
||||||
api-path:
|
api-path:
|
||||||
user-center: ${security.oauth2.oauth-server}
|
user-center: ${security.oauth2.oauth-server}
|
||||||
|
notice-url: http://192.168.0.103:7001/usercenter
|
||||||
|
|
||||||
# 访问控制
|
# 访问控制
|
||||||
access-control:
|
access-control:
|
||||||
@ -129,6 +130,4 @@ access-control:
|
|||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
root: error
|
root: error
|
||||||
com.cm: debug
|
com.cm: debug
|
||||||
|
|
||||||
notice-url: http://192.168.0.103:7001/usercenter
|
|
Loading…
Reference in New Issue
Block a user