|
@@ -32,6 +32,7 @@ import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.google.common.collect.ImmutableList;
|
|
import com.google.common.collect.ImmutableList;
|
|
import com.google.common.collect.ImmutableMap;
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -251,13 +252,31 @@ public class IotInspectOrderServiceImpl implements IotInspectOrderService {
|
|
IotInspectOrderDO iotInspectOrderDO = new IotInspectOrderDO();
|
|
IotInspectOrderDO iotInspectOrderDO = new IotInspectOrderDO();
|
|
AdminUserRespDTO user = adminUserApi.getUser(k);
|
|
AdminUserRespDTO user = adminUserApi.getUser(k);
|
|
String deptName = "";
|
|
String deptName = "";
|
|
|
|
+ String chinese = "";
|
|
|
|
+ String english = "";
|
|
if (Objects.nonNull(user)&&Objects.nonNull(user.getDeptId())) {
|
|
if (Objects.nonNull(user)&&Objects.nonNull(user.getDeptId())) {
|
|
DeptRespDTO dept = deptApi.getDept(user.getDeptId());
|
|
DeptRespDTO dept = deptApi.getDept(user.getDeptId());
|
|
if (Objects.nonNull(dept)) {
|
|
if (Objects.nonNull(dept)) {
|
|
deptName = dept.getName();
|
|
deptName = dept.getName();
|
|
|
|
+ if (StringUtils.isNotBlank(deptName)) {
|
|
|
|
+ String[] split = deptName.split("~~");
|
|
|
|
+ chinese = split[0];
|
|
|
|
+ if (split.length > 1) {
|
|
|
|
+ english = split[1];
|
|
|
|
+ if (StringUtils.isBlank(english)) {
|
|
|
|
+ english = chinese;
|
|
|
|
+ } else {
|
|
|
|
+ english = english.replace("en**", "");
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ english = chinese;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- iotInspectOrderDO.setInspectOrderTitle(deptName+"/"+(Objects.nonNull(user)?user.getNickname():"")+"/"+ DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd")+"-巡检工单");
|
|
|
|
|
|
+ String chineseName = chinese+"/"+(Objects.nonNull(user)?user.getNickname():"")+"/"+ DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd")+"-巡检工单";
|
|
|
|
+ String englishName = english+"/"+(Objects.nonNull(user)?user.getNickname():"")+"/"+ DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd")+"-inspect order";
|
|
|
|
+ iotInspectOrderDO.setInspectOrderTitle(chineseName+"~~en**"+englishName);
|
|
iotInspectOrderDO.setInspectOrderCode("IN"+ DateUtil.format(new Date(),"yyyyMMddHHmmss")+UUID.randomUUID().toString().substring(0, 4));
|
|
iotInspectOrderDO.setInspectOrderCode("IN"+ DateUtil.format(new Date(),"yyyyMMddHHmmss")+UUID.randomUUID().toString().substring(0, 4));
|
|
iotInspectOrderDO.setCharge(k);
|
|
iotInspectOrderDO.setCharge(k);
|
|
iotInspectOrderDO.setStatus("todo");
|
|
iotInspectOrderDO.setStatus("todo");
|