| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package restcontroller.webmanage.saletool.appointment;
- import com.alibaba.fastjson.JSONObject;
- import common.Controller;
- import common.YosException;
- import common.annotation.API;
- import common.data.InsertSQL;
- import common.data.Rows;
- import common.data.SQLFactory;
- import io.swagger.annotations.Api;
- import restcontroller.R;
- /**
- * 预约报名
- */
- public class Appointment extends Controller {
- /**
- * 构造函数
- *
- * @param content
- */
- public Appointment(JSONObject content) throws YosException {
- super(content);
- }
- @API(title = "新增预约单", apiversion = R.ID20240513144602.v1.class)
- public String insert() throws YosException {
- String ownertable = content.getStringValue("ownertable");
- String ownerid = content.getStringValue("ownerid");
- Long shareuserid = 0L;
- String sharename = "";
- if (!ownertable.isEmpty()) {
- Rows rows = dbConnect.runSqlQuery("SELECT createuserid,createby from " + ownertable + " WHERE " + ownertable + "id=" + ownerid + " and siteid='" + siteid + "'");
- if (rows.isNotEmpty()) {
- shareuserid = rows.get(0).getLong("createuserid");
- sharename = rows.get(0).getString("createby");
- }
- }
- InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sa_appointment");
- insertSQL.setUniqueid(createTableID("sa_appointment"));
- insertSQL.setSiteid(siteid);
- insertSQL.setValue("name", content.getStringValue("name"));
- insertSQL.setValue("phonenumber", content.getStringValue("phonenumber"));
- insertSQL.setValue("province", content.getStringValue("province"));
- insertSQL.setValue("city", content.getStringValue("city"));
- insertSQL.setValue("county", content.getStringValue("county"));
- insertSQL.setValue("address", content.getStringValue("address"));
- insertSQL.setValue("ownertable", ownertable);
- insertSQL.setValue("ownerid", ownerid);
- insertSQL.setValue("type", content.getStringValue("type"));
- insertSQL.setValue("shareuserid", shareuserid);
- insertSQL.setValue("sharename", sharename);
- insertSQL.insert();
- return getSucReturnObject().toString();
- }
- }
|