Commit 72c6da3f authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents b0fa7252 028824c4
......@@ -118,18 +118,18 @@ export default {
desc: '根据部门/个人承担的目标和任务完成情况以及工作<br>评价结果、加减分纪实现考核结果自动生成。',
navList: []
},
{
icon: require('@/assets/images/u167.png'),
barName: 'OA审批',
desc: '无纸化审批流程,轻松完成打卡请假、移动审批等<br>操作,审批资料查找方便',
navList: []
},
{
icon: require('@/assets/images/u172.png'),
barName: '数据分析',
desc: '完整团队经营状态的数字化,人财物事数据分析<br>展示,为管理提供智能决策依据',
navList: []
},
// {
// icon: require('@/assets/images/u167.png'),
// barName: 'OA审批',
// desc: '无纸化审批流程,轻松完成打卡请假、移动审批等<br>操作,审批资料查找方便',
// navList: []
// },
// {
// icon: require('@/assets/images/u172.png'),
// barName: '数据分析',
// desc: '完整团队经营状态的数字化,人财物事数据分析<br>展示,为管理提供智能决策依据',
// navList: []
// },
{
icon: require('@/assets/images/u177.png'),
barName: '系统设置',
......
<template>
<div class="page">
<LayoutTable :data="tableData" noDel :config="tableConfig">
<LayoutTable :data="tableData" notDel :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
......@@ -87,28 +87,28 @@ export default {
{ label: "反馈人数", prop: "feedbackNum", formatter: this.formatter },
{ label: "创建用户", prop: "createUserId", formatter: this.formatter },
{
label: "绩效反馈问题",
width: 120,
prop: "subColumns",
formatter: (row) => {
let widthsize = this.columnSet.reduce((pre, cur) => {
return pre + Number(cur.width);
}, 50);
return (
<el-popover placement="right" width={widthsize} trigger="click">
{this.renderTable(row.feedbackQuestionList)}
<el-button type="text" slot="reference">详细</el-button>
</el-popover>
);
},
},
// {
// label: "绩效反馈问题",
// width: 120,
// prop: "subColumns",
// formatter: (row) => {
// let widthsize = this.columnSet.reduce((pre, cur) => {
// return pre + Number(cur.width);
// }, 50);
// return (
// <el-popover placement="right" width={widthsize} trigger="click">
// {this.renderTable(row.feedbackQuestionList)}
// <el-button type="text" slot="reference">详细</el-button>
// </el-popover>
// );
// },
// },
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
<table-buttons noAdd noEdit row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
......
......@@ -188,97 +188,6 @@ export default {
mounted() {
let id = localStorage.getItem('checkFeedbackId')
this.getInfo(id)
// this.Frule = [
// {
// "type": "span",
// "title": "问卷名称",
// "native": false,
// "children": [
// "这是一段文字"
// ],
// "_fc_drag_tag": "span",
// "hidden": false,
// "display": true
// },
// {
// "type": "input",
// "field": "Fupb1nuyh5txf1",
// "title": "输入框",
// "info": "",
// "$required": false,
// "_fc_drag_tag": "input",
// "hidden": false,
// "display": true
// },
// {
// "type": "inputNumber",
// "field": "Flo91nuyh5vjag",
// "title": "计数器",
// "info": "",
// "$required": false,
// "_fc_drag_tag": "inputNumber",
// "hidden": false,
// "display": true
// },
// {
// "type": "radio",
// "field": "Fz3d1nuyh5xpor",
// "title": "单选框",
// "info": "",
// "effect": {
// "fetch": ""
// },
// "$required": false,
// "options": [
// {
// "value": "1",
// "label": "选项1"
// },
// {
// "value": "2",
// "label": "选项2"
// }
// ],
// "_fc_drag_tag": "radio",
// "hidden": false,
// "display": true
// },
// {
// "type": "checkbox",
// "field": "Fwzb1nuyh61906",
// "title": "多选框",
// "info": "",
// "effect": {
// "fetch": ""
// },
// "$required": false,
// "options": [
// {
// "value": "1",
// "label": "选项1"
// },
// {
// "value": "2",
// "label": "选项2"
// }
// ],
// "_fc_drag_tag": "checkbox",
// "hidden": false,
// "display": true
// }
// ]
// this.Fopthion = {
// "form": {
// "labelPosition": "top",
// "size": "mini",
// "labelWidth": "20%",
// "hideRequiredAsterisk": false,
// "showMessage": true,
// "inlineMessage": false
// },
// "submitBtn": true,
// "resetBtn": false
// }
},
methods: {
......@@ -295,6 +204,9 @@ export default {
this.Frule = formCreate.parseJson(this.feedbackData.formContent)
this.Fopthion = formCreate.parseJson(this.feedbackData.ruleContent)
})
this.$get('/feedback/getOptionSummaryList', { feedbackId: id }).then(res => {
console.log(res)
})
}
}
}
......
......@@ -21,8 +21,6 @@ public abstract class BaseReq implements Serializable {
/**
* 工号
*/
......
package com.mortals.xhx.busiz.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.xhx.busiz.BaseReq;
import lombok.Data;
import java.util.Date;
@Data
public class InspectSaveReq extends BaseReq {
//考勤
/**
* 所属考勤组ID
*/
private Long attendanceGroupId;
/**
* 所属考勤组名称
*/
private String attendanceGroupName;
/**
* 考勤时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date attendanceDate;
/**
* 异常时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date errorTime;
/**
* 上下班时间
*/
private String goOffTimeStr;
/**
* 实际打卡时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date actualAttendTime;
/**
* 异常处理结果
*/
private String errorResult;
//评价
/**
* 评价结果(1.非常不满意,2.差评)
*/
private Integer reviewResult;
/**
* 评价时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date reviewTime;
/**
* 评价来源(窗口评价系统,导视系统,自助服务系统,微官网,其它)
*/
private String reviewSource;
/**
* 评价设备
*/
private String reviewDevice;
//投诉
/**
* 投诉标题
*/
private String complainTitle;
/**
* 投诉内容
*/
private String complainContent;
/**
* 投诉人真实姓名
*/
private String complainRealName;
/**
* 联系电话
*/
private String contact;
/**
* 投诉时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date complainTime;
/**
* 投诉来源
*/
private String complainSource;
/**
* 投诉设备
*/
private String complainDevice;
//办件
/**
* 办件编码
*/
private String goworkCode;
/**
* 办件所属部门
*/
private String goworkDepts;
/**
* 事项名称
*/
private String matterlName;
/**
* 办理时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date goworkTime;
//效能
/**
* 违规类型(1.脱岗,2.离岗,3.玩手机,4.睡觉)
*/
private Integer irregularType;
/**
* 发生时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date happenTime;
/**
* 持续时间,秒
*/
private Integer duration;
/**
* 报警时间
*/
private Date alarmTime;
//其它
/**
* 违规类型(1.工作纪律)
*/
private Integer irregularOtherType;
// /**
// * 发生时间
// */
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
// private Date happenTime;
/**
* 评分标准
*/
private String ruleDesc;
}
......@@ -19,5 +19,9 @@ public class PerformReq extends BaseReq {
private Long id;
private Integer processStatus;
private Integer scoreType;
}
package com.mortals.xhx.busiz.rsp;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class InspectStatInfo {
/**
* 累计次数
*/
private Integer totalTimes;
/**
* 今日次数
*/
private Integer todayTimes;
}
......@@ -31,7 +31,7 @@ import java.util.Date;
@RestController
@Slf4j
@RequestMapping("/api/v1/web/")
public class ApiWebPerformController extends AbstractBaseController<PerformReq> {
public class ApiWebPerformController extends AbstractBaseController<PerformReq> {
@Autowired
private PerformAttendRecordService attendRecordService;
......
......@@ -130,6 +130,8 @@ public class AppealApiController extends AbstractBaseController<PerformReq> {
model.put(PAGEINFO_KEY, result.getPageInfo());
parsePageInfo(model, result.getPageInfo());
rest.setData(model);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
......
......@@ -105,6 +105,8 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> {
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
rest.setData(model);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
......
package com.mortals.xhx.busiz.web;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.busiz.req.*;
import com.mortals.xhx.busiz.rsp.AppealStatInfo;
import com.mortals.xhx.busiz.rsp.InspectStatInfo;
import com.mortals.xhx.busiz.rsp.PerformInfo;
import com.mortals.xhx.busiz.rsp.PerformStatInfo;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.ProcessStatusEnum;
import com.mortals.xhx.common.code.SubAddTypeEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.*;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.perform.model.*;
import com.mortals.xhx.module.perform.service.*;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT;
/**
* h5 巡查
*
* @author: zxfei
* @date: 2023/7/7 15:08
*/
@RestController
@Slf4j
@RequestMapping("/api/v1/inspect")
public class InspectApiController extends AbstractBaseController<PerformReq> {
@Autowired
private PerformAttendRecordService attendRecordService;
@Autowired
private PerformReviewRecordService reviewRecordService;
@Autowired
private PerformComplainRecordService complainRecordService;
@Autowired
private PerformGoworkRecordService performGoworkRecordService;
@Autowired
private PerformEffectRecordService effectRecordService;
@Autowired
private PerformOtherRecordService otherRecordService;
@Autowired
private PerformRulesService rulesService;
@Autowired
private StaffService staffService;
@Autowired
private CheckAllRecordService checkAllRecordService;
/**
* 个人巡查效统计
*/
@PostMapping(value = "stat")
public Rest<InspectStatInfo> inspectStat() {
String busiDesc = "H5 个人巡查统计";
Rest<InspectStatInfo> rest = Rest.ok(busiDesc + " 【成功】");
Context context = this.getContext();
if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) {
throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT);
}
log.info("【{}】【请求体】--> 用户:{}", busiDesc, context.getUser().getRealName());
try {
//todo
InspectStatInfo performStatInfo = new InspectStatInfo();
performStatInfo.setTotalTimes(12);
performStatInfo.setTodayTimes(4);
rest.setData(performStatInfo);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
/**
* 个人巡查列表
*/
@PostMapping(value = "list")
public Rest<Object> performList(@RequestBody PerformReq performReq) {
String busiDesc = "个人巡查列表";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(performReq));
Rest<Object> rest = Rest.ok();
Map<String, Object> model = new HashMap<>();
Context context = this.getContext();
if (ObjectUtils.isEmpty(context) || ObjectUtils.isEmpty(context.getUser())) {
throw new AppException(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT);
}
try {
if (ObjectUtils.isEmpty(performReq.getPerformStartDate())) {
//未设置时间的情况,默认为当月
performReq.setPerformStartDate(DateUtil.beginOfMonth(new Date()).toDateStr());
performReq.setPerformEndDate(DateUtil.today());
} else {
performReq.setPerformStartDate(DateUtil.beginOfMonth(DateUtil.parse(performReq.getPerformStartDate()).toJdkDate()).toDateStr());
performReq.setPerformEndDate(DateUtil.endOfMonth(DateUtil.parse(performReq.getPerformStartDate()).toJdkDate()).toDateStr());
}
CheckAllRecordQuery query = new CheckAllRecordQuery();
query.setCheckTimeStart(performReq.getPerformStartDate());
query.setCheckTimeEnd(performReq.getPerformEndDate());
query.setCreateUserId(context.getUser().getId());
if (PerformTypeEnum.全部.getValue().equals(performReq.getPerformType())) {
List<CheckAllRecordVo> allCheckRecord = checkAllRecordService.getAllCheckRecord(query);
List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
PageInfo pageAllInfo = new PageInfo();
pageAllInfo.setTotalResult(collect.size());
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
}
if(!ObjectUtils.isEmpty(performReq.getProcessStatus())){
query.setCheckStatus(performReq.getProcessStatus());
List<CheckAllRecordVo> allCheckRecord = checkAllRecordService.getAllCheckRecord(query);
List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
PageInfo pageAllInfo = new PageInfo();
pageAllInfo.setTotalResult(collect.size());
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
}
if(!ObjectUtils.isEmpty(performReq.getScoreType())){
query.setSubMethod(performReq.getScoreType());
List<CheckAllRecordVo> allCheckRecord = checkAllRecordService.getAllCheckRecord(query);
List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
PageInfo pageAllInfo = new PageInfo();
pageAllInfo.setTotalResult(collect.size());
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
}
// model.put(KEY_RESULT_DATA, result.getList());
// model.put(PAGEINFO_KEY, result.getPageInfo());
// parsePageInfo(model, result.getPageInfo());
rest.setData(model);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
/**
* 巡查新增
*/
@PostMapping(value = "save")
public Rest<PerformAttendAppealEntity> appealSave(@RequestBody InspectSaveReq req) {
String busiDesc = "个人巡查记录新增";
log.info("【{}】【请求体】--> {}", busiDesc, JSONObject.toJSONString(req));
Rest<PerformAttendAppealEntity> rest = Rest.ok(busiDesc + " 【成功】");
Context context = this.getContext();
try {
//根据状态 查询 当前是否已经存在正在进行的申诉
if (ObjectUtils.isEmpty(req.getPerformType())) throw new AppException("绩效类型不能为空!");
if (PerformTypeEnum.考勤绩效.getValue().equals(req.getPerformType())) {
boolean bool = attend(req);
if (!bool) throw new AppException(busiDesc + "失败!");
} else if (PerformTypeEnum.评价差评绩效.getValue().equals(req.getPerformType())) {
boolean bool = review(req);
if (!bool) throw new AppException(busiDesc + "失败!");
} else if (PerformTypeEnum.评价投诉绩效.getValue().equals(req.getPerformType())) {
boolean bool = complain(req);
if (!bool) throw new AppException(busiDesc + "失败!");
} else if (PerformTypeEnum.办件绩效.getValue().equals(req.getPerformType())) {
boolean bool = gowork(req);
if (!bool) throw new AppException(busiDesc + "失败!");
} else if (PerformTypeEnum.效能绩效.getValue().equals(req.getPerformType())) {
boolean bool = effect(req);
if (!bool) throw new AppException(busiDesc + "失败!");
} else if (PerformTypeEnum.其它绩效.getValue().equals(req.getPerformType())) {
boolean bool = other(req);
if (!bool) throw new AppException(busiDesc + "失败!");
} else {
throw new AppException("不支持当前绩效类型");
}
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
log.info("【{}】【响应体】--> {}", busiDesc, JSONObject.toJSONString(req));
return rest;
}
private boolean attend(InspectSaveReq req) throws AppException {
//考勤保存
//通过手机号码查询员工属性
PerformRulesEntity rule = getRule(req.getRuleCode());
StaffEntity staffEntity = getStaff(req.getPhone());
PerformAttendRecordEntity recordEntity = new PerformAttendRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
recordEntity.setRuleNme(rule.getName());
recordEntity.setCategoryId(rule.getCategoryId());
recordEntity.setCategoryName(rule.getCategoryName());
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformAttendRecordEntity save = attendRecordService.save(recordEntity);
return save.newEntity();
}
private boolean review(InspectSaveReq req) throws AppException {
//评价保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
PerformReviewRecordEntity recordEntity = new PerformReviewRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
recordEntity.setRuleName(rule.getName());
recordEntity.setCategoryId(rule.getCategoryId());
recordEntity.setCategoryName(rule.getCategoryName());
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformReviewRecordEntity save = reviewRecordService.save(recordEntity);
return save.newEntity();
}
private boolean complain(InspectSaveReq req) throws AppException {
//投诉保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
PerformComplainRecordEntity recordEntity = new PerformComplainRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
recordEntity.setRuleName(rule.getName());
recordEntity.setCategoryId(rule.getCategoryId());
recordEntity.setCategoryName(rule.getCategoryName());
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformComplainRecordEntity save = complainRecordService.save(recordEntity);
return save.newEntity();
}
private boolean gowork(InspectSaveReq req) throws AppException {
//办件保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
PerformGoworkRecordEntity recordEntity = new PerformGoworkRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
recordEntity.setRuleName(rule.getName());
recordEntity.setCategoryId(rule.getCategoryId());
recordEntity.setCategoryName(rule.getCategoryName());
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformGoworkRecordEntity save = performGoworkRecordService.save(recordEntity);
return save.newEntity();
}
private boolean effect(InspectSaveReq req) throws AppException {
//效能保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
PerformEffectRecordEntity recordEntity = new PerformEffectRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
recordEntity.setRuleName(rule.getName());
recordEntity.setCategoryId(rule.getCategoryId());
recordEntity.setCategoryName(rule.getCategoryName());
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformEffectRecordEntity save = effectRecordService.save(recordEntity);
return save.newEntity();
}
private boolean other(InspectSaveReq req) throws AppException {
//其它保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
PerformOtherRecordEntity recordEntity = new PerformOtherRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
recordEntity.setRuleName(rule.getName());
recordEntity.setCategoryId(rule.getCategoryId());
recordEntity.setCategoryName(rule.getCategoryName());
recordEntity.setCreateUserId(1L);
recordEntity.setCreateTime(new Date());
PerformOtherRecordEntity save = otherRecordService.save(recordEntity);
return save.newEntity();
}
private PerformRulesEntity getRule(String ruleCode) {
PerformRulesEntity rule = rulesService.getCache(ruleCode);
if (ObjectUtils.isEmpty(rule))
throw new AppException(String.format("当前手机号码未找到匹配的员工!rule:%s", ruleCode));
return rule;
}
private StaffEntity getStaff(String phone) {
StaffEntity staffEntity = staffService.selectOne(new StaffQuery().phoneNumber(phone));
if (ObjectUtils.isEmpty(staffEntity))
throw new AppException(String.format("当前手机号码未找到匹配的员工!phone:%s", phone));
return staffEntity;
}
protected void parsePageInfo(Map<String, Object> model, PageInfo pageInfo) {
model.put(TOTAL, pageInfo.getTotalResult());
model.put(PER_PAGE, pageInfo.getPrePageResult());
model.put(CURRENT_PAGE, pageInfo.getCurrPage());
model.put(LAST_PAGE, pageInfo.getTotalPage());
model.put(PAGEINFO_KEY, pageInfo);
}
public static void main(String[] args) {
}
}
......@@ -98,7 +98,8 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
performStatInfo.setTotalScore(new BigDecimal("15.9"));
performStatInfo.setTotalTimes(12);
performStatInfo.setTodayScore(new BigDecimal("12.6"));
performStatInfo.setTodayTimes(11);
performStatInfo.setTodayTimes(4);
rest.setData(performStatInfo);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
......
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