|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; |
|
|
import com.thing.common.core.annotation.LogOperation; |
|
|
import com.thing.common.core.annotation.LogOperation; |
|
|
import com.thing.common.core.constants.Constant; |
|
|
import com.thing.common.core.constants.Constant; |
|
|
import com.thing.common.core.exception.SysException; |
|
|
import com.thing.common.core.exception.SysException; |
|
|
|
|
|
import com.thing.common.core.utils.ConvertUtils; |
|
|
import com.thing.common.core.utils.excel.ExcelUtils; |
|
|
import com.thing.common.core.utils.excel.ExcelUtils; |
|
|
import com.thing.common.core.validator.AssertUtils; |
|
|
import com.thing.common.core.validator.AssertUtils; |
|
|
import com.thing.common.core.validator.ValidatorUtils; |
|
|
import com.thing.common.core.validator.ValidatorUtils; |
|
|
@ -124,21 +125,23 @@ public class EqWxPlanController { |
|
|
List<EqWxInfoRes> resultList = new ArrayList<>(); |
|
|
List<EqWxInfoRes> resultList = new ArrayList<>(); |
|
|
if (CollectionUtil.isNotEmpty(pageData)) { |
|
|
if (CollectionUtil.isNotEmpty(pageData)) { |
|
|
for (EqWxPlanDTO data : pageData) { |
|
|
for (EqWxPlanDTO data : pageData) { |
|
|
EqWxInfoRes eqWxInfoRes = new EqWxInfoRes(); |
|
|
|
|
|
BeanUtils.copyProperties(data, eqWxInfoRes); |
|
|
|
|
|
|
|
|
EqWxInfoRes eqWxInfoRes = ConvertUtils.sourceToTarget(data, EqWxInfoRes.class); |
|
|
//调整 |
|
|
//调整 |
|
|
String userId = data.getWxUser(); |
|
|
String userId = data.getWxUser(); |
|
|
String[] split = userId.split(","); |
|
|
|
|
|
List<Long> longs = new ArrayList<>(); |
|
|
|
|
|
for (String s : split) { |
|
|
|
|
|
longs.add(new Long(s)); |
|
|
|
|
|
} List<String> planUserName = sysUserService.getUserNameLists(longs); |
|
|
|
|
|
String name=""; |
|
|
|
|
|
for (String s : planUserName) { |
|
|
|
|
|
name+=s+","; |
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(userId)){ |
|
|
|
|
|
String[] split = userId.split(","); |
|
|
|
|
|
List<Long> longs = new ArrayList<>(); |
|
|
|
|
|
for (String s : split) { |
|
|
|
|
|
longs.add(Long.parseLong(s)); |
|
|
|
|
|
} |
|
|
|
|
|
List<String> planUserName = sysUserService.getUserNameLists(longs); |
|
|
|
|
|
String name=""; |
|
|
|
|
|
for (String s : planUserName) { |
|
|
|
|
|
name+=s+","; |
|
|
|
|
|
} |
|
|
|
|
|
name = name.substring(0, name.length() - 1); |
|
|
|
|
|
eqWxInfoRes.setWxUseText(name); |
|
|
} |
|
|
} |
|
|
name = name.substring(0, name.length() - 1); |
|
|
|
|
|
eqWxInfoRes.setWxUseText(name); |
|
|
|
|
|
// 查询设备信息 |
|
|
// 查询设备信息 |
|
|
ThingDTO thingDTO = new ThingDTO(); |
|
|
ThingDTO thingDTO = new ThingDTO(); |
|
|
if (storeThingsMap.containsKey(data.getThingId())) { |
|
|
if (storeThingsMap.containsKey(data.getThingId())) { |
|
|
@ -153,7 +156,10 @@ public class EqWxPlanController { |
|
|
if (storeEqBxMap.containsKey(data.getEqBxId())) { |
|
|
if (storeEqBxMap.containsKey(data.getEqBxId())) { |
|
|
eqWxInfoRes.setBxInfo(storeEqBxMap.get(data.getEqBxId())); |
|
|
eqWxInfoRes.setBxInfo(storeEqBxMap.get(data.getEqBxId())); |
|
|
} else { |
|
|
} else { |
|
|
EqBxEntity eqBxEntity = eqBxService.getById(data.getEqBxId()); |
|
|
|
|
|
|
|
|
EqBxEntity eqBxEntity = null; |
|
|
|
|
|
if(!Objects.isNull(data.getEqBxId())){ |
|
|
|
|
|
eqBxEntity = eqBxService.getById(data.getEqBxId()); |
|
|
|
|
|
} |
|
|
if (!Objects.isNull(eqBxEntity)) { |
|
|
if (!Objects.isNull(eqBxEntity)) { |
|
|
BxInfoDTO bxInfoDTO = new BxInfoDTO(); |
|
|
BxInfoDTO bxInfoDTO = new BxInfoDTO(); |
|
|
BeanUtils.copyProperties(eqBxEntity, bxInfoDTO); |
|
|
BeanUtils.copyProperties(eqBxEntity, bxInfoDTO); |
|
|
@ -163,13 +169,10 @@ public class EqWxPlanController { |
|
|
storeEqBxMap.put(data.getEqBxId(), null); |
|
|
storeEqBxMap.put(data.getEqBxId(), null); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
resultList.add(eqWxInfoRes); |
|
|
resultList.add(eqWxInfoRes); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
PageData<EqWxInfoRes> page = new PageData<>(resultList, CollectionUtil.isEmpty(resultList) ? 0 : pageList.getTotal()); |
|
|
PageData<EqWxInfoRes> page = new PageData<>(resultList, CollectionUtil.isEmpty(resultList) ? 0 : pageList.getTotal()); |
|
|
|
|
|
|
|
|
return new Result<PageData<EqWxInfoRes>>().ok(page); |
|
|
return new Result<PageData<EqWxInfoRes>>().ok(page); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -195,7 +198,7 @@ public class EqWxPlanController { |
|
|
String[] split = userId.split(","); |
|
|
String[] split = userId.split(","); |
|
|
List<Long> longs = new ArrayList<>(); |
|
|
List<Long> longs = new ArrayList<>(); |
|
|
for (String s : split) { |
|
|
for (String s : split) { |
|
|
longs.add(new Long(s)); |
|
|
|
|
|
|
|
|
longs.add(Long.parseLong(s)); |
|
|
} List<String> planUserName = sysUserService.getUserNameLists(longs); |
|
|
} List<String> planUserName = sysUserService.getUserNameLists(longs); |
|
|
String name=""; |
|
|
String name=""; |
|
|
for (String s : planUserName) { |
|
|
for (String s : planUserName) { |
|
|
@ -355,7 +358,7 @@ public class EqWxPlanController { |
|
|
String[] split = userId.split(","); |
|
|
String[] split = userId.split(","); |
|
|
List<Long> longs = new ArrayList<>(); |
|
|
List<Long> longs = new ArrayList<>(); |
|
|
for (String s : split) { |
|
|
for (String s : split) { |
|
|
longs.add(new Long(s)); |
|
|
|
|
|
|
|
|
longs.add(Long.parseLong(s)); |
|
|
} List<String> planUserName = sysUserService.getUserNameLists(longs); |
|
|
} List<String> planUserName = sysUserService.getUserNameLists(longs); |
|
|
String name=""; |
|
|
String name=""; |
|
|
for (String s : planUserName) { |
|
|
for (String s : planUserName) { |
|
|
|