Commit 230fd3b8 authored by 姬鋆屾's avatar 姬鋆屾
parents 030eadf3 ce77bd1c
......@@ -6,7 +6,10 @@
<el-tab-pane label="设计问卷" name="1">
<fc-designer style="height: 79vh;" ref="designer">
<template slot="handle">
<ElButton icon="el-icon-upload" type="success" size="small" @click="showDrawer" round>移动端预览
<ElButton style="margin-left: 10px;" icon="el-icon-upload" type="primary" size="small"
@click="issueBtn" round>问卷发布
</ElButton>
<ElButton icon="el-icon-view" type="success" size="small" @click="showDrawer" round>H5预览
</ElButton>
</template>
</fc-designer>
......@@ -31,6 +34,30 @@
</div>
</div>
</el-drawer>
<el-dialog title="问卷发布" :visible.sync="issueDialog" width="30%" top="25vh">
<el-form :model="issueForm">
<el-form-item label="问卷封面:" label-width="125px">
<div style="display: flex;align-items: center;">
<img style="width:80px; height: 50px; margin-right: 10px;cursor: pointer;"
v-for="i in issueForm.cover" :src="i" alt="">
</div>
<!-- <el-input v-model="issueForm.cover" autocomplete="off"></el-input> -->
</el-form-item>
<el-form-item label="反馈期限:" label-width="125px">
<el-date-picker v-model="issueForm.time" type="datetimerange" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="邀请人员:" label-width="125px">
<el-button type="success" size="small">选择人员</el-button>
</el-form-item>
<div style="text-align: center;">
<el-button size="small" @click="issueDialog = false">取消</el-button>
<el-button type="primary" size="small" @click="issueFormBtn">发布</el-button>
</div>
</el-form>
</el-dialog>
</el-tab-pane>
</el-tabs>
</div>
......@@ -43,8 +70,15 @@ export default {
return {
tabs: '1',
drawer: 0,
Frule: '',
Frule: [],
Fopthion: '',
issueDialog: false,
issueForm: {
cover: [
'http://sy.scsmile.cn/YX-JXgl/v1.0/HT/images/%E6%96%B0%E5%A2%9E%E5%8F%8D%E9%A6%88_%E7%AC%AC3%E6%AD%A5_/u26101.svg',
'http://sy.scsmile.cn/YX-JXgl/v1.0/HT/images/%E6%96%B0%E5%A2%9E%E5%8F%8D%E9%A6%88_%E7%AC%AC3%E6%AD%A5_/u26102.svg'
]
},
}
},
mounted() {
......@@ -75,11 +109,31 @@ export default {
this.$refs.designer.removeMenuItem("timePicker")
this.$refs.designer.removeMenuItem("switch")
this.$refs.designer.removeMenuItem("tree")
this.$refs.designer.removeMenuItem("inputNumber")
this.$refs.designer.removeMenuItem("select")
this.$refs.designer.removeMenuItem("fc-editor")
this.$refs.designer.removeMenuItem("el-button")
this.$refs.designer.removeMenuItem("el-divider")
//配置组件生成规则---直接配置显示在页面上
// const rule = [{ "type": "input", "field": "int", "title": "输入框", "info": "", "_fc_drag_tag": "input", "hidden": false, "display": true }]
// this.$refs.designer.setRule(rule)
},
methods: {
//问卷发布
issueBtn() {
this.Frule = formCreate.parseJson(this.getFormJson())
this.Fopthion = formCreate.parseJson(this.getFormOption())
console.log(this.Frule)
//判断是否配置了表单
if (this.Frule.length > 0) {
this.issueDialog = true
} else {
this.$message({
message: '请配置表单后发布',
type: 'warning'
});
}
},
//预览生成按钮的输出
onSubmit(formData) {
console.log(formData)
......@@ -101,12 +155,20 @@ export default {
const FcDesignerOptions = this.$refs.designer.getOption();
console.log(FcDesignerOptions)
return JSON.stringify(FcDesignerOptions)
},
issueFormBtn() {
console.log(this.issueForm)
}
}
}
</script>
<style lang="less" scoped>
/deep/._fc-m-tools {
flex-direction: row-reverse;
justify-content: flex-start;
}
/deep/._fc-l-title {
text-align: center;
margin-bottom: 10px;
......
......@@ -18,22 +18,65 @@
</div>
<div class="content">
<div class="cLeft"></div>
<div class="cLeft">
<div class="title">
全部数据(220)
<span style="font-weight: 400; font-size: 16px;margin-left: 20px;">已反馈(1)</span>
<span style="font-weight: 400; font-size: 16px;margin-left: 20px;">未反馈(219)</span>
</div>
<el-button class="m15" type="primary" size="small">导出数据</el-button>
<div class="lBox m15">
<div class="treeS">
<el-tree :data="treeData" :props="defaultProps" @node-click="treeSub"></el-tree>
</div>
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column label="日期" width="120">
<template slot-scope="scope">{{ scope.row.date }}</template>
</el-table-column>
<el-table-column prop="name" label="姓名" width="120">
</el-table-column>
<el-table-column prop="address" label="地址" show-overflow-tooltip>
</el-table-column>
</el-table>
</div>
</div>
<div class="cRight">
<div class="title">
题型数据分析
</div>
<div class="box">
<div style="display: flex;align-items: center;">
<el-tag type="primary" effect="plain">单项选择</el-tag>
<div style="margin-left: 10px;">1.你是男性还是女性</div>
<div class="scroll">
<div class="box" v-for="i in 2">
<div style="display: flex;align-items: center;">
<el-tag type="primary" effect="plain">单项选择</el-tag>
<div style="margin-left: 10px;">1.你是男性还是女性</div>
</div>
<div class="m15"
style="display: flex;align-items: center;justify-content: space-around; width: 40%;">
<div style="text-align: center;">
<el-progress type="circle" :percentage="45" show-text width="75"></el-progress>
<div></div>
</div>
<div style="text-align: center;">
<el-progress type="circle" :percentage="45" show-text width="75"></el-progress>
<div></div>
</div>
</div>
</div>
<div>
<el-progress type="circle" :percentage="45"></el-progress>
<el-progress type="circle" :percentage="55"></el-progress>
<div class="box m15" v-for="i in 4">
<div style="display: flex;align-items: center;">
<el-tag type="primary" effect="plain">单项选择</el-tag>
<div style="margin-left: 10px;">1.你是男性还是女性</div>
</div>
<el-button class="m15" type="primary" size="small"
@click="drawerAnswer = 1">查看详情答案</el-button>
</div>
</div>
</div>
</div>
......@@ -51,6 +94,22 @@
</div>
</div>
</el-drawer>
<el-drawer :visible.sync="drawerAnswer" title="反馈详情" size="40%">
<div class="answerBox">
<div class="aTop">
问题:你的具体想法?
</div>
<el-table class="m15" :data="tableData" border style="width: 100%;">
<el-table-column prop="date" label="日期" width="180">
</el-table-column>
<el-table-column prop="name" label="姓名" width="180">
</el-table-column>
<el-table-column prop="address" label="地址">
</el-table-column>
</el-table>
</div>
</el-drawer>
</div>
</template>
......@@ -63,6 +122,63 @@ export default {
drawer: false,
Frule: '',
Fopthion: '',
drawerAnswer: false,
tableData: [{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}, {
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
}],
treeData: [{
label: '一级 1',
children: [{
label: '二级 1-1',
children: [{
label: '三级 1-1-1'
}]
}]
}, {
label: '一级 2',
children: [{
label: '二级 2-1',
children: [{
label: '三级 2-1-1'
}]
}, {
label: '二级 2-2',
children: [{
label: '三级 2-2-1'
}]
}]
}, {
label: '一级 3',
children: [{
label: '二级 3-1',
children: [{
label: '三级 3-1-1'
}]
}, {
label: '二级 3-2',
children: [{
label: '三级 3-2-1'
}]
}]
}],
defaultProps: {
children: 'children',
label: 'label'
}
}
},
mounted() {
......@@ -158,11 +274,32 @@ export default {
"resetBtn": false
}
},
methods: {
treeSub(data) {
console.log(data)
},
handleSelectionChange(val) {
this.multipleSelection = val;
}
}
}
</script>
<style lang="less" scoped>
.treeS {
width: 20%;
margin-left: 10px;
}
/deep/.el-tree {
background-color: transparent;
}
.m15 {
margin-top: 15px;
}
.font {
font-size: 16px;
line-height: 1.5;
......@@ -240,6 +377,21 @@ export default {
}
}
.answerBox {
padding: 0 20px;
box-sizing: border-box;
.aTop {
border-left: 4px solid #3377ff;
background-color: #eff4ff;
color: #3377ff;
line-height: 70px;
padding-left: 20px;
box-sizing: border-box;
font-weight: bold;
}
}
.content {
display: flex;
align-items: center;
......@@ -252,6 +404,15 @@ export default {
height: 100%;
border-radius: 4px;
width: 49%;
box-sizing: border-box;
padding: 20px;
.lBox {
display: flex;
// align-items: center
justify-content: space-between;
}
}
.cRight {
......@@ -261,6 +422,32 @@ export default {
width: 49%;
box-sizing: border-box;
padding: 20px;
.scroll {
height: 93%;
overflow-y: auto;
overflow-x: hidden;
// border: 1px solid;
}
/* 侧边滚动条 */
.scroll::-webkit-scrollbar {
width: 3px;
}
/* 滚动条上的滚动滑块 */
.scroll::-webkit-scrollbar-thumb {
background: #CCCCCC;
border-radius: 4px;
}
/* 滚动条轨道 */
.scroll::-webkit-scrollbar-track {
background: #EEEEEE;
border-radius: 4px;
}
}
.title {
......
......@@ -27,4 +27,11 @@ public interface RoleUserService extends ICRUDService<RoleUserEntity,Long> {
void doDistributionUser(RoleUserQuery query);
void doDistributionRole(RoleUserQuery query);
/**
* 给用户分配角色
* @param query
*/
void assignRoleToUser(RoleUserQuery query);
}
\ No newline at end of file
......@@ -70,6 +70,26 @@ public class RoleUserServiceImpl extends AbstractCRUDServiceImpl<RoleUserDao,Rol
this.dao.insertBatch(list);
}
@Override
public void assignRoleToUser(RoleUserQuery query) {
//删除当前用户所有关联角色
Long userId = query.getUserId();
Map<String, Object> condition = new HashMap<>(1);
condition.put("userId", userId);
dao.delete(condition);
//新增用户角色
List<Long> roleIdList = query.getRoleIdList();
List<RoleUserEntity> list = new ArrayList<>();
for (Long roleId : roleIdList) {
RoleUserEntity rolseUser = new RoleUserEntity();
rolseUser.setRoleId(roleId);
rolseUser.setUserId(userId);
list.add(rolseUser);
}
this.save(list);
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@
package com.mortals.xhx.base.system.task.service.impl;
import cn.hutool.core.net.NetUtil;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.code.ExcuteStatus;
import com.mortals.framework.common.code.TaskExcuteStrategy;
......@@ -148,7 +149,8 @@ public class TaskServiceImpl extends AbstractCRUDServiceImpl<TaskDao, TaskEntity
@Override
public void start() throws AppException {
final String localIp = SystemUtil.getLocalHostIp();
// final String localIp = SystemUtil.getLocalHostIp();
final String localIp = NetUtil.getLocalhostStr();
log.info("任务执行线程启动...-->" + localIp);
thread = new Thread(() -> {
// 将本机上次执行而未完成的任务状态变更
......
......@@ -48,7 +48,7 @@ public class UserEntity extends UserVo implements IUser {
*/
private String qq;
/**
* 用户类型(0.系统用户,1.普通用户,2.工作人员)
* 用户类型(0.系统用户,1.普通用户,2.工作人员,3.普通员工)
*/
private Integer userType;
......@@ -86,6 +86,11 @@ public class UserEntity extends UserVo implements IUser {
*/
private String lastLoginAddress;
/**
* 员工id
*/
private Long customerId;
public UserEntity(){}
......@@ -227,7 +232,7 @@ public class UserEntity extends UserVo implements IUser {
this.qq = qq;
}
/**
* 获取 用户类型(0.系统用户,1.普通用户,2.工作人员)
* 获取 用户类型(0.系统用户,1.普通用户,2.工作人员,3.普通员工)
* @return Integer
*/
public Integer getUserType(){
......@@ -253,7 +258,7 @@ public class UserEntity extends UserVo implements IUser {
@Override
public Long getCustomerId() {
return null;
return this.customerId;
}
@Override
......@@ -358,7 +363,9 @@ public class UserEntity extends UserVo implements IUser {
}
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
@Override
public int hashCode() {
......
package com.mortals.xhx.busiz.req;
import com.mortals.xhx.busiz.BaseReq;
import lombok.Data;
@Data
public class FeedbackReq extends BaseReq {
//反馈开始时间
private String feedBackStartDate;
//反馈结束时间
private String feedBackEndDate;
//反馈状态(1.未反馈,2.已反馈)
private Integer feedbackStatus;
//详细
private Long Id;
}
......@@ -55,5 +55,10 @@ public class PerformInfo {
*/
private BigDecimal score;
/**
* 类型
*/
private String performType;
}
......@@ -6,6 +6,7 @@ import com.mortals.framework.ap.CookieService;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.IUser;
......@@ -32,6 +33,8 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
......@@ -40,40 +43,18 @@ import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT;
@RestController
@Slf4j
@RequestMapping("/api/v1/")
@RequestMapping("/api/v1/login")
public class ApiLoginController extends BaseJsonBodyController {
@Autowired
private UserService userService;
@Autowired
private ValidCodeService validCodeService;
@Autowired
private ResourceService resourceService;
@Autowired
private MenuService menuService;
// @Autowired
// private ITokenService tokenService;
@Autowired
private ICacheService cacheService;
@Autowired
private IAuthTokenService authTokenService;
@RequestMapping("login")
public String login(@RequestBody LoginForm loginForm) throws Exception {
/*
JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
UserPdu userPdu = new UserPdu();
userPdu.setLoginName(loginName);
userPdu.setPassword(password);
String resp = userFeign.portalLogin(userPdu);
return resp;
*/
JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
......@@ -88,42 +69,35 @@ public class ApiLoginController extends BaseJsonBodyController {
loginForm.validate();
userEntity = userService.doLogin(loginName, password, ip);
userEntity.setLastLoginAddress(ip);
recordSysLog(request, userEntity, "用户登录系统成功!");
// 返回拥有的菜单数据
Set<String> urls = resourceService.findUrlSetByUserId(userEntity.getId());
List<MenuEntity> outlookBarList = menuService.findTreeMenu(userEntity, urls);
recordSysLog(request, userEntity, "H5用户登录系统成功!");
String currUserName = userEntity.getRealName();
if (currUserName == null || currUserName.trim().length() == 0) {
currUserName = "管理员";
}
JSONObject data = new JSONObject();
data.put("currUserName", currUserName);
data.put("barList", outlookBarList);
data.put("id", userEntity.getId());
data.put("userType", userEntity.getUserType());
HashSet<Integer> set = new HashSet<>();
set.add(1);
set.add(2);
if (ObjectUtils.isEmpty(userEntity.getUserType()) || !set.contains(userEntity.getUserType())) {
throw new AppException("当前用户不支持H5登录!");
}
userEntity.setLoginTime(System.currentTimeMillis());
userEntity.setToken(IdUtil.fastSimpleUUID());
userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime());
userEntity.setMenuUrl(generateMenuUrlCode(urls));
String token = authTokenService.createToken(userEntity);
data.put("token", token);
//设置token 和过期时间
//data.put("expiresTime", DateUtils.addCurrDate(7).getTime());
generateMenuUrlCode(urls);
//this.generateBlackCookie(request, response, loginName, urls);
ret.put(KEY_RESULT_DATA, data);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "用户登录系统成功!");
ret.put("resources", urls);
return ret.toJSONString();
} catch (Exception e) {
log.error("login error ", e);
if (userEntity == null) {
userEntity = new UserEntity();
userEntity.setLoginName(loginName);
}
log.error("h5 login error ", e);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
......@@ -136,78 +110,6 @@ public class ApiLoginController extends BaseJsonBodyController {
super.removeCurrUser(request);
}
@RequestMapping("index")
public String index() throws Exception {
JSONObject ret = new JSONObject();
IUser user = this.getCurUser();
if (user == null) {
return JSONObject.toJSONString(Rest.fail(ERROR_TOKEN_EXPIRED, ERROR_TOKEN_EXPIRED_CONTENT));
}
Set<String> urls = resourceService.findUrlSetByUserId(user.getId());
List<MenuEntity> outlookBarList = menuService.findTreeMenu(user, urls);
String currUserName = user.getRealName();
if (currUserName == null || currUserName.trim().length() == 0) {
currUserName = "管理员";
}
JSONObject data = new JSONObject();
String token = authTokenService.getToken(request);
data.put("token", token);
data.put("currUserName", currUserName);
data.put("barList", outlookBarList);
data.put("id", user.getId());
data.put("userType", user.getUserType());
ret.put(KEY_RESULT_DATA, data);
//this.generateBlackCookie(request, response, user.getLoginName(), urls);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "用户登录系统成功!");
ret.put("resources", urls);
return ret.toJSONString();
}
private void generateBlackCookie(HttpServletRequest request, HttpServletResponse response, String loginName, Set<String> urls) {
try {
String cacheKey = RedisKey.KEY_MENU_CACHE + loginName;
String securityKey = GlobalSysInfo.getPropertyValue(SysConstains.PROP_COOKIE_SECURITY_KEY);
//应为Cookie会超长,所以改为仅存储key将值放入redis
//CookieService.setCookieForAuth(request, response, securityKey, null);
StringBuilder sb = new StringBuilder();
if (urls != null && urls.size() > 0) {
for (String url : urls) {
int index = url.hashCode() & (Integer.MAX_VALUE - 1);
sb.append(index).append(",");
}
}
String menuUrl = sb.toString();
menuUrl = AESUtil.encrypt(menuUrl, securityKey);
cacheService.set(cacheKey, menuUrl, 604800);
HttpUtil.setCookieValue(request, response, SysConstains.COOKIE_MENU, cacheKey, -1);
} catch (Throwable e) {
}
}
private String generateMenuUrlCode(Set<String> urls) {
try {
String securityKey = GlobalSysInfo.getPropertyValue(SysConstains.PROP_COOKIE_SECURITY_KEY);
StringBuilder sb = new StringBuilder();
if (urls != null && urls.size() > 0) {
for (String url : urls) {
int index = url.hashCode() & (Integer.MAX_VALUE - 1);
sb.append(index).append(",");
}
}
String menuUrl = sb.toString();
return AESUtil.encrypt(menuUrl, securityKey);
} catch (Throwable e) {
log.error("编码异常", e);
return null;
}
}
@RequestMapping("parseToken")
public IUser parseToken() throws Exception {
......
......@@ -33,7 +33,7 @@ import java.util.List;
*/
@RestController
@Slf4j
@RequestMapping("/api/v1/")
@RequestMapping("/api/v1/appeal")
public class AppealApiController extends BaseJsonBodyController {
@Autowired
......@@ -55,7 +55,7 @@ public class AppealApiController extends BaseJsonBodyController {
/**
* 个人申诉绩效统计
*/
@PostMapping(value = "appeal/stat")
@PostMapping(value = "stat")
public Rest<AppealStatInfo> appealStat() {
String busiDesc = "H5个人申诉绩效统计";
Rest<AppealStatInfo> rest = Rest.ok(busiDesc + " 【成功】");
......@@ -72,7 +72,7 @@ public class AppealApiController extends BaseJsonBodyController {
/**
* 申诉列表
*/
@PostMapping(value = "appeal/list")
@PostMapping(value = "list")
public Rest<List<PerformAttendAppealEntity>> performList(@RequestBody AppealReq appealReq) {
String busiDesc = "个人申诉列表";
Rest<List<PerformAttendAppealEntity>> rest = Rest.ok(busiDesc + " 【成功】");
......@@ -95,8 +95,8 @@ public class AppealApiController extends BaseJsonBodyController {
/**
* 申诉详细
*/
@PostMapping(value = "appeal/detail")
public Rest<PerformAttendAppealEntity> performDetail(@RequestBody AppealReq appealReq) {
@PostMapping(value = "info")
public Rest<PerformAttendAppealEntity> performInfo(@RequestBody AppealReq appealReq) {
String busiDesc = "个人申诉详细";
Rest<PerformAttendAppealEntity> rest = Rest.ok(busiDesc + " 【成功】");
try {
......@@ -116,7 +116,7 @@ public class AppealApiController extends BaseJsonBodyController {
/**
* 申诉新增
*/
@PostMapping(value = "appeal/save")
@PostMapping(value = "save")
public Rest<String> appealSave(@RequestBody PerformAttendAppealEntity appealEntity) {
String busiDesc = "个人申诉新增";
Rest<String> rest = Rest.ok(busiDesc + " 【成功】");
......
package com.mortals.xhx.busiz.web;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.busiz.req.AppealReq;
import com.mortals.xhx.busiz.req.FeedbackReq;
import com.mortals.xhx.busiz.rsp.AppealStatInfo;
import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import lombok.extern.slf4j.Slf4j;
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.util.Date;
import java.util.List;
/**
* h5 申诉
*
* @author: zxfei
* @date: 2023/7/7 15:08
*/
@RestController
@Slf4j
@RequestMapping("/api/v1/feedback")
public class FeedbackApiController extends BaseJsonBodyController {
@Autowired
private CheckAttendRecordService checkAttendRecordService;
@Autowired
private CheckReviewRecordService checkReviewRecordService;
@Autowired
private CheckComplainRecordService checkComplainRecordService;
@Autowired
private CheckEffectRecordService checkEffectRecordService;
@Autowired
private CheckGoworkRecordService checkGoworkRecordService;
@Autowired
private CheckOtherRecordService checkOtherRecordService;
/**
* 反馈列表
*/
@PostMapping(value = "list")
public Rest<List<PerformAttendAppealEntity>> feedbackList(@RequestBody FeedbackReq feedbackReq) {
String busiDesc = "个人反馈列表";
Rest<List<PerformAttendAppealEntity>> rest = Rest.ok(busiDesc + " 【成功】");
try {
if (ObjectUtils.isEmpty(feedbackReq.getFeedbackStatus())) {
//未设置时间的情况,默认为当月
feedbackReq.setFeedBackStartDate(DateUtil.beginOfMonth(new Date()).toDateStr());
feedbackReq.setFeedBackEndDate(DateUtil.today());
}
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
/**
* 反馈详细
*/
@PostMapping(value = "question")
public Rest<PerformAttendAppealEntity> performDetail(@RequestBody AppealReq appealReq) {
String busiDesc = "个人申诉详细";
Rest<PerformAttendAppealEntity> rest = Rest.ok(busiDesc + " 【成功】");
try {
if (ObjectUtils.isEmpty(appealReq.getId())) {
throw new AppException("详细查询id不能为空!");
}
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
/**
* 申诉新增
*/
@PostMapping(value = "save")
public Rest<String> feedbackSave(@RequestBody PerformAttendAppealEntity appealEntity) {
String busiDesc = "反馈回答";
Rest<String> rest = Rest.ok(busiDesc + " 【成功】");
try {
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error(busiDesc, e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
public static void main(String[] args) {
}
}
......@@ -27,7 +27,7 @@ import java.util.List;
*/
@RestController
@Slf4j
@RequestMapping("/api/v1/")
@RequestMapping("/api/v1/perform")
public class PerformApiController extends BaseJsonBodyController {
@Autowired
......@@ -47,7 +47,7 @@ public class PerformApiController extends BaseJsonBodyController {
/**
* 个人当天绩效统计
*/
@PostMapping(value = "perform/stat")
@PostMapping(value = "stat")
public Rest<PerformStatInfo> performStat() {
String busiDesc = "H5 个人绩效统计";
Rest<PerformStatInfo> rest = Rest.ok(busiDesc + " 【成功】");
......@@ -65,7 +65,7 @@ public class PerformApiController extends BaseJsonBodyController {
/**
* 个人当月绩效加分扣分列表
*/
@PostMapping(value = "perform/list")
@PostMapping(value = "list")
public Rest<List<PerformInfo>> performList(@RequestBody PerformReq performReq) {
String busiDesc = "个人绩效列表";
Rest<List<PerformInfo>> rest = Rest.ok(busiDesc + " 【成功】");
......@@ -107,7 +107,7 @@ public class PerformApiController extends BaseJsonBodyController {
/**
* 详细
*/
@PostMapping(value = "perform/info")
@PostMapping(value = "info")
public Rest<PerformDetailInfo> performInfo(@RequestBody PerformReq performReq) {
String busiDesc = "个人绩效增减详细";
Rest<PerformDetailInfo> rest = Rest.ok(busiDesc + " 【成功】");
......
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/***
* 核查类型枚举(1.考勤绩效,2.效能绩效,3.评价绩效,4.办件绩效,5.评价差评绩效,6.其它绩效)
*/
public enum CheckTypeEnum {
考勤绩效(1, "考勤绩效"),
效能绩效(2, "效能绩效"),
评价绩效(3, "评价绩效"),
办件绩效(4, "办件绩效"),
差评绩效(5, "差评绩效"),
其它绩效(6, "其它绩效"),
;
private Integer value;
private String desc;
CheckTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static CheckTypeEnum getByValue(Integer value) {
for (CheckTypeEnum checkTypeEnum : CheckTypeEnum.values()) {
if (checkTypeEnum.getValue() == value) {
return checkTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (CheckTypeEnum item : CheckTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
......@@ -2,6 +2,7 @@ package com.mortals.xhx.daemon.task;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.PageUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
......@@ -115,7 +116,7 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
List<AttendanceRecordHikEntity> attRecords = doorEventsRest.getData().getList().stream().map(item -> {
AttendanceRecordHikEntity recordHikEntity = new AttendanceRecordHikEntity();
recordHikEntity.initAttrValue();
StaffEntity staffCache = staffService.getExtCache(item.getJobNo());
StaffEntity staffCache = staffService.getExtCache(StrUtil.padPre(item.getJobNo(), 8, "0"));
if (ObjectUtils.isEmpty(staffCache)) {
log.info("staff is null !staffCode:{}",item.getJobNo());
return null;
......
package com.mortals.xhx.daemon.task;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
......@@ -57,8 +58,6 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
@Autowired
private DeptService deptService;
@Autowired
private StaffService service;
@Autowired
private AttendanceStatService attendanceStatService;
......@@ -70,12 +69,11 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
@Override
public void excuteTask(ITask task) throws AppException {
log.info("同步用户--部门");
try {
//同步部门
syncDepts();
//同步员工
log.info("同步用户");
syncPersons();
log.info("同步部门");
syncDepts();
} catch (Exception e) {
log.error("同步人事异常", e);
}
......@@ -89,7 +87,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
if (personRest.getCode() == YesNoEnum.YES.getValue()) {
List<PersonInfo> personInfoList = personRest.getData().getList();
for (PersonInfo personInfo : personInfoList) {
StaffEntity staffEntity = staffService.getExtCache(personInfo.getJobNo());
StaffEntity staffEntity = staffService.getExtCache(StrUtil.padPre(personInfo.getJobNo(), 8, "0"));
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().deptCode(personInfo.getOrgIndexCode()));
// AttendanceVacationBalanceEntity balanceEntity = balanceService.selectOne(new AttendanceVacationBalanceQuery().staffId(staffEntity.getId()));
// AttendanceStatEntity statEntity = attendanceStatService.selectOne(new AttendanceStatQuery().staffId(staffEntity.getId()));
......@@ -111,7 +109,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity.setPhoneNumber(personInfo.getPhoneNo());
staffEntity.setCreateUserId(1L);
staffEntity.setCreateTime(new Date());
service.save(staffEntity);
staffService.save(staffEntity);
AttendanceVacationBalanceEntity balanceEntity = new AttendanceVacationBalanceEntity();
balanceEntity.initAttrValue();
......@@ -181,7 +179,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity.setPhoneNumber(personInfo.getPhoneNo());
staffEntity.setUpdateUserId(1L);
staffEntity.setUpdateTime(new Date());
service.update(staffEntity);
staffService.update(staffEntity);
//统计各级部门员工数量
String ancestor = deptEntity.getAncestors().split(",", 2)[1];
String[] ancestors = ancestor.split(",");
......
package com.mortals.xhx.module.check.dao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import java.util.List;
/**
* 全部类型核查信息Dao
*/
public interface CheckAllRecordDao {
List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query);
}
package com.mortals.xhx.module.check.dao.ibatis;
import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 全部类型核查信息Dao
*/
@Repository("checkAllRecordDao")
public class CheckAllRecordDaoImpl extends SqlSessionDaoSupport implements CheckAllRecordDao {
protected String namespace = this.getClass().getName();
@Autowired
public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
super.setSqlSessionFactory(sqlSessionFactory);
}
protected String getSqlId(String id) {
return this.namespace + "." + id;
}
@Override
public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getList"), query);
}
}
package com.mortals.xhx.module.check.model;
import lombok.Data;
@Data
public class CheckAllRecordQuery {
/**
* 员工ID
*/
private Long staffId;
/**
* 处理状态(1.未处理,2.已处理)
*/
private Integer checkStatus;
private String createTimeStart;
private String createTimeEnd;
private Long createUserId;
}
......@@ -9,113 +9,128 @@ import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.check.model.vo.CheckAttendRecordVo;
import lombok.Data;
/**
* 考勤绩效记录核查信息实体对象
*
* @author zxfei
* @date 2023-07-07
*/
* 考勤绩效记录核查信息实体对象
*
* @author zxfei
* @date 2023-07-08
*/
@Data
public class CheckAttendRecordEntity extends CheckAttendRecordVo {
private static final long serialVersionUID = 1L;
/**
* 记录ID
*/
* 记录ID
*/
private Long recordId;
/**
* 员工ID
*/
* 员工ID
*/
private Long staffId;
/**
* 员工姓名
*/
* 员工姓名
*/
private String staffName;
/**
* 工号
*/
* 工号
*/
private String workNum;
/**
* 所属部门
*/
* 所属部门
*/
private Long deptId;
/**
* 所属部门名称
*/
* 所属部门名称
*/
private String deptName;
/**
* 所属考勤组ID
*/
* 所属考勤组ID
*/
private Long attendanceGroupId;
/**
* 所属考勤组名称
*/
* 所属考勤组名称
*/
private String attendanceGroupName;
/**
* 考勤时间
*/
* 考勤时间
*/
private Date attendanceDate;
/**
* 绩效规则id
*/
* 绩效规则id
*/
private Long ruleId;
/**
* 规则名称
*/
* 规则名称
*/
private String ruleName;
/**
* 增减类型(1.增加,2.扣除)
*/
* 增减类型(1.增加,2.扣除)
*/
private Integer subAddType;
/**
* 扣分或增加分值
*/
* 扣分或增加分值
*/
private BigDecimal score;
/**
* 上下班时间
*/
* 上下班时间
*/
private String goOffTimeStr;
/**
* 异常时间
*/
* 异常时间
*/
private Date errorTime;
/**
* 实际打卡时间
*/
* 实际打卡时间
*/
private Date actualAttendTime;
/**
* 异常处理结果
*/
* 异常处理结果
*/
private String errorResult;
/**
* 核查人员
*/
* 核查人员
*/
@Excel(name = "核查人员")
private String checkPerson;
/**
* 核查时间
*/
* 核查时间
*/
private Date checkTime;
/**
* 核查说明
*/
* 核查说明
*/
@Excel(name = "核查说明")
private String checkDesc;
/**
* 核查结果
*/
* 核查结果
*/
@Excel(name = "核查结果")
private String checkResult;
/**
* 处理状态(1.未处理,2.已处理)
*/
* 处理状态(1.未处理,2.已处理)
*/
private Integer checkStatus;
/**
* 扣分方式(1.系统自动,2.人工添加,3.大厅巡查)
*/
* 扣分方式(1.系统自动,2.人工添加,3.大厅巡查)
*/
private Integer subMethod;
/**
* 说明
*/
@Excel(name = "说明")
private String remark;
/**
* 附件名称,多个逗号分割
*/
@Excel(name = "附件名称,多个逗号分割")
private String fileNames;
/**
* 附件下载地址,多个逗号分割
*/
@Excel(name = "附件下载地址,多个逗号分割")
private String filePaths;
@Override
public int hashCode() {
return this.getId().hashCode();
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
......@@ -123,7 +138,7 @@ public class CheckAttendRecordEntity extends CheckAttendRecordVo {
if (obj instanceof CheckAttendRecordEntity) {
CheckAttendRecordEntity tmp = (CheckAttendRecordEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
return true;
}
}
return false;
......@@ -131,50 +146,56 @@ public class CheckAttendRecordEntity extends CheckAttendRecordVo {
public void initAttrValue(){
this.recordId = -1L;
this.recordId = -1L;
this.staffId = -1L;
this.staffName = "";
this.workNum = "";
this.staffId = -1L;
this.deptId = -1L;
this.staffName = "";
this.deptName = "";
this.workNum = "";
this.attendanceGroupId = -1L;
this.deptId = -1L;
this.attendanceGroupName = "";
this.deptName = "";
this.attendanceDate = null;
this.attendanceGroupId = -1L;
this.ruleId = -1L;
this.attendanceGroupName = "";
this.ruleName = "";
this.attendanceDate = null;
this.subAddType = 1;
this.ruleId = -1L;
this.score = BigDecimal.valueOf(0.00);
this.ruleName = "";
this.goOffTimeStr = "";
this.subAddType = 1;
this.errorTime = null;
this.score = BigDecimal.valueOf(0.00);
this.actualAttendTime = null;
this.goOffTimeStr = "";
this.errorResult = "";
this.errorTime = null;
this.checkPerson = "";
this.actualAttendTime = null;
this.checkTime = null;
this.errorResult = "";
this.checkDesc = "";
this.checkPerson = "";
this.checkResult = "";
this.checkTime = null;
this.checkStatus = 1;
this.checkDesc = "";
this.subMethod = 1;
this.checkResult = "";
this.remark = "";
this.checkStatus = 1;
this.fileNames = "";
this.subMethod = 1;
this.filePaths = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.check.service;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import java.util.List;
/**
* 全部类型核查信息Dao
*/
public interface CheckAllRecordService {
List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query);
}
This diff is collapsed.
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