1234567891011121314151617181920212223242526272829303132333435363738394041 |
- 'use strict';
- const Controller = require('../extend/baseController');
- class OverRangeController extends Controller {
- tag() {
- return this.ctx.service.overRangeService;
- }
- async add() {
- const { ctx, service } = this;
- const query = ctx.request.body;
- const { infoId } = query;
- delete query.infoId;
- if (infoId) {
- const user = ctx.user;
- query.userid = user._id;
- const oneInfo = await this.ctx.service.infoService.one(infoId);
- // 添加记录
- query.fid = oneInfo.fid;
- query.infoId = infoId;
- query.oldInfo = oneInfo.name;
- query.oldLocation = oneInfo.photoAndLocation;
- query.dept1 = oneInfo.dept1;
- query.dept2 = oneInfo.dept2;
- query.dept3 = oneInfo.dept3;
- query.dept4 = oneInfo.dept4;
- query.dept5 = oneInfo.dept5;
- const result = await service.overRangeService.add(query);
- ctx.logger.error('超范围添加探访记录', infoId);
- ctx.success(result);
- } else {
- ctx.error('infoId is null');
- }
- }
- }
- module.exports = OverRangeController;
|