Commit 3dd05197 authored by zhangsen's avatar zhangsen

Merge remote-tracking branch 'origin/develop_dl_plan6' into develop_dl_plan6_temp

parents 1945bcda 0b44e35e
......@@ -10,8 +10,12 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.biz.enums.DataDictionaryTypeEnum;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCodeEnum;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -74,7 +78,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
}
Map<String, Object> map = Bean.BeantoMap(dutyPersonDto);
buildDataMap(map, userId);
if (!instances.isEmpty()) {
// 0.定位instanceId,准备进行更新操作
instanceId = instances.get(0).getInstanceId(); // 已经有了走更新方法
......@@ -132,7 +136,27 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
}
private Map<String, Object> buildDataMap(Map<String, Object> d, String userId) {
// 表单存在人员类型,获取用户ID,查询人员类型赋值
if (!ObjectUtils.isEmpty(userId)) {
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "peopleType")
.eq(DynamicFormInstance::getInstanceId, userId)
.eq(DynamicFormInstance::getGroupCode, DynamicGroupCodeEnum.JCS_PERSON.getCode()));
if (!CollectionUtils.isEmpty(instances)) {
String fieldValue = instances.get(0).getFieldValue();
List<DataDictionary> dictionaryList = dataDictionaryService.getByType(DataDictionaryTypeEnum.PERSON_TYPE.getCode());
if (StringUtils.isNotBlank(fieldValue) && !CollectionUtils.isEmpty(dictionaryList)) {
Map<String, List<DataDictionary>> map = dictionaryList.stream().collect(Collectors.groupingBy(DataDictionary::getCode));
List<DataDictionary> list = map.get(fieldValue);
if (!CollectionUtils.isEmpty(list)) {
d.put("personType", list.get(0).getName());
}
}
}
}
return d;
}
@Override
public DutyPersonDto update(Long instanceId, DutyPersonDto dutyPersonDto) {
String groupCode = this.getGroupCode();
......@@ -144,6 +168,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//页面数据转Map
Map<String, Object> map = Bean.BeantoMap(dutyPersonDto);
buildDataMap(map, dutyPersonDto.getUserId());
//4.已列为主 填充动态表单数据
List<DynamicFormInstance> entrys = new ArrayList<>();
for (DynamicFormColumn column : columns) {
......
......@@ -885,7 +885,7 @@ public class TopographyController extends AbstractBaseController {
try {
entity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), beginDate, endDate, prefix, suffix, fieldKey);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("调用AMOS-API-IOT服务失败,请检查服务是否正常!");
}
if (200 == entity.getStatus() && !ObjectUtils.isEmpty(entity.getResult())) {
String json = JSON.toJSONString(entity.getResult());
......@@ -1046,7 +1046,7 @@ public class TopographyController extends AbstractBaseController {
try {
entity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), beginDate, endDate, prefix, suffix, st);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("调用AMOS-API-IOT服务失败,请检查服务是否正常!");
}
if (200 == entity.getStatus() && !ObjectUtils.isEmpty(entity.getResult())) {
String json = JSON.toJSONString(entity.getResult());
......
......@@ -1893,12 +1893,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
Date now = new Date();
String scrapTime = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN).format(calendar.getTime());
long time1 = calendar.getTimeInMillis();
calendar.setTime(now);
long time2 = calendar.getTimeInMillis();
long between_days=(time2-time1)/(10003600*24);
int day = Integer.parseInt(String.valueOf(between_days));
int day = DateUtils.dateBetween(now,calendar.getTime());
if(day < Integer.parseInt(equipmentScrapDay) && day > -1) {
syncSystemctlMsg(e, scrapTime, day);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment