更改员工相关逻辑,支付方式部分调整

This commit is contained in:
liuyingfang
2024-03-04 13:52:15 +08:00
parent b1f6a494e6
commit ebe5c2123b
4 changed files with 20 additions and 5 deletions

View File

@@ -61,4 +61,6 @@ public class TbPlussShopStaffDto implements Serializable {
private Long createdAt;
private Long updatedAt;
private String type;
}

View File

@@ -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));
}

View File

@@ -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);

View File

@@ -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<String,Object> 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());