tntdc 1 year ago
parent
commit
a3e193fdf6

+ 13 - 0
adm/src/main/java/com/minpay/db/table/model/ObsQuestion.java

@@ -110,6 +110,11 @@ public class ObsQuestion extends AbstractMINBean implements Serializable {
      * 修改时间
      */
     private String oqUpdateTime;
+    
+    /**
+     * 图片
+     */
+    private String picture;
 
     public String getOqId() {
         return oqId;
@@ -256,5 +261,13 @@ public class ObsQuestion extends AbstractMINBean implements Serializable {
 	public void setOqRecord(String oqRecord) {
 		this.oqRecord = oqRecord;
 	}
+
+	public String getPicture() {
+		return picture;
+	}
+
+	public void setPicture(String picture) {
+		this.picture = picture;
+	}
 	
 }

+ 26 - 6
adm/src/main/java/com/minpay/guomao/obsmanage/action/ObsQuestionManage.java

@@ -1,7 +1,9 @@
 package com.minpay.guomao.obsmanage.action;
 
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
+import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
@@ -54,7 +56,8 @@ public class ObsQuestionManage implements IMINAction{
 			@MINParam(key = "degree") String degree,
 			@MINParam(key = "module") String module,
 			@MINParam(key = "expectTime") String expectTime,
-			@MINParam(key = "step") String step
+			@MINParam(key = "step") String step,
+			@MINParam(key = "pictureUrl") String pictureUrl
 			) throws IOException{
 		step = Base64.decode(step);
 		step = URLDecoder.decode(step, "UTF-8");
@@ -80,6 +83,7 @@ public class ObsQuestionManage implements IMINAction{
 		obsQuestion.setOqCreateUser(u.getId());
 		String record = u.getName() + "在" + dateString + "提出";
 		obsQuestion.setOqRecord(record);
+		obsQuestion.setPicture(pictureUrl);
 		iObsQuestionService.save(obsQuestion);
 		return res;
 	}
@@ -114,10 +118,11 @@ public class ObsQuestionManage implements IMINAction{
 	@MINAction(value = QUESTION_QUERY)
 	public MINActionResult questionQuery(
 			@MINParam(key = "oqId") String oqId
-			){
+			) throws UnsupportedEncodingException{
 		IObsQuestionService iObsQuestionService = applicationContext.getBean(IObsQuestionService.class);
 		ObsQuestion obsQuestion = iObsQuestionService.getById(oqId);
 		MINActionResult res = new MINActionResult();
+		obsQuestion.setOqStep(Base64.encode(URLEncoder.encode(obsQuestion.getOqStep(), "UTF-8")));
 		res.set(IMINBusinessConstant.F_PAGING_LAY, obsQuestion);
 		return res;
 	}
@@ -128,21 +133,36 @@ public class ObsQuestionManage implements IMINAction{
 			@MINParam(key = "id") String id,
 			@MINParam(key = "name") String name,
 			@MINParam(key = "degree") String degree,
-			@MINParam(key = "step") String step
-			){
+			@MINParam(key = "module") String module,
+			@MINParam(key = "expectTime") String expectTime,
+			@MINParam(key = "step") String step,
+			@MINParam(key = "pictureUrl") String pictureUrl
+			) throws UnsupportedEncodingException{
+		step = Base64.decode(step);
+		step = URLDecoder.decode(step, "UTF-8");
+		
 		Date date = new Date();
 		SimpleDateFormat sd = new SimpleDateFormat("yyyyMMddhhmmss");
 		String dateString = sd.format(date);
 		User u = session.getUser();
 		
+		IObsQuestionService iObsQuestionService1 = applicationContext.getBean(IObsQuestionService.class);
+		// 原记录
+		String record = iObsQuestionService1.getById(id).getOqRecord();
+		
 		IObsQuestionService iObsQuestionService = applicationContext.getBean(IObsQuestionService.class);
 		ObsQuestion obsQuestion = new ObsQuestion();
 		obsQuestion.setOqId(id);
 		obsQuestion.setOqName(name);
 		obsQuestion.setOqDegree(degree);
 		obsQuestion.setOqStep(step);
+		obsQuestion.setOqModule(module);
+		obsQuestion.setOqExpectTime(expectTime.replaceAll("-", ""));
 		obsQuestion.setOqUpdateUser(u.getId());
 		obsQuestion.setOqUpdateTime(dateString);
+		record = record + "\n" + u.getName() + "在" + dateString + "编辑";
+		obsQuestion.setOqRecord(record);
+		obsQuestion.setPicture(pictureUrl);
 		iObsQuestionService.updateById(obsQuestion);
 		
 		MINActionResult res = new MINActionResult();
@@ -212,7 +232,7 @@ public class ObsQuestionManage implements IMINAction{
 	@MINAction(value = QUESTION_PRINT_QUERY)
 	public MINActionResult questionPrintQuery(
 			@MINParam(key = "oqId") String oqId
-			) throws MINBusinessException{
+			) throws MINBusinessException, UnsupportedEncodingException{
 		IObsQuestionService iObsQuestionService = applicationContext.getBean(IObsQuestionService.class);
 		ObsQuestion obsQuestion = iObsQuestionService.getById(oqId);
 		
@@ -231,7 +251,7 @@ public class ObsQuestionManage implements IMINAction{
 				  .getMenuListByRoleId(param);
 		data.put("mukuai", list.get(0).get("menuName"));
 		
-		data.put("shixiangmiaoshu", obsQuestion.getOqStep());
+		data.put("shixiangmiaoshu", Base64.encode(URLEncoder.encode(obsQuestion.getOqStep(), "UTF-8")));
 		data.put("yaoqiuwanchengqixian", obsQuestion.getOqExpectTime());
 		
 		if(obsQuestion.getOqEngineer() != null && !"".equals(obsQuestion.getOqEngineer())) {

+ 161 - 79
adm/src/main/java/com/minpay/guomao/stockManage/StockManageAction.java

@@ -984,9 +984,17 @@ public class StockManageAction implements IMINAction {
 		int num = 0;
 		
 		List<String> stockIdList = new ArrayList<String>();
+		
+		List<String> checkedWareName = new ArrayList<String>();
 		// 校验仓库的放在前面,避免部分数据提交后明细总重量不更新
 		for (int i = 0; i < goodsArray.size(); i++) {
 			Map<String, String> map = (Map<String, String>)goodsArray.get(i);
+			// 校验过的不再校验
+			if(checkedWareName.contains(map.get("warehouseName").trim())) {
+				continue;
+			}
+			checkedWareName.add(map.get("warehouseName").trim());
+			
 			OwnApWarehouseInfExample wareEx = new OwnApWarehouseInfExample(user.getBranchId());
 			wareEx.createCriteria().andNameEqualTo(map.get("warehouseName").trim()).andStateEqualTo("00");
 			wareEx.branchIdQuery();
@@ -1009,27 +1017,53 @@ public class StockManageAction implements IMINAction {
 				}
 			}
 		}
+		
+		// 检查过的订单信息
+		Map<String, ApOrderInf> orderInfMap = new HashMap<String, ApOrderInf>();
+		// 查询过的合同信息
+		Map<String, ApContractInf> contractInfMap = new HashMap<>();
+		// 查询过的合同信息
+		Map<String, ApContractDetail> contractInfDetailMap = new HashMap<>();
+		// 查询过的品牌
+		Map<String, ApBrandInf> brandInfMap = new HashMap<>();
+		// 查询过的产品
+		Map<String, ApProductInf> productInfMap = new HashMap<>();
+		// 查询过的规格信息
+		Map<String, ApProductSpecRel> productSpecRelMap = new HashMap<>();
+		// 查询过的仓库信息
+		Map<String, ApWarehouseInf> warehouseInfMap = new HashMap<>();
+		// 查询过的仓储合同信息
+		Map<String, ApWarehouseContract> warehouseContractMap = new HashMap<>();
+		
 		for (int i = 0; i < goodsArray.size(); i++) {
 			Map<String, String> map = (Map<String, String>)goodsArray.get(i);
-			if(modelType.equals("01")) {
-				//校验订单是否存在
-				ApOrderInfExample example = new ApOrderInfExample();
-				example.createCriteria().andNameEqualTo(map.get("orderId").trim()).andStateNotEqualTo("04");
-				List<ApOrderInf> orderInf = Service.lookup(IMINDataBaseService.class)
-													.getMybatisMapper(ApOrderInfMapper.class)
-													.selectByExample(example);
-				if(orderInf.size() <=0){
-					throw new MINBusinessException("第"+(i+1)+"条数据订单信息不存在,请检查订单编号");
+			
+			// 从查询过的数据中取数
+			ApOrderInf orderInf = orderInfMap.get(map.get("orderId").trim());
+			// 只校验未查询的订单
+			if(orderInf == null) {
+				if(modelType.equals("01")) {
+					//校验订单是否存在
+					ApOrderInfExample example = new ApOrderInfExample();
+					example.createCriteria().andNameEqualTo(map.get("orderId").trim()).andStateNotEqualTo("04");
+					List<ApOrderInf> orderInfList = Service.lookup(IMINDataBaseService.class)
+														.getMybatisMapper(ApOrderInfMapper.class)
+														.selectByExample(example);
+					if(orderInfList.size() <=0){
+						throw new MINBusinessException("第"+(i+1)+"条数据订单信息不存在,请检查订单编号");
+					}
+					orderInf = orderInfList.get(0);
+					orderInfMap.put(map.get("orderId").trim(), orderInfList.get(0));
 				}
-				contractId = orderInf.get(0).getContractId();
-				orderID = orderInf.get(0).getId();
 			}
+			contractId = orderInf.getContractId();
+			orderID = orderInf.getId();
 			
 			//判断是否重复导入
 			ApWarehouseDetailExample deWxample = new ApWarehouseDetailExample();
 			deWxample.createCriteria().andTypeNotEqualTo("99").andOrderIdEqualTo(orderID)
 									.andBoxNoEqualTo(map.get("boxNo").trim()).andWeightEqualTo(map.get("weight").trim());
-			List<ApWarehouseDetail> deList = 	Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApWarehouseDetailMapper.class)
+			List<ApWarehouseDetail> deList = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ApWarehouseDetailMapper.class)
 												.selectByExample(deWxample);
 			
 			if(deList.size() > 0){
@@ -1037,81 +1071,131 @@ public class StockManageAction implements IMINAction {
 				continue;
 			}
 			
-			ApContractInf conTract = Service.lookup(IMINDataBaseService.class)
-					.getMybatisMapper(ApContractInfMapper.class)
-					.selectByPrimaryKey(contractId);
+			// 从map中取数据,减少查询次数
+			ApContractInf conTract = contractInfMap.get(contractId);
+			if(conTract == null) {
+				conTract = Service.lookup(IMINDataBaseService.class)
+						.getMybatisMapper(ApContractInfMapper.class)
+						.selectByPrimaryKey(contractId);
+				if(conTract != null) {
+					contractInfMap.put(contractId, conTract);
+				}
+			}
+			
 			if(conTract!= null) {
 				conType = conTract.getContractType();
 			}
-			ApContractDetailExample example1 = new ApContractDetailExample();
-			example1.createCriteria().andContractIdEqualTo(contractId).andStateEqualTo("00");
-			List<ApContractDetail> detail = Service.lookup(IMINDataBaseService.class)
-												.getMybatisMapper(ApContractDetailMapper.class)
-												.selectByExample(example1);
-			if(detail.size()>0) {
-				price = detail.get(0).getPrice();
+			
+			ApContractDetail contractDetail = contractInfDetailMap.get(contractId);
+			if(contractDetail == null) {
+				ApContractDetailExample example1 = new ApContractDetailExample();
+				example1.createCriteria().andContractIdEqualTo(contractId).andStateEqualTo("00");
+				List<ApContractDetail> detail = Service.lookup(IMINDataBaseService.class)
+													.getMybatisMapper(ApContractDetailMapper.class)
+													.selectByExample(example1);
+				if(detail.size()>0) {
+					price = detail.get(0).getPrice();
+					contractInfDetailMap.put(contractId, detail.get(0));
+				}
+			} else {
+				price = contractDetail.getPrice();
 			}
+			
+			// 获取品牌id
+			String brandId;
 			// 判断品牌是否存在
-			ApBrandInfExample brandInfExample = new ApBrandInfExample();
-			brandInfExample.createCriteria().andNameEqualTo(map.get("brand").trim())
-											.andStateEqualTo("0");
-			List<ApBrandInf> list = Service.lookup(IMINDataBaseService.class)
-											.getMybatisMapper(ApBrandInfMapper.class)
-											.selectByExample(brandInfExample);
-			if (list.size() == 0) {
-				throw new MINBusinessException("第"+(i+1)+"条数据品牌不存在,请检查品牌名称");
+			ApBrandInf brandInf = brandInfMap.get(map.get("brand").trim());
+			if(brandInf == null) {
+				ApBrandInfExample brandInfExample = new ApBrandInfExample();
+				brandInfExample.createCriteria().andNameEqualTo(map.get("brand").trim())
+												.andStateEqualTo("0");
+				List<ApBrandInf> list = Service.lookup(IMINDataBaseService.class)
+												.getMybatisMapper(ApBrandInfMapper.class)
+												.selectByExample(brandInfExample);
+				if (list.size() == 0) {
+					throw new MINBusinessException("第"+(i+1)+"条数据品牌不存在,请检查品牌名称");
+				}
+				brandInfMap.put(map.get("brand").trim(), list.get(0));
+				brandId = list.get(0).getId();
+			} else {
+				brandId = brandInf.getId();
 			}
-			// 获取品牌id
-			String brandId = list.get(0).getId();
 			
+			//获取产品id
+			String productId;
 			//判断产品是否存在
-			ApProductInfExample productInfExample = new ApProductInfExample();
-			productInfExample.createCriteria().andNameEqualTo(map.get("productName").trim())
-//												.andBrandIdEqualTo(brandId)
-												.andStateEqualTo("00");
-			List<ApProductInf> list2 = Service.lookup(IMINDataBaseService.class)
-												.getMybatisMapper(ApProductInfMapper.class)
-												.selectByExample(productInfExample);
-			if(list2.size() == 0){
-				throw new MINBusinessException("第"+(i+1)+"条数据产品不存在,请检查产品名称");
+			ApProductInf productInf = productInfMap.get(map.get("productName").trim());
+			if(productInf == null) {
+				ApProductInfExample productInfExample = new ApProductInfExample();
+				productInfExample.createCriteria().andNameEqualTo(map.get("productName").trim())
+													.andStateEqualTo("00");
+				List<ApProductInf> list2 = Service.lookup(IMINDataBaseService.class)
+													.getMybatisMapper(ApProductInfMapper.class)
+													.selectByExample(productInfExample);
+				if(list2.size() == 0){
+					throw new MINBusinessException("第"+(i+1)+"条数据产品不存在,请检查产品名称");
+				}
+				productInfMap.put(map.get("productName").trim(), list2.get(0));
+				productId = list2.get(0).getId();
+			} else {
+				productId = productInf.getId();
 			}
-			//获取地址id
-			String productId = list2.get(0).getId();
 			
+			// 获取规格编号
+			String specNo;
 			//判断是商品规格是否正确
-			ApProductSpecRelExample relExample = new ApProductSpecRelExample();
-			relExample.createCriteria().andProductIdEqualTo(productId)
-										.andValueEqualTo(map.get("standard").trim())
-										.andStateEqualTo("0");
-			List<ApProductSpecRel> list3 = Service.lookup(IMINDataBaseService.class)
-													.getMybatisMapper(ApProductSpecRelMapper.class)
-													.selectByExample(relExample);
-			if(list3.size() == 0){
-				throw new MINBusinessException("第"+(i+1)+"条数据规格不存在,请检查规格值");
+			ApProductSpecRel productSpecRel = productSpecRelMap.get(productId + "_" + map.get("standard").trim());
+			if(productSpecRel == null) {
+				ApProductSpecRelExample relExample = new ApProductSpecRelExample();
+				relExample.createCriteria().andProductIdEqualTo(productId)
+											.andValueEqualTo(map.get("standard").trim())
+											.andStateEqualTo("0");
+				List<ApProductSpecRel> list3 = Service.lookup(IMINDataBaseService.class)
+														.getMybatisMapper(ApProductSpecRelMapper.class)
+														.selectByExample(relExample);
+				if(list3.size() == 0){
+					throw new MINBusinessException("第"+(i+1)+"条数据规格不存在,请检查规格值");
+				}
+				productSpecRelMap.put(productId + "_" + map.get("standard").trim(), list3.get(0));
+				specNo = list3.get(0).getSpecNo();
+			} else {
+				specNo = productSpecRel.getSpecNo();
 			}
 			
-			//校验仓库是否存在
-			OwnApWarehouseInfExample wareEx = new OwnApWarehouseInfExample(user.getBranchId());
-			wareEx.createCriteria().andNameEqualTo(map.get("warehouseName").trim()).andStateEqualTo("00");
-			wareEx.branchIdQuery();
-			List<ApWarehouseInf> warehouseList = Service.lookup(IMINDataBaseService.class)
-					.getMybatisMapper(ApWarehouseInfMapper.class)
-					.selectByExample(wareEx);
-			//获取仓库id
-			String warehouseId = warehouseList.get(0).getId();
+			//获取仓库id, 可优化,前面已经查询过一次仓库信息 TODO
+			String warehouseId;
+			ApWarehouseInf warehouseInf = warehouseInfMap.get(map.get("warehouseName").trim());
+			if(warehouseInf == null) {
+				//校验仓库是否存在
+				OwnApWarehouseInfExample wareEx = new OwnApWarehouseInfExample(user.getBranchId());
+				wareEx.createCriteria().andNameEqualTo(map.get("warehouseName").trim()).andStateEqualTo("00");
+				wareEx.branchIdQuery();
+				List<ApWarehouseInf> warehouseList = Service.lookup(IMINDataBaseService.class)
+						.getMybatisMapper(ApWarehouseInfMapper.class)
+						.selectByExample(wareEx);
+				warehouseInfMap.put(map.get("warehouseName").trim(), warehouseList.get(0));
+				warehouseId = warehouseList.get(0).getId();
+			} else {
+				warehouseId = warehouseInf.getId();
+			}
 			
-		    ApWarehouseContractExample awcEx = new ApWarehouseContractExample();
-			awcEx.createCriteria().andWarehouseIdEqualTo(warehouseId)
-									.andCompanyIdEqualTo(companyId)
-									.andStateEqualTo("00")
-									.andStartDateLessThanOrEqualTo(nowDate)
-									.andEndDateGreaterThanOrEqualTo(nowDate)
-									.andBranchIdEqualTo(user.getBranchId());
-			List<ApWarehouseContract> awcList = Service.lookup(IMINDataBaseService.class)
-								.getMybatisMapper(ApWarehouseContractMapper.class)
-								.selectByExample(awcEx);
-			if(awcList.size() == 0){
-				throw new MINBusinessException("第"+(i+1)+"条合同信息有误,请检查仓库合同是否存在!");
+			// 校验仓储合同信息
+			ApWarehouseContract warehouseContract = warehouseContractMap.get(warehouseId);
+			if(warehouseContract == null) {
+				ApWarehouseContractExample awcEx = new ApWarehouseContractExample();
+				awcEx.createCriteria().andWarehouseIdEqualTo(warehouseId)
+										.andCompanyIdEqualTo(companyId)
+										.andStateEqualTo("00")
+										.andStartDateLessThanOrEqualTo(nowDate)
+										.andEndDateGreaterThanOrEqualTo(nowDate)
+										.andBranchIdEqualTo(user.getBranchId());
+				List<ApWarehouseContract> awcList = Service.lookup(IMINDataBaseService.class)
+									.getMybatisMapper(ApWarehouseContractMapper.class)
+									.selectByExample(awcEx);
+				if(awcList.size() == 0){
+					throw new MINBusinessException("第"+(i+1)+"条合同信息有误,请检查仓库合同是否存在!");
+				}
+				warehouseContractMap.put(warehouseId, awcList.get(0));
 			}
 			
 			//获取库存ID
@@ -1120,16 +1204,14 @@ public class StockManageAction implements IMINAction {
 			record.setId(id);											//物流ID
 			
 			// 00:单条记录 01:多条记录
-			if(modelType.equals("00")) {
-				record.setOrderId(orderID);									//订单id
-			}else if(modelType.equals("01")) {
+			if(modelType.equals("00") || modelType.equals("01")) {
 				record.setOrderId(orderID);									//订单id
 			}
 			// 参与导入的orderId
 			orderIdMap.put(record.getOrderId(), record.getOrderId());
 			
 			record.setWarehouseId(warehouseId);							//仓库id
-			record.setStandardId(list3.get(0).getSpecNo());				//商品规格id
+			record.setStandardId(specNo);				//商品规格id
 			if(conType.equals("01")) {
 				record.setUnitPrice(price);						//单价
 			}else {
@@ -1137,8 +1219,8 @@ public class StockManageAction implements IMINAction {
 			}
 			// 获取当前订单商品的库存表编号
 			Map<String,Object> stockmap = new HashMap<String,Object>();
-			stockmap.put("warehouseId",warehouseList.get(0).getId()); 	//仓库名称
-			stockmap.put("spId",list3.get(0).getSpecNo());   			//产品名称
+			stockmap.put("warehouseId", warehouseId); 	//仓库名称
+			stockmap.put("spId", specNo);   			//产品名称
 			stockmap.put("orderId",orderID);     						//订单号
 			stockmap.put("stockType","00");    							//入库:00 出库:01 冲正入库:02 冲正出库:03
 			stockmap.put("abfId", brandId);

+ 1 - 1
adm/src/main/resources/com/minpay/db/table/own/mapper/GiveoutManageMapper.xml

@@ -145,7 +145,7 @@
 				#{item}
 			</foreach>
 	    </if>
-		ORDER BY AGO_FH_DATE DESC ,ago.AGO_CREATE_TIME DESC, ago.AGO_CONTRACT_ID 
+		ORDER BY AGO_FH_DATE DESC ,ago.AGO_CREATE_TIME DESC, ago.AGO_CONTRACT_ID, ago.AGO_ID desc
 	</select>
 	
 	<select id="freightPrinting" resultType="hashmap" parameterType="java.util.Map">

+ 6 - 6
adm/src/main/webapp/WEB-INF/config.properties

@@ -3,16 +3,16 @@
 #dataSource.driverClassName=com.mysql.jdbc.Driver
 
 #ceshi
-#dataSource.url=jdbc:mysql://106.12.253.71:3306/guomaotest?useUnicode=true&characterEncoding=UTF8&autoReconnect=true
-#dataSource.username=root
-#dataSource.password=Keao@2022
+dataSource.url=jdbc:mysql://127.0.0.1:3306/guomao?useUnicode=true&characterEncoding=UTF8&autoReconnect=true
+dataSource.username=root
+dataSource.password=12345
 #shengchan
 #dataSource.url=jdbc:mysql://rm-bp1fic3mnw98q3149to.mysql.rds.aliyuncs.com:3306/guomaodb?useUnicode=true&characterEncoding=UTF8
 #dataSource.username=guomaouser
 #dataSource.password=Aa111111
-dataSource.url=jdbc:mysql://172.16.128.210:3306/guomaodb?useUnicode=true&characterEncoding=UTF8
-dataSource.username=root
-dataSource.password=guomao@2022
+#dataSource.url=jdbc:mysql://172.16.128.210:3306/guomaodb?useUnicode=true&characterEncoding=UTF8
+#dataSource.username=root
+#dataSource.password=guomao@2022
 
 
 config.MINDebug=false

+ 2 - 2
adm/src/main/webapp/WEB-INF/web.xml

@@ -30,14 +30,14 @@
     <filter-name>CharacterEncoder</filter-name>
     <url-pattern>/*</url-pattern>
   </filter-mapping>
-  <filter>
+  <!-- <filter>
     <filter-name>SSOFilter</filter-name>
     <filter-class>com.minpay.common.event.SSOFilter</filter-class>
   </filter>
   <filter-mapping>
     <filter-name>SSOFilter</filter-name>
     <url-pattern>/*</url-pattern>
-  </filter-mapping>
+  </filter-mapping> -->
   <filter>
     <filter-name>PasswordFilter</filter-name>
     <filter-class>com.minpay.common.event.PasswordFilter</filter-class>

+ 1 - 1
adm/src/main/webapp/admin/longcontractManage/addlongpc.html

@@ -327,7 +327,7 @@
 					<option value="01">华北</option>
 					<option value="02">华南</option>
 					<option value="03">华中</option>
-				
+					<option value="06">西南</option>
     		</select> 
 			
    </script>

+ 6 - 0
adm/src/main/webapp/admin/longcontractManage/editlongpc.html

@@ -270,6 +270,12 @@
 				{{#  }else{ }}
 					<option value="03">华中</option>
 				{{#  } }}
+
+				{{#  if(d.region == '06'){ }}
+        			<option value="06"selected>西南</option>
+				{{#  }else{ }}
+					<option value="06">西南</option>
+				{{#  } }}
 				
     		</select> 
 	</script>

+ 58 - 34
adm/src/main/webapp/admin/ops/addQuestion.html

@@ -3,16 +3,11 @@
 
 <head>
     <meta charset="utf-8">
-    <title>编辑问题</title>
+    <title>问题新增</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
     <script src="../../js/min-loader-next.js"></script>
-    <script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.config.js"></script>
-    <script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.all.min.js"> </script>
-    <!--建议手动加在语言,避免在ie下有时因为加载语言失败导致编辑器加载失败-->
-    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->
-    <script type="text/javascript" charset="utf-8" src="../../ueditor/lang/zh-cn/zh-cn.js"></script>
     <style type="text/css">
 	    .layui-anim-upbit {
 		    animation-name: layui-upbit;
@@ -67,10 +62,18 @@
 		<div class="layui-inline">
 			<label class="layui-form-label">*事项描述:</label>
 			<div class="layui-input-inline">
-				<script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>
+				<textarea name="step" id="step" class="layui-textarea" style="width:1024px;height:500px;"></textarea>
 			</div>
 		</div>
 	</div>
+	<div class="layui-upload" style="margin-left: 40px; padding-bottom: 70px;">
+	  <button type="button" class="layui-btn" id="test2">图片上传</button> 
+	  <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
+	    预览图:
+	    <div class="layui-upload-list" id="demo2">
+	    </div>
+	 </blockquote>
+	</div>
       <div class="layui-form-item box-button">
           <div class="layui-input-block">
               <button class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
@@ -82,36 +85,16 @@
     <script>
     //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
 	$(function(){
-		layui.use(['form', 'laydate'], function() {
-			var ue = UE.getEditor('editor',{
-				toolbars : [
-					[
-						'undo', //撤销
-						'redo', //重做
-						'bold', //加粗
-						'indent', //首行缩进
-						'pasteplain', //纯文本粘贴模式
-						'print', //打印
-						'horizontal', //分隔线
-						'removeformat', //清除格式
-						'fontfamily', //字体
-						'justifyleft', //居左对齐
-						'justifyright', //居右对齐
-						'justifycenter', //居中对齐
-						'justifyjustify', //两端对齐
-						'forecolor', //字体颜色
-					]
-				]
-			});
-			ue.ready(function() {
-				ue.setContent('<p>[步骤]</p><p></p><p>[结果]</p><p></p><p>[期望]</p><p></p>');
-			});
+		layui.use(['form', 'laydate', 'upload'], function() {
+			$("#step").val('[步骤]\n\n[结果]\n\n[期望]\n');
 
 			var form = layui.form;
 			var laydate = layui.laydate;
+			var upload = layui.upload;
 			laydate.render({
 				elem: '#expectTime' //指定元素
 				,min: getNowFormatDate()
+				,trigger: 'click'
 			});
 			
 			// 查询模块数据
@@ -137,12 +120,19 @@
 			//监听提交
 			form.on('submit(demo1)', function(data) {
 				var param = {};
-				param.type = data.field.type;
 				param.name = data.field.name;
 				param.degree = data.field.degree;
 				param.module = data.field.module;
 				param.expectTime = data.field.expectTime;
-				param.step = window.btoa(encodeURI(ue.getContent()));
+				param.step = window.btoa(encodeURI($("#step").val()));
+				
+				var categoryImg = new Array();
+				var imgNode = $("#demo2").find("img");
+				for(var index = 0; index < imgNode.length; index ++) {
+					var url = $(imgNode[index]).attr("src");
+					categoryImg.push(url);
+				}
+				param.pictureUrl = categoryImg.join(",");
 				$.request({
 					action : 'ObsQuestionManage/questionAdd',
 					data :  param,
@@ -161,6 +151,34 @@
 				});
 			})
 			
+			
+			  upload.render({
+			    elem: '#test2'
+			    ,url: '../../FileManageAction/uploadFile' //此处配置你自己的上传接口即可
+			    ,multiple: false
+			    ,data: {
+			    	fileType : '00',
+			    	MINView : 'JSON'
+			    }
+			    ,before: function(obj){
+			    	load = layer.load();
+			    }
+			    ,done: function(res){
+			    	layer.close(load);
+			    	if (res.MINStatus != 0) {
+						layer.alert(res.MINErrorMessage, {
+	  						icon: 5,
+	  						title: "提示"
+	  					}); 
+						return;
+					}	
+			    	var url = res.data.src;
+			    	url = window.location.origin + url.replace("http://127.0.0.1", "")
+			    	$('#demo2').append('<img onclick="isDelete(this)" width="100px" style="margin:10px;" height="100px" src="'+ url +'" class="layui-upload-img">')
+			    }
+			  });
+
+			
 			//获取当前日期函数
 			function getNowFormatDate() {
 			  let date = new Date(),
@@ -169,11 +187,17 @@
 			    strDate = date.getDate() // 获取当前日(1-31)
 			  if (month < 10) month = `0${month}` // 如果月份是个位数,在前面补0
 			  if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数,在前面补0
-			 
 			  return `${year}-${month}-${strDate}`
 			}
 		})
 	})
+    
+    function isDelete(t){
+		layer.confirm('确认删除此图片?', function(index){
+        	$(t).remove();
+			layer.close(index);//关闭弹窗
+    	});
+	}
 
     </script>
 

+ 142 - 56
adm/src/main/webapp/admin/ops/editQuestion.html

@@ -3,16 +3,11 @@
 
 <head>
     <meta charset="utf-8">
-    <title>新增问题</title>
+    <title>问题编辑</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
     <script src="../../js/min-loader-next.js"></script>
-    <script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.config.js"></script>
-    <script type="text/javascript" charset="utf-8" src="../../ueditor/ueditor.all.min.js"> </script>
-    <!--建议手动加在语言,避免在ie下有时因为加载语言失败导致编辑器加载失败-->
-    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->
-    <script type="text/javascript" charset="utf-8" src="../../ueditor/lang/zh-cn/zh-cn.js"></script>
     <style type="text/css">
 	    .layui-anim-upbit {
 		    animation-name: layui-upbit;
@@ -44,16 +39,44 @@
 				</select>
 			</div>
 		</div>
+		
+		<div class="layui-form-item">
+			<div class="layui-inline">
+				<label class="layui-form-label">*系统/模块:</label>
+				<div class="layui-input-inline" style = "width: 400px;">
+					<select name="module" id = "module" lay-search>
+						
+					</select>
+				</div>
+			</div>
+		</div>
+		<div class="layui-form-item">
+			<div class="layui-inline">
+				<label class="layui-form-label">*期望完成时间:</label>
+				<div class="layui-input-inline">
+					<input type="text" name="expectTime" id="expectTime" maxlength="10" autocomplete="off" placeholder="请选择日期" class="layui-input" readOnly>
+				</div>
+			</div>
+		</div>
 	</div>
 	
 	<div class="layui-form-item">	
 		<div class="layui-inline">
 			<label class="layui-form-label">*重现步骤:</label>
 			<div class="layui-input-inline">
-				<script id="editor" type="text/plain" style="width:1024px;height:500px;"></script>
+				<textarea name="step" id="step" class="layui-textarea" style="width:1024px;height:500px;"></textarea>
 			</div>
 		</div>
 	</div>
+	
+	<div class="layui-upload" style="margin-left: 40px; padding-bottom: 70px;">
+	  <button type="button" class="layui-btn" id="test2">图片上传</button> 
+	  <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
+	    预览图:
+	    <div class="layui-upload-list" id="demo2"></div>
+	 </blockquote>
+	</div>
+	
       <div class="layui-form-item box-button">
           <div class="layui-input-block">
               <button class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
@@ -65,59 +88,79 @@
     <script>
     //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
 	$(function(){
-		layui.use(['form'], function() {
+		layui.use(['form', 'laydate', 'upload'], function() {
 			var form = layui.form;
-			var ue = UE.getEditor('editor',{
-				toolbars : [
-					[
-						'undo', //撤销
-						'redo', //重做
-						'bold', //加粗
-						'indent', //首行缩进
-						'pasteplain', //纯文本粘贴模式
-						'print', //打印
-						'horizontal', //分隔线
-						'removeformat', //清除格式
-						'fontfamily', //字体
-						'justifyleft', //居左对齐
-						'justifyright', //居右对齐
-						'justifycenter', //居中对齐
-						'justifyjustify', //两端对齐
-						'forecolor', //字体颜色
-					]
-				]
-			});
-			ue.ready(function() {
-				var oqId = getQueryString("oqId");
-				$.request({
-					action : 'ObsQuestionManage/questionQuery',
-					data :  {'oqId': oqId},
-					success : function(data) {
-						$("#name").val(data.data.oqName);
-						var options = $("#degree").children("option");
-						for(let i = 0; i < options.length; i ++) {
-							if($(options[i]).attr("value") != data.data.oqDegree) {
-								$(options[i]).removeAttr("selected");
-							} else {
-								$(options[i]).attr("selected", true);
-							}
-						}
-						if(isEmpty(data.data.oqStep)) {
-							ue.setContent('<p>[步骤]</p><p></p><p>[结果]</p><p></p><p>[期望]</p><p></p>');
+			var laydate = layui.laydate;
+			var upload = layui.upload;
+
+			var oqId = getQueryString("oqId");
+			$.request({
+				action : 'ObsQuestionManage/questionQuery',
+				data :  {'oqId': oqId},
+				success : function(data) {
+					var oqModule = data.data.oqModule;
+					var oqExpectTime = data.data.oqExpectTime;
+					$("#name").val(data.data.oqName);
+					var options = $("#degree").children("option");
+					for(let i = 0; i < options.length; i ++) {
+						if($(options[i]).attr("value") != data.data.oqDegree) {
+							$(options[i]).removeAttr("selected");
 						} else {
-							ue.setContent(data.data.oqStep);
+							$(options[i]).attr("selected", true);
 						}
-						form.render();
-					},
-					error : function(data2) {
-						layer.alert(data2.MINErrorMessage, {
-							icon: 5,
-							title: "提示"
-						});
 					}
-				});
-				
+					if(isEmpty(data.data.oqStep)) {
+						$("#step").val('[步骤]\n\n[结果]\n\n[期望]\n');
+					} else {
+						$("#step").val(decodeURIComponent(window.atob(data.data.oqStep)));
+					}
+					
+					laydate.render({
+						elem: '#expectTime' //指定元素
+						,trigger: 'click'
+						,value: oqExpectTime.substring(0,4) + "-" + oqExpectTime.substring(4,6) + "-" + oqExpectTime.substring(6,8)
+					});
+					
+					var picture = data.data.picture;
+					if(!isEmpty(picture)) {
+						var pictureUrl = picture.split(",");
+						for(var i = 0; i < pictureUrl.length; i++) {
+							$('#demo2').append('<img onclick="isDelete(this)" width="100px" style="margin:10px;" height="100px" src="'+ pictureUrl[i] +'" class="layui-upload-img">')
+						}
+					}
+					
+					// 查询模块数据
+					$.request({
+						action : 'ObsQuestionManage/menuList',
+						data :  {},
+						success : function(data) {
+							let optionHtml = '<option value="" selected></option>';
+							for(let menu of data.data) {
+								if(oqModule == menu.id){
+									optionHtml += '<option value="' + menu.id + '" selected>' + menu.menuName + '</option>';
+								} else {
+									optionHtml += '<option value="' + menu.id + '">' + menu.menuName + '</option>';
+								}
+							}
+							$("#module").html(optionHtml);
+							form.render();
+						},
+						error : function(data2) {
+							layer.alert(data2.MINErrorMessage, {
+								icon: 5,
+								title: "提示"
+							});
+						}
+					});
+				},
+				error : function(data2) {
+					layer.alert(data2.MINErrorMessage, {
+						icon: 5,
+						title: "提示"
+					});
+				}
 			});
+				
 
 			
 			//监听提交
@@ -126,7 +169,18 @@
 				param.id = getQueryString("oqId");
 				param.name = data.field.name;
 				param.degree = data.field.degree;
-				param.step = ue.getContent();
+				param.module = data.field.module;
+				param.expectTime = data.field.expectTime;
+				param.step = window.btoa(encodeURI($("#step").val()));
+				
+				var categoryImg = new Array();
+				var imgNode = $("#demo2").find("img");
+				for(var index = 0; index < imgNode.length; index ++) {
+					var url = $(imgNode[index]).attr("src");
+					categoryImg.push(url);
+				}
+				param.pictureUrl = categoryImg.join(",");
+				
 				$.request({
 					action : 'ObsQuestionManage/questionEdit',
 					data :  param,
@@ -144,9 +198,41 @@
 					}
 				});
 			})
+			
+		  upload.render({
+		    elem: '#test2'
+		    ,url: '../../FileManageAction/uploadFile' //此处配置你自己的上传接口即可
+		    ,multiple: false
+		    ,data: {
+		    	fileType : '00',
+		    	MINView : 'JSON'
+		    }
+		    ,before: function(obj){
+		    	load = layer.load();
+		    }
+		    ,done: function(res){
+		    	layer.close(load);
+		    	if (res.MINStatus != 0) {
+					layer.alert(res.MINErrorMessage, {
+  						icon: 5,
+  						title: "提示"
+  					}); 
+					return;
+				}	
+		    	var url = res.data.src;
+		    	url = window.location.origin + url.replace("http://127.0.0.1", "")
+		    	$('#demo2').append('<img onclick="isDelete(this)" width="100px" style="margin:10px;" height="100px" src="'+ url +'" class="layui-upload-img">')
+		    }
+		  });
 		})
 	})
 
+    function isDelete(t){
+		layer.confirm('确认删除此图片?', function(index){
+        	$(t).remove();
+			layer.close(index);//关闭弹窗
+    	});
+	}
     </script>
 
 </body>

+ 2 - 2
adm/src/main/webapp/admin/ops/printQuestion.html

@@ -143,7 +143,7 @@
 			$("#suozaibumen").html(printData.suozaibumen);
 			$("#lianxidianhua").html(printData.lianxidianhua);
 			$("#mukuai").html(printData.mukuai);
-			$("#shixiangmiaoshu").html(printData.shixiangmiaoshu);
+			$("#shixiangmiaoshu").html(decodeURIComponent(window.atob(printData.shixiangmiaoshu)));
 			$("#yaoqiuwanchengqixian").html(printData.yaoqiuwanchengqixian.substr(0, 4) + '年' + printData.yaoqiuwanchengqixian.substr(4, 2) + '月' + printData.yaoqiuwanchengqixian.substr(6, 2) + '日前完成');
 			$("#wanchengqingkuang").html(printData.wanchengqingkuang);
 			$("#fuwurenyuan").html('服务人员:' + printData.fuwurenyuan);
@@ -153,7 +153,7 @@
 			$("#shenqingrenyuan").html('申请人员:' + printData.shenqingrenyuan);
 			$("#fanguiriqi").html('日期:' + printData.fanguiriqi.substr(0, 4) + '年' + printData.fanguiriqi.substr(4, 2) + '月' + printData.fanguiriqi.substr(6, 2) + '日');
 			
-	        window.print()
+	        //window.print()
 		},
 		error : function(data2) {
 			layer.alert(data2.MINErrorMessage, {