Compare commits

..

No commits in common. "392956408e1b998551f088df13cb81adba4de4cd" and "d0d78d54c61f78db83a28e15461f1be10a20b19e" have entirely different histories.

5 changed files with 12 additions and 30 deletions

View File

@ -538,6 +538,7 @@ public class TicketController extends ControllerBase {
@GetMapping("exportPdf")
@ApiMark(moduleName = "工单管理", apiName = "导出工单为pdf")
public void exportPdf(HttpServletResponse response, @Valid @RequestParam @NotNull(message = "工单编号不能为空") Integer id) {
Ticket ticket = ticketService.getById(id);
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
DeviceInfoVO device = deviceService.getByDeviceNo(ticket.getDeviceNo());

View File

@ -22,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -98,10 +99,10 @@ public class AdminCustomerService {
*/
public void syncFromCrm(SyncFromCrmDTO dateParam) {
// DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 循环从起始日期到结束日期每次增加一天
// List<TBaseCustomer> result = new ArrayList<>();
List<TBaseCustomer> result = new ArrayList<>();
// for (LocalDate date = stDate; !date.isAfter(edDate); date = date.plusDays(1)) {
@ -109,19 +110,12 @@ public class AdminCustomerService {
if (CollUtil.isEmpty(agentList)) {
return;
}
List<TBaseCustomer> result = new ArrayList<>();
// Set<String> crmComanyCodes = agentList.stream().map(u -> u.getId()).collect(Collectors.toSet());
// List<TBaseCustomer> crmCompanyList = baseCustomerService.lambdaQuery().in(TBaseCustomer::getAgencyCompanyCode, crmComanyCodes).list();
// Map<String, TBaseCustomer> crmCompanyMap = crmCompanyList.stream().collect(Collectors.toMap(TBaseCustomer::getAgencyCompanyCode, cm -> cm));
List<TBaseCustomer> customers = baseCustomerService.list();
Set<String> crmComanyCodes = agentList.stream().map(u -> u.getId()).collect(Collectors.toSet());
List<TBaseCustomer> crmCompanyList = baseCustomerService.lambdaQuery().in(TBaseCustomer::getAgencyCompanyCode, crmComanyCodes).list();
Map<String, TBaseCustomer> crmCompanyMap = crmCompanyList.stream().collect(Collectors.toMap(TBaseCustomer::getAgencyCompanyCode, cm -> cm));
agentList.forEach(u -> {
// TBaseCustomer ent = crmCompanyMap.get(u.getId());
TBaseCustomer ent = customers.stream()
.filter(c -> Objects.equals(c.getAgencyCompanyCode(), u.getId())
|| StrUtil.equals(convertName(c.getAgencyCompanyName()), convertName(u.getName())))
.findFirst()
.orElse(null);
TBaseCustomer ent = crmCompanyMap.get(u.getId());
if (Objects.nonNull(ent)) {
ent.setDataModifyTime(LocalDateTime.now());
@ -156,7 +150,5 @@ public class AdminCustomerService {
}
private String convertName(String name) {
return name.replaceAll("\\s+", "");
}
}

View File

@ -63,11 +63,8 @@
<td colspan="2" th:text="${ticket.useTime}+'小时'"></td>
</tr>
<tr>
<td class="desc1">主要负责人</td>
<td colspan="2"
th:text="${#strings.arraySplit(ticket.handleUserName, ',').length > 0 ? #strings.arraySplit(ticket.handleUserName, ',')[0] : ''}"></td>
<td class="desc1">处理人</td>
<td colspan="8" th:text="${ticket.handleUserName}"></td>
<td colspan="11" th:text="${ticket.handleUserName}"></td>
</tr>
<tr>
<td class="desc1">问题描述</td>

View File

@ -14,9 +14,4 @@ public class TTest {
System.out.println(t2);
System.out.println(ChronoUnit.DAYS.between(null, t1));
}
@Test
public void test2() {
System.out.println("" + " 打 撒sfc dffd发多少分多少 分多少分的d f ".replaceAll("\\s+", "") + "");
}
}
}

View File

@ -67,11 +67,8 @@
<td colspan="2" th:text="${base.v1}"></td>
</tr>
<tr>
<td class="desc1">主要负责人</td>
<td colspan="2"
th:text="${#strings.arraySplit(ticket.handleUserName, ',').length > 0 ? #strings.arraySplit(ticket.handleUserName, ',')[0] : ''}"></td>
<td class="desc1">处理人</td>
<td colspan="8" th:text="${ticket.handleUserName}"></td>
<td colspan="11" th:text="${ticket.handleUserName}"></td>
</tr>
<tr>
<td class="desc1">问题描述</td>