diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbPlussShopStaffDto.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbPlussShopStaffDto.java index 0e9ddaad..af23511b 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbPlussShopStaffDto.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/shop/TbPlussShopStaffDto.java @@ -61,4 +61,6 @@ public class TbPlussShopStaffDto implements Serializable { private Long createdAt; private Long updatedAt; + + private String type; } \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbPlussShopStaff.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbPlussShopStaff.java index 618b8411..a6bd1189 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbPlussShopStaff.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/shop/TbPlussShopStaff.java @@ -79,7 +79,9 @@ public class TbPlussShopStaff implements Serializable { @Column(name = "`updated_at`") @ApiModelProperty(value = "updatedAt") private Long updatedAt; - + @Column(name = "type") + @ApiModelProperty(value = "master商户账号staff员工") + private String type; public void copy(TbPlussShopStaff source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbShopPayTypeServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbShopPayTypeServiceImpl.java index 9bc50119..da9b64d4 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbShopPayTypeServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/TbShopPayTypeServiceImpl.java @@ -83,8 +83,6 @@ public class TbShopPayTypeServiceImpl implements TbShopPayTypeService { throw new BadRequestException("支付方式图标不能为空"); } //类型转换 - String nameByType = PayTypeEnum.getNameByType(resources.getPayName()); - resources.setPayType(nameByType); resources.setIsRefundable(0); resources.setIsShowShortcut(1); resources.setIsSystem(0); @@ -101,8 +99,6 @@ public class TbShopPayTypeServiceImpl implements TbShopPayTypeService { } TbShopPayType tbShopPayType = tbShopPayTypeRepository.findById(resources.getId()).orElseGet(TbShopPayType::new); //类型转换 - String nameByType = PayTypeEnum.getNameByType(resources.getPayName()); - resources.setPayType(nameByType); resources.setUpdatedAt(Instant.now().toEpochMilli()); ValidationUtil.isNull( tbShopPayType.getId(),"TbShopPayType","id",resources.getId()); tbShopPayType.copy(resources); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java index 0a74294d..901d73ac 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java @@ -17,10 +17,12 @@ package cn.ysk.cashier.service.impl.shopimpl; import cn.ysk.cashier.exception.BadRequestException; import cn.ysk.cashier.pojo.shop.TbMerchantAccount; +import cn.ysk.cashier.pojo.shop.TbPlussShopStaff; import cn.ysk.cashier.repository.shop.TbMerchantAccountRepository; import cn.ysk.cashier.pojo.shop.TbShopInfo; import cn.ysk.cashier.pojo.shop.TbMerchantRegister; import cn.ysk.cashier.repository.shop.TbMerchantRegisterRepository; +import cn.ysk.cashier.repository.shop.TbPlussShopStaffRepository; import cn.ysk.cashier.system.domain.Dept; import cn.ysk.cashier.system.domain.Job; import cn.ysk.cashier.system.domain.Role; @@ -68,6 +70,8 @@ public class TbShopInfoServiceImpl implements TbShopInfoService { private final PasswordEncoder passwordEncoder; + private final TbPlussShopStaffRepository shopStaffRepository; + @Override public Map queryAll(TbShopInfoQueryCriteria criteria, Pageable pageable){ // if (!"admin".equals(criteria.getAccount())){ @@ -165,6 +169,17 @@ public class TbShopInfoServiceImpl implements TbShopInfoService { user.setJobs(jobs); userRepository.save(user); + //增加员工表中的员工 + TbPlussShopStaff tbPlussShopStaff = new TbPlussShopStaff(); + tbPlussShopStaff.setShopId(String.valueOf(save.getId())); + tbPlussShopStaff.setType("master"); + tbPlussShopStaff.setAccount(resources.getAccount()); + tbPlussShopStaff.setPassword(MD5Utils.encrypt(resources.getPassword())); + tbPlussShopStaff.setStatus(1); + tbPlussShopStaff.setCreatedAt(Instant.now().toEpochMilli()); + tbPlussShopStaff.setUpdatedAt(Instant.now().toEpochMilli()); + shopStaffRepository.save(tbPlussShopStaff); + if (resources.getRegisterCode() != null){ //激活码绑定 TbMerchantRegister tbMerchantRegister = merchantRegisterRepository.findByRegisterCode(resources.getRegisterCode());