From 496b4e8fc7019a36be66cc75f9d2f7d208afb4ce Mon Sep 17 00:00:00 2001 From: anthonywj Date: Fri, 7 Jul 2023 10:32:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/trace/UdiTraceController.java | 184 +++++++++--------- .../mybatis/mapper/trace/TraceOrderMapper.xml | 1 + 2 files changed, 93 insertions(+), 92 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/trace/UdiTraceController.java b/src/main/java/com/glxp/api/controller/trace/UdiTraceController.java index b02fb3f..a4c61cc 100644 --- a/src/main/java/com/glxp/api/controller/trace/UdiTraceController.java +++ b/src/main/java/com/glxp/api/controller/trace/UdiTraceController.java @@ -290,97 +290,97 @@ public class UdiTraceController extends BaseController { } - /** - * 客户端根据任务上传出入库单据 - * - * @param traceOrderUploadRequest - * @param bindingResult - * @return - */ - @Transactional - @ApiOperation(value = "客户端根据任务上传出入库单据", response = BaseResponse.class) - @AuthRuleAnnotation("udi/trace/order/upload") - @PostMapping("udi/trace/order/upload") - public BaseResponse uploadOrder(@RequestBody TraceOrderUploadRequest traceOrderUploadRequest, BindingResult bindingResult) { - if (bindingResult.hasErrors()) { - return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); - } - - TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.getById(traceOrderUploadRequest.getTaskId()); - if (taskNoticeEntity == null) { - return ResultVOUtils.error(500, "任务已过期,或任务不存在!"); - } - - //清空历史数据 - traceOrderService.deleteByCompanyId(taskNoticeEntity.getProdudctRecordIdFk(), taskNoticeEntity.getCompanyIdFk()); - - TraceOrderEntity traceOrderEntity = new TraceOrderEntity(); - BeanUtils.copyProperties(traceOrderUploadRequest, traceOrderEntity); - traceOrderEntity.setId(IdUtil.getSnowflakeNextId()); - traceOrderEntity.setUpdateTime(new Date()); - traceOrderService.save(traceOrderEntity); - - //设置任务已完成 - taskNoticeEntity.setStatus(3); - traceTaskNoticeService.updateById(taskNoticeEntity); - udiTraceService.pushDelayRemoveTask(taskNoticeEntity); - return ResultVOUtils.success("上传成功"); - } - - - /** - * 客户端根据任务上传生产关联关系信息 - * - * @param traceManuOrderUploadRequest - * @param bindingResult - * @return - */ - @Transactional - @ApiOperation(value = "客户端根据任务上传生产关联关系信息", response = BaseResponse.class) - @AuthRuleAnnotation("udi/trace/manuOrder/upload") - @PostMapping("udi/trace/manuOrder/upload") - public BaseResponse uploadManuOrder(@RequestBody TraceManuOrderUploadRequest traceManuOrderUploadRequest, BindingResult bindingResult) { - if (bindingResult.hasErrors()) { - return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); - } - - - TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.getById(traceManuOrderUploadRequest.getTaskId()); - if (taskNoticeEntity == null) { - return ResultVOUtils.error(500, "任务已过期,或任务不存在!"); - } - - //清除历史数据 - TraceManuOrderEntity originOrder = traceManuOrderService.findByBillNo(traceManuOrderUploadRequest.getBillNo(), taskNoticeEntity.getProdudctRecordIdFk(), taskNoticeEntity.getCompanyIdFk()); - if (originOrder != null) { - traceManuOrderService.removeById(originOrder.getId()); - traceManuCodeRelService.remove(new QueryWrapper().eq("manuOrderIdFk", originOrder.getId())); - } - - //新增生产订单 - TraceManuOrderEntity traceManuOrderEntity = new TraceManuOrderEntity(); - BeanUtils.copyProperties(traceManuOrderUploadRequest, traceManuOrderEntity); - traceManuOrderEntity.setId(IdUtil.getSnowflakeNextId()); - traceManuOrderService.save(traceManuOrderEntity); - - //新增订单关联明细 - List traceManuDetailRequests = traceManuOrderUploadRequest.getDetails(); - if (CollUtil.isNotEmpty(traceManuDetailRequests)) { - for (TraceManuDetailRequest traceManuDetailRequest : traceManuDetailRequests) { - TraceManuCodeRelEntity traceManuCodeRelEntity = new TraceManuCodeRelEntity(); - BeanUtils.copyProperties(traceManuDetailRequest, traceManuCodeRelEntity); - traceManuCodeRelEntity.setId(IdUtil.getSnowflakeNextId()); - traceManuCodeRelEntity.setManuOrderIdFk(traceManuOrderEntity.getId()); - traceManuOrderService.save(traceManuOrderEntity); - } - } - - //设置任务已完成 - taskNoticeEntity.setStatus(3); - traceTaskNoticeService.updateById(taskNoticeEntity); - udiTraceService.pushDelayRemoveTask(taskNoticeEntity); - - return ResultVOUtils.success("上传成功"); - } +// /** +// * 客户端根据任务上传出入库单据 +// * +// * @param traceOrderUploadRequest +// * @param bindingResult +// * @return +// */ +// @Transactional +// @ApiOperation(value = "客户端根据任务上传出入库单据", response = BaseResponse.class) +// @AuthRuleAnnotation("udi/trace/order/upload") +// @PostMapping("udi/trace/order/upload") +// public BaseResponse uploadOrder(@RequestBody TraceOrderUploadRequest traceOrderUploadRequest, BindingResult bindingResult) { +// if (bindingResult.hasErrors()) { +// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); +// } +// +// TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.getById(traceOrderUploadRequest.getTaskId()); +// if (taskNoticeEntity == null) { +// return ResultVOUtils.error(500, "任务已过期,或任务不存在!"); +// } +// +// //清空历史数据 +// traceOrderService.deleteByCompanyId(taskNoticeEntity.getProdudctRecordIdFk(), taskNoticeEntity.getCompanyIdFk()); +// +// TraceOrderEntity traceOrderEntity = new TraceOrderEntity(); +// BeanUtils.copyProperties(traceOrderUploadRequest, traceOrderEntity); +// traceOrderEntity.setId(IdUtil.getSnowflakeNextId()); +// traceOrderEntity.setUpdateTime(new Date()); +// traceOrderService.save(traceOrderEntity); +// +// //设置任务已完成 +// taskNoticeEntity.setStatus(3); +// traceTaskNoticeService.updateById(taskNoticeEntity); +// udiTraceService.pushDelayRemoveTask(taskNoticeEntity); +// return ResultVOUtils.success("上传成功"); +// } +// +// +// /** +// * 客户端根据任务上传生产关联关系信息 +// * +// * @param traceManuOrderUploadRequest +// * @param bindingResult +// * @return +// */ +// @Transactional +// @ApiOperation(value = "客户端根据任务上传生产关联关系信息", response = BaseResponse.class) +// @AuthRuleAnnotation("udi/trace/manuOrder/upload") +// @PostMapping("udi/trace/manuOrder/upload") +// public BaseResponse uploadManuOrder(@RequestBody TraceManuOrderUploadRequest traceManuOrderUploadRequest, BindingResult bindingResult) { +// if (bindingResult.hasErrors()) { +// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); +// } +// +// +// TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.getById(traceManuOrderUploadRequest.getTaskId()); +// if (taskNoticeEntity == null) { +// return ResultVOUtils.error(500, "任务已过期,或任务不存在!"); +// } +// +// //清除历史数据 +// TraceManuOrderEntity originOrder = traceManuOrderService.findByBillNo(traceManuOrderUploadRequest.getBillNo(), taskNoticeEntity.getProdudctRecordIdFk(), taskNoticeEntity.getCompanyIdFk()); +// if (originOrder != null) { +// traceManuOrderService.removeById(originOrder.getId()); +// traceManuCodeRelService.remove(new QueryWrapper().eq("manuOrderIdFk", originOrder.getId())); +// } +// +// //新增生产订单 +// TraceManuOrderEntity traceManuOrderEntity = new TraceManuOrderEntity(); +// BeanUtils.copyProperties(traceManuOrderUploadRequest, traceManuOrderEntity); +// traceManuOrderEntity.setId(IdUtil.getSnowflakeNextId()); +// traceManuOrderService.save(traceManuOrderEntity); +// +// //新增订单关联明细 +// List traceManuDetailRequests = traceManuOrderUploadRequest.getDetails(); +// if (CollUtil.isNotEmpty(traceManuDetailRequests)) { +// for (TraceManuDetailRequest traceManuDetailRequest : traceManuDetailRequests) { +// TraceManuCodeRelEntity traceManuCodeRelEntity = new TraceManuCodeRelEntity(); +// BeanUtils.copyProperties(traceManuDetailRequest, traceManuCodeRelEntity); +// traceManuCodeRelEntity.setId(IdUtil.getSnowflakeNextId()); +// traceManuCodeRelEntity.setManuOrderIdFk(traceManuOrderEntity.getId()); +// traceManuOrderService.save(traceManuOrderEntity); +// } +// } +// +// //设置任务已完成 +// taskNoticeEntity.setStatus(3); +// traceTaskNoticeService.updateById(taskNoticeEntity); +// udiTraceService.pushDelayRemoveTask(taskNoticeEntity); +// +// return ResultVOUtils.success("上传成功"); +// } } diff --git a/src/main/resources/mybatis/mapper/trace/TraceOrderMapper.xml b/src/main/resources/mybatis/mapper/trace/TraceOrderMapper.xml index f58700b..26abd1d 100644 --- a/src/main/resources/mybatis/mapper/trace/TraceOrderMapper.xml +++ b/src/main/resources/mybatis/mapper/trace/TraceOrderMapper.xml @@ -78,6 +78,7 @@ and batchNo = #{batchNo} + order by trace_order.billDate From 9000fcfd0afb5d6d8b97b9398b88864ddeab7c0a Mon Sep 17 00:00:00 2001 From: 1178634255 <1178634255@qq.com> Date: Fri, 7 Jul 2023 16:41:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/auth/AuthUserController.java | 32 +++++++++++++--- .../com/glxp/api/dao/auth/AuthAdminDao.java | 3 +- .../glxp/api/req/auth/UpdateUserRequset.java | 37 +++++++++++++++++++ .../api/service/auth/AuthAdminService.java | 3 +- .../auth/impl/AuthAdminServiceImpl.java | 9 ++++- .../mybatis/mapper/auth/AuthAdminDao.xml | 10 ++++- 6 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 src/main/java/com/glxp/api/req/auth/UpdateUserRequset.java diff --git a/src/main/java/com/glxp/api/controller/auth/AuthUserController.java b/src/main/java/com/glxp/api/controller/auth/AuthUserController.java index 11cf3a5..58d606e 100644 --- a/src/main/java/com/glxp/api/controller/auth/AuthUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/AuthUserController.java @@ -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; @@ -34,7 +31,8 @@ import java.util.*; @ApiIgnore @RestController public class AuthUserController extends BaseController { - + @Resource + CustomerService customerService; @Resource private AuthAdminService authAdminService; @Resource @@ -136,4 +134,28 @@ public class AuthUserController extends BaseController { 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,"新密码与确认密码不相同!请重新修改!"); + } + + } + + + } diff --git a/src/main/java/com/glxp/api/dao/auth/AuthAdminDao.java b/src/main/java/com/glxp/api/dao/auth/AuthAdminDao.java index 6e29eb7..b939f89 100644 --- a/src/main/java/com/glxp/api/dao/auth/AuthAdminDao.java +++ b/src/main/java/com/glxp/api/dao/auth/AuthAdminDao.java @@ -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; @@ -75,7 +76,7 @@ public interface AuthAdminDao extends BaseMapperPlus selectHospitalUser(); - + boolean updateUser(UpdateUserRequset updateUserRequset); List selectNotSelectUser(@Param("userIds") List userIds, @Param("deptId") Long deptId); List selectAllocatedList(FilterAuthUserRequest filterAuthUserRequest); diff --git a/src/main/java/com/glxp/api/req/auth/UpdateUserRequset.java b/src/main/java/com/glxp/api/req/auth/UpdateUserRequset.java new file mode 100644 index 0000000..2fe54c3 --- /dev/null +++ b/src/main/java/com/glxp/api/req/auth/UpdateUserRequset.java @@ -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 roles; + private Long[] roleIds; + + +} diff --git a/src/main/java/com/glxp/api/service/auth/AuthAdminService.java b/src/main/java/com/glxp/api/service/auth/AuthAdminService.java index 0c77b14..5b623ad 100644 --- a/src/main/java/com/glxp/api/service/auth/AuthAdminService.java +++ b/src/main/java/com/glxp/api/service/auth/AuthAdminService.java @@ -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; @@ -34,7 +35,7 @@ public interface AuthAdminService extends IService { * @return */ List getHospitalUserList(); - + boolean updateUser(UpdateUserRequset updateUserRequset); List selectNotSelectUser(FilterNoSelectUserRequest filterNoSelectUserRequest); List selectAllocatedList(FilterAuthUserRequest filterAuthUserRequest); diff --git a/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java index 65d3207..4c5b704 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/AuthAdminServiceImpl.java @@ -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; @@ -134,7 +135,13 @@ public class AuthAdminServiceImpl extends ServiceImpl i //查询未被禁用的医院用户 return authAdminDao.selectHospitalUser(); } - + @Override + public boolean updateUser(UpdateUserRequset updateUserRequset) { + if (updateUserRequset.getId() == null) { + return false; + } + return authAdminDao.updateUser(updateUserRequset); + } @Override public List selectNotSelectUser(FilterNoSelectUserRequest filterNoSelectUserRequest) { diff --git a/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml b/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml index dc62167..2befcd7 100644 --- a/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml +++ b/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml @@ -176,7 +176,15 @@ from auth_user where userFlag != 0 - + + UPDATE auth_user + + + passWord=#{newPassword}, + + + WHERE id = #{id} +