Merge remote-tracking branch 'origin/dev' into dev

dev
anthonywj 2 years ago
commit 9658dcd316

@ -6,10 +6,7 @@ import com.glxp.api.annotation.Log;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.*;
import com.glxp.api.req.auth.AuthUserSaveRequest;
import com.glxp.api.req.auth.FilterInvLinkDataRequest;
import com.glxp.api.req.auth.FilterInvWarehouseRequest;
import com.glxp.api.req.auth.FilterNoSelectUserRequest;
import com.glxp.api.req.auth.*;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
@ -136,4 +133,25 @@ public class AuthUserController extends BaseController {
return ResultVOUtils.success(authAdmin);
}
//修改用户名信息
@AuthRuleAnnotation("")
@PostMapping("/admin/auth/admin/updateUser")
public BaseResponse updateUser(@RequestBody UpdateUserRequset updateUserRequset) {
AuthAdmin authAdmin=customerService.getUserBean();
System.out.println(updateUserRequset.toString());
if (!updateUserRequset.getPassWord().equals(authAdmin.getPassWord())){
return ResultVOUtils.error(500,"当前密码输入错误!请重新输入!");
}
if (updateUserRequset.getNewPassword().equals(authAdmin.getPassWord())){
return ResultVOUtils.error(500,"新密码与旧密码重复!请重新修改!");
}
if (updateUserRequset.getNewPassword().equals(updateUserRequset.getConfirmPassword())&&updateUserRequset.getPassWord().equals(authAdmin.getPassWord())){
customerService.update(updateUserRequset);
return ResultVOUtils.success("修改成功");
}else {
return ResultVOUtils.error(500,"新密码与确认密码不相同!请重新修改!");
}
}
}

@ -433,7 +433,7 @@ public class IoCodeTempController extends BaseController {
String expireDate = "20" + udiEntity.getExpireDate();
long expireTime = MsDateUtil.parseDateExpire(expireDate);
if (expireTime - System.currentTimeMillis() < 0) {
return ResultVOUtils.error(604, "当前产品已过期,无法添加?");
return ResultVOUtils.error(604, "当前产品已过期,无法添加!");
}
}
}
@ -455,7 +455,7 @@ public class IoCodeTempController extends BaseController {
if (resultTime > 0) {
long time = resultTime / (24 * 60 * 60 * 1000);
if (resultTime < recentTieme) {
return ResultVOUtils.error(505, "当前产品临近过期,距过期还剩" + time + ",是否确定继续添加?");
return ResultVOUtils.error(505, "当前产品临近过期,距过期还剩" + time + ",是否确定继续添加?");
}
}
}

@ -118,6 +118,45 @@ public class ThrProductsExportLogController {
//产品信息导出生成Excel并创建生成记录
@PostMapping("/udiwms/thrProducts/importLog/export")
public BaseResponse excelDownload(@RequestBody ThrProductsExportRequest thrProductsExportRequest) {
ThrProductsExportLogEntity thrProductsExportLogEntity = new ThrProductsExportLogEntity();
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
filterThrProductsRequest.setThirdSysFk(thrProductsExportRequest.getThirdSys());
filterThrProductsRequest.setThirdSys(thrProductsExportRequest.getThirdSys());
//List<ThrProductsEntity> thrProductsEntities = thrProductsService.filterThrProducts1(filterThrProductsRequest);
//thrProductsExportRequest.setThrProductsEntities(thrProductsEntities);
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
String fileName = "D:\\udiwms\\exportFile\\" + "第三方产品信息" + genKey + ".UpperIn";
File file = new File(fileName);
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
List<ThrProductsEntity> thrProductsEntityList = thrProductsExportRequest.getThrProductsEntities();
thrProductsExportLogEntity.setGenKey(genKey);
thrProductsExportLogEntity.setFilePath(fileName);
thrProductsExportLogEntity.setUpdateTime(new Date());
thrProductsExportLogEntity.setDlCount(0);
thrProductsExportLogEntity.setType(BasicProcessStatus.EXPORT_JSON);
thrProductsExportLogEntity.setUpdateUser(String.valueOf(customerService.getUserId()));
thrProductsExportLogEntity.setCreateUser(String.valueOf(customerService.getUserId()));
thrProductsExportLogEntity.setUpdateTime(new Date());
thrProductsExportLogEntity.setCreateTime(new Date());
thrProductsExportLogEntity.setRemark("本次导出数据" + thrProductsEntityList.size() + "条");
thrProductsExportLogService.insertThrProductsExportLog(thrProductsExportLogEntity);
//thrProductsDlService.genExcel(genKey, thrProductsExportRequest);
//修改为导出json文件
thrProductsDlService.genJsonFile(genKey, thrProductsExportRequest);
return ResultVOUtils.success("后台正在导出生成udi文件请稍后刷新查看!");
}
//产品信息导出生成Excel并创建生成记录
@PostMapping("/udiwms/thrProducts/importLog/exportAll")
public BaseResponse excelDownloadAll(@RequestBody ThrProductsExportRequest thrProductsExportRequest) {
ThrProductsExportLogEntity thrProductsExportLogEntity = new ThrProductsExportLogEntity();
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
filterThrProductsRequest.setThirdSysFk(thrProductsExportRequest.getThirdSys());
@ -135,6 +174,7 @@ public class ThrProductsExportLogController {
e.printStackTrace();
}
}
List<ThrProductsEntity> thrProductsEntityList = thrProductsExportRequest.getThrProductsEntities();
thrProductsExportLogEntity.setGenKey(genKey);
thrProductsExportLogEntity.setFilePath(fileName);
thrProductsExportLogEntity.setUpdateTime(new Date());
@ -144,6 +184,7 @@ public class ThrProductsExportLogController {
thrProductsExportLogEntity.setCreateUser(String.valueOf(customerService.getUserId()));
thrProductsExportLogEntity.setUpdateTime(new Date());
thrProductsExportLogEntity.setCreateTime(new Date());
thrProductsExportLogEntity.setRemark("本次导出数据" + thrProductsEntityList.size() + "条");
thrProductsExportLogService.insertThrProductsExportLog(thrProductsExportLogEntity);
//thrProductsDlService.genExcel(genKey, thrProductsExportRequest);
//修改为导出json文件

@ -3,6 +3,7 @@ package com.glxp.api.dao.auth;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.req.auth.FilterAuthUserRequest;
import com.glxp.api.req.auth.UpdateUserRequset;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -60,6 +61,8 @@ public interface AuthAdminDao extends BaseMapperPlus<AuthAdminDao, AuthAdmin, Au
*/
boolean updateAuthAdmin(AuthAdmin authAdmin);
boolean updateUser(UpdateUserRequset updateUserRequset);
/**
*
*

@ -12,6 +12,8 @@ public class FilterAuthUserRequest extends ListPageRequest {
private String userName;
private String deptName;
private Integer userFlag;
private Long roleId;

@ -7,6 +7,6 @@ import lombok.Data;
public class FilterDeptUserReqeust extends ListPageRequest {
private Long deptId;
private Long userId;
private String deptName;
private String key;
}

@ -0,0 +1,38 @@
package com.glxp.api.req.auth;
import com.baomidou.mybatisplus.annotation.TableField;
import com.glxp.api.entity.auth.SysRole;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class UpdateUserRequset {
// 主键
private Long id;
private String userName;
// 登录密码
private String passWord;
private String newPassword;
private String confirmPassword;
// 最后登录ip
private String lastLoginIp;
// 最后登录时间
private Date lastLoginTime;
// 创建时间
private Date createTime;
// 状态
private Integer userFlag;
private Date lastModifyTime;
private String comments;
private String employeeName;
private Long CustomerId;
private String locDeptCode;
private String locInvCode;
private String deptName;
private List<SysRole> roles;
private Long[] roleIds;
}

@ -9,6 +9,7 @@ public class AddOrderRequest {
private String mainAction;
private String action;
private String fromCorp;
private String fromCorpName;
private String fromInvCode;
private String deptCode;
private String invCode;
@ -30,7 +31,7 @@ public class AddOrderRequest {
private String checkPreInOrders;
private String selectSupId;
private Long relId;
private Integer checkVailDate;
// 预验收货位
private String checkPreInSpaceCode;
private String curSpaceCode;

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.req.auth.FilterAuthUserRequest;
import com.glxp.api.req.auth.FilterNoSelectUserRequest;
import com.glxp.api.req.auth.UpdateUserRequset;
import java.util.List;
@ -24,6 +25,8 @@ public interface AuthAdminService extends IService<AuthAdmin> {
boolean updateAuthAdmin(AuthAdmin authAdmin);
boolean updateUser(UpdateUserRequset updateUserRequset);
boolean deleteById(Long id);
/**

@ -3,6 +3,8 @@ package com.glxp.api.service.auth;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.auth.UpdateUserRequset;
import lombok.val;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -50,4 +52,9 @@ public class CustomerService {
return authAdmin.getUserName();
}
public boolean update(UpdateUserRequset updateUserRequset) {
return authAdminService.updateUser(updateUserRequset);
}
}

@ -12,6 +12,7 @@ import com.glxp.api.exception.JsonException;
import com.glxp.api.req.auth.FilterAuthUserRequest;
import com.glxp.api.req.auth.FilterNoSelectUserRequest;
import com.glxp.api.req.auth.FilterUserRoleRequest;
import com.glxp.api.req.auth.UpdateUserRequset;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.common.enums.ResultEnum;
import org.springframework.stereotype.Service;
@ -115,6 +116,23 @@ public class AuthAdminServiceImpl extends ServiceImpl<AuthAdminDao, AuthAdmin> i
return authAdminDao.updateAuthAdmin(authAdmin);
}
@Override
public boolean updateUser(UpdateUserRequset updateUserRequset) {
if (updateUserRequset.getId() == null) {
return false;
}
return authAdminDao.updateUser(updateUserRequset);
}
// @Override
// public boolean updateAuthAdmin(UpdateUserRequset updateUserRequset) {
//
// if (updateUserRequset.getId() == null) {
// return false;
// }
// return authAdminDao.updateUser(updateUserRequset);
// }
/**
* id
*

@ -23,6 +23,12 @@
<if test="neUserName != null and '' != neUserName">
AND userName != #{neUserName}
</if>
<if test="deptName != null and '' != deptName">
AND auth_dept.name LIKE CONCAT('%', #{deptName}, '%')
</if>
<if test="deptName != null and '' != deptName">
AND auth_dept.name != #{deptName}
</if>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(lastModifyTime
@ -164,6 +170,16 @@
WHERE id = #{id}
</update>
<update id="updateUser" parameterType="com.glxp.api.req.auth.UpdateUserRequset">
UPDATE auth_user
<set>
<if test="passWord != null">
passWord=#{newPassword},
</if>
</set>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="java.lang.Long">
delete
from auth_user

@ -45,7 +45,7 @@
)
</if>
<if test="outType != null">
AND (outType <![CDATA[ <> ]]> #{outType} or outType is NULL)
AND (outType = #{outType} or outType is NULL)
</if>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[

Loading…
Cancel
Save