|
|
@@ -224,4 +224,74 @@ public class serviceorder extends Controller {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+ @API(title = "拒绝受理", apiversion = R.ID2025072409011703.v1.class)
|
|
|
+ @CACHEING_CLEAN(apiversions = {serviceorder.class, restcontroller.webmanage.sale.serviceorder.serviceorder.class})
|
|
|
+ public String refuse() throws YosException {
|
|
|
+ Long sa_serviceorderid = content.getLong("sa_serviceorderid");
|
|
|
+ Rows rows = dbConnect
|
|
|
+ .runSqlQuery("select sa_serviceorderid,status,billno,sys_enterpriseid,province,city,county from sa_serviceorder where sa_serviceorderid ='"
|
|
|
+ + sa_serviceorderid + "' and siteid='" + siteid + "'");
|
|
|
+ for (Row row : rows) {
|
|
|
+ if (!row.getString("status").equals("待受理")) {
|
|
|
+ return getErrReturnObject().setErrMsg("单号为:【" + row.getString("billno") + "】的服务申请单为非待受理状态,无法拒绝受理")
|
|
|
+ .toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ArrayList<String> sqlList = new ArrayList<>();
|
|
|
+
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
+ updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setValue("status", "拒绝受理");
|
|
|
+ updateSQL.setValue("changeby", username);
|
|
|
+ updateSQL.setDateValue("changedate");
|
|
|
+ sqlList.add(updateSQL.getSQL());
|
|
|
+ sqlList.add(
|
|
|
+ DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "拒绝受理", "服务申请单拒绝受理成功").getSQL());
|
|
|
+
|
|
|
+
|
|
|
+ dbConnect.runSqlUpdate(sqlList);
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @API(title = "完结服务单", apiversion = R.ID2025072409161803.v1.class)
|
|
|
+ @CACHEING_CLEAN(apiversions = {serviceorder.class, restcontroller.webmanage.sale.serviceorder.serviceorder.class})
|
|
|
+ public String wanjie() throws YosException {
|
|
|
+ Long sa_serviceorderid = content.getLong("sa_serviceorderid");
|
|
|
+ Rows rows = dbConnect
|
|
|
+ .runSqlQuery("select sa_serviceorderid,status,billno,sys_enterpriseid,province,city,county from sa_serviceorder where sa_serviceorderid ='"
|
|
|
+ + sa_serviceorderid + "' and siteid='" + siteid + "'");
|
|
|
+ for (Row row : rows) {
|
|
|
+ if (!row.getString("status").equals("待分配") && !row.getString("status").equals("拒绝受理")) {
|
|
|
+ return getErrReturnObject().setErrMsg("单号为:【" + row.getString("billno") + "】的服务申请单为非待受理状态,无法拒绝受理")
|
|
|
+ .toString();
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(content.getString("backreason"))) {
|
|
|
+ return getErrReturnObject().setErrMsg("完结原因(拒绝原因)为空不可完结").toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ArrayList<String> sqlList = new ArrayList<>();
|
|
|
+
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
+ updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setValue("status", "已完结");
|
|
|
+ updateSQL.setValue("changeby", username);
|
|
|
+ updateSQL.setDateValue("changedate");
|
|
|
+ sqlList.add(updateSQL.getSQL());
|
|
|
+ sqlList.add(
|
|
|
+ DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "完结", "服务申请单完结成功").getSQL());
|
|
|
+
|
|
|
+ // 退回原因
|
|
|
+ ArrayList<Long> sa_serviceorderids = new ArrayList<>();
|
|
|
+ sa_serviceorderids.add(sa_serviceorderid);
|
|
|
+ DataExtend.createBackReasonSql(this, "sa_serviceorder", sa_serviceorderids,
|
|
|
+ content.getStringValue("backreason"));
|
|
|
+
|
|
|
+ dbConnect.runSqlUpdate(sqlList);
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+
|
|
|
}
|