|
@@ -18,15 +18,12 @@ import com.jeeplus.modules.sg.raiseCapital.entity.RaiseCapital;
|
|
|
import com.jeeplus.modules.sg.raiseCapital.mapper.RaiseCapitalMapper;
|
|
|
import com.jeeplus.modules.sg.raiseCapital.utils.RaiseExportUtil;
|
|
|
import com.jeeplus.modules.sg.raiseCapital.utils.RaiseTemplate;
|
|
|
-import com.jeeplus.modules.sg.raiseCapitalDesign.entity.DisposeData;
|
|
|
-import com.jeeplus.modules.sg.raiseCapitalDesign.entity.CableSectionData;
|
|
|
-import com.jeeplus.modules.sg.raiseCapitalDesign.entity.CableSectionInfo;
|
|
|
-import com.jeeplus.modules.sg.raiseCapitalDesign.entity.VoltageData;
|
|
|
-import com.jeeplus.modules.sg.raiseCapitalDesign.entity.VoltageInfo;
|
|
|
+import com.jeeplus.modules.sg.raiseCapitalDesign.entity.*;
|
|
|
import com.jeeplus.modules.sg.raiseCapitalDesign.mapper.RaiseCapitalDesignMapper;
|
|
|
import com.jeeplus.modules.sys.entity.DictValue;
|
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
import com.jeeplus.modules.test.one.dialog.mapper.Leave1Mapper;
|
|
|
+import io.swagger.models.auth.In;
|
|
|
import net.oschina.j2cache.CacheChannel;
|
|
|
import net.oschina.j2cache.J2Cache;
|
|
|
import net.oschina.j2cache.redis.RedisCacheProvider;
|
|
@@ -270,6 +267,26 @@ public class RaiseCapitalDesignService extends CrudService<RaiseCapitalDesignMap
|
|
|
}
|
|
|
return voltageDisposeDataList;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 遍历查询结构 大类 中类 小类
|
|
|
+ * 去除重复,记录大类
|
|
|
+ * 根据大类查询它的中类放入list并记录
|
|
|
+ */
|
|
|
+ public List<DisposeCableData> disposeFormCableDataList(String uuid) {
|
|
|
+ //创建通道,查询redis中数据
|
|
|
+ List<DisposeCableData> voltageDisposeDataList = Lists.newArrayList();
|
|
|
+ CacheChannel channel = J2Cache.getChannel();
|
|
|
+ RedisClient client = ((RedisCacheProvider)channel.getL2Provider()).getRedisClient();
|
|
|
+ BinaryJedisCommands binaryJedisCommands = client.get();
|
|
|
+ byte[] voltageDisposeBytes = binaryJedisCommands.get((uuid+"cableDisposeData").getBytes());
|
|
|
+ String voltageDisposeItem = null;
|
|
|
+ if(null != voltageDisposeBytes){
|
|
|
+ voltageDisposeItem = new String(voltageDisposeBytes);
|
|
|
+ if(StringUtils.isNotBlank(voltageDisposeItem))
|
|
|
+ voltageDisposeDataList = JSON.parseArray(voltageDisposeItem,DisposeCableData.class);
|
|
|
+ }
|
|
|
+ return voltageDisposeDataList;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 将页面数据保存到redis中
|
|
@@ -349,6 +366,25 @@ public class RaiseCapitalDesignService extends CrudService<RaiseCapitalDesignMap
|
|
|
return list;
|
|
|
}
|
|
|
/**
|
|
|
+ * 根据UUID查询再拆旧材料清册redis中的数据
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<InventoryInfo> getInventory(String uuidKey) {
|
|
|
+ List<InventoryInfo> list = Lists.newArrayList();
|
|
|
+ //创建通道,查询redis中数据
|
|
|
+ CacheChannel channel = J2Cache.getChannel();
|
|
|
+ RedisClient client = ((RedisCacheProvider)channel.getL2Provider()).getRedisClient();
|
|
|
+ BinaryJedisCommands binaryJedisCommands = client.get();
|
|
|
+ byte[] bytes = binaryJedisCommands.get(uuidKey.getBytes());
|
|
|
+ //判定是否存在这些数据的备份,有则进行处理并返回
|
|
|
+ if(null != bytes){
|
|
|
+ list = JSON.parseArray(new String(bytes),InventoryInfo.class);
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ /**
|
|
|
* 根据UUID查询电缆分段再redis中的数据
|
|
|
* @return
|
|
|
*/
|
|
@@ -411,7 +447,7 @@ public class RaiseCapitalDesignService extends CrudService<RaiseCapitalDesignMap
|
|
|
*/
|
|
|
@Transactional(readOnly = false)
|
|
|
public void saveCable(CableSectionData cableSectionData) {
|
|
|
- List<DisposeData> dataList = this.CableDataList(cableSectionData);
|
|
|
+ List<DisposeCableData> dataList = this.CableDataList(cableSectionData);
|
|
|
List<CableSectionInfo> cableFourHundredList=cableSectionData.getCableFourHundredList();
|
|
|
List<CableSectionInfo> cableHundredAndTwentyList=cableSectionData.getCableHundredAndTwentyList();
|
|
|
List<CableSectionInfo> cableThreeHundredList=cableSectionData.getCableThreeHundredList();
|
|
@@ -432,7 +468,7 @@ public class RaiseCapitalDesignService extends CrudService<RaiseCapitalDesignMap
|
|
|
binaryJedisCommands.set((cableSectionData.getUuid()+"cableThreeHundred").getBytes(),cableThreeHundredListJson.getBytes());
|
|
|
binaryJedisCommands.set((cableSectionData.getUuid()+"cableTwoHundredForty").getBytes(),cableTwoHundredFortyListJson.getBytes());
|
|
|
binaryJedisCommands.set((cableSectionData.getUuid()+"cableSeventy").getBytes(),cableSeventyListJson.getBytes());
|
|
|
- binaryJedisCommands.expire((cableSectionData.getUuid()+"voltageDisposeData").getBytes(),86400);
|
|
|
+ binaryJedisCommands.expire((cableSectionData.getUuid()+"cableDisposeData").getBytes(),86400);
|
|
|
binaryJedisCommands.expire((cableSectionData.getUuid()+"cableFourHundred").getBytes(),86400);
|
|
|
binaryJedisCommands.expire((cableSectionData.getUuid()+"cableHundredAndTwenty").getBytes(),86400);
|
|
|
binaryJedisCommands.expire((cableSectionData.getUuid()+"cableThreeHundred").getBytes(),86400);
|
|
@@ -446,33 +482,49 @@ public class RaiseCapitalDesignService extends CrudService<RaiseCapitalDesignMap
|
|
|
* @param cableSectionData
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<DisposeData> CableDataList(CableSectionData cableSectionData){
|
|
|
- List<DisposeData> dataList = Lists.newArrayList();
|
|
|
+ public List<DisposeCableData> CableDataList(CableSectionData cableSectionData){
|
|
|
+ List<DisposeCableData> dataList = Lists.newArrayList();
|
|
|
|
|
|
- DisposeData data = new DisposeData();
|
|
|
+ DisposeCableData data = new DisposeCableData();
|
|
|
data.setId(cableSectionData.getCableFourHundredId());
|
|
|
+ data.setKey("cableFourHundred");
|
|
|
data.setNumber(cableSectionData.getCableFourHundredListTotal());
|
|
|
dataList.add(data);
|
|
|
|
|
|
- DisposeData dataCableHundredAndTwenty = new DisposeData();
|
|
|
+ DisposeCableData dataCableHundredAndTwenty = new DisposeCableData();
|
|
|
dataCableHundredAndTwenty.setId(cableSectionData.getCableHundredAndTwentyId());
|
|
|
+ dataCableHundredAndTwenty.setKey("HundredAndTwenty");
|
|
|
dataCableHundredAndTwenty.setNumber(cableSectionData.getCableHundredAndTwentyListTotal());
|
|
|
dataList.add(dataCableHundredAndTwenty);
|
|
|
|
|
|
- DisposeData dataCableThreeHundred = new DisposeData();
|
|
|
+ DisposeCableData dataCableThreeHundred = new DisposeCableData();
|
|
|
dataCableThreeHundred.setId(cableSectionData.getCableThreeHundredId());
|
|
|
+ dataCableThreeHundred.setKey("cableThreeHundred");
|
|
|
dataCableThreeHundred.setNumber(cableSectionData.getCableThreeHundredListTotal());
|
|
|
dataList.add(dataCableThreeHundred);
|
|
|
|
|
|
- DisposeData dataCableTwoHundredForty = new DisposeData();
|
|
|
+ DisposeCableData dataCableTwoHundredForty = new DisposeCableData();
|
|
|
dataCableTwoHundredForty.setId(cableSectionData.getCableTwoHundredFortyId());
|
|
|
+ dataCableTwoHundredForty.setKey("cableTwoHundredForty");
|
|
|
dataCableTwoHundredForty.setNumber(cableSectionData.getCableTwoHundredFortyListTotal());
|
|
|
dataList.add(dataCableTwoHundredForty);
|
|
|
|
|
|
- DisposeData dataCableSeventy = new DisposeData();
|
|
|
+ DisposeCableData dataCableSeventy = new DisposeCableData();
|
|
|
dataCableSeventy.setId(cableSectionData.getCableSeventyId());
|
|
|
+ dataCableSeventy.setKey("cableSeventy");
|
|
|
dataCableSeventy.setNumber(cableSectionData.getCableSeventyListTotal());
|
|
|
dataList.add(dataCableSeventy);
|
|
|
return dataList;
|
|
|
}
|
|
|
+
|
|
|
+ public List<InventoryInfo> InventoryData(){
|
|
|
+ List<InventoryInfo> list = Lists.newArrayList();
|
|
|
+ InventoryInfo inventory1=new InventoryInfo();
|
|
|
+ inventory1.setNum("1");
|
|
|
+ inventory1.setName("10kV电力电缆");
|
|
|
+ inventory1.setNum("YJV22-8.7/15-3×400");
|
|
|
+ inventory1.setNum("1");
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|