|
|
@@ -77,7 +77,7 @@ public class serviceorder extends Controller {
|
|
|
if (content.containsKey("servicetype")) {
|
|
|
if (content.getString("servicetype").equals("安装")) {
|
|
|
if (StringUtils.isBlank(sku)) {
|
|
|
- return getErrReturnObject().setErrMsg("安装服务单需添加序列号").toString();
|
|
|
+ //return getErrReturnObject().setErrMsg("安装服务单需添加序列号").toString();
|
|
|
}
|
|
|
if (dbConnect.runSqlQuery("select * from sa_warrantycard where sku='" + sku + "' and siteid='" + siteid + "'").isNotEmpty()) {
|
|
|
DataTag.createSystemTag(this, "sa_serviceorder", sa_serviceorderid, "重复安装");
|
|
|
@@ -250,12 +250,34 @@ public class serviceorder extends Controller {
|
|
|
ArrayList<Long> ids = rows.toArrayList("itemid", new ArrayList<>());
|
|
|
RowsMap attRowsMap = getAttachmentUrl("plm_item", ids);
|
|
|
|
|
|
+ RowsMap warrantycardRowsMap = SQLFactory.createQuerySQL(this, "sa_warrantycard", "sku","name", "phonenumber","address","sa_customersid","province","city","county").setWhere("sku", rows.toArrayList("sku")).query().toRowsMap("sku");
|
|
|
+
|
|
|
for (Row row : rows) {
|
|
|
if (attRowsMap.getOrDefault(row.getString("itemid"), new Rows()).isNotEmpty()) {
|
|
|
row.put("attinfos", attRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
} else {
|
|
|
row.put("attinfos", defaultImageRows);
|
|
|
}
|
|
|
+ String sku = row.getString("sku");
|
|
|
+ if (warrantycardRowsMap.containsKey(sku) && warrantycardRowsMap.get(sku).isNotEmpty()) {
|
|
|
+ Row warrantycardRow = warrantycardRowsMap.get(sku).get(0);
|
|
|
+ row.put("name", warrantycardRow.getString("name"));
|
|
|
+ row.put("phonenumber", warrantycardRow.getString("phonenumber"));
|
|
|
+ row.put("address", warrantycardRow.getString("address"));
|
|
|
+ row.put("sa_customersid", warrantycardRow.getLong("sa_customersid"));
|
|
|
+ row.put("province", warrantycardRow.getString("province"));
|
|
|
+ row.put("city", warrantycardRow.getString("city"));
|
|
|
+ row.put("county", warrantycardRow.getString("county"));
|
|
|
+ }else{
|
|
|
+ row.put("name", "");
|
|
|
+ row.put("phonenumber", "");
|
|
|
+ row.put("address","");
|
|
|
+ row.put("sa_customersid", "");
|
|
|
+ row.put("province", "");
|
|
|
+ row.put("city", "");
|
|
|
+ row.put("county", "");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return getSucReturnObject().setData(rows).toString();
|