Commit b9282344a776039f8b40b88459259c3d9e9bfe28

Authored by 陈威
1 parent a55811c0
Exists in dev

1:update

zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/controller/McBasicMoneyController.java
... ... @@ -15,6 +15,7 @@ import com.chinagas.modules.schsf.domain.McBasicCmty;
15 15 import com.chinagas.modules.schsf.domain.McBasicMoney;
16 16 import com.chinagas.modules.schsf.domain.vo.McBasicMoneyVo;
17 17 import com.chinagas.modules.schsf.service.IMcBasicMoneyService;
  18 +import lombok.extern.slf4j.Slf4j;
18 19 import org.apache.commons.lang3.StringUtils;
19 20 import org.springframework.beans.factory.annotation.Autowired;
20 21 import org.springframework.web.bind.annotation.*;
... ... @@ -37,6 +38,7 @@ import java.util.stream.Collectors;
37 38 * @author cw
38 39 * @date 2024-05-23
39 40 */
  41 +@Slf4j
40 42 @RestController
41 43 @RequestMapping("/mcBasicMoney")
42 44 public class McBasicMoneyController extends BaseController {
... ... @@ -84,6 +86,7 @@ public class McBasicMoneyController extends BaseController {
84 86 .sheet(0) // 导入数据的sheet页编号,0代表第一个sheet页,如果不填,则会导入所有sheet页的数据
85 87 .headRowNumber(4) // 列表头行数,1代表列表头有1行,第二行开始为数据行
86 88 .doReadSync(); // 开始读Excel,返回一个List<T>集合,继续后续入库操作
  89 + log.info("导入基础数据-金额总条数:{}", list == null ? 0 : list.size());
87 90  
88 91 // // 检验重复数据
89 92 // Map<String, List<McBasicMoney>> collect = list.stream().collect(Collectors.groupingBy(o ->
... ... @@ -102,6 +105,7 @@ public class McBasicMoneyController extends BaseController {
102 105 // if (strings.size() < list.size()) {
103 106 // throw new RuntimeException("表格中存在重复的数据");
104 107 // }
  108 + long startTime = System.currentTimeMillis(); // 记录任务开始时间
105 109 // 插入数据库
106 110 if (CollectionUtils.isNotEmpty(list)) {
107 111 Runnable task = () -> {
... ... @@ -113,7 +117,16 @@ public class McBasicMoneyController extends BaseController {
113 117 Thread backgroundThread = new Thread(task, "后台插入任务线程");
114 118 backgroundThread.setDaemon(true); // 设置为守护线程,随主线程结束而结束
115 119 backgroundThread.start();
  120 + try {
  121 + backgroundThread.join(); // 等待线程执行完毕,确保能准确计算运行时长
  122 + } catch (InterruptedException e) {
  123 + Thread.currentThread().interrupt(); // 恢复中断状态
  124 + log.error("导入基础数据-户数,等待线程执行完毕时被中断", e);
  125 + }
116 126 }
  127 + long endTime = System.currentTimeMillis(); // 记录任务结束时间
  128 + long duration = endTime - startTime; // 计算任务运行时长
  129 + log.info("导入基础数据-金额,数据库插入任务运行时长:{}毫秒", duration);
117 130 } catch (Exception e) {
118 131 Throwable cause = e.getCause();
119 132 if (cause instanceof SQLIntegrityConstraintViolationException) {
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/controller/McVisitController.java
... ... @@ -16,6 +16,7 @@ import com.chinagas.modules.schsf.domain.vo.McVisitModificationVo;
16 16 import com.chinagas.modules.schsf.domain.vo.McVisitVo;
17 17 import com.chinagas.modules.schsf.enums.YesNoEnums;
18 18 import com.chinagas.modules.schsf.service.IMcVisitService;
  19 +import lombok.extern.slf4j.Slf4j;
19 20 import org.springframework.beans.factory.annotation.Autowired;
20 21 import org.springframework.validation.annotation.Validated;
21 22 import org.springframework.web.bind.annotation.*;
... ... @@ -29,6 +30,7 @@ import java.util.List;
29 30 * @author cw
30 31 * @date 2024-05-30
31 32 */
  33 +@Slf4j
32 34 @RestController
33 35 @RequestMapping("/mcVisit")
34 36 public class McVisitController extends BaseController {
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McIgnitionServiceImpl.java
... ... @@ -190,7 +190,7 @@ public class McIgnitionServiceImpl implements IMcIgnitionService {
190 190 mcIgnition_new.setCnfPersonId(userId);
191 191 mcIgnition_new.setCnfPersonAccount(userAccount);
192 192 mcIgnition_new.setCnfPersonName(userName);
193   - mcIgnition_new.setUserCode(StringUtils.isEmpty(mcIgnition_old.getUserCity())?mcIgnitionMaintenanceVo.getUserCode():mcIgnition_old.getUserCity());
  193 + mcIgnition_new.setUserCode(StringUtils.isEmpty(mcIgnition_old.getUserCode())?mcIgnitionMaintenanceVo.getUserCode():mcIgnition_old.getUserCode());
194 194 int i = mcIgnitionMapper.updateMcIgnition(mcIgnition_new);
195 195 //1:添加记录
196 196 iMcOperationLogService.insertMcOperationLog("mc_ignition", mcIgnitionMaintenanceVo.getId(), "schsf:mcIgnition:maintenance",
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McVisitServiceImpl.java
... ... @@ -24,6 +24,7 @@ import com.chinagas.modules.schsf.service.IMcIgnitionService;
24 24 import com.chinagas.modules.schsf.service.IMcOperationLogService;
25 25 import com.chinagas.modules.schsf.service.IMcVisitService;
26 26 import com.chinagas.modules.schsf.stateMachine.StateMachineNext;
  27 +import lombok.extern.slf4j.Slf4j;
27 28 import org.jetbrains.annotations.NotNull;
28 29 import org.slf4j.Logger;
29 30 import org.slf4j.LoggerFactory;
... ... @@ -46,6 +47,7 @@ import java.util.concurrent.atomic.AtomicInteger;
46 47 * @date 2024-05-30
47 48 */
48 49  
  50 +@Slf4j
49 51 @Service
50 52 public class McVisitServiceImpl implements IMcVisitService {
51 53 private static final Logger log = LoggerFactory.getLogger(McVisitServiceImpl.class);
... ... @@ -139,6 +141,7 @@ public class McVisitServiceImpl implements IMcVisitService {
139 141 @Transactional
140 142 @Override
141 143 public int insertMcVisit(McVisit mcVisit) {
  144 + log.info("拜访工单-新增拜访工单,参数对象:{}", mcVisit);
142 145 List<McBasicCmty> mcBasicCmties = iMcBasicCmtyService.selectVisitDeptList(mcVisit);
143 146 if (mcBasicCmties==null || mcBasicCmties.size()==0){
144 147 throw new ServiceException("选择的组织不存在!");
... ... @@ -158,12 +161,16 @@ public class McVisitServiceImpl implements IMcVisitService {
158 161 mcVisit.setUpdateBy(userId);
159 162 //获取工单号
160 163 mcVisit.setTicketNumber(getTicketNumber());
  164 +
  165 + log.info("拜访工单-新增拜访工单,获取工单号:{}", mcVisit.getTicketNumber());
161 166 //工单类型
162 167 mcVisit.setTicketType(getTicketType(mcVisit.getIsCharged(), mcVisit.getIsVisited()));
  168 + log.info("拜访工单-新增拜访工单,工单类型:{}", mcVisit.getTicketType());
163 169 //状态获取
164 170 getStatusNodeInfo(mcVisit, VisitlsEventEnums.PUBLISH);
165 171 //收费验证
166 172 isChargedValidate(mcVisit);
  173 + log.info("拜访工单-新增拜访工单,添加工单实体:{}", mcVisit);
167 174 int i = mcVisitMapper.insertMcVisit(mcVisit);
168 175 if (i > 0) {
169 176 if (StringUtils.isNotEmpty(mcVisit.getFieldPhotoFile())) {
... ...