退料申请表数据问题修改
This commit is contained in:
parent
15c8119f94
commit
3878c5a23f
|
|
@ -68,6 +68,7 @@ public class TokenController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* App端登录
|
* App端登录
|
||||||
|
*
|
||||||
* @param form
|
* @param form
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -125,13 +126,19 @@ public class TokenController {
|
||||||
public R<?> register(@RequestBody RegisterBody registerBody) {
|
public R<?> register(@RequestBody RegisterBody registerBody) {
|
||||||
// 用户注册
|
// 用户注册
|
||||||
sysLoginService.register(registerBody);
|
sysLoginService.register(registerBody);
|
||||||
return R.ok(null,"注册成功");
|
return R.ok(null, "注册成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("loginByMall")
|
@PostMapping("loginByMall")
|
||||||
public R<?> loginByMall(@RequestBody LoginUser loginUser) {
|
public R<?> loginByMall(@RequestBody LoginUser loginUser) {
|
||||||
// 用户注册
|
// 用户注册
|
||||||
return R.ok(sysLoginService.loginByMall(loginUser));
|
Map map = sysLoginService.loginByMall(loginUser);
|
||||||
|
if ("1".equals(map.get("status").toString())) {
|
||||||
|
return R.fail("登录用户未注册");
|
||||||
|
} else if ("2".equals(map.get("login_user").toString())) {
|
||||||
|
return R.fail("未携带token");
|
||||||
|
}
|
||||||
|
return R.ok(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("微服务平台认证接口")
|
@ApiOperation("微服务平台认证接口")
|
||||||
|
|
|
||||||
|
|
@ -247,14 +247,14 @@ public class SysLoginService {
|
||||||
// 表示商城登录该系统的标识
|
// 表示商城登录该系统的标识
|
||||||
if (StringUtils.isNotBlank(token)) {
|
if (StringUtils.isNotBlank(token)) {
|
||||||
R<LoginUser> userInfo = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
|
R<LoginUser> userInfo = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
|
||||||
if (ObjectUtils.isNotEmpty(userInfo.getData())) {
|
if (ObjectUtils.isNotEmpty(userInfo.getData()) && userInfo.getCode() == 200) {
|
||||||
return tokenService.createToken(userInfo.getData());
|
return tokenService.createToken(userInfo.getData());
|
||||||
} else {
|
} else {
|
||||||
hashMap.put("login_user", "该用户未注册");
|
hashMap.put("status", "1");
|
||||||
return hashMap;
|
return hashMap;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
hashMap.put("login_user", "token为空");
|
hashMap.put("status", "2");
|
||||||
return hashMap;
|
return hashMap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ public class TokenService
|
||||||
//密码置空后返回
|
//密码置空后返回
|
||||||
loginUser.getSysUser().setPassword("");
|
loginUser.getSysUser().setPassword("");
|
||||||
rspMap.put("login_user", loginUser);
|
rspMap.put("login_user", loginUser);
|
||||||
|
rspMap.put("status", "0");
|
||||||
return rspMap;
|
return rspMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
List<BackApplyInfo> backApplyListByAdmin = backApplyMapper.getBackApplyListByAdmin(bean);
|
List<BackApplyInfo> backApplyListByAdmin = backApplyMapper.getBackApplyListByAdmin(bean);
|
||||||
//机具分公司只能看到机具公司的退料
|
//机具分公司只能看到机具公司的退料
|
||||||
if (CollUtil.isNotEmpty(backApplyListByAdmin)) {
|
if (CollUtil.isNotEmpty(backApplyListByAdmin)) {
|
||||||
if (roles.contains("sgb") || roles.contains("jjfgs")) {
|
if (roles.contains("jjfgs")) {
|
||||||
for (BackApplyInfo backApplyInfo : backApplyListByAdmin) {
|
for (BackApplyInfo backApplyInfo : backApplyListByAdmin) {
|
||||||
if (StringUtils.hasText(backApplyInfo.getCompanyId()) && backApplyInfo.getCompanyId().contains(String.valueOf(companyId))) {
|
if (StringUtils.hasText(backApplyInfo.getCompanyId()) && backApplyInfo.getCompanyId().contains(String.valueOf(companyId))) {
|
||||||
backApplyInfos.add(backApplyInfo);
|
backApplyInfos.add(backApplyInfo);
|
||||||
|
|
@ -71,7 +71,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
}
|
}
|
||||||
//调试分公司只能看到调试公司的退料
|
//调试分公司只能看到调试公司的退料
|
||||||
if (CollUtil.isNotEmpty(backApplyListByAdmin)) {
|
if (CollUtil.isNotEmpty(backApplyListByAdmin)) {
|
||||||
if (roles.contains("ajb") || roles.contains("tsfgs")) {
|
if (roles.contains("tsfgs")) {
|
||||||
for (BackApplyInfo backApplyInfo : backApplyListByAdmin) {
|
for (BackApplyInfo backApplyInfo : backApplyListByAdmin) {
|
||||||
if (StringUtils.hasText(backApplyInfo.getCompanyId()) && backApplyInfo.getCompanyId().contains(String.valueOf(companyId))) {
|
if (StringUtils.hasText(backApplyInfo.getCompanyId()) && backApplyInfo.getCompanyId().contains(String.valueOf(companyId))) {
|
||||||
backApplyInfos.add(backApplyInfo);
|
backApplyInfos.add(backApplyInfo);
|
||||||
|
|
@ -162,6 +162,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
public AjaxResult audit(BackApplyInfo bean) {
|
public AjaxResult audit(BackApplyInfo bean) {
|
||||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||||
String username = SecurityUtils.getLoginUser().getUsername();
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||||
int num = 0;
|
int num = 0;
|
||||||
if (!StringUtils.isEmpty(bean.getIds())) {
|
if (!StringUtils.isEmpty(bean.getIds())) {
|
||||||
String[] ids = bean.getIds().split(",");
|
String[] ids = bean.getIds().split(",");
|
||||||
|
|
@ -169,7 +170,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
String id = ids[i];
|
String id = ids[i];
|
||||||
bean.setId(Long.valueOf(id));
|
bean.setId(Long.valueOf(id));
|
||||||
if (roles.contains("jjfgs") || roles.contains("admin")) {
|
if (roles.contains("jjfgs") || roles.contains("admin")) {
|
||||||
bean.setCompanyId("101");
|
bean.setCompanyId(companyId.toString());
|
||||||
bean.setCreateBy(username);
|
bean.setCreateBy(username);
|
||||||
bean.setStatus("1");
|
bean.setStatus("1");
|
||||||
int re = backApplyMapper.audit(bean);
|
int re = backApplyMapper.audit(bean);
|
||||||
|
|
@ -178,7 +179,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (roles.contains("tsfgs") || roles.contains("admin")) {
|
if (roles.contains("tsfgs") || roles.contains("admin")) {
|
||||||
bean.setCompanyId("102");
|
bean.setCompanyId(companyId.toString());
|
||||||
bean.setCreateBy(username);
|
bean.setCreateBy(username);
|
||||||
bean.setStatus("2");
|
bean.setStatus("2");
|
||||||
int re = backApplyMapper.audit(bean);
|
int re = backApplyMapper.audit(bean);
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
UPDATE tm_task tt
|
UPDATE tm_task tt
|
||||||
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
||||||
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||||
SET bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status=#{status},bai.direct_audit_time=NOW()
|
SET bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.status=#{status},bai.direct_audit_time=NOW()
|
||||||
WHERE
|
WHERE
|
||||||
bai.id = #{id}
|
bai.id = #{id}
|
||||||
<if test="companyId != null and companyId != ''">
|
<if test="companyId != null and companyId != ''">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue