浏览代码

Merge remote-tracking branch 'origin/dev' into hejq-redhot-201809

hejq 7 年之前
父节点
当前提交
0424256d19

+ 3 - 3
src/main/java/com/uas/platform/b2b/controller/AuthenticationController.java

@@ -1,9 +1,9 @@
 package com.uas.platform.b2b.controller;
 package com.uas.platform.b2b.controller;
 
 
+import com.uas.platform.b2b.core.util.FastjsonUtils;
 import com.uas.platform.b2b.model.User;
 import com.uas.platform.b2b.model.User;
 import com.uas.platform.b2b.model.UserInfo;
 import com.uas.platform.b2b.model.UserInfo;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.SystemSession;
-import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import com.uas.sso.SSOConfig;
 import com.uas.sso.SSOConfig;
 import com.uas.sso.SSOHelper;
 import com.uas.sso.SSOHelper;
 import com.uas.sso.SSOToken;
 import com.uas.sso.SSOToken;
@@ -46,10 +46,10 @@ public class AuthenticationController {
 		// 通知到账户中心
 		// 通知到账户中心
 		SSOToken token = SSOHelper.attrToken(request);
 		SSOToken token = SSOHelper.attrToken(request);
 		if (null != token) {
 		if (null != token) {
-			UserAccount tokenUser = FlexJsonUtils.fromJson(token.getData(), UserAccount.class);
+			UserAccount tokenUser = FastjsonUtils.fromJson(token.getData(), UserAccount.class);
 			tokenUser.setSpaceUU(enUU);
 			tokenUser.setSpaceUU(enUU);
 			SSOToken newToken = new SSOToken(request, tokenUser.getMobile());
 			SSOToken newToken = new SSOToken(request, tokenUser.getMobile());
-			newToken.setData(FlexJsonUtils.toJson(tokenUser));
+			newToken.setData(FastjsonUtils.toJson(tokenUser));
 			SSOHelper.setSSOCookie(request, response, newToken, true);
 			SSOHelper.setSSOCookie(request, response, newToken, true);
 			return new ModelMap("data", tokenUser).addAttribute("url", SSOConfig.getSSOProperties().get("mall.login.url"));
 			return new ModelMap("data", tokenUser).addAttribute("url", SSOConfig.getSSOProperties().get("mall.login.url"));
 		}
 		}

+ 94 - 0
src/main/java/com/uas/platform/b2b/core/util/FastjsonUtils.java

@@ -0,0 +1,94 @@
+package com.uas.platform.b2b.core.util;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.parser.Feature;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
+import java.util.List;
+
+/**
+ * alibaba fastjson工具类封装
+ * @author yingp
+ * @see JSON
+ *
+ */
+public class FastjsonUtils {
+
+	public static Feature DEFAULT_PARSER_FEATURE = Feature.DisableCircularReferenceDetect;
+	public static SerializerFeature DEFAULT_SERIAL_FEATURE = SerializerFeature.DisableCircularReferenceDetect;
+
+	/**
+	 * 把JSON文本parse为JSONObject或者JSONArray
+	 * 
+	 * @param text
+	 * @return
+	 */
+	public static Object parse(String text) {
+		return JSON.parse(text, DEFAULT_PARSER_FEATURE);
+	}
+
+	/**
+	 * 把JSON文本parse成JSONObject
+	 * 
+	 * @param text
+	 * @return
+	 */
+	public static final JSONObject parseObject(String text) {
+		return JSON.parseObject(text, DEFAULT_PARSER_FEATURE);
+	}
+
+	/**
+	 * 把JSON文本parse为JavaBean
+	 * 
+	 * @param text
+	 * @param clazz
+	 * @return
+	 */
+	public static final <T> T fromJson(String text, Class<T> clazz) {
+		return JSON.parseObject(text, clazz, DEFAULT_PARSER_FEATURE);
+	}
+
+	/**
+	 * 把JSON文本parse成JSONArray
+	 * 
+	 * @param text
+	 * @return
+	 */
+	public static final JSONArray fromJsonArray(String text) {
+		return JSON.parseArray(text);
+	}
+
+	/**
+	 * 把JSON文本parse成JavaBean集合
+	 * 
+	 * @param text
+	 * @param clazz
+	 * @return
+	 */
+	public static final <T> List<T> fromJsonArray(String text, Class<T> clazz) {
+		return JSON.parseArray(text, clazz);
+	}
+
+	/**
+	 * 将JavaBean序列化为JSON文本
+	 * 
+	 * @param object
+	 * @return
+	 */
+	public static final String toJson(Object object) {
+		return JSON.toJSONString(object, DEFAULT_SERIAL_FEATURE);
+	}
+
+	/**
+	 * 将JavaBean转换为JSONObject或者JSONArray。
+	 * 
+	 * @param javaObject
+	 * @return
+	 */
+	public static final Object toJSON(Object javaObject) {
+		return JSON.toJSON(javaObject);
+	}
+
+}

+ 20 - 0
src/main/java/com/uas/platform/b2b/erp/model/PurchaseChange.java

@@ -28,6 +28,8 @@ public class PurchaseChange extends KeyEntity {
 	private Float pc_newrate;
 	private Float pc_newrate;
 	private String pc_apvendname;
 	private String pc_apvendname;
 	private String pc_newapvendname;
 	private String pc_newapvendname;
+	private String pc_apvendcode;
+	private String pc_newapvendcode;
 	private String pc_description;
 	private String pc_description;
 	private String pc_remark;
 	private String pc_remark;
 	private Short pc_agreed;
 	private Short pc_agreed;
@@ -150,6 +152,22 @@ public class PurchaseChange extends KeyEntity {
 		return pc_newapvendname;
 		return pc_newapvendname;
 	}
 	}
 
 
+	public String getPc_apvendcode() {
+		return pc_apvendcode;
+	}
+
+	public void setPc_apvendcode(String pc_apvendcode) {
+		this.pc_apvendcode = pc_apvendcode;
+	}
+
+	public String getPc_newapvendcode() {
+		return pc_newapvendcode;
+	}
+
+	public void setPc_newapvendcode(String pc_newapvendcode) {
+		this.pc_newapvendcode = pc_newapvendcode;
+	}
+
 	public void setPc_newapvendname(String pc_newapvendname) {
 	public void setPc_newapvendname(String pc_newapvendname) {
 		this.pc_newapvendname = pc_newapvendname;
 		this.pc_newapvendname = pc_newapvendname;
 	}
 	}
@@ -170,6 +188,8 @@ public class PurchaseChange extends KeyEntity {
 		change.setEnterprise(new EnterpriseInfo(SystemSession.getUser().getEnterprise()));
 		change.setEnterprise(new EnterpriseInfo(SystemSession.getUser().getEnterprise()));
 		change.setNewCurrency(this.pc_newcurrency);
 		change.setNewCurrency(this.pc_newcurrency);
 		change.setNewPayments(this.pc_newpayments);
 		change.setNewPayments(this.pc_newpayments);
+		change.setApvendcode(this.pc_apvendcode);
+		change.setNewapvendcode(this.pc_newapvendcode);
 		change.setApVendorName(this.pc_apvendname);
 		change.setApVendorName(this.pc_apvendname);
 		change.setNewApVendorName(this.pc_newapvendname);
 		change.setNewApVendorName(this.pc_newapvendname);
 		change.setNewRate(this.pc_newrate);
 		change.setNewRate(this.pc_newrate);

+ 28 - 0
src/main/java/com/uas/platform/b2b/model/PurchaseOrderChange.java

@@ -67,6 +67,18 @@ public class PurchaseOrderChange implements Serializable {
 	@Column(name = "pc_newapvendname")
 	@Column(name = "pc_newapvendname")
 	private String newApVendorName;
 	private String newApVendorName;
 
 
+	/**
+	 * 原应付供应商编号
+	 */
+	@Column(name = "pc_apvendcode")
+	private String apvendcode;
+
+	/**
+	 * 新应付供应商编号
+	 */
+	@Column(name = "pc_newapvendcode")
+	private String newapvendcode;
+
 	/**
 	/**
 	 * 采购变更单卖方用户UU(订单中的数据)
 	 * 采购变更单卖方用户UU(订单中的数据)
 	 */
 	 */
@@ -421,6 +433,22 @@ public class PurchaseOrderChange implements Serializable {
 		return apVendorName;
 		return apVendorName;
 	}
 	}
 
 
+	public String getApvendcode() {
+		return apvendcode;
+	}
+
+	public void setApvendcode(String apvendcode) {
+		this.apvendcode = apvendcode;
+	}
+
+	public String getNewapvendcode() {
+		return newapvendcode;
+	}
+
+	public void setNewapvendcode(String newapvendcode) {
+		this.newapvendcode = newapvendcode;
+	}
+
 	public void setApVendorName(String apVendorName) {
 	public void setApVendorName(String apVendorName) {
 		this.apVendorName = apVendorName;
 		this.apVendorName = apVendorName;
 	}
 	}

+ 6 - 6
src/main/java/com/uas/platform/b2b/openapi/model/CustTrading.java

@@ -9,9 +9,9 @@ public class CustTrading {
     private Long custUU;
     private Long custUU;
     private String custName;
     private String custName;
     private Double realAccept;
     private Double realAccept;
-    private String acceptPercent;
+    private Double acceptPercent;
     private Integer realNum;
     private Integer realNum;
-    private String numPercent;
+    private Double numPercent;
     private Double timeSum;
     private Double timeSum;
 
 
     public Long getCustUU() {
     public Long getCustUU() {
@@ -38,11 +38,11 @@ public class CustTrading {
         this.custName = custName;
         this.custName = custName;
     }
     }
 
 
-    public String getAcceptPercent() {
+    public Double getAcceptPercent() {
         return acceptPercent;
         return acceptPercent;
     }
     }
 
 
-    public void setAcceptPercent(String acceptPercent) {
+    public void setAcceptPercent(Double acceptPercent) {
         this.acceptPercent = acceptPercent;
         this.acceptPercent = acceptPercent;
     }
     }
 
 
@@ -54,11 +54,11 @@ public class CustTrading {
         this.realNum = realNum;
         this.realNum = realNum;
     }
     }
 
 
-    public String getNumPercent() {
+    public Double getNumPercent() {
         return numPercent;
         return numPercent;
     }
     }
 
 
-    public void setNumPercent(String numPercent) {
+    public void setNumPercent(Double numPercent) {
         this.numPercent = numPercent;
         this.numPercent = numPercent;
     }
     }
 
 

+ 9 - 9
src/main/java/com/uas/platform/b2b/openapi/model/RecentOfMonth.java

@@ -16,11 +16,11 @@ public class RecentOfMonth {
 
 
     private Double oneMonth;
     private Double oneMonth;
 
 
-    private String threeMonthNum;
+    private Double threeMonthNum;
 
 
-    private String twoMonthNum;
+    private Double twoMonthNum;
 
 
-    private String oneMonthNum;
+    private Double oneMonthNum;
 
 
     public String getName() {
     public String getName() {
         return name;
         return name;
@@ -62,27 +62,27 @@ public class RecentOfMonth {
         this.oneMonth = oneMonth;
         this.oneMonth = oneMonth;
     }
     }
 
 
-    public String getThreeMonthNum() {
+    public Double getThreeMonthNum() {
         return threeMonthNum;
         return threeMonthNum;
     }
     }
 
 
-    public void setThreeMonthNum(String threeMonthNum) {
+    public void setThreeMonthNum(Double threeMonthNum) {
         this.threeMonthNum = threeMonthNum;
         this.threeMonthNum = threeMonthNum;
     }
     }
 
 
-    public String getTwoMonthNum() {
+    public Double getTwoMonthNum() {
         return twoMonthNum;
         return twoMonthNum;
     }
     }
 
 
-    public void setTwoMonthNum(String twoMonthNum) {
+    public void setTwoMonthNum(Double twoMonthNum) {
         this.twoMonthNum = twoMonthNum;
         this.twoMonthNum = twoMonthNum;
     }
     }
 
 
-    public String getOneMonthNum() {
+    public Double getOneMonthNum() {
         return oneMonthNum;
         return oneMonthNum;
     }
     }
 
 
-    public void setOneMonthNum(String oneMonthNum) {
+    public void setOneMonthNum(Double oneMonthNum) {
         this.oneMonthNum = oneMonthNum;
         this.oneMonthNum = oneMonthNum;
     }
     }
 
 

+ 6 - 6
src/main/java/com/uas/platform/b2b/openapi/model/RecentOfYear.java

@@ -14,9 +14,9 @@ public class RecentOfYear {
 
 
     private Double thisYear;
     private Double thisYear;
 
 
-    private String oneYearNum;
+    private Double oneYearNum;
 
 
-    private String thisYearNum;
+    private Double thisYearNum;
 
 
     public String getName() {
     public String getName() {
         return name;
         return name;
@@ -50,19 +50,19 @@ public class RecentOfYear {
         this.thisYear = thisYear;
         this.thisYear = thisYear;
     }
     }
 
 
-    public String getOneYearNum() {
+    public Double getOneYearNum() {
         return oneYearNum;
         return oneYearNum;
     }
     }
 
 
-    public void setOneYearNum(String oneYearNum) {
+    public void setOneYearNum(Double oneYearNum) {
         this.oneYearNum = oneYearNum;
         this.oneYearNum = oneYearNum;
     }
     }
 
 
-    public String getThisYearNum() {
+    public Double getThisYearNum() {
         return thisYearNum;
         return thisYearNum;
     }
     }
 
 
-    public void setThisYearNum(String thisYearNum) {
+    public void setThisYearNum(Double thisYearNum) {
         this.thisYearNum = thisYearNum;
         this.thisYearNum = thisYearNum;
     }
     }
 
 

+ 2 - 2
src/main/java/com/uas/platform/b2b/openapi/service/impl/TradingDataServiceImpl.java

@@ -45,7 +45,7 @@ public class TradingDataServiceImpl implements TradingDataService {
         // 获取累计发票金额
         // 获取累计发票金额
         Double apBillSum = getApBillSum(enUU);
         Double apBillSum = getApBillSum(enUU);
         // 获取历史退货率
         // 获取历史退货率
-        String historyReturn = NumFormat.getPercent(returnSum / getOrderSum(enUU));
+        Double historyReturn = NumFormat.getPercent(returnSum / getOrderSum(enUU));
         map.put("timeSum", timeSum);
         map.put("timeSum", timeSum);
         map.put("acceptSum", acceptSum);
         map.put("acceptSum", acceptSum);
         map.put("returnSum", returnSum);
         map.put("returnSum", returnSum);
@@ -68,7 +68,7 @@ public class TradingDataServiceImpl implements TradingDataService {
                 Double returnSum = getReturnSum(enUU, custTrading.getCustUU());
                 Double returnSum = getReturnSum(enUU, custTrading.getCustUU());
                 custTrading.setRealAccept(NumFormat.getTwo(acceptSum - returnSum));
                 custTrading.setRealAccept(NumFormat.getTwo(acceptSum - returnSum));
                 if (StringUtils.isEmpty(acceptSum) || acceptSum == 0.0) {
                 if (StringUtils.isEmpty(acceptSum) || acceptSum == 0.0) {
-                    custTrading.setAcceptPercent("0.00%");
+                    custTrading.setAcceptPercent(0.00);
                 } else {
                 } else {
                     custTrading.setAcceptPercent(NumFormat.getPercent((acceptSum - returnSum) / sum));
                     custTrading.setAcceptPercent(NumFormat.getPercent((acceptSum - returnSum) / sum));
                 }
                 }

+ 8 - 7
src/main/java/com/uas/platform/b2b/openapi/support/NumFormat.java

@@ -24,7 +24,7 @@ public class NumFormat {
     public static Double getOne(Double result) {
     public static Double getOne(Double result) {
         DecimalFormat df = new DecimalFormat("#.0");
         DecimalFormat df = new DecimalFormat("#.0");
         if (StringUtils.isEmpty(result)) {
         if (StringUtils.isEmpty(result)) {
-            return 0.00;
+            return 0.0;
         } else {
         } else {
             return Double.parseDouble(df.format(result));
             return Double.parseDouble(df.format(result));
         }
         }
@@ -39,11 +39,12 @@ public class NumFormat {
         }
         }
     }
     }
 
 
-    public static String getPercent(Double result) {
-        NumberFormat nt = NumberFormat.getPercentInstance();
+    public static Double getPercent(Double result) {
         //设置百分数精确度2即保留两位小数
         //设置百分数精确度2即保留两位小数
-        nt.setMinimumFractionDigits(2);
-        return nt.format(result);
+        DecimalFormat dfPercent = new DecimalFormat("##.00%");
+        String resultStr = dfPercent.format(result);
+        String needStr = resultStr.substring(0, resultStr.length() - 1);
+        return getTwo(Double.valueOf(needStr));
     }
     }
 
 
     public static java.sql.Date getTwoYear() {
     public static java.sql.Date getTwoYear() {
@@ -72,7 +73,7 @@ public class NumFormat {
         return new java.sql.Date(ca.getTime().getTime());
         return new java.sql.Date(ca.getTime().getTime());
     }
     }
 
 
-    public static String getIncrease(Double last, Double now) {
+    public static Double getIncrease(Double last, Double now) {
         if ((last != 0.0) && (now != 0.0)) {
         if ((last != 0.0) && (now != 0.0)) {
             return NumFormat.getPercent(now / last - 1);
             return NumFormat.getPercent(now / last - 1);
         }
         }
@@ -82,7 +83,7 @@ public class NumFormat {
         if (last != 0.0 && now == 0.0) {
         if (last != 0.0 && now == 0.0) {
             return NumFormat.getPercent(-last);
             return NumFormat.getPercent(-last);
         }
         }
-        return "0%";
+        return 0.0;
     }
     }
 
 
     public static java.sql.Date getThreeM() {
     public static java.sql.Date getThreeM() {

+ 6 - 0
src/main/java/com/uas/platform/b2b/service/impl/PurchaseOrderChangeServiceImpl.java

@@ -201,6 +201,12 @@ public class PurchaseOrderChangeServiceImpl implements PurchaseOrderChangeServic
 				order.setCurrency(change.getNewCurrency());
 				order.setCurrency(change.getNewCurrency());
 				order.setRate(change.getNewRate());
 				order.setRate(change.getNewRate());
 			}
 			}
+			if (StringUtils.hasText(change.getNewapvendcode()) && !change.getNewapvendcode().equals(change.getApvendcode())) {
+				order.setReceiveCode(change.getNewapvendcode());
+			}
+			if (StringUtils.hasText(change.getNewApVendorName()) && !change.getNewApVendorName().equals(change.getApVendorName())) {
+				order.setReceiveName(change.getNewApVendorName());
+			}
 		}
 		}
 		return order;
 		return order;
 	}
 	}

+ 1 - 1
src/main/webapp/WEB-INF/views/normal/index.html

@@ -254,7 +254,7 @@
 			<a href="http://www.fantem.com" target="_blank" title="丰唐物联技术(深圳)">丰唐物联技术(深圳)</a>|
 			<a href="http://www.fantem.com" target="_blank" title="丰唐物联技术(深圳)">丰唐物联技术(深圳)</a>|
 			<a href="http://www.hiways.com" target="_blank" title="深圳市海威思科技">深圳市海威思科技</a>|
 			<a href="http://www.hiways.com" target="_blank" title="深圳市海威思科技">深圳市海威思科技</a>|
 			<a href="http://www.huashangweitai.com" target="_blank" title="深圳市华商维泰显示科技">深圳市华商维泰显示科技</a>|
 			<a href="http://www.huashangweitai.com" target="_blank" title="深圳市华商维泰显示科技">深圳市华商维泰显示科技</a>|
-			<a href="http://www.ufct.com.cn/" target="_blank" title="联合创泰科技">联合创泰科技</a>
+			<a href="http://www.ufct.com.cn/" target="_blank" title="联合创泰科技">联合创泰科技</a>|
 			<a href="http://www.hi-mantech.com/" target="_blank" title="怡海能达">怡海能达</a>
 			<a href="http://www.hi-mantech.com/" target="_blank" title="怡海能达">怡海能达</a>
 		</div>
 		</div>
 		<ul class="list-unstyled footer-bottom">
 		<ul class="list-unstyled footer-bottom">

+ 1 - 1
src/main/webapp/resources/tpl/index/common/header.html

@@ -261,7 +261,7 @@
                 <a ng-click="b2cLink('/pcb')">PCB专区</a>
                 <a ng-click="b2cLink('/pcb')">PCB专区</a>
             </li>
             </li>
             <li>
             <li>
-                <a href="https://zb.usoftchina.com/" target="_blank">U创网</a>
+                <a href="https://zb.usoftchina.com/" target="_blank">闯客网</a>
             </li>
             </li>
             <li>
             <li>
                 <a href="https://bbs.usoftchina.com/" target="_blank">U客论坛</a>
                 <a href="https://bbs.usoftchina.com/" target="_blank">U客论坛</a>