|
|
@@ -17,6 +17,7 @@ import p2.util.P2Exception;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Iterator;
|
|
|
+import java.util.List;
|
|
|
|
|
|
public class tagents extends Controller {
|
|
|
public tagents(JSONObject content) {
|
|
|
@@ -159,12 +160,8 @@ public class tagents extends Controller {
|
|
|
fchangemsgObject.checkStringLength("femail", "tagents.femail", "邮箱");//邮箱
|
|
|
fchangemsgObject.checkStringLength("fdutyparagraph", "tagents.fdutyparagraph", "统一社会代码");//统一社会信用代码
|
|
|
fchangemsgObject.checkStringLength("fbrand", "tagents.fbrand", "经营品牌");//统一社会信用代码
|
|
|
- if (fchangemsgObject.containsKey("saleprodclass")) {
|
|
|
- try {
|
|
|
- fchangemsgObject.getJSONArray("saleprodclass");
|
|
|
- } catch (Exception e) {
|
|
|
- return new D3BReturnObject_Err().setErrMsg("saleprodclass不是有效的JSONArray格式").toString();
|
|
|
- }
|
|
|
+ if (fchangemsgObject.containsKey("saleprodclass") && !isJSONArray(fchangemsgObject.getString("saleprodclass"))) {
|
|
|
+ return new D3BReturnObject_Err().setErrMsg("saleprodclass不是有效的JSONArray格式").toString();
|
|
|
}
|
|
|
if (tagentsid > 0) {
|
|
|
dbConnect.runSqlUpdate("update tagents_msgchangeapp set fstatus='作废' where siteid='" + siteid + "' and tagentsid='" + tagentsid + "' and fstatus='申请'");
|
|
|
@@ -223,27 +220,10 @@ public class tagents extends Controller {
|
|
|
PaoRemote tagents = tagentsSet.getPao(0);
|
|
|
JSONObject changemsgObject = JSONObject.parseObject(fchangemsg);
|
|
|
Iterator it = changemsgObject.keySet().iterator();
|
|
|
+ List<String> fieldlist=Arrays.asList(getTableColumns("tagents"));
|
|
|
while (it.hasNext()) {
|
|
|
String key = (String) it.next();
|
|
|
- if ("saleprodclass".equalsIgnoreCase(key)) {
|
|
|
- try {
|
|
|
- changemsgObject.getJSONArray("saleprodclass");
|
|
|
- } catch (Exception e) {
|
|
|
- return new D3BReturnObject_Err().setErrMsg("saleprodclass不是有效的JSONArray格式").toString();
|
|
|
- }
|
|
|
-// //经营类目修改
|
|
|
-// JSONArray saleprodclassArray = changemsgObject.getJSONArray("saleprodclass");
|
|
|
-// PaoSetRemote tagents_prodclassSet = tagents.getPaoSet("$tagents_prodclass", "tagents_prodclass", "tagentsid=" + tagentsid);
|
|
|
-// tagents_prodclassSet.deleteAll();
|
|
|
-// for (Object saleprodclassObject : saleprodclassArray) {
|
|
|
-// String fprodclassname = (String) saleprodclassObject;
|
|
|
-// PaoRemote saleprodclassPao = tagents_prodclassSet.addAtEnd();
|
|
|
-// saleprodclassPao.setValue("tagentsid", tagentsid, 11L);
|
|
|
-// saleprodclassPao.setValue("siteid", siteid, 11L);
|
|
|
-// saleprodclassPao.setValue("fprodclassname", fprodclassname, 11L);
|
|
|
-// }
|
|
|
- }
|
|
|
- if (Arrays.asList(getTableColumns("tagents")).contains(key.toLowerCase())) {
|
|
|
+ if (fieldlist.contains(key.toLowerCase())) {
|
|
|
if (getTableColumnType("tagents", key.toLowerCase()).equals("datetime")) {
|
|
|
tagents.setValue(key, changemsgObject.getDate(key.toLowerCase()), 11L);
|
|
|
} else {
|