添加获取最大折扣接口
This commit is contained in:
parent
c300f61def
commit
d93bfd24a1
|
|
@ -1,7 +1,6 @@
|
||||||
package com.chaozhanggui.system.cashierservice;
|
package com.chaozhanggui.system.cashierservice;
|
||||||
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.task.ConsInfoTask;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
@ -45,7 +44,6 @@ public class Shell {
|
||||||
@Bean
|
@Bean
|
||||||
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
|
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
|
||||||
return (args) -> {
|
return (args) -> {
|
||||||
// ctx.getBean(ConsInfoTask.class).init();
|
|
||||||
logger.info("=========================启动完成==========================");
|
logger.info("=========================启动完成==========================");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,4 +51,14 @@ public class LoginContoller {
|
||||||
@RequestHeader("clientType") String clientType){
|
@RequestHeader("clientType") String clientType){
|
||||||
return loginService.getShopInfo(token);
|
return loginService.getShopInfo(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value = "getStaffDiscount")
|
||||||
|
public Result getStaffDiscount(@RequestHeader("token") String token,
|
||||||
|
@RequestHeader("loginName") String loginName,
|
||||||
|
@RequestHeader("clientType") String clientType){
|
||||||
|
|
||||||
|
return loginService.getStaffDiscount(token);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -191,4 +192,23 @@ public class LoginService {
|
||||||
|
|
||||||
return Result.success(SUCCESS,shopInfo);
|
return Result.success(SUCCESS,shopInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Result getStaffDiscount(String token){
|
||||||
|
|
||||||
|
JSONObject jsonObject= TokenUtil.parseParamFromToken(token);
|
||||||
|
if(Objects.isNull(jsonObject)){
|
||||||
|
return Result.fail(CodeEnum.TOKENTERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer staffId=Integer.valueOf(jsonObject.getString("staffId"));
|
||||||
|
|
||||||
|
TbPlussShopStaff staff= tbPlussShopStaffMapper.selectByPrimaryKey(staffId);
|
||||||
|
if(Objects.nonNull(staff)&&Objects.nonNull(staff.getMaxDiscountAmount())){
|
||||||
|
return Result.success(SUCCESS,staff.getMaxDiscountAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.success(SUCCESS, BigDecimal.ZERO);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue