|
@@ -14,11 +14,14 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import com.alibaba.druid.pool.DruidDataSource;
|
|
|
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import org.apache.catalina.core.ApplicationContext;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
|
|
import org.jeecg.modules.oa.entity.CdEnterpriseEnnouncement;
|
|
|
+import org.jeecg.modules.oa.entity.IncidentTicketMsg;
|
|
|
import org.jeecg.modules.oa.mapper.IncidentTicketMapper;
|
|
|
+import org.jeecg.modules.oa.service.IIncidentTicketMsgService;
|
|
|
import org.jeecgframework.core.util.ApplicationContextUtil;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
@@ -67,12 +70,12 @@ public class IncidentTicketController {
|
|
|
private IIncidentTicketService incidentTicketService;
|
|
|
@Autowired
|
|
|
private IIncidentTicketChildrenService incidentTicketChildrenService;
|
|
|
- @Autowired
|
|
|
- private IncidentTicketMapper incidentTicketMapper;
|
|
|
- @Autowired
|
|
|
- private ISysBaseAPI sysBaseAPI;
|
|
|
+ @Autowired
|
|
|
+ private ISysBaseAPI sysBaseAPI;
|
|
|
+ @Autowired
|
|
|
+ private IIncidentTicketMsgService incidentTicketMsgService;
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
+ public static void main(String[] args) {
|
|
|
|
|
|
// DruidDataSource dataSource = ApplicationContextHelper.getBean("dataSource");//获取数据源
|
|
|
// Connection connection = dataSource.getConnection();//获取连接
|
|
@@ -136,6 +139,15 @@ public class IncidentTicketController {
|
|
|
IPage<IncidentTicket> pageList = incidentTicketService.page(page, queryWrapper);
|
|
|
|
|
|
for (IncidentTicket o:pageList.getRecords()) {
|
|
|
+
|
|
|
+ LambdaQueryWrapper<IncidentTicketMsg> query = new LambdaQueryWrapper<IncidentTicketMsg>();
|
|
|
+ query.eq(IncidentTicketMsg::getPkIncidentTicket,o.getId());
|
|
|
+ List<IncidentTicketMsg> list2 = incidentTicketMsgService.list(query);
|
|
|
+ if(list2.size() > 0) {
|
|
|
+ String result = list2.stream().map(IncidentTicketMsg::getUserName).collect(Collectors.joining(","));
|
|
|
+ o.setNoticerUser(result);
|
|
|
+ }
|
|
|
+
|
|
|
//1未处理 2已通知 3通知已反馈 4已推送 5已完结
|
|
|
List<IncidentTicketChildren> list = incidentTicketChildrenService.selectByMainId(o.getId());
|
|
|
if(o.getState().equals("4") || o.getState().equals("5")){
|
|
@@ -144,9 +156,10 @@ public class IncidentTicketController {
|
|
|
o.setU8Invoices(result);
|
|
|
}
|
|
|
}
|
|
|
- String result2 = list.stream().map(IncidentTicketChildren::getZhanghaoId).collect(Collectors.joining(","));
|
|
|
+// String result2 = list.stream().map(IncidentTicketChildren::getZhanghaoId).collect(Collectors.joining(","));
|
|
|
+ String result2 = list.get(0).getZhanghaoId();
|
|
|
if(StringUtils.isNotBlank(result2) && !result2.equals("null")){
|
|
|
- o.setU8Invoices(result2);
|
|
|
+ o.setAcSetNo(result2);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(o.getResponsibilityPerson1())){
|
|
|
LoginUser login = sysBaseAPI.getUserByName(o.getResponsibilityPerson1());
|
|
@@ -355,13 +368,13 @@ public class IncidentTicketController {
|
|
|
// if(StringUtils.isBlank(moneyType)){
|
|
|
// return Result.error("币种为空无法同步");
|
|
|
// }
|
|
|
- String factory = incidentTicket.getFactory();//工厂
|
|
|
- if(StringUtils.isBlank(factory)){
|
|
|
- return Result.error("工厂为空无法同步");
|
|
|
- }
|
|
|
+// String factory = incidentTicket.getFactory();//工厂
|
|
|
+// if(StringUtils.isBlank(factory)){
|
|
|
+// return Result.error("工厂为空无法同步");
|
|
|
+// }
|
|
|
String responsibilityCompany = incidentTicket.getResponsibilityCompany();//责任单位
|
|
|
if(StringUtils.isBlank(responsibilityCompany)){
|
|
|
- return Result.error("工厂为空责任单位");
|
|
|
+ return Result.error("责任单位为空无法同步");
|
|
|
}
|
|
|
|
|
|
boolean res = true;
|