Merge remote-tracking branch 'origin/master'

cert
1178634255 2 years ago
commit 8e92e2d7ec

@ -6,10 +6,7 @@ import com.glxp.api.annotation.Log;
import com.glxp.api.constant.BusinessType; import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.*; import com.glxp.api.entity.auth.*;
import com.glxp.api.req.auth.AuthUserSaveRequest; import com.glxp.api.req.auth.*;
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.res.PageSimpleResponse; import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
@ -34,7 +31,8 @@ import java.util.*;
@ApiIgnore @ApiIgnore
@RestController @RestController
public class AuthUserController extends BaseController { public class AuthUserController extends BaseController {
@Resource
CustomerService customerService;
@Resource @Resource
private AuthAdminService authAdminService; private AuthAdminService authAdminService;
@Resource @Resource
@ -136,4 +134,28 @@ public class AuthUserController extends BaseController {
return ResultVOUtils.success(hospitalUserList); return ResultVOUtils.success(hospitalUserList);
} }
//修改用户信息
@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())){
updateUserRequset.setId(authAdmin.getId());
authAdminService.updateUser(updateUserRequset);
return ResultVOUtils.success("修改成功");
}else {
return ResultVOUtils.error(500,"新密码与确认密码不相同!请重新修改!");
}
}
} }

@ -290,97 +290,97 @@ public class UdiTraceController extends BaseController {
} }
/** // /**
* // * 客户端根据任务上传出入库单据
* // *
* @param traceOrderUploadRequest // * @param traceOrderUploadRequest
* @param bindingResult // * @param bindingResult
* @return // * @return
*/ // */
@Transactional // @Transactional
@ApiOperation(value = "客户端根据任务上传出入库单据", response = BaseResponse.class) // @ApiOperation(value = "客户端根据任务上传出入库单据", response = BaseResponse.class)
@AuthRuleAnnotation("udi/trace/order/upload") // @AuthRuleAnnotation("udi/trace/order/upload")
@PostMapping("udi/trace/order/upload") // @PostMapping("udi/trace/order/upload")
public BaseResponse uploadOrder(@RequestBody TraceOrderUploadRequest traceOrderUploadRequest, BindingResult bindingResult) { // public BaseResponse uploadOrder(@RequestBody TraceOrderUploadRequest traceOrderUploadRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) { // if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); // return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
} // }
//
TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.getById(traceOrderUploadRequest.getTaskId()); // TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.getById(traceOrderUploadRequest.getTaskId());
if (taskNoticeEntity == null) { // if (taskNoticeEntity == null) {
return ResultVOUtils.error(500, "任务已过期,或任务不存在!"); // return ResultVOUtils.error(500, "任务已过期,或任务不存在!");
} // }
//
//清空历史数据 // //清空历史数据
traceOrderService.deleteByCompanyId(taskNoticeEntity.getProdudctRecordIdFk(), taskNoticeEntity.getCompanyIdFk()); // traceOrderService.deleteByCompanyId(taskNoticeEntity.getProdudctRecordIdFk(), taskNoticeEntity.getCompanyIdFk());
//
TraceOrderEntity traceOrderEntity = new TraceOrderEntity(); // TraceOrderEntity traceOrderEntity = new TraceOrderEntity();
BeanUtils.copyProperties(traceOrderUploadRequest, traceOrderEntity); // BeanUtils.copyProperties(traceOrderUploadRequest, traceOrderEntity);
traceOrderEntity.setId(IdUtil.getSnowflakeNextId()); // traceOrderEntity.setId(IdUtil.getSnowflakeNextId());
traceOrderEntity.setUpdateTime(new Date()); // traceOrderEntity.setUpdateTime(new Date());
traceOrderService.save(traceOrderEntity); // traceOrderService.save(traceOrderEntity);
//
//设置任务已完成 // //设置任务已完成
taskNoticeEntity.setStatus(3); // taskNoticeEntity.setStatus(3);
traceTaskNoticeService.updateById(taskNoticeEntity); // traceTaskNoticeService.updateById(taskNoticeEntity);
udiTraceService.pushDelayRemoveTask(taskNoticeEntity); // udiTraceService.pushDelayRemoveTask(taskNoticeEntity);
return ResultVOUtils.success("上传成功"); // return ResultVOUtils.success("上传成功");
} // }
//
//
/** // /**
* // * 客户端根据任务上传生产关联关系信息
* // *
* @param traceManuOrderUploadRequest // * @param traceManuOrderUploadRequest
* @param bindingResult // * @param bindingResult
* @return // * @return
*/ // */
@Transactional // @Transactional
@ApiOperation(value = "客户端根据任务上传生产关联关系信息", response = BaseResponse.class) // @ApiOperation(value = "客户端根据任务上传生产关联关系信息", response = BaseResponse.class)
@AuthRuleAnnotation("udi/trace/manuOrder/upload") // @AuthRuleAnnotation("udi/trace/manuOrder/upload")
@PostMapping("udi/trace/manuOrder/upload") // @PostMapping("udi/trace/manuOrder/upload")
public BaseResponse uploadManuOrder(@RequestBody TraceManuOrderUploadRequest traceManuOrderUploadRequest, BindingResult bindingResult) { // public BaseResponse uploadManuOrder(@RequestBody TraceManuOrderUploadRequest traceManuOrderUploadRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) { // if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); // return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
} // }
//
//
TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.getById(traceManuOrderUploadRequest.getTaskId()); // TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.getById(traceManuOrderUploadRequest.getTaskId());
if (taskNoticeEntity == null) { // if (taskNoticeEntity == null) {
return ResultVOUtils.error(500, "任务已过期,或任务不存在!"); // return ResultVOUtils.error(500, "任务已过期,或任务不存在!");
} // }
//
//清除历史数据 // //清除历史数据
TraceManuOrderEntity originOrder = traceManuOrderService.findByBillNo(traceManuOrderUploadRequest.getBillNo(), taskNoticeEntity.getProdudctRecordIdFk(), taskNoticeEntity.getCompanyIdFk()); // TraceManuOrderEntity originOrder = traceManuOrderService.findByBillNo(traceManuOrderUploadRequest.getBillNo(), taskNoticeEntity.getProdudctRecordIdFk(), taskNoticeEntity.getCompanyIdFk());
if (originOrder != null) { // if (originOrder != null) {
traceManuOrderService.removeById(originOrder.getId()); // traceManuOrderService.removeById(originOrder.getId());
traceManuCodeRelService.remove(new QueryWrapper<TraceManuCodeRelEntity>().eq("manuOrderIdFk", originOrder.getId())); // traceManuCodeRelService.remove(new QueryWrapper<TraceManuCodeRelEntity>().eq("manuOrderIdFk", originOrder.getId()));
} // }
//
//新增生产订单 // //新增生产订单
TraceManuOrderEntity traceManuOrderEntity = new TraceManuOrderEntity(); // TraceManuOrderEntity traceManuOrderEntity = new TraceManuOrderEntity();
BeanUtils.copyProperties(traceManuOrderUploadRequest, traceManuOrderEntity); // BeanUtils.copyProperties(traceManuOrderUploadRequest, traceManuOrderEntity);
traceManuOrderEntity.setId(IdUtil.getSnowflakeNextId()); // traceManuOrderEntity.setId(IdUtil.getSnowflakeNextId());
traceManuOrderService.save(traceManuOrderEntity); // traceManuOrderService.save(traceManuOrderEntity);
//
//新增订单关联明细 // //新增订单关联明细
List<TraceManuDetailRequest> traceManuDetailRequests = traceManuOrderUploadRequest.getDetails(); // List<TraceManuDetailRequest> traceManuDetailRequests = traceManuOrderUploadRequest.getDetails();
if (CollUtil.isNotEmpty(traceManuDetailRequests)) { // if (CollUtil.isNotEmpty(traceManuDetailRequests)) {
for (TraceManuDetailRequest traceManuDetailRequest : traceManuDetailRequests) { // for (TraceManuDetailRequest traceManuDetailRequest : traceManuDetailRequests) {
TraceManuCodeRelEntity traceManuCodeRelEntity = new TraceManuCodeRelEntity(); // TraceManuCodeRelEntity traceManuCodeRelEntity = new TraceManuCodeRelEntity();
BeanUtils.copyProperties(traceManuDetailRequest, traceManuCodeRelEntity); // BeanUtils.copyProperties(traceManuDetailRequest, traceManuCodeRelEntity);
traceManuCodeRelEntity.setId(IdUtil.getSnowflakeNextId()); // traceManuCodeRelEntity.setId(IdUtil.getSnowflakeNextId());
traceManuCodeRelEntity.setManuOrderIdFk(traceManuOrderEntity.getId()); // traceManuCodeRelEntity.setManuOrderIdFk(traceManuOrderEntity.getId());
traceManuOrderService.save(traceManuOrderEntity); // traceManuOrderService.save(traceManuOrderEntity);
} // }
} // }
//
//设置任务已完成 // //设置任务已完成
taskNoticeEntity.setStatus(3); // taskNoticeEntity.setStatus(3);
traceTaskNoticeService.updateById(taskNoticeEntity); // traceTaskNoticeService.updateById(taskNoticeEntity);
udiTraceService.pushDelayRemoveTask(taskNoticeEntity); // udiTraceService.pushDelayRemoveTask(taskNoticeEntity);
//
return ResultVOUtils.success("上传成功"); // return ResultVOUtils.success("上传成功");
} // }
} }

@ -3,6 +3,7 @@ package com.glxp.api.dao.auth;
import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.req.auth.FilterAuthUserRequest; 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.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -75,7 +76,7 @@ public interface AuthAdminDao extends BaseMapperPlus<AuthAdminDao, AuthAdmin, Au
* @return * @return
*/ */
List<AuthAdmin> selectHospitalUser(); List<AuthAdmin> selectHospitalUser();
boolean updateUser(UpdateUserRequset updateUserRequset);
List<AuthAdmin> selectNotSelectUser(@Param("userIds") List<Long> userIds, @Param("deptId") Long deptId); List<AuthAdmin> selectNotSelectUser(@Param("userIds") List<Long> userIds, @Param("deptId") Long deptId);
List<AuthAdmin> selectAllocatedList(FilterAuthUserRequest filterAuthUserRequest); List<AuthAdmin> selectAllocatedList(FilterAuthUserRequest filterAuthUserRequest);

@ -0,0 +1,37 @@
package com.glxp.api.req.auth;
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;
}

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.entity.auth.AuthAdmin; import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.req.auth.FilterAuthUserRequest; import com.glxp.api.req.auth.FilterAuthUserRequest;
import com.glxp.api.req.auth.FilterNoSelectUserRequest; import com.glxp.api.req.auth.FilterNoSelectUserRequest;
import com.glxp.api.req.auth.UpdateUserRequset;
import java.util.List; import java.util.List;
@ -34,7 +35,7 @@ public interface AuthAdminService extends IService<AuthAdmin> {
* @return * @return
*/ */
List<AuthAdmin> getHospitalUserList(); List<AuthAdmin> getHospitalUserList();
boolean updateUser(UpdateUserRequset updateUserRequset);
List<AuthAdmin> selectNotSelectUser(FilterNoSelectUserRequest filterNoSelectUserRequest); List<AuthAdmin> selectNotSelectUser(FilterNoSelectUserRequest filterNoSelectUserRequest);
List<AuthAdmin> selectAllocatedList(FilterAuthUserRequest filterAuthUserRequest); List<AuthAdmin> selectAllocatedList(FilterAuthUserRequest filterAuthUserRequest);

@ -12,6 +12,7 @@ import com.glxp.api.exception.JsonException;
import com.glxp.api.req.auth.FilterAuthUserRequest; import com.glxp.api.req.auth.FilterAuthUserRequest;
import com.glxp.api.req.auth.FilterNoSelectUserRequest; import com.glxp.api.req.auth.FilterNoSelectUserRequest;
import com.glxp.api.req.auth.FilterUserRoleRequest; 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.service.auth.AuthAdminService;
import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.enums.ResultEnum;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -134,7 +135,13 @@ public class AuthAdminServiceImpl extends ServiceImpl<AuthAdminDao, AuthAdmin> i
//查询未被禁用的医院用户 //查询未被禁用的医院用户
return authAdminDao.selectHospitalUser(); return authAdminDao.selectHospitalUser();
} }
@Override
public boolean updateUser(UpdateUserRequset updateUserRequset) {
if (updateUserRequset.getId() == null) {
return false;
}
return authAdminDao.updateUser(updateUserRequset);
}
@Override @Override
public List<AuthAdmin> selectNotSelectUser(FilterNoSelectUserRequest filterNoSelectUserRequest) { public List<AuthAdmin> selectNotSelectUser(FilterNoSelectUserRequest filterNoSelectUserRequest) {

@ -179,7 +179,15 @@
from auth_user from auth_user
where userFlag != 0 where userFlag != 0
</select> </select>
<update id="updateUser" parameterType="com.glxp.api.req.auth.UpdateUserRequset">
UPDATE auth_user
<set>
<if test="newPassword != null">
passWord=#{newPassword},
</if>
</set>
WHERE id = #{id}
</update>
<select id="selectNotSelectUser" resultType="com.glxp.api.entity.auth.AuthAdmin"> <select id="selectNotSelectUser" resultType="com.glxp.api.entity.auth.AuthAdmin">
select * select *

@ -78,6 +78,7 @@
and batchNo = #{batchNo} and batchNo = #{batchNo}
</if> </if>
</where> </where>
order by trace_order.billDate
</select> </select>

Loading…
Cancel
Save