Commit 9297151e authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents c8172f12 c3092e75
...@@ -5,80 +5,28 @@ ...@@ -5,80 +5,28 @@
</template> </template>
<script> <script>
import jwt_decode from "jwt-decode";
export default { export default {
name: "sso",
created() {},
mounted() { mounted() {
let token = this.$route.query.token; let token = this.$route.query.token;
console.log("token:" + token); let siteid = this.$route.query.siteid;
console.log("解析后的token:", jwt_decode(token));
//const decode = jwt_decode(data.normal_login_token).accountId; // 解析
if (token) { if (token) {
//本地登录后跳转 window.sessionStorage.setItem("token", token);
this.form.loginName = jwt_decode(token).userInfo.account; window.sessionStorage.setItem("siteid", siteid);
this.form.password = jwt_decode(token).userInfo.password; this.$router.push("/index"); // 有token直接跳转首页
this.$route.query.sysName
? localStorage.setItem("sysName", this.$route.query.sysName)
: "";
this.$route.query.sysLogo
? localStorage.setItem("sysLogo", this.$route.query.sysLogo)
: "";
this.$route.query.sysName
? (document.title = this.$route.query.sysName)
: "";
/* this.form.loginName="admin"
this.form.password="scsmile"*/
this.login();
//window.sessionStorage.setItem("token", token);
// this.$router.push('/index') // 有token直接跳转首页
} else { } else {
this.$message({ this.$message({
message: "没有权限,正在跳转登录页面...", message: "没有权限,正在跳转登录页面...",
center: true, center: true,
}); });
setTimeout(function() { setTimeout(function () {
window.location.href = window.location.href =
process.env.VUE_APP_PORTAL_URL == "undefined" process.env.VUE_APP_PORTAL_URL == "undefined"
? "http://192.168.0.98:11072" ? "http://192.168.0.98:11072"
: process.env.VUE_APP_PORTAL_URL; : process.env.VUE_APP_PORTAL_URL;
//this.$router.push('/login') //this.$router.push('/login')
}, 1000); }, 1000);
} }
}, },
methods: {
login() {
this.loading = true;
this.$post("/login/login", this.form)
.then(this.loginSuccess)
.catch(this.loginFail);
},
loginSuccess({ data }) {
console.log("userData", data);
this.$store.commit("setUserData", data);
this.$router.push("/index"); // 有token直接跳转首页
/* this.$router.replace({
path: this.redirect,
});*/
},
loginFail(error) {
this.loading = false;
this.$message.error(error.message);
},
},
data() {
return {
form: {
loginName: "",
password: "",
securityCode: "",
},
redirect: this.$route.query.redirect,
loading: true,
};
},
}; };
</script> </script>
......
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
// {label: "所属部门id", prop: "deptId", formatter: this.formatter}, // {label: "所属部门id", prop: "deptId", formatter: this.formatter},
{ label: "所属部门", prop: "deptName" }, { label: "所属部门", prop: "deptId", formatter: this.formatter },
{ label: "电话号码", prop: "phoneNumber" }, { label: "电话号码", prop: "phoneNumber" },
......
...@@ -124,9 +124,9 @@ export default { ...@@ -124,9 +124,9 @@ export default {
label: "异常开始时间", label: "异常开始时间",
}, },
{ {
name: "attendanceDateEnd", name: "errorDateTimeEnd",
type: "date", type: "date",
label: "errorDateTimeEnd", label: "异常结束时间",
}, },
{ {
name: "staffName", name: "staffName",
......
...@@ -13,7 +13,7 @@ module.exports = { ...@@ -13,7 +13,7 @@ module.exports = {
devServer: { devServer: {
inline: true, inline: true,
disableHostCheck: true, disableHostCheck: true,
port: 8086, port: 8087,
hot: true,//自动保存 hot: true,//自动保存
proxy: { proxy: {
'/attendance': { '/attendance': {
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<profiles.publish.path>/home/publish</profiles.publish.path> <profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr> <profiles.nacos.server-addr>192.168.0.252:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group> <profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
<profiles.nacos.namespace>smart-gov-dev</profiles.nacos.namespace> <profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>INFO</profiles.log.level> <profiles.log.level>INFO</profiles.log.level>
<profiles.sms.smsSendUrl>http://127.0.0.1:8089/api/index/index</profiles.sms.smsSendUrl> <profiles.sms.smsSendUrl>http://127.0.0.1:8089/api/index/index</profiles.sms.smsSendUrl>
......
...@@ -91,8 +91,9 @@ public class AuthTokenServiceImpl implements IAuthTokenService { ...@@ -91,8 +91,9 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY); String uuid = (String) claims.get(SysConstains.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid); String userKey = getTokenKey(uuid);
//cacheService.select(portalDb); //cacheService.select(portalDb);
cacheService.select(0);
String userStr = cacheService.get(userKey); String userStr = cacheService.get(userKey);
//cacheService.select(db); cacheService.select(db);
if (StringUtils.isNotEmpty(userStr)) { if (StringUtils.isNotEmpty(userStr)) {
UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class); UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class);
userEntity.setToken(token); userEntity.setToken(token);
......
...@@ -25,6 +25,8 @@ import com.mortals.xhx.common.code.GoWorkResultEnum; ...@@ -25,6 +25,8 @@ import com.mortals.xhx.common.code.GoWorkResultEnum;
import com.mortals.xhx.common.code.OffWorkResultEnum; import com.mortals.xhx.common.code.OffWorkResultEnum;
import com.mortals.xhx.common.key.RedisKey; import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo; import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.attendance.model.AttendanceRecordEntity; import com.mortals.xhx.module.attendance.model.AttendanceRecordEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordQuery; import com.mortals.xhx.module.attendance.model.AttendanceRecordQuery;
import com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceQuery; import com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceQuery;
...@@ -80,10 +82,26 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -80,10 +82,26 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired @Autowired
private DeptService deptService; private DeptService deptService;
@Autowired
private IUserFeign userFeign;
@RequestMapping("login") @RequestMapping("login")
public String login(@RequestBody LoginForm loginForm) throws Exception { public String login(@RequestBody LoginForm loginForm) throws Exception {
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
UserPdu userPdu = new UserPdu();
userPdu.setLoginName(loginName);
userPdu.setPassword(password);
userPdu.setSecurityCode("admin");
String resp = userFeign.portalLogin(userPdu);
return resp;
/*
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName(); String loginName = loginForm.getLoginName();
String password = loginForm.getPassword(); String password = loginForm.getPassword();
...@@ -137,7 +155,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -137,7 +155,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e)); ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString(); return ret.toJSONString();
} }*/
} }
@RequestMapping("logout") @RequestMapping("logout")
......
...@@ -136,7 +136,7 @@ public class AttendanceStatEntity extends AttendanceStatVo { ...@@ -136,7 +136,7 @@ public class AttendanceStatEntity extends AttendanceStatVo {
/** /**
* 考勤汇总-出勤率(%) * 考勤汇总-出勤率(%)
*/ */
@Excel(name = "考勤汇总-出勤率") @Excel(name = "考勤汇总-出勤率",percentEnabled = true,suffix="%",scale=4)
private BigDecimal attendanceRate; private BigDecimal attendanceRate;
/** /**
* 考勤汇总-未按规定打卡(含忘记打卡) * 考勤汇总-未按规定打卡(含忘记打卡)
......
package com.mortals.xhx.module.attendance.model.vo; package com.mortals.xhx.module.attendance.model.vo;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.attendance.model.AttendanceStaffStatEntity; import com.mortals.xhx.module.attendance.model.AttendanceStaffStatEntity;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
* 考勤汇总信息视图对象 * 考勤汇总信息视图对象
...@@ -19,4 +21,6 @@ public class AttendanceStatVo extends BaseEntityLong { ...@@ -19,4 +21,6 @@ public class AttendanceStatVo extends BaseEntityLong {
private String startTime; private String startTime;
private String endTime; private String endTime;
} }
\ No newline at end of file
...@@ -83,11 +83,6 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At ...@@ -83,11 +83,6 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
//判断后打绩效 //判断后打绩效
String ruleCode = ""; String ruleCode = "";
if (ErrorStatusEnum.早退.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) { if (ErrorStatusEnum.早退.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) {
if (ObjectUtils.isEmpty(entity.getErrorDateTime()) || ObjectUtils.isEmpty(entity.getGoOffDateTime())) {
//早退5分钟内
ruleCode = "ATTEND1002";
}
if (!ObjectUtils.isEmpty(entity.getErrorDateTime()) && !ObjectUtils.isEmpty(entity.getGoOffDateTime())) { if (!ObjectUtils.isEmpty(entity.getErrorDateTime()) && !ObjectUtils.isEmpty(entity.getGoOffDateTime())) {
//判断时间差定义 //判断时间差定义
Long earlyMin = DateUtil.between(entity.getErrorDateTime(), entity.getGoOffDateTime(), DateUnit.MINUTE); Long earlyMin = DateUtil.between(entity.getErrorDateTime(), entity.getGoOffDateTime(), DateUnit.MINUTE);
...@@ -104,12 +99,11 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At ...@@ -104,12 +99,11 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
//早退5分钟内 //早退5分钟内
ruleCode = "ATTEND1006"; ruleCode = "ATTEND1006";
} }
}else {
ruleCode = "ATTEND1002";
} }
} else if (ErrorStatusEnum.迟到.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) { } else if (ErrorStatusEnum.迟到.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) {
if (ObjectUtils.isEmpty(entity.getErrorDateTime()) || ObjectUtils.isEmpty(entity.getGoOffDateTime())) {
//早退5分钟内
ruleCode = "ATTEND1001";
}
if (!ObjectUtils.isEmpty(entity.getErrorDateTime()) && !ObjectUtils.isEmpty(entity.getGoOffDateTime())) { if (!ObjectUtils.isEmpty(entity.getErrorDateTime()) && !ObjectUtils.isEmpty(entity.getGoOffDateTime())) {
Long lateMin = DateUtil.between(entity.getErrorDateTime(), entity.getGoOffDateTime(), DateUnit.MINUTE); Long lateMin = DateUtil.between(entity.getErrorDateTime(), entity.getGoOffDateTime(), DateUnit.MINUTE);
...@@ -125,6 +119,9 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At ...@@ -125,6 +119,9 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
//迟到60分钟以上 //迟到60分钟以上
ruleCode = "ATTEND1005"; ruleCode = "ATTEND1005";
} }
}else{
//早退5分钟内
ruleCode = "ATTEND1001";
} }
} else if (ErrorStatusEnum.缺卡.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) { } else if (ErrorStatusEnum.缺卡.getValue() == DataUtil.converStr2Int(entity.getProcessResult(), 3)) {
ruleCode = "ATTEND1007"; ruleCode = "ATTEND1007";
...@@ -139,7 +136,7 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At ...@@ -139,7 +136,7 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
attendSaveReq.setActualAttendTime(entity.getActualAttendanceDateTime()); attendSaveReq.setActualAttendTime(entity.getActualAttendanceDateTime());
attendSaveReq.setErrorResult(entity.getRemark()); attendSaveReq.setErrorResult(entity.getRemark());
attendSaveReq.setTitle("考勤:" + ErrorStatusEnum.getByValue(entity.getErrorStatus()).getDesc()); attendSaveReq.setTitle("考勤");
attendSaveReq.setHappenTime(entity.getErrorDateTime()); attendSaveReq.setHappenTime(entity.getErrorDateTime());
attendSaveReq.setRuleCode(ruleCode); attendSaveReq.setRuleCode(ruleCode);
attendSaveReq.setStaffId(entity.getStaffId()); attendSaveReq.setStaffId(entity.getStaffId());
......
...@@ -234,7 +234,7 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont ...@@ -234,7 +234,7 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont
@Override @Override
protected void doListBefore(AttendanceRecordErrorEntity query, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(AttendanceRecordErrorEntity query, Map<String, Object> model, Context context) throws AppException {
if (org.springframework.util.ObjectUtils.isEmpty(query.getOrderColList())) { if (ObjectUtils.isEmpty(query.getOrderColList())) {
query.setOrderColList(Arrays.asList(new OrderCol("errorDateTime", OrderCol.DESCENDING), new OrderCol("staffName", OrderCol.DESCENDING))); query.setOrderColList(Arrays.asList(new OrderCol("errorDateTime", OrderCol.DESCENDING), new OrderCol("staffName", OrderCol.DESCENDING)));
} else { } else {
query.getOrderColList().add(new OrderCol("errorDateTime", OrderCol.DESCENDING)); query.getOrderColList().add(new OrderCol("errorDateTime", OrderCol.DESCENDING));
......
...@@ -18,7 +18,7 @@ import java.util.List; ...@@ -18,7 +18,7 @@ import java.util.List;
* @author zxfei * @author zxfei
* @date 2022-07-06 * @date 2022-07-06
*/ */
//@FeignClient(name = "portal-manager", path = "/zwfw", fallbackFactory = UserFeignFallbackFactory.class) @FeignClient(name = "portal-manager", path = "/zwfw", fallbackFactory = UserFeignFallbackFactory.class)
public interface IUserFeign extends IFeign { public interface IUserFeign extends IFeign {
......
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