嘗試構建一個預約提醒管理系統:
目標:
- 能通過開放H5,小程序,公衆號等平臺預約
- 能通過時間線的方式展示當前的預約狀態,對預約狀態一目瞭然
- 能夠智能進行工作的分派
- 可以通過公衆號,短信,郵件,企業微信,釘釘等方式進行實時的工作提醒
技術方面沒有任何問題,現在初步實現
預約詳情時間線:
預約添加簡單頁面:可以進行任意字段方向的擴展
代碼段:
@QClass(name = "預約")
@Entity
@Table(name = "b_appointment")
@Data
@EqualsAndHashCode(callSuper = false)
public class Appointment extends BaseEntity {
@QField(name = "訂單號", as = {A.edit, A.show, A.query}, query = Q.like, nullable = false)
@Column(name = "no", unique = true, columnDefinition = "varchar(100) COMMENT '訂單號'")
private String no;//訂單號
@QField(name = "客戶姓名", as = {A.edit, A.show, A.query}, query = Q.like, nullable = false)
@Column(name = "name", columnDefinition = "varchar(100) COMMENT '客戶姓名'")
private String name;//客戶姓名
@QField(name = "客戶電話", as = {A.edit, A.show, A.query}, query = Q.like)
@Column(name = "phone", columnDefinition = "varchar(100) COMMENT '客戶電話'")
private String phone;//客戶電話
@QField(name = "項目", as = {A.edit, A.show, A.query}, query = Q.like)
@Column(name = "item", columnDefinition = "varchar(100) COMMENT '項目'")
private String item;//項目
@QField(name = "開始時間", type = QType.date, as = {A.edit, A.show}, nullable = false)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Column(name = "start_date", columnDefinition = "datetime COMMENT '開始時間'")
private Date startDate;//開始時間
@QField(name = "結束時間", type = QType.date, as = {A.edit, A.show})
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Column(name = "end_date", columnDefinition = "datetime COMMENT '結束時間'")
private Date endDate;//結束時間
@QField(name = "提醒歷史")
@Column(name = "remind_history", columnDefinition = "varchar(100) COMMENT '提醒歷史'")
private String remindHistory;//提醒歷史(比如90,20,40),每通知一次都會增量保存,下次判斷是否通知的時候會先排序,然後跟設定的提醒天數進行比較,來動態確定下一步是否繼續提醒
@QField(name = "備註", as = {A.edit, A.show})
@Column(name = "bz", columnDefinition = "text COMMENT '備註'")
private String bz;//備註
@Transient
private String startDateStr;
@Transient
private String endDateStr;
public String getStartDateStr() {
if (this.getStartDate() != null) {
return DateUtil.format(this.getStartDate(), "yyyy-MM-dd HH:mm:ss");
}
return startDateStr;
}
public String getEndDateStr() {
if (this.getEndDate() != null) {
return DateUtil.format(this.getEndDate(), "yyyy-MM-dd HH:mm:ss");
}
return endDateStr;
}
}
@Controller
@RequestMapping(value = "/busi/appointment", name = "預約管理")
public class AppointmentController {
private static final Logger logger = Logger.getLogger(Appointment.class);
@Resource
private AppointmentService service;
@RequestMapping(value = "/home")
public String home(Model model) {
model.addAttribute("fieldMap", FieldService.getFieldMap(Appointment.class));
return "busi/appointment/home";
}
@RequestMapping(value = "/scheduler")
public String scheduler(Model model) {
model.addAttribute("fieldMap", FieldService.getFieldMap(Appointment.class));
return "busi/appointment/scheduler";
}
@RequestMapping(value = "/page", name = "分頁查詢")
@ResponseBody
public Object page(HttpServletRequest request, Appointment entity, WorldPage worldPage) throws Exception {
Page<Appointment> page = service.page(entity, worldPage);
return page;
}
@RequestMapping(value = "/list")
@ResponseBody
public Object list(HttpServletRequest request, Appointment entity) throws Exception {
List<Appointment> list = service.list(entity);
return list;
}
@RequestMapping(value = "/save")
@ResponseBody
public Object save(Appointment entity) throws Exception {
Result result = service.saveAppointment(entity);
return result;
}
@RequestMapping(value = "/batchDel", name = "批量刪除")
@ResponseBody
public Object batchDel(String[] ids) {
service.del(ids);
return new Result(true);
}
@RequestMapping(value = "/del", name = "刪除")
@ResponseBody
public Object del(String id) {
service.del(id);
return new Result(true);
}
@RequestMapping(value = "/add", name = "添加")
public String add(Model model) {
model.addAttribute("fieldMap", FieldService.getFieldMap(Appointment.class));
model.addAttribute("page", "add");
return "busi/appointment/edit";
}
@RequestMapping(value = "/edit", name = "編輯")
public String edit(Model model, String id) {
model.addAttribute("fieldMap", FieldService.getFieldMap(Appointment.class));
Appointment object = service.get(id);
model.addAttribute("obj", object);
model.addAttribute("page", "edit");
return "busi/appointment/edit";
}
@RequestMapping(value = "/view", name = "查看")
public String view(Model model, String id) {
model.addAttribute("fieldMap", FieldService.getFieldMap(Appointment.class));
Appointment object = service.get(id);
model.addAttribute("obj", object);
model.addAttribute("page", "view");
return "busi/appointment/view";
}
}
可進行任意方向快速定製開發,聯繫我 QQ 2644328654,
源碼獲取 http://mutou888.com/pay/source.html