wang-hao-jie
2022-03-17 6dfd2599d2e52507e018fd4c6b35d38873e48cfb
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/FingerprintController.java
@@ -174,6 +174,15 @@
    @ApiOperation(value = "编辑或更新数据")
    public Result<Fingerprint> saveOrUpdate(Fingerprint fingerprint) {
        if(StrUtil.isNotEmpty(fingerprint.getUserId())){
            QueryWrapper<Fingerprint> wrapper = new QueryWrapper<Fingerprint>();
            wrapper.eq("code",fingerprint.getCode());
            wrapper.isNotNull("user_id");
            Fingerprint one = iFingerprintService.getOne(wrapper);
            if(one!=null){
                return ResultUtil.error("code重复了,请重新获取");
            }
            User user = userService.get(fingerprint.getUserId());
            fingerprint.setUsername(user.getUsername());
            fingerprint.setPassword(user.getDescription());
@@ -182,6 +191,15 @@
        if(StrUtil.isNotEmpty(fingerprint.getCustomerId())){
            Customer byId = iCustomerService.getById(fingerprint.getCustomerId());
            fingerprint.setAreaId(byId.getAreaId());
            QueryWrapper<Fingerprint> wrapper = new QueryWrapper<Fingerprint>();
            wrapper.eq("code",fingerprint.getCode());
            wrapper.eq("area_id",byId.getAreaId());
            wrapper.isNotNull("customer_id");
            Fingerprint one = iFingerprintService.getOne(wrapper);
            if(one!=null){
                return ResultUtil.error("code重复了,请重新获取");
            }
        }
        if(StrUtil.isNotEmpty(fingerprint.getCustomerReceiveId())){