|
|
@@ -14,10 +14,12 @@ import common.YosException;
|
|
|
import common.annotation.API;
|
|
|
import common.annotation.CACHEING;
|
|
|
import common.annotation.CACHEING_CLEAN;
|
|
|
+import common.crm.bean.warrantycard;
|
|
|
import common.data.*;
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.cxf.configuration.security.DNConstraintsType;
|
|
|
+import org.glassfish.grizzly.utils.StringFilter;
|
|
|
import restcontroller.R;
|
|
|
import restcontroller.webmanage.executorService.Executor;
|
|
|
import restcontroller.webmanage.sale.serviceorder.tools.HttpURLRest;
|
|
|
@@ -69,6 +71,8 @@ public class serviceorder extends Controller {
|
|
|
String enddate = content.getStringValue("enddate");
|
|
|
long saler_hrid = content.getLongValue("saler_hrid");
|
|
|
boolean isonlinesales = content.getBooleanValue("isonlinesales");
|
|
|
+ boolean isallowance = content.getBooleanValue("isallowance");
|
|
|
+
|
|
|
long sys_enterpriseid_service = content.getLongValue("sys_enterpriseid_service");
|
|
|
|
|
|
String sku = content.getStringValue("sku");
|
|
|
@@ -87,7 +91,20 @@ public class serviceorder extends Controller {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ String initiator="";
|
|
|
+ Rows userrows = dbConnect.runSqlQuery("select t2.usertype,t1.phonenumber from sys_users t1 inner join sys_usersite t2 on t1.userid = t2.userid where t2.siteid = '" + siteid + "' and t1.userid=" + userid);
|
|
|
+ long usertype = 0;
|
|
|
|
|
|
+ if (userrows.isNotEmpty()) {
|
|
|
+ usertype = userrows.get(0).getLong("usertype");
|
|
|
+ }
|
|
|
+ if(usertype==99){
|
|
|
+ initiator="消费者";
|
|
|
+ }else if(usertype==21 || usertype==22){
|
|
|
+ initiator="经销商";
|
|
|
+ }else{
|
|
|
+ initiator="总部";
|
|
|
+ }
|
|
|
if (sa_serviceorderid <= 0 || dbConnect.runSqlQuery(
|
|
|
"select sa_serviceorderid from sa_serviceorder where sa_serviceorderid=" + sa_serviceorderid)
|
|
|
.isEmpty()) {
|
|
|
@@ -152,6 +169,12 @@ public class serviceorder extends Controller {
|
|
|
sqlFactory.addParameter("phonenumber", content.getStringValue("phonenumber"));
|
|
|
sqlFactory.addParameter("sa_customersid", content.getStringValue("sa_customersid"));
|
|
|
sqlFactory.addParameter("isonlinesales",isonlinesales);
|
|
|
+ sqlFactory.addParameter("isallowance",isallowance);
|
|
|
+
|
|
|
+ sqlFactory.addParameter("initiator",initiator);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
sqlFactory.addParameter("sys_enterpriseid_service",sys_enterpriseid_service);
|
|
|
|
|
|
|
|
|
@@ -176,6 +199,15 @@ public class serviceorder extends Controller {
|
|
|
return queryserviceorderMain();
|
|
|
}
|
|
|
|
|
|
+ @API(title = "更新是否补贴", apiversion = R.ID2025121517474303.v1.class)
|
|
|
+ public String cheangeisallowance() throws YosException {
|
|
|
+ Long sa_serviceorderid = content.getLong("sa_serviceorderid");
|
|
|
+ boolean isallowance = content.getBooleanValue("isallowance");
|
|
|
+ dbConnect.runSqlUpdate("update sa_serviceorder set isallowance="+isallowance+" where sa_serviceorderid="+sa_serviceorderid);
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 服务分类查询
|
|
|
**/
|
|
|
@@ -542,8 +574,12 @@ public class serviceorder extends Controller {
|
|
|
querySQL.setTableAlias("t0");
|
|
|
querySQL.addJoinTable(JOINTYPE.right, sqlFactory, "t1", "t0.siteid='111'", "*");
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
+
|
|
|
Rows rows = querySQL.query();
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
ArrayList<Long> ids = rows.toArrayList("sa_serviceorderid", new ArrayList<>());
|
|
|
HashMap<Long, ArrayList<String>> tagRows = DataTag.queryTag(this, "sa_serviceorder", ids, true);
|
|
|
for (Row row : rows) {
|
|
|
@@ -819,6 +855,39 @@ public class serviceorder extends Controller {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @API(title = "作废服务申请单", apiversion = R.ID2025121519311203.v1.class)
|
|
|
+ @CACHEING_CLEAN(apiClass = {workorder.class, serviceorder.class, warrantycard.class})
|
|
|
+ public String cancelServiceOrder() throws YosException {
|
|
|
+ long sa_serviceorderid = content.getLong("sa_serviceorderid");
|
|
|
+ String voidreason =content.getStringValue("voidreason");
|
|
|
+ ArrayList<String> sqllist = new ArrayList<>();
|
|
|
+ Rows workorderrows = dbConnect.runSqlQuery("select sa_workorderid from sa_workorder where sa_serviceorderid ='"
|
|
|
+ + sa_serviceorderid + "' and siteid='" + siteid + "' and status!='作废'");
|
|
|
+ sqllist.add("update sa_serviceorder set voidreason='"+voidreason+"',status='作废' where sa_serviceorderid="+sa_serviceorderid);
|
|
|
+ sqllist.add(DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "作废", "服务申请单作废成功")
|
|
|
+ .getSQL());
|
|
|
+ if(workorderrows.isNotEmpty()){
|
|
|
+ long sa_workorderid= workorderrows.get(0).getLong("sa_workorderid");
|
|
|
+ voidreason="【服务申请单作废】"+voidreason;
|
|
|
+ sqllist.add("update sa_workorder set voidreason='"+voidreason+"',status='作废' where sa_workorderid="+sa_workorderid);
|
|
|
+ sqllist.add(DataContrlLog.createLog(this, "sa_workorder", sa_serviceorderid, "作废", "工单作废成功")
|
|
|
+ .getSQL());
|
|
|
+ Rows warrantycardrows = dbConnect.runSqlQuery("select sa_warrantycardid from sa_warrantycard where sa_workorderid ='"
|
|
|
+ + sa_workorderid + "' and siteid='" + siteid + "' and isvoid=0");
|
|
|
+ if(warrantycardrows.isNotEmpty()){
|
|
|
+ sqllist.add("update sa_warrantycard set voiddate=CURRENT_TIME,voidreason='"+voidreason+"',isvoid=1 where sa_warrantycardid="+warrantycardrows.get(0).getLong("sa_warrantycardid"));
|
|
|
+ sqllist.add(DataContrlLog.createLog(this, "sa_warrantycard", warrantycardrows.get(0).getLong("sa_warrantycardid"), "作废", "保修卡作废成功")
|
|
|
+ .getSQL());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ dbConnect.runSqlUpdate(sqllist);
|
|
|
+
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@API(title = "发送手机验证码", apiversion = R.ID20230215173103.v1.class, accesstoken = false)
|
|
|
public String sendMessage() throws YosException {
|
|
|
String customerphone = "";
|