尝试构建一个预约提醒管理系统:
目标:
- 能通过开放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