Commit 43149cf1 authored by lings's avatar lings

浙里办

parent ecbfe5ad
......@@ -59,14 +59,13 @@ public class AppointmentOrderController {
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "appointmentIdCard", value = "预约人身份证", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "appointmentPhone", value = "预约人电话", paramType = "query", dataType="String")
@ApiImplicitParam(name = "flag", value = "预约或取号,预约传Y,取号传Q", paramType = "query", dataType="String")
})
public Result<PageData<AppointmentOrderDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<AppointmentOrderDTO> page = appointmentOrderService.page(params);
page.getList().forEach(l->{
//判断已取号或者消除过号
if(null!=l.getStatus() &&(2==l.getStatus() ||4==l.getStatus()) ){
if(null!=l.getStatus() && 3<=l.getStatus()){
YynumberDTO yynumberDTO = appointmentOrderService.findByYuNumber(l.getAppointmentNum());
l.setYynumberDTO(yynumberDTO);
}
......@@ -79,7 +78,7 @@ public class AppointmentOrderController {
@ApiOperation("信息,预约详情接口")
public Result<AppointmentOrderDTO> get(@PathVariable("id") Long id){
AppointmentOrderDTO data = appointmentOrderService.get(id);
if(null!=data.getStatus() &&(2==data.getStatus() ||4==data.getStatus()) ) {
if(null!=data.getStatus() && 3<=data.getStatus() ) {
data.setYynumberDTO(appointmentOrderService.findByYuNumber(data.getAppointmentNum()));
}
return new Result<AppointmentOrderDTO>().ok(data);
......@@ -133,7 +132,7 @@ public class AppointmentOrderController {
appointmentOrderEntity.setServiceWindow(String.join(",", dto.getListWin()));
appointmentOrderEntity.setTicketDate(dto.getTicketDate());
//取号机生成取号码则设置取号预约状态为:完成
appointmentOrderEntity.setStatus(2);
appointmentOrderEntity.setStatus(3);
appointmentOrderEntity.setStatusName("已完成");
appointmentOrderService.updateById(appointmentOrderEntity);
......@@ -146,7 +145,7 @@ public class AppointmentOrderController {
public Result cancelReservation(@PathVariable("id") Long id){
AppointmentOrderDTO data = appointmentOrderService.get(id);
data.setStatus(3);
data.setStatus(2);
data.setServiceName("已取消");
data.setUpdateDate(new Date());
appointmentOrderService.update(data);
......@@ -178,27 +177,31 @@ public class AppointmentOrderController {
String appointmentPhone = appointmentOrderDTO.getAppointmentPhone();
String serviceId = appointmentOrderDTO.getServiceId().toString();
String appointmentPerson = appointmentOrderDTO.getAppointmentPerson();
String sign = "hjfhsdjfueytRwYSdsa%hdf^jdshfh*KGh$e"+serviceId+new Date().getTime();
String nowtime = String.valueOf(new Date().getTime()/1000);
String sign = "hjfhsdjfueytRwYSdsa%hdf^jdshfh*KGh$e"+serviceId+nowtime;
//判断签到时间是否在预约时间前
//调用取号机取号接口,获取取号信息,并更新预约号。
// http://IP:8223/smartqueue/yynumber?sQueueInfoID=24&time=1613389800&sign=ee2c3fc1bdabf439f00aa90af6a0a68f&sTel=13988888888&sName=王小二&sCardID=333111123456
String url = "http://IP:8223/smartqueue/yynumber?" +
String url = "http://192.168.1.97:8223/smartqueue/yynumber?" +
"sQueueInfoID=" +serviceId+
"&time="+ new Date().getTime()+
"&time="+ nowtime +
"&sign="+ MD5.md5(sign)+
"&sTel="+ appointmentPhone+
"&sName="+appointmentPerson+
"&sCardID="+appointmentIdCard;
String s = HttpRequestUtil.sendGetAndRetrieveContent(url);
// String s = HttpRequestUtil.sendGetAndRetrieveContent(url);
String s = "{\"nStatus\":0,\"sMsg\":\"\",\"sPaperNumber\":\"Z1001\",\"nWait\":1,\"nid\":4322,\"sRegTime\":\"2018-12-21 13:49:21\",\"sQueueName\":\"预约-交通违法处理\",\"listWin\":[\"B03\",\"B04\",\"B05\",\"B06\"]}\n" +
"{\"nStatus\":0,\"sMsg\":\"成功\",\"nWait\":9,\"sCallTime\":\"\",\"sRegTime\":\"2018-12-21 13:49:21\",\"sQueueName\":\"交通违法处理\",\"listWin\":[\"B03\",\"B04\",\"B05\",\"B06\"]}\n";
YynumberDTO yynumberDTO = JSONObject.parseObject(s,YynumberDTO.class);
//根据接口返回的结果更新预约单号
if("0".equals(yynumberDTO.getNStatus())){
if(0 == yynumberDTO.getNStatus()){
appointmentOrderDTO.setAppointmentNum(yynumberDTO.getSPaperNumber());
appointmentOrderDTO.setTicketDate(yynumberDTO.getSRegTime());
appointmentOrderDTO.setWaitNum(yynumberDTO.getNWait());
appointmentOrderDTO.setServiceWindow(yynumberDTO.getListWin().toString());
appointmentOrderDTO.setStatus(2);
appointmentOrderDTO.setServiceWindow(String.join(",",yynumberDTO.getListWin()));
appointmentOrderDTO.setStatus(3);
appointmentOrderDTO.setStatusName("签到");
appointmentOrderDTO.setUpdateDate(new Date());
appointmentOrderService.update(appointmentOrderDTO);
......
......@@ -56,9 +56,13 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
@Override
public QueryWrapper<AppointmentOrderEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
String flag = (String)params.get("flag");
QueryWrapper<AppointmentOrderEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
wrapper.le(StringUtils.isNotBlank(flag) && "Y".equals(flag), "status", 2);
wrapper.ge(StringUtils.isNotBlank(flag) && "Q".equals(flag), "status", 3);
return wrapper;
}
......@@ -148,7 +152,7 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
public YynumberDTO findByYuNumber(String sPaperNumber) {
//调用取号机接口,。
// String url = "http://IP:8223/smartqueue/getpaperwait?sPaperNumber=" +sPaperNumber;
String url = "http://IP:8223/smartqueue/getpaperwait?sPaperNumber=" +sPaperNumber;
// String url = "http://192.168.1.97:8223/smartqueue/getpaperwait?sPaperNumber=" +sPaperNumber;
// String s = HttpRequestUtil.sendGetAndRetrieveContent(url);
String s = "{\"nStatus\":1,\"sMsg\":\"号码已被呼叫\",\"nWait\":0,\"sCallTime\":\"2021-03-08 16:27:09\",\"sRegTime\":\"2021-03-08 16:26:55\",\"sQueueName\":\"不动产档案查询\",\"listWin\":[\"38号窗口\",\"39号窗口\",\"40号窗口\",\"41号窗口\",\"42号窗口\",\"43号窗口\"]}";
YynumberDTO yynumberDTO = JSONObject.parseObject(s,YynumberDTO.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment