|
|
@@ -6,7 +6,6 @@ import beans.data.BatchDeleteErr;
|
|
|
import beans.datacontrllog.DataContrlLog;
|
|
|
import beans.hr.Hr;
|
|
|
import beans.remind.Remind;
|
|
|
-
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import common.Controller;
|
|
|
@@ -141,7 +140,10 @@ public class aftersalesmag extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "返退单更新退货金额及物流单号", apiversion = R.ID20230105100203.v1.class)
|
|
|
- @CACHEING_CLEAN(apiversions = {R.ID20230104160603.v1.class, R.ID20230104160703.v1.class, R.ID20230105161503.v1.class})
|
|
|
+ @CACHEING_CLEAN(apiversions = {
|
|
|
+ R.ID20230104160603.v1.class,
|
|
|
+ R.ID20230104160703.v1.class,
|
|
|
+ R.ID20230105161503.v1.class})
|
|
|
public String updateaftersalesmag() throws YosException {
|
|
|
Long sa_aftersalesmagid = content.getLong("sa_aftersalesmagid");
|
|
|
String logisticno = content.getStringValue("logisticno");
|
|
|
@@ -209,12 +211,12 @@ public class aftersalesmag extends Controller {
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sa_warrantycard", "t6", "t6.sku=t1.sku and t6.siteid=t1.siteid", "cardno", "begdate", "enddate");
|
|
|
|
|
|
querySQL.setSiteid(siteid);
|
|
|
- querySQL.setWhere("(t1.sa_agentsid in (select sa_agentsid from sa_agents where sys_enterpriseid=" + sys_enterpriseid + ") or t1.sys_enterpriseid="+sys_enterpriseid+")");
|
|
|
+ querySQL.setWhere("(t1.sa_agentsid in (select sa_agentsid from sa_agents where sys_enterpriseid=" + sys_enterpriseid + ") or t1.sys_enterpriseid=" + sys_enterpriseid + ")");
|
|
|
querySQL.setWhere("t1.sku not in (select distinct machinecode from sa_aftersalesmag_items where siteid='" + siteid + "' and ifnull(machinecode,'')!='')");
|
|
|
querySQL.setWhere(where.toString());
|
|
|
- querySQL.addQueryFields("cardname","t6.name");
|
|
|
- querySQL.addQueryFields("cardphonenumber","t6.phonenumber");
|
|
|
- querySQL.addQueryFields("cardaddress","t6.address");
|
|
|
+ querySQL.addQueryFields("cardname", "t6.name");
|
|
|
+ querySQL.addQueryFields("cardphonenumber", "t6.phonenumber");
|
|
|
+ querySQL.addQueryFields("cardaddress", "t6.address");
|
|
|
|
|
|
querySQL.addGroupBy("t4.agentnum,t5.contact,t5.phonenumber,t5.address,t6.cardno,t6.begdate" +
|
|
|
",t6.enddate,t1.sku,t2.itemid,t2.itemno,t2.itemname,t2.model,t2.spec,t3.unitname,t6.name,t6.phonenumber,t6.address");
|
|
|
@@ -223,17 +225,17 @@ public class aftersalesmag extends Controller {
|
|
|
|
|
|
QuerySQL skuquerySQL = SQLFactory.createQuerySQL(this, "st_stockbill_items_sku", "sku");
|
|
|
skuquerySQL.setTableAlias("t1");
|
|
|
- skuquerySQL.addJoinTable(JOINTYPE.inner, "st_stockbill", "t2", "t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid","checkdate");
|
|
|
+ skuquerySQL.addJoinTable(JOINTYPE.inner, "st_stockbill", "t2", "t1.st_stockbillid=t2.st_stockbillid and t1.siteid=t2.siteid", "checkdate");
|
|
|
skuquerySQL.setWhere("t2.status='审核'");
|
|
|
- skuquerySQL.setWhere("t1.sku",rows.toArrayList("sku"));
|
|
|
+ skuquerySQL.setWhere("t1.sku", rows.toArrayList("sku"));
|
|
|
skuquerySQL.setSiteid(siteid);
|
|
|
Rows skurows = skuquerySQL.query();
|
|
|
RowsMap skurowsMap = skurows.toRowsMap("sku");
|
|
|
- for(Row row :rows){
|
|
|
- if(skurowsMap.containsKey(row.getString("sku"))){
|
|
|
- row.put("stockdate",skurowsMap.get(row.getString("sku")).get(0).getString("checkdate"));
|
|
|
- }else{
|
|
|
- row.put("stockdate","");
|
|
|
+ for (Row row : rows) {
|
|
|
+ if (skurowsMap.containsKey(row.getString("sku"))) {
|
|
|
+ row.put("stockdate", skurowsMap.get(row.getString("sku")).get(0).getString("checkdate"));
|
|
|
+ } else {
|
|
|
+ row.put("stockdate", "");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -266,11 +268,11 @@ public class aftersalesmag extends Controller {
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sa_agents", "t8", "t8.agentnum=t6.toagentnum and t8.siteid=t6.siteid");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t9", "t9.sys_enterpriseid=t8.sys_enterpriseid and t9.siteid=t8.siteid");
|
|
|
|
|
|
- querySQL.addQueryFields("sa_agentsid_service","t8.sa_agentsid");
|
|
|
- querySQL.addQueryFields("agentnum_service","t8.agentnum");
|
|
|
- querySQL.addQueryFields("enterprisename_service","t9.enterprisename");
|
|
|
- querySQL.addQueryFields("abbreviation_service","t9.abbreviation");
|
|
|
- querySQL.addQueryFields("sys_enterpriseid_service","t9.sys_enterpriseid");
|
|
|
+ querySQL.addQueryFields("sa_agentsid_service", "t8.sa_agentsid");
|
|
|
+ querySQL.addQueryFields("agentnum_service", "t8.agentnum");
|
|
|
+ querySQL.addQueryFields("enterprisename_service", "t9.enterprisename");
|
|
|
+ querySQL.addQueryFields("abbreviation_service", "t9.abbreviation");
|
|
|
+ querySQL.addQueryFields("sys_enterpriseid_service", "t9.sys_enterpriseid");
|
|
|
|
|
|
querySQL.setSiteid(siteid);
|
|
|
querySQL.setWhere("t6.sa_customersid", sa_customersid);
|
|
|
@@ -317,7 +319,7 @@ public class aftersalesmag extends Controller {
|
|
|
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_aftersalesmag", "*");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
- querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t2", "t1.sys_enterpriseid = t2.sys_enterpriseid AND t1.siteid = t2.siteid", "enterprisename","abbreviation");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t2", "t1.sys_enterpriseid = t2.sys_enterpriseid AND t1.siteid = t2.siteid", "enterprisename", "abbreviation");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sa_agents", "t3", "t1.sys_enterpriseid = t3.sys_enterpriseid AND t1.siteid = t3.siteid", "agentnum");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sa_aftersalesmag_items", "t4", "t1.sa_aftersalesmagid = t4.sa_aftersalesmagid AND t1.siteid = t4.siteid", "name", "phonenumber", "address",
|
|
|
"stockdate", "enddate", "model", "spec", "unitname", "itemname", "itemno", "duty", "demand", "machinecode", "qty", "itemid");
|
|
|
@@ -331,15 +333,15 @@ public class aftersalesmag extends Controller {
|
|
|
querySQL.setSiteid(siteid);
|
|
|
querySQL.setWhere("t1.sa_aftersalesmagid", sa_aftersalesmagid);
|
|
|
Rows rows = querySQL.query();
|
|
|
- for(Row row :rows){
|
|
|
- if(StringUtils.isBlank(row.getString("machinecode"))){
|
|
|
- row.put("cardno","");
|
|
|
- }else{
|
|
|
- Rows warrantycardrows = dbConnect.runSqlQuery("select cardno from sa_warrantycard where sku='"+row.getString("machinecode")+"'");
|
|
|
- if(warrantycardrows.isEmpty()){
|
|
|
- row.put("cardno","");
|
|
|
- }else{
|
|
|
- row.put("cardno",warrantycardrows.get(0).getString("cardno"));
|
|
|
+ for (Row row : rows) {
|
|
|
+ if (StringUtils.isBlank(row.getString("machinecode"))) {
|
|
|
+ row.put("cardno", "");
|
|
|
+ } else {
|
|
|
+ Rows warrantycardrows = dbConnect.runSqlQuery("select cardno from sa_warrantycard where sku='" + row.getString("machinecode") + "'");
|
|
|
+ if (warrantycardrows.isEmpty()) {
|
|
|
+ row.put("cardno", "");
|
|
|
+ } else {
|
|
|
+ row.put("cardno", warrantycardrows.get(0).getString("cardno"));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -451,7 +453,10 @@ public class aftersalesmag extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "撤回反撤回", apiversion = R.ID2025061316113303.v1.class)
|
|
|
- @CACHEING_CLEAN(apiClass = {aftersalesmag.class, aftersalesmagItems.class, restcontroller.sale.aftersalesmag.aftersalesmag.class})
|
|
|
+ @CACHEING_CLEAN(apiClass = {
|
|
|
+ aftersalesmag.class,
|
|
|
+ aftersalesmagItems.class,
|
|
|
+ restcontroller.sale.aftersalesmag.aftersalesmag.class})
|
|
|
public String chehui() throws YosException {
|
|
|
Long sa_aftersalesmagid = content.getLong("sa_aftersalesmagid");
|
|
|
boolean ischehui = content.getBooleanValue("ischehui");
|
|
|
@@ -539,7 +544,10 @@ public class aftersalesmag extends Controller {
|
|
|
|
|
|
|
|
|
@API(title = "审核反审核", apiversion = R.ID20230104161103.v1.class)
|
|
|
- @CACHEING_CLEAN(apiClass = {aftersalesmag.class, aftersalesmagItems.class, restcontroller.sale.aftersalesmag.aftersalesmag.class})
|
|
|
+ @CACHEING_CLEAN(apiClass = {
|
|
|
+ aftersalesmag.class,
|
|
|
+ aftersalesmagItems.class,
|
|
|
+ restcontroller.sale.aftersalesmag.aftersalesmag.class})
|
|
|
public String check() throws YosException {
|
|
|
Long sa_aftersalesmagid = content.getLong("sa_aftersalesmagid");
|
|
|
boolean ischeck = content.getBooleanValue("ischeck");
|
|
|
@@ -589,8 +597,8 @@ public class aftersalesmag extends Controller {
|
|
|
}
|
|
|
SQLList sqlList = new SQLList();
|
|
|
SQLFactory sqlFactoryupdate;
|
|
|
- long st_stockbillid =0;
|
|
|
- Rows departmenthrrows =dbConnect.runSqlQuery("select * from sys_departmenthrid where hrid="+hrid);
|
|
|
+ long st_stockbillid = 0;
|
|
|
+ Rows departmenthrrows = dbConnect.runSqlQuery("select * from sys_departmenthrid where hrid=" + hrid);
|
|
|
if (ischeck) {
|
|
|
InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "st_stockbill");
|
|
|
st_stockbillid = createTableID("st_stockbill");
|
|
|
@@ -602,7 +610,7 @@ public class aftersalesmag extends Controller {
|
|
|
insertSQL.setValue("sys_enterpriseid", rows.get(0).getLong("sys_enterpriseid"));
|
|
|
insertSQL.setValue("rb", 1);
|
|
|
insertSQL.setValue("sourceobject", "sa_aftersalesmag");
|
|
|
- insertSQL.setValue("departmentid", departmenthrrows.isNotEmpty()?departmenthrrows.get(0).getLong("departmentid"):0);
|
|
|
+ insertSQL.setValue("departmentid", departmenthrrows.isNotEmpty() ? departmenthrrows.get(0).getLong("departmentid") : 0);
|
|
|
insertSQL.setValue("sourceid", sa_aftersalesmagid);
|
|
|
insertSQL.setValue("stockid", stockid);
|
|
|
insertSQL.setValue("remarks", rows.get(0).getString("remarks"));
|
|
|
@@ -639,7 +647,7 @@ public class aftersalesmag extends Controller {
|
|
|
long st_stockbill_items_skuid = createTableID("st_stockbill_items_sku");
|
|
|
insertSQL.setUniqueid(st_stockbill_items_skuid);
|
|
|
insertSQL.setSiteid(siteid);
|
|
|
- insertSQL.setValue("stockid",stockid);
|
|
|
+ insertSQL.setValue("stockid", stockid);
|
|
|
insertSQL.setValue("itemid", row.getLong("itemid"));
|
|
|
insertSQL.setValue("sku", row.getString("machinecode"));
|
|
|
insertSQL.setValue("st_stockbillid", st_stockbillid);
|
|
|
@@ -692,7 +700,11 @@ public class aftersalesmag extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "复核", apiversion = R.ID20230104160903.v1.class)
|
|
|
- @CACHEING_CLEAN(apiClass = {aftersalesmag.class, aftersalesmagItems.class, cashbill.class, restcontroller.sale.aftersalesmag.aftersalesmag.class})
|
|
|
+ @CACHEING_CLEAN(apiClass = {
|
|
|
+ aftersalesmag.class,
|
|
|
+ aftersalesmagItems.class,
|
|
|
+ cashbill.class,
|
|
|
+ restcontroller.sale.aftersalesmag.aftersalesmag.class})
|
|
|
public String recheck() throws YosException {
|
|
|
Long sa_aftersalesmagid = content.getLong("sa_aftersalesmagid");
|
|
|
Long sa_accountclassid = content.getLongValue("sa_accountclassid");
|
|
|
@@ -763,13 +775,13 @@ public class aftersalesmag extends Controller {
|
|
|
cashbillEntity.setSource("退货单复核");
|
|
|
|
|
|
if (sa_accountclassid == 0) {
|
|
|
- JSONObject cashbillPay = Accountbalance.createCashbillPay(this, sys_enterpriseid, rows.get(0).getLong("sa_accountclassid"), cashbillEntity, true);
|
|
|
- sqlList.addAll(cashbillPay.getJSONArray("sqlList").toJavaList(String.class));
|
|
|
+ SQLList cashbillPay = Accountbalance.createCashbillPay(this, sys_enterpriseid, rows.get(0).getLong("sa_accountclassid"), cashbillEntity, true);
|
|
|
+ sqlList.addAll(cashbillPay);
|
|
|
sa_cashbillid = cashbillPay.getLong("sa_cashbillid");
|
|
|
} else {
|
|
|
sqlList.add("update sa_aftersalesmag set sa_accountclassid=" + sa_accountclassid + " where sa_aftersalesmagid=" + sa_aftersalesmagid + " and siteid='" + siteid + "'");
|
|
|
- JSONObject cashbillPay = Accountbalance.createCashbillPay(this, sys_enterpriseid, sa_accountclassid, cashbillEntity, true);
|
|
|
- sqlList.addAll(cashbillPay.getJSONArray("sqlList").toJavaList(String.class));
|
|
|
+ SQLList cashbillPay = Accountbalance.createCashbillPay(this, sys_enterpriseid, sa_accountclassid, cashbillEntity, true);
|
|
|
+ sqlList.addAll(cashbillPay);
|
|
|
sa_cashbillid = cashbillPay.getLong("sa_cashbillid");
|
|
|
}
|
|
|
|
|
|
@@ -835,7 +847,14 @@ public class aftersalesmag extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "反复核", apiversion = R.ID20230523085403.v1.class)
|
|
|
- @CACHEING_CLEAN(apiversions = {R.ID20230104160603.v1.class, R.ID20230104160703.v1.class, R.ID20230105110903.class, R.ID20230105161503.v1.class}, apiClass = {aftersalesmag.class, aftersalesmagItems.class, cashbill.class})
|
|
|
+ @CACHEING_CLEAN(apiversions = {
|
|
|
+ R.ID20230104160603.v1.class,
|
|
|
+ R.ID20230104160703.v1.class,
|
|
|
+ R.ID20230105110903.class,
|
|
|
+ R.ID20230105161503.v1.class}, apiClass = {
|
|
|
+ aftersalesmag.class,
|
|
|
+ aftersalesmagItems.class,
|
|
|
+ cashbill.class})
|
|
|
public String unrecheck() throws YosException {
|
|
|
Long sa_aftersalesmagid = content.getLong("sa_aftersalesmagid");
|
|
|
Long sa_orderid = 0L;
|
|
|
@@ -902,8 +921,8 @@ public class aftersalesmag extends Controller {
|
|
|
// sqlList.add("update sa_orderitems set returnqty=returnqty-" + returnqty + " where sa_orderitemsid=" + row.getString("sa_orderitemsid"));
|
|
|
// }
|
|
|
// }
|
|
|
- JSONObject cashbillPay = Accountbalance.createCashbillPay(this, sys_enterpriseid, rows.get(0).getLong("sa_accountclassid"), cashbillEntity, true);
|
|
|
- sqlList.addAll(cashbillPay.getJSONArray("sqlList").toJavaList(String.class));
|
|
|
+ SQLList cashbillPay = Accountbalance.createCashbillPay(this, sys_enterpriseid, rows.get(0).getLong("sa_accountclassid"), cashbillEntity, true);
|
|
|
+ sqlList.addAll(cashbillPay);
|
|
|
sa_cashbillid = cashbillPay.getLong("sa_cashbillid");
|
|
|
}
|
|
|
}
|
|
|
@@ -930,7 +949,14 @@ public class aftersalesmag extends Controller {
|
|
|
|
|
|
|
|
|
@API(title = "关闭", apiversion = R.ID20230522090403.v1.class)
|
|
|
- @CACHEING_CLEAN(apiversions = {R.ID20230104160603.v1.class, R.ID20230104160703.v1.class, R.ID20230105110903.class, R.ID20230105161503.v1.class}, apiClass = {aftersalesmag.class, aftersalesmagItems.class, cashbill.class})
|
|
|
+ @CACHEING_CLEAN(apiversions = {
|
|
|
+ R.ID20230104160603.v1.class,
|
|
|
+ R.ID20230104160703.v1.class,
|
|
|
+ R.ID20230105110903.class,
|
|
|
+ R.ID20230105161503.v1.class}, apiClass = {
|
|
|
+ aftersalesmag.class,
|
|
|
+ aftersalesmagItems.class,
|
|
|
+ cashbill.class})
|
|
|
public String close() throws YosException {
|
|
|
Long sa_aftersalesmagid = content.getLong("sa_aftersalesmagid");
|
|
|
Long sa_orderid = 0L;
|
|
|
@@ -1036,7 +1062,14 @@ public class aftersalesmag extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "反复核", apiversion = R.ID20230104161003.v1.class)
|
|
|
- @CACHEING_CLEAN(apiversions = {R.ID20230104160603.v1.class, R.ID20230104160703.v1.class, R.ID20230105110903.class, R.ID20230105161503.v1.class}, apiClass = {aftersalesmag.class, aftersalesmagItems.class, cashbill.class})
|
|
|
+ @CACHEING_CLEAN(apiversions = {
|
|
|
+ R.ID20230104160603.v1.class,
|
|
|
+ R.ID20230104160703.v1.class,
|
|
|
+ R.ID20230105110903.class,
|
|
|
+ R.ID20230105161503.v1.class}, apiClass = {
|
|
|
+ aftersalesmag.class,
|
|
|
+ aftersalesmagItems.class,
|
|
|
+ cashbill.class})
|
|
|
public String uncheck() throws YosException {
|
|
|
Long sa_aftersalesmagid = content.getLong("sa_aftersalesmagid");
|
|
|
Long sa_orderid = 0L;
|
|
|
@@ -1083,8 +1116,8 @@ public class aftersalesmag extends Controller {
|
|
|
cashbillEntity.setRemarks("退货单号:" + rows.get(0).getString("billno") + ";订单号:" + rows.get(0).getString("sonum"));
|
|
|
cashbillEntity.setSource("退货单反复核");
|
|
|
|
|
|
- JSONObject cashbillPay = Accountbalance.createCashbillPay(this, sys_enterpriseid, rows.get(0).getLong("sa_accountclassid"), cashbillEntity, true);
|
|
|
- sqlList.addAll(cashbillPay.getJSONArray("sqlList").toJavaList(String.class));
|
|
|
+ SQLList cashbillPay = Accountbalance.createCashbillPay(this, sys_enterpriseid, rows.get(0).getLong("sa_accountclassid"), cashbillEntity, true);
|
|
|
+ sqlList.addAll(cashbillPay);
|
|
|
sa_cashbillid = cashbillPay.getLong("sa_cashbillid");
|
|
|
}
|
|
|
}
|