Jelajahi Sumber

架空导线数据阶段提交

user5 3 tahun lalu
induk
melakukan
bb419eb791

+ 3 - 0
src/main/java/com/jeeplus/modules/sg/raiseCapitalDesign/service/RaiseCapitalDesignService.java

@@ -362,6 +362,9 @@ public class RaiseCapitalDesignService extends CrudService<RaiseCapitalDesignMap
 		binaryJedisCommands.set((voltageData.getUuid()+"voltageDisposeData").getBytes(),voltageDisposeDataJson.getBytes());
 		binaryJedisCommands.set((voltageData.getUuid()+"highVoltage").getBytes(),highVoltageJson.getBytes());
 		binaryJedisCommands.set((voltageData.getUuid()+"lowVoltage").getBytes(),lowVoltageJson.getBytes());
+		binaryJedisCommands.expire((voltageData.getUuid()+"voltageDisposeData").getBytes(),86400);
+		binaryJedisCommands.expire((voltageData.getUuid()+"highVoltage").getBytes(),86400);
+		binaryJedisCommands.expire((voltageData.getUuid()+"lowVoltage").getBytes(),86400);
 
 	}
 }

+ 20 - 1
src/main/java/com/jeeplus/modules/sg/raiseCapitalDesign/web/RaiseCapitalDesignController.java

@@ -25,6 +25,7 @@ import com.jeeplus.modules.sg.raiseCapitalDesign.entity.DisposeData;
 import com.jeeplus.modules.sg.raiseCapitalDesign.entity.VoltageData;
 import com.jeeplus.modules.sg.raiseCapitalDesign.entity.VoltageInfo;
 import com.jeeplus.modules.sg.raiseCapitalDesign.service.RaiseCapitalDesignService;
+import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
 import net.oschina.j2cache.CacheChannel;
 import net.oschina.j2cache.J2Cache;
@@ -41,6 +42,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
+import redis.clients.jedis.BinaryJedisCommands;
 import redis.clients.jedis.Jedis;
 
 import javax.json.Json;
@@ -131,8 +133,20 @@ public class RaiseCapitalDesignController extends BaseController {
 	public String aerialConductorForm(String uuid,String item, Model model) {
 		//将新增页数据保存到redis中(item)
 		//raiseCapitalDesignService.disposeFormData(uuid,item);
+		//查询10KV计算系数
+		String highSingleVoltageCoefficient = DictUtils.getDictLabel("highSingleVoltageCoefficient", "designCalculateCoefficient", "");
+		String highDoubleVoltageCoefficient = DictUtils.getDictLabel("highDoubleVoltageCoefficient", "designCalculateCoefficient", "");
+		//查询0.4KV计算系数
+		String lowSingleVoltageCoefficient = DictUtils.getDictLabel("lowSingleVoltageCoefficient", "designCalculateCoefficient", "");
+		String lowDoubleVoltageCoefficient = DictUtils.getDictLabel("lowDoubleVoltageCoefficient", "designCalculateCoefficient", "");
+		//查询10KV数据
 		List<VoltageInfo> highVoltageList = raiseCapitalDesignService.getAerialConductor(uuid + "highVoltage","highVoltage");
+		//查询0.4KV数据
 		List<VoltageInfo> lowVoltageList = raiseCapitalDesignService.getAerialConductor(uuid + "lowVoltage","lowVoltage");
+		model.addAttribute("highSingleVoltageCoefficient", highSingleVoltageCoefficient);
+		model.addAttribute("highDoubleVoltageCoefficient", highDoubleVoltageCoefficient);
+		model.addAttribute("lowSingleVoltageCoefficient", lowSingleVoltageCoefficient);
+		model.addAttribute("lowDoubleVoltageCoefficient", lowDoubleVoltageCoefficient);
 		model.addAttribute("highVoltageList", highVoltageList);
 		model.addAttribute("lowVoltageList", lowVoltageList);
 		model.addAttribute("uuid", uuid);
@@ -276,7 +290,7 @@ public class RaiseCapitalDesignController extends BaseController {
 	 * */
 	@ResponseBody
 	@RequestMapping(value = "exportCache")
-	public AjaxJson exportCache(RaiseCapital raiseCapital,String item, HttpServletRequest request, HttpServletResponse response, Model model) {
+	public AjaxJson exportCache(RaiseCapital raiseCapital,String uuid,String item, HttpServletRequest request, HttpServletResponse response, Model model) {
 		AjaxJson j = new AjaxJson();
 		ArrayList<String> objects = new ArrayList<>();
 		ArrayList<String> findList = new ArrayList<>();
@@ -311,6 +325,11 @@ public class RaiseCapitalDesignController extends BaseController {
 			client.release();
 		}
 		j.setSuccess(true);
+		//导出成功后删除reids中的对应uuid的数据(没有模糊删除,只能一条条删除)
+		BinaryJedisCommands binaryJedisCommands = client.get();
+		binaryJedisCommands.del((uuid + "voltageDisposeData").getBytes());
+		binaryJedisCommands.del((uuid + "highVoltage").getBytes());
+		binaryJedisCommands.del((uuid + "lowVoltage").getBytes());
 		return j;
 	}
 

+ 44 - 10
src/main/webapp/webpage/modules/sg/raiseCapitalDesign/aerialConductorForm.jsp

@@ -74,15 +74,45 @@
 			var tr=$(obj).parent().parent();
 			var singleCircuitPath =document.getElementById(prefix+"_singleCircuitPath").value;//单回路路径
 			var doubleCircuitPath =document.getElementById(prefix+"_doubleCircuitPath").value;//双回路路径
-			//var coefficient = document.getElementById(prefix+"_coefficient").value;//系数
-			var singleCoefficient = 3.3;
-			var doubleCoefficient = 6.6;
-			if (singleCircuitPath=='' || singleCircuitPath==undefined){
+			var highSingleVoltageCoefficient = $("#highSingleVoltageCoefficient").val();//10KV单回路路径系数
+			var highDoubleVoltageCoefficient = $("#highDoubleVoltageCoefficient").val();//10KV双回路路径系数
+
+			if (singleCircuitPath==undefined || singleCircuitPath==null || singleCircuitPath==''){
 				singleCircuitPath=0;
-			}if (doubleCircuitPath=='' || doubleCircuitPath==undefined){
+			}
+			if (doubleCircuitPath==undefined || doubleCircuitPath==null || doubleCircuitPath==''){
 				doubleCircuitPath=0;
 			}
-			var total=parseFloat(singleCircuitPath)*parseFloat(singleCoefficient)+parseFloat(doubleCircuitPath)*parseFloat(doubleCoefficient);
+			if (highSingleVoltageCoefficient==undefined || highSingleVoltageCoefficient==null || highSingleVoltageCoefficient==''){
+				highSingleVoltageCoefficient=1;
+			}
+			if (highDoubleVoltageCoefficient==undefined || highDoubleVoltageCoefficient==null || highDoubleVoltageCoefficient==''){
+				highDoubleVoltageCoefficient=1;
+			}
+			var total=parseFloat(singleCircuitPath)*parseFloat(highSingleVoltageCoefficient)+parseFloat(doubleCircuitPath)*parseFloat(highDoubleVoltageCoefficient);
+			document.getElementById(prefix+"_singleLong").value=total.toFixed(2);
+		}
+
+		function lowVoltageCalculate(obj,prefix) {
+			var tr=$(obj).parent().parent();
+			var singleCircuitPath =document.getElementById(prefix+"_singleCircuitPath").value;//单回路路径
+			var doubleCircuitPath =document.getElementById(prefix+"_doubleCircuitPath").value;//双回路路径
+			var lowSingleVoltageCoefficient = $("#lowSingleVoltageCoefficient").val();//0.4KV单回路路径系数
+			var lowDoubleVoltageCoefficient = $("#lowDoubleVoltageCoefficient").val();//0.4KV双回路路径系数
+
+			if (singleCircuitPath==undefined || singleCircuitPath==null || singleCircuitPath==''){
+				singleCircuitPath=0;
+			}
+			if (doubleCircuitPath==undefined || doubleCircuitPath==null || doubleCircuitPath==''){
+				doubleCircuitPath=0;
+			}
+			if (lowSingleVoltageCoefficient==undefined || lowSingleVoltageCoefficient==null || lowSingleVoltageCoefficient==''){
+				lowSingleVoltageCoefficient=1;
+			}
+			if (lowDoubleVoltageCoefficient==undefined || lowDoubleVoltageCoefficient==null || lowDoubleVoltageCoefficient==''){
+				lowDoubleVoltageCoefficient=1;
+			}
+			var total=parseFloat(singleCircuitPath)*parseFloat(lowSingleVoltageCoefficient)+parseFloat(doubleCircuitPath)*parseFloat(lowDoubleVoltageCoefficient);
 			document.getElementById(prefix+"_singleLong").value=total.toFixed(2);
 		}
 	</script>
@@ -95,6 +125,10 @@
 </div>
 		<form:form id="inputForm" modelAttribute="voltageData" action="${ctx}/filing/basicInformation/save" method="post" class="form-horizontal">
 			<input type="hidden" id="uuid" name="uuid" value="${uuid}">
+			<input type="hidden" id="highSingleVoltageCoefficient" value="${highSingleVoltageCoefficient}">
+			<input type="hidden" id="highDoubleVoltageCoefficient" value="${highDoubleVoltageCoefficient}">
+			<input type="hidden" id="lowSingleVoltageCoefficient" value="${lowSingleVoltageCoefficient}">
+			<input type="hidden" id="lowDoubleVoltageCoefficient" value="${lowDoubleVoltageCoefficient}">
 			<div class="tabs-container">
 				<div class="tab-content">
 					<div id="tab-1" class="tab-pane fade in  active">
@@ -178,17 +212,17 @@
 					</td>
 
 					<td  class="max-width-250">
-					<input type='text' id="highVoltageList[{{idx}}]_voltageName" name="lowVoltageList[{{idx}}].voltageName"  readonly= "true" class="form-control"  value="{{row.voltageName}}"/>
+					<input type='text' id="lowVoltageList[{{idx}}]_voltageName" name="lowVoltageList[{{idx}}].voltageName"  readonly= "true" class="form-control"  value="{{row.voltageName}}"/>
 					</td>
 
 					<td  class="max-width-250">
-						<input type='text' id="highVoltageList[{{idx}}]_singleCircuitPath" name="lowVoltageList[{{idx}}].singleCircuitPath" placeholder="请输入数字"  onkeyup="this.value=this.value.replace(/^(\d*\.?\d{0,2}).*/,'$1')" maxlength="10" class="form-control number"  value="{{row.singleCircuitPath}}" onchange="lowVoltageCalculate(this,'lowVoltageList[{{idx}}]')"/>
+						<input type='text' id="lowVoltageList[{{idx}}]_singleCircuitPath" name="lowVoltageList[{{idx}}].singleCircuitPath" placeholder="请输入数字"  onkeyup="this.value=this.value.replace(/^(\d*\.?\d{0,2}).*/,'$1')" maxlength="10" class="form-control number"  value="{{row.singleCircuitPath}}" onchange="lowVoltageCalculate(this,'lowVoltageList[{{idx}}]')"/>
 					</td>
 					<td class="max-width-250">
-						<input type='text' id="highVoltageList[{{idx}}]_doubleCircuitPath" name="lowVoltageList[{{idx}}].doubleCircuitPath" placeholder="请输入数字"  onkeyup="this.value=this.value.replace(/^(\d*\.?\d{0,2}).*/,'$1')" maxlength="10" class="form-control number"  value="{{row.doubleCircuitPath}}" onchange="lowVoltageCalculate(this,'lowVoltageList[{{idx}}]')"/>
+						<input type='text' id="lowVoltageList[{{idx}}]_doubleCircuitPath" name="lowVoltageList[{{idx}}].doubleCircuitPath" placeholder="请输入数字"  onkeyup="this.value=this.value.replace(/^(\d*\.?\d{0,2}).*/,'$1')" maxlength="10" class="form-control number"  value="{{row.doubleCircuitPath}}" onchange="lowVoltageCalculate(this,'lowVoltageList[{{idx}}]')"/>
 					</td>
 					<td class="max-width-250">
-						<input type='text' id="highVoltageList[{{idx}}]_singleLong" name="lowVoltageList[{{idx}}].singleLong" readonly= "true" class="form-control number"  value="{{row.singleLong}}"/>
+						<input type='text' id="lowVoltageList[{{idx}}]_singleLong" name="lowVoltageList[{{idx}}].singleLong" readonly= "true" class="form-control number"  value="{{row.singleLong}}"/>
 					</td>
 				</tr>//-->
 						</script>

+ 3 - 1
src/main/webapp/webpage/modules/sg/raiseCapitalDesign/raiseCapitalDesign.js

@@ -343,6 +343,7 @@ $(document).ready(function() {
 			}
 		})
 		let projectNo = $("#projectNo").val();
+		let uuid = $("#pickUuid").val();
 		let approver = $("#approver").val();
 		let erpCode = $("#erpCode").val();
 		let reviewer = $("#reviewer").val();
@@ -367,7 +368,8 @@ $(document).ready(function() {
 				"preparedBy": preparedBy,
 				"manager": manager,
 				"reqUnit": reqUnit,
-				"preTime": preTime
+				"preTime": preTime,
+				"uuid": uuid
 			},
 			function (data) {
 				if(data.success){