|
|
|
@@ -37,6 +37,7 @@ import com.xueyi.system.staff.mapper.DmVisitorSmsConfigMapper; |
|
|
|
import com.xueyi.system.staff.mapper.DmVisitorsMapper; |
|
|
|
import com.xueyi.system.staff.service.impl.DmVisitRecordsServiceImpl; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping; |
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
@@ -200,6 +201,23 @@ public class DmVisitorInnerApiController extends BaseApiController { |
|
|
|
return outputSuccess().toJSON(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@InnerAuth |
|
|
|
@DeleteMapping(value = "del-visitor") |
|
|
|
public com.alibaba.fastjson2.JSONObject delVisit(@RequestBody DmVisitCommonDto commonDto){ |
|
|
|
if (null != commonDto && null != commonDto.getRecordId()){ |
|
|
|
DmVisitRecordsDto recordsDto = visitRecordsService.selectById(commonDto.getRecordId()); |
|
|
|
if (null!= recordsDto){ |
|
|
|
visitRecordsService.deleteById(commonDto.getRecordId()); |
|
|
|
return outputSuccess("邀约记录删除成功").toJSON(); |
|
|
|
} else { |
|
|
|
return output(ResponseCode.DATA_NOT_EXISTS, "邀约记录").toJSON(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
return output(ResponseCode.ILLEGAL_PARAMETER, "recordId").toJSON(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@InnerAuth |
|
|
|
@GetMapping(value = "sms-config") |
|
|
|
public com.alibaba.fastjson2.JSONObject smsConfig(){ |
|
|
|
@@ -249,26 +267,27 @@ public class DmVisitorInnerApiController extends BaseApiController { |
|
|
|
@GetMapping(value = "list-all") |
|
|
|
public com.alibaba.fastjson2.JSONObject visitListAll(){ |
|
|
|
List<DmVisitRecordsPo> v = dmVisitRecordsMapper.findList(); |
|
|
|
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
List<DmVisitRecordsDto> dtos = new ArrayList<>(); |
|
|
|
|
|
|
|
v.forEach(item->{ |
|
|
|
DmStaffPo e = dmStaffMapper.selectById(item.getUserId()); |
|
|
|
DmVisitRecordsDto d = recordsConverter.mapperDto(item); |
|
|
|
if (null != e) { |
|
|
|
d.setUserPhone(e.getPhone()); |
|
|
|
d.setUserName(e.getUserName()); |
|
|
|
} |
|
|
|
if (null != item && null!=item.getUserId()) { |
|
|
|
DmStaffPo e = dmStaffMapper.selectById(item.getUserId()); |
|
|
|
DmVisitRecordsDto d = recordsConverter.mapperDto(item); |
|
|
|
if (null != e) { |
|
|
|
d.setUserPhone(e.getPhone()); |
|
|
|
d.setUserName(e.getUserName()); |
|
|
|
} |
|
|
|
|
|
|
|
DmVisitorsPo visitorsPo = dmVisitorsMapper.selectById(item.getVisitorId()); |
|
|
|
if (null != visitorsPo) { |
|
|
|
d.setVisitorName(visitorsPo.getName()); |
|
|
|
} |
|
|
|
if (null != item.getVisitDate()) { |
|
|
|
d.setVisitDateStr(DateUtils.formatDate(item.getVisitDate(), "yyyy-MM-dd")); |
|
|
|
DmVisitorsPo visitorsPo = dmVisitorsMapper.selectById(item.getVisitorId()); |
|
|
|
if (null != visitorsPo) { |
|
|
|
d.setVisitorName(visitorsPo.getName()); |
|
|
|
} |
|
|
|
if (null != item.getVisitDate()) { |
|
|
|
d.setVisitDateStr(DateUtils.formatDate(item.getVisitDate(), "yyyy-MM-dd")); |
|
|
|
} |
|
|
|
dtos.add(d); |
|
|
|
} |
|
|
|
dtos.add(d); |
|
|
|
}); |
|
|
|
json.put("data", dtos); |
|
|
|
|
|
|
|
|