Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
3b8cbdee6e
|
|
@ -7,7 +7,7 @@ import java.util.regex.Pattern;
|
||||||
*/
|
*/
|
||||||
public class PhoneUtil {
|
public class PhoneUtil {
|
||||||
public static boolean validator(String phone) {
|
public static boolean validator(String phone) {
|
||||||
String regex = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$";
|
String regex = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[0-9]))\\d{8}$";
|
||||||
if (phone.length() != 11) {
|
if (phone.length() != 11) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -78,12 +78,14 @@ public class LogAspect {
|
||||||
Object o = redisUtils.get("online-token-"+getToken(request));
|
Object o = redisUtils.get("online-token-"+getToken(request));
|
||||||
JSONObject jsonObject = null;
|
JSONObject jsonObject = null;
|
||||||
Integer shopId = null;
|
Integer shopId = null;
|
||||||
if (o!= null){
|
String nickName = "";
|
||||||
|
if (o != null) {
|
||||||
String jsonString = JSON.toJSONString(o);
|
String jsonString = JSON.toJSONString(o);
|
||||||
jsonObject = JSONObject.parseObject(jsonString);
|
jsonObject = JSONObject.parseObject(jsonString);
|
||||||
shopId = (Integer)jsonObject.get("shopId");
|
shopId = (Integer) jsonObject.get("shopId");
|
||||||
|
nickName = jsonObject.get("nickName") == null ? "" : jsonObject.get("nickName").toString();
|
||||||
}
|
}
|
||||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log, shopId);
|
logService.save(nickName+":"+getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log, shopId);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -110,6 +112,7 @@ public class LogAspect {
|
||||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log, shopId);
|
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log, shopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
try {
|
try {
|
||||||
return SecurityUtils.getCurrentUsername();
|
return SecurityUtils.getCurrentUsername();
|
||||||
|
|
@ -117,6 +120,7 @@ public class LogAspect {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getToken(HttpServletRequest request) {
|
public String getToken(HttpServletRequest request) {
|
||||||
final String requestHeader = request.getHeader("Authorization");
|
final String requestHeader = request.getHeader("Authorization");
|
||||||
if (requestHeader != null && requestHeader.startsWith("Bearer")) {
|
if (requestHeader != null && requestHeader.startsWith("Bearer")) {
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
// 所有类型的接口都放行
|
// 所有类型的接口都放行
|
||||||
.antMatchers(anonymousUrls.get(RequestMethodEnum.ALL.getType()).toArray(new String[0])).permitAll()
|
.antMatchers(anonymousUrls.get(RequestMethodEnum.ALL.getType()).toArray(new String[0])).permitAll()
|
||||||
.antMatchers("/auth/appletsLogin").permitAll()
|
.antMatchers("/auth/appletsLogin").permitAll()
|
||||||
|
.antMatchers("/api/tbHandover").permitAll()
|
||||||
// 所有请求都需要认证
|
// 所有请求都需要认证
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
.and().apply(securityConfigurerAdapter());
|
.and().apply(securityConfigurerAdapter());
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,12 @@
|
||||||
package cn.ysk.cashier.config.security.rest;
|
package cn.ysk.cashier.config.security.rest;
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.ysk.cashier.config.security.config.bean.LoginCodeEnum;
|
import cn.ysk.cashier.config.security.config.bean.LoginCodeEnum;
|
||||||
import cn.ysk.cashier.config.security.security.TokenProvider;
|
import cn.ysk.cashier.config.security.security.TokenProvider;
|
||||||
|
import cn.ysk.cashier.pojo.shop.TbMerchantAccount;
|
||||||
import cn.ysk.cashier.pojo.shop.TbPlussShopStaff;
|
import cn.ysk.cashier.pojo.shop.TbPlussShopStaff;
|
||||||
|
import cn.ysk.cashier.repository.shop.TbMerchantAccountRepository;
|
||||||
import cn.ysk.cashier.repository.shop.TbPlussShopStaffRepository;
|
import cn.ysk.cashier.repository.shop.TbPlussShopStaffRepository;
|
||||||
import cn.ysk.cashier.utils.*;
|
import cn.ysk.cashier.utils.*;
|
||||||
import com.wf.captcha.base.Captcha;
|
import com.wf.captcha.base.Captcha;
|
||||||
|
|
@ -75,6 +78,8 @@ public class AuthorizationController {
|
||||||
private final AuthenticationManagerBuilder authenticationManagerBuilder;
|
private final AuthenticationManagerBuilder authenticationManagerBuilder;
|
||||||
private final TbShopInfoRepository tbShopInfoRepository;
|
private final TbShopInfoRepository tbShopInfoRepository;
|
||||||
private final TbPlussShopStaffRepository staffRepository;
|
private final TbPlussShopStaffRepository staffRepository;
|
||||||
|
private final TbMerchantAccountRepository tbMerchantAccountRepository;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private LoginProperties loginProperties;
|
private LoginProperties loginProperties;
|
||||||
|
|
||||||
|
|
@ -93,9 +98,23 @@ public class AuthorizationController {
|
||||||
if (authUser.isChecked() && StringUtils.isBlank(authUser.getCode()) || authUser.isChecked() && !authUser.getCode().equalsIgnoreCase(code)) {
|
if (authUser.isChecked() && StringUtils.isBlank(authUser.getCode()) || authUser.isChecked() && !authUser.getCode().equalsIgnoreCase(code)) {
|
||||||
throw new BadRequestException("验证码错误");
|
throw new BadRequestException("验证码错误");
|
||||||
}
|
}
|
||||||
|
String loginpre="";
|
||||||
|
// 判断是否是员工登录
|
||||||
|
if (authUser.getLoginType() != null && "staff".equals(authUser.getLoginType())) {
|
||||||
|
if (StrUtil.isBlank(authUser.getMerchantName())) {
|
||||||
|
throw new BadRequestException("商户名称不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
TbMerchantAccount merchant = tbMerchantAccountRepository.findByAccount(authUser.getMerchantName());
|
||||||
|
if (merchant == null) {
|
||||||
|
throw new BadRequestException("商户不存在");
|
||||||
|
}
|
||||||
|
loginpre=merchant.getShopId() + "@";
|
||||||
|
}
|
||||||
|
|
||||||
//生成token
|
//生成token
|
||||||
UsernamePasswordAuthenticationToken authenticationToken =
|
UsernamePasswordAuthenticationToken authenticationToken =
|
||||||
new UsernamePasswordAuthenticationToken(authUser.getUsername(), password);
|
new UsernamePasswordAuthenticationToken(loginpre+authUser.getUsername(), password);
|
||||||
Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
|
Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
|
||||||
SecurityContextHolder.getContext().setAuthentication(authentication);
|
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||||
// 生成令牌与第三方系统获取令牌方式
|
// 生成令牌与第三方系统获取令牌方式
|
||||||
|
|
@ -104,12 +123,17 @@ public class AuthorizationController {
|
||||||
// SecurityContextHolder.getContext().setAuthentication(authentication);
|
// SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||||
final JwtUserDto jwtUserDto = (JwtUserDto) authentication.getPrincipal();
|
final JwtUserDto jwtUserDto = (JwtUserDto) authentication.getPrincipal();
|
||||||
// TbShopInfo byAccount = tbShopInfoRepository.findByAccount(jwtUserDto.getUsername());
|
// TbShopInfo byAccount = tbShopInfoRepository.findByAccount(jwtUserDto.getUsername());
|
||||||
TbPlussShopStaff tbPlussShopStaff = staffRepository.queryByAccount(jwtUserDto.getUsername());
|
TbPlussShopStaff tbPlussShopStaff = staffRepository.queryByAccount(authUser.getUsername());
|
||||||
if (tbPlussShopStaff != null && tbPlussShopStaff.getType().equals("staff")) {
|
if (tbPlussShopStaff != null && tbPlussShopStaff.getType().equals("staff")) {
|
||||||
Integer isManage = tbPlussShopStaff.getIsManage();
|
Integer isManage = tbPlussShopStaff.getIsManage();
|
||||||
if (isManage != null && isManage != 1) {
|
if (isManage != null && isManage != 1) {
|
||||||
throw new BadRequestException("该账号无权限登录,请联系管理员");
|
throw new BadRequestException("该账号无权限登录,请联系管理员");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Integer status = tbPlussShopStaff.getStatus();
|
||||||
|
if (status != null && status != 1) {
|
||||||
|
throw new BadRequestException("该账号已被禁用,请联系管理员");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TbShopInfo byAccount = tbShopInfoRepository.findById(Integer.valueOf(tbPlussShopStaff.getShopId())).get();
|
TbShopInfo byAccount = tbShopInfoRepository.findById(Integer.valueOf(tbPlussShopStaff.getShopId())).get();
|
||||||
//校验商户商户激活是否到期(未激活)
|
//校验商户商户激活是否到期(未激活)
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ public class AuthUserDto {
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
private String loginType = "merchant";
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private String uuid = "";
|
private String uuid = "";
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ public class SuppFlow implements Serializable {
|
||||||
|
|
||||||
private List<ConInfos> list;
|
private List<ConInfos> list;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ public class TbConCheckController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询盘点耗材")
|
|
||||||
@ApiOperation("查询盘点耗材")
|
@ApiOperation("查询盘点耗材")
|
||||||
public ResponseEntity<Object> queryTbConCheck(TbConCheckQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryTbConCheck(TbConCheckQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(tbConCheckService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(tbConCheckService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ public class TbConUnitController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询耗材单位添加")
|
|
||||||
@ApiOperation("查询耗材单位添加")
|
@ApiOperation("查询耗材单位添加")
|
||||||
public ResponseEntity<Object> queryTbConUnit(TbConUnitQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryTbConUnit(TbConUnitQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(tbConUnitService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(tbConUnitService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ public class TbConsInfoController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询耗材信息")
|
|
||||||
@ApiOperation("查询耗材信息")
|
@ApiOperation("查询耗材信息")
|
||||||
public ResponseEntity<Object> queryTbConsInfo(TbConsInfoQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryTbConsInfo(TbConsInfoQueryCriteria criteria, Pageable pageable){
|
||||||
pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("createTime").descending());
|
pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("createTime").descending());
|
||||||
|
|
@ -75,6 +74,7 @@ public class TbConsInfoController {
|
||||||
@Log("耗材出入库")
|
@Log("耗材出入库")
|
||||||
@ApiOperation("耗材出入库")
|
@ApiOperation("耗材出入库")
|
||||||
public ResponseEntity<Object> stockInOut(@Validated @RequestBody SuppFlow resources) throws Exception {
|
public ResponseEntity<Object> stockInOut(@Validated @RequestBody SuppFlow resources) throws Exception {
|
||||||
|
|
||||||
tbConsInfoService.stockInOut(resources);
|
tbConsInfoService.stockInOut(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ public class TbConsInfoFlowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询耗材流水")
|
|
||||||
@ApiOperation("查询耗材流水")
|
@ApiOperation("查询耗材流水")
|
||||||
public ResponseEntity<Object> queryTbConsInfoFlow(TbConsInfoFlowQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryTbConsInfoFlow(TbConsInfoFlowQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(tbConsInfoFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(tbConsInfoFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ public class TbConsSuppFlowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询入库记录")
|
|
||||||
@ApiOperation("查询入库记录")
|
@ApiOperation("查询入库记录")
|
||||||
public ResponseEntity<Object> queryTbConsSuppFlow(TbConsSuppFlowQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryTbConsSuppFlow(TbConsSuppFlowQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(tbConsSuppFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(tbConsSuppFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ public class TbConsTypeController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询耗材类型")
|
|
||||||
@ApiOperation("查询耗材类型")
|
@ApiOperation("查询耗材类型")
|
||||||
public ResponseEntity<Object> queryTbConsType(TbConsTypeQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryTbConsType(TbConsTypeQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(tbConsTypeService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(tbConsTypeService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -34,19 +34,11 @@ public class TbHandoverController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询查询交班记录")
|
|
||||||
@ApiOperation("查询查询交班记录")
|
@ApiOperation("查询查询交班记录")
|
||||||
public ResponseEntity<Object> queryTbHandover(TbHandoverQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryTbHandover(TbHandoverQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(tbHandoverService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(tbHandoverService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
|
||||||
@Log("新增查询交班记录")
|
|
||||||
@ApiOperation("新增查询交班记录")
|
|
||||||
public ResponseEntity<Object> createTbHandover(@Validated @RequestBody TbHandover resources){
|
|
||||||
return new ResponseEntity<>(tbHandoverService.create(resources),HttpStatus.CREATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@Log("修改查询交班记录")
|
@Log("修改查询交班记录")
|
||||||
@ApiOperation("修改查询交班记录")
|
@ApiOperation("修改查询交班记录")
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ public class TbProskuConController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询商品规格耗材信息")
|
|
||||||
@ApiOperation("查询商品规格耗材信息")
|
@ApiOperation("查询商品规格耗材信息")
|
||||||
public ResponseEntity<Object> queryTbProskuCon(TbProskuConQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryTbProskuCon(TbProskuConQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(tbProskuConService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(tbProskuConService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ public class ViewConInfoFlowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询获取耗材流水信息")
|
|
||||||
@ApiOperation("查询获取耗材流水信息")
|
@ApiOperation("查询获取耗材流水信息")
|
||||||
public ResponseEntity<Object> queryViewConInfoFlow(ViewConInfoFlowQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryViewConInfoFlow(ViewConInfoFlowQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(viewConInfoFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(viewConInfoFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ public class ViewConSkuController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询查询耗材规格信息")
|
|
||||||
@ApiOperation("查询查询耗材规格信息")
|
@ApiOperation("查询查询耗材规格信息")
|
||||||
public ResponseEntity<Object> queryViewConSku(ViewConSkuQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryViewConSku(ViewConSkuQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(viewConSkuService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(viewConSkuService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ public class ViewConsSuppFlowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询出入库记录")
|
|
||||||
@ApiOperation("查询出入库记录")
|
@ApiOperation("查询出入库记录")
|
||||||
public ResponseEntity<Object> queryViewConsSuppFlow(ViewConsSuppFlowQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryViewConsSuppFlow(ViewConsSuppFlowQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(viewConsSuppFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(viewConsSuppFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ public class ViewProductSkuShopController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询商品规格信息查询")
|
|
||||||
@ApiOperation("查询商品规格信息查询")
|
@ApiOperation("查询商品规格信息查询")
|
||||||
public ResponseEntity<Object> queryViewProductSkuShop(ViewProductSkuShopQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryViewProductSkuShop(ViewProductSkuShopQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(viewProductSkuShopService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(viewProductSkuShopService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ import cn.ysk.cashier.annotation.Query;
|
||||||
public class TbHandoverQueryCriteria{
|
public class TbHandoverQueryCriteria{
|
||||||
|
|
||||||
/** 精确 */
|
/** 精确 */
|
||||||
@Query
|
@Query(type = Query.Type.BETWEEN)
|
||||||
private String tradeDay;
|
private List<String> tradeDay;
|
||||||
|
|
||||||
/** 精确 */
|
/** 精确 */
|
||||||
@Query
|
@Query
|
||||||
|
|
@ -26,4 +26,6 @@ public class TbHandoverQueryCriteria{
|
||||||
/** 精确 */
|
/** 精确 */
|
||||||
@Query
|
@Query
|
||||||
private String merchantName;
|
private String merchantName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -10,6 +10,7 @@ import cn.ysk.cashier.cons.service.TbConsInfoService;
|
||||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoDto;
|
import cn.ysk.cashier.cons.service.dto.TbConsInfoDto;
|
||||||
import cn.ysk.cashier.cons.service.dto.TbConsInfoQueryCriteria;
|
import cn.ysk.cashier.cons.service.dto.TbConsInfoQueryCriteria;
|
||||||
import cn.ysk.cashier.cons.service.mapstruct.TbConsInfoMapper;
|
import cn.ysk.cashier.cons.service.mapstruct.TbConsInfoMapper;
|
||||||
|
import cn.ysk.cashier.exception.BadRequestException;
|
||||||
import cn.ysk.cashier.pojo.product.TbProductStockOperate;
|
import cn.ysk.cashier.pojo.product.TbProductStockOperate;
|
||||||
import cn.ysk.cashier.pojo.shop.TbShopInfo;
|
import cn.ysk.cashier.pojo.shop.TbShopInfo;
|
||||||
import cn.ysk.cashier.pojo.shop.TbShopPurveyor;
|
import cn.ysk.cashier.pojo.shop.TbShopPurveyor;
|
||||||
|
|
@ -174,6 +175,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void stockInOut(SuppFlow resources) throws Exception {
|
public void stockInOut(SuppFlow resources) throws Exception {
|
||||||
|
log.info("resources:{}",JSON.toJSONString(resources));
|
||||||
if (Objects.isNull(resources)) {
|
if (Objects.isNull(resources)) {
|
||||||
throw new Exception("参数错误");
|
throw new Exception("参数错误");
|
||||||
}
|
}
|
||||||
|
|
@ -197,7 +199,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||||
operatorSnapMap.put("account", tbShopInfo.getAccount());
|
operatorSnapMap.put("account", tbShopInfo.getAccount());
|
||||||
|
|
||||||
stockOperate.setOperatorSnap(JSON.toJSONString(operatorSnapMap));
|
stockOperate.setOperatorSnap(JSON.toJSONString(operatorSnapMap));
|
||||||
stockOperate.setRemark("");
|
stockOperate.setRemark(resources.getRemark());
|
||||||
stockOperate.setStockTime(System.currentTimeMillis());
|
stockOperate.setStockTime(System.currentTimeMillis());
|
||||||
stockOperate.setCreatedAt(System.currentTimeMillis());
|
stockOperate.setCreatedAt(System.currentTimeMillis());
|
||||||
stockOperate.setUpdatedAt(System.currentTimeMillis());
|
stockOperate.setUpdatedAt(System.currentTimeMillis());
|
||||||
|
|
@ -255,7 +257,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||||
purveyorTransact.setType("cons_in");
|
purveyorTransact.setType("cons_in");
|
||||||
|
|
||||||
object.put("number",conInfos.getStockNumber());
|
object.put("number",conInfos.getStockNumber());
|
||||||
} else {
|
} else if("out".equals(resources.getType())) {
|
||||||
stockOperate.setSubType(-1);
|
stockOperate.setSubType(-1);
|
||||||
info.setStockNumber(info.getStockNumber().subtract(conInfos.getStockNumber()));
|
info.setStockNumber(info.getStockNumber().subtract(conInfos.getStockNumber()));
|
||||||
suppFlow.setBalance(info.getStockNumber().subtract(info.getStockConsume()).subtract(conInfos.getStockNumber()));
|
suppFlow.setBalance(info.getStockNumber().subtract(info.getStockConsume()).subtract(conInfos.getStockNumber()));
|
||||||
|
|
@ -271,6 +273,8 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||||
purveyorTransact.setWaitAmount((resources.getAccountsPayable().subtract(resources.getActualPayment())).negate());
|
purveyorTransact.setWaitAmount((resources.getAccountsPayable().subtract(resources.getActualPayment())).negate());
|
||||||
purveyorTransact.setType("cons_out");
|
purveyorTransact.setType("cons_out");
|
||||||
object.put("number",conInfos.getStockNumber());
|
object.put("number",conInfos.getStockNumber());
|
||||||
|
}else {
|
||||||
|
throw new BadRequestException("错误操作类型");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,8 @@ public class StockController {
|
||||||
return new ResponseEntity<>(dataMap, HttpStatus.OK);
|
return new ResponseEntity<>(dataMap, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AnonymousAccess
|
|
||||||
|
@Log("商品库存:上下架商品")
|
||||||
@PutMapping("/grounding")
|
@PutMapping("/grounding")
|
||||||
@ApiOperation("上下架商品")
|
@ApiOperation("上下架商品")
|
||||||
public ResponseEntity<Object> grounding(
|
public ResponseEntity<Object> grounding(
|
||||||
|
|
@ -140,6 +141,7 @@ public class StockController {
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Log("商品库存:修改商品状态")
|
||||||
@PutMapping("productStatus")
|
@PutMapping("productStatus")
|
||||||
public ResponseEntity<Object> updateProductStatus(@RequestBody StockUpdateValueVO updateValueVO) {
|
public ResponseEntity<Object> updateProductStatus(@RequestBody StockUpdateValueVO updateValueVO) {
|
||||||
stockService.updateProductStatus(updateValueVO);
|
stockService.updateProductStatus(updateValueVO);
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ public class TbCouponCategoryController {
|
||||||
private final TbCouponCategoryService tbCouponCategoryService;
|
private final TbCouponCategoryService tbCouponCategoryService;
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询团购卷类别")
|
|
||||||
@ApiOperation("查询团购卷类别")
|
@ApiOperation("查询团购卷类别")
|
||||||
public ResponseEntity<Object> queryTbCouponCategory(TbCouponCategoryQueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> queryTbCouponCategory(TbCouponCategoryQueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(tbCouponCategoryService.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(tbCouponCategoryService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public interface StockCountRepository extends JpaRepository<StockCountDTO, Integ
|
||||||
"\n" +
|
"\n" +
|
||||||
"WHEN pro.is_distribute = 0 THEN\n" +
|
"WHEN pro.is_distribute = 0 THEN\n" +
|
||||||
"sku.stock_number ELSE pro.stock_number \n" +
|
"sku.stock_number ELSE pro.stock_number \n" +
|
||||||
"END AS stock_number, ifnull(sku.spec_snap, '')\n" +
|
"END AS stock_number, ifnull(sku.spec_snap, '') spec_snap\n" +
|
||||||
"FROM\n" +
|
"FROM\n" +
|
||||||
"tb_order_detail info\n" +
|
"tb_order_detail info\n" +
|
||||||
"LEFT JOIN tb_order_info orders ON orders.id = info.order_id\n" +
|
"LEFT JOIN tb_order_info orders ON orders.id = info.order_id\n" +
|
||||||
|
|
|
||||||
|
|
@ -58,4 +58,8 @@ public interface TbProductRepository extends JpaRepository<TbProduct, Integer>,
|
||||||
|
|
||||||
@Query("select product from TbProduct product where product.id=:id and product.shopId=:shopId")
|
@Query("select product from TbProduct product where product.id=:id and product.shopId=:shopId")
|
||||||
TbProduct selectByShopIdAndId(Integer id, String shopId);
|
TbProduct selectByShopIdAndId(Integer id, String shopId);
|
||||||
|
|
||||||
|
@Query("select product from TbProduct product where product.shopId=:shopId")
|
||||||
|
List<TbProduct> selectByShopId(String shopId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -409,7 +409,7 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||||
case "offline":
|
case "offline":
|
||||||
tbOrderInfo.setOrderType("线下");
|
tbOrderInfo.setOrderType("线下");
|
||||||
break;
|
break;
|
||||||
case "return ":
|
case "return":
|
||||||
tbOrderInfo.setOrderType("退单");
|
tbOrderInfo.setOrderType("退单");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -466,7 +466,6 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||||
|
|
||||||
map.put("支付类型", tbOrderInfo.getPayType());
|
map.put("支付类型", tbOrderInfo.getPayType());
|
||||||
map.put("订单金额", tbOrderInfo.getOrderAmount());
|
map.put("订单金额", tbOrderInfo.getOrderAmount());
|
||||||
map.put("退单金额", tbOrderInfo.getRefundAmount());
|
|
||||||
map.put("支付金额", tbOrderInfo.getPayAmount());
|
map.put("支付金额", tbOrderInfo.getPayAmount());
|
||||||
switch (tbOrderInfo.getStatus()) {
|
switch (tbOrderInfo.getStatus()) {
|
||||||
case "unpaid":
|
case "unpaid":
|
||||||
|
|
@ -485,6 +484,7 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||||
tbOrderInfo.setStatus("申请退单中");
|
tbOrderInfo.setStatus("申请退单中");
|
||||||
break;
|
break;
|
||||||
case "refund":
|
case "refund":
|
||||||
|
map.put("支付金额", "-"+tbOrderInfo.getPayAmount());
|
||||||
tbOrderInfo.setStatus("退单完成");
|
tbOrderInfo.setStatus("退单完成");
|
||||||
break;
|
break;
|
||||||
case "cancelled":
|
case "cancelled":
|
||||||
|
|
|
||||||
|
|
@ -373,6 +373,7 @@ public class TbProductServiceImpl implements TbProductService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TbProduct save = tbProductRepository.save(product);
|
TbProduct save = tbProductRepository.save(product);
|
||||||
if (save.getId() == null) {
|
if (save.getId() == null) {
|
||||||
throw new BadRequestException("添加商品失败");
|
throw new BadRequestException("添加商品失败");
|
||||||
|
|
@ -381,6 +382,16 @@ public class TbProductServiceImpl implements TbProductService {
|
||||||
tbProductRepository.save(save);
|
tbProductRepository.save(save);
|
||||||
//sku
|
//sku
|
||||||
if (resources.getSkuList() != null) {
|
if (resources.getSkuList() != null) {
|
||||||
|
Integer warnLine = 0;
|
||||||
|
List<TbProduct> productList = tbProductRepository.selectByShopId(resources.getShopId());
|
||||||
|
if (!productList.isEmpty()) {
|
||||||
|
TbProduct p = productList.get(0);
|
||||||
|
List<TbProductSku> productSkus = tbProductSkuRepository.searchSku(p.getId().toString());
|
||||||
|
if (!productSkus.isEmpty()) {
|
||||||
|
warnLine = productSkus.get(0).getWarnLine();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<TbProductSku> skuList = new ArrayList<>();
|
List<TbProductSku> skuList = new ArrayList<>();
|
||||||
for (TbProductSku sku : resources.getSkuList()) {
|
for (TbProductSku sku : resources.getSkuList()) {
|
||||||
sku.setProductId(String.valueOf(save.getId()));
|
sku.setProductId(String.valueOf(save.getId()));
|
||||||
|
|
@ -388,6 +399,7 @@ public class TbProductServiceImpl implements TbProductService {
|
||||||
sku.setCreatedAt(Instant.now().toEpochMilli());
|
sku.setCreatedAt(Instant.now().toEpochMilli());
|
||||||
sku.setUpdatedAt(Instant.now().toEpochMilli());
|
sku.setUpdatedAt(Instant.now().toEpochMilli());
|
||||||
sku.setIsGrounding(1);
|
sku.setIsGrounding(1);
|
||||||
|
sku.setWarnLine(warnLine);
|
||||||
skuList.add(sku);
|
skuList.add(sku);
|
||||||
}
|
}
|
||||||
List<TbProductSku> tbProductSkus = tbProductSkuRepository.saveAll(skuList);
|
List<TbProductSku> tbProductSkus = tbProductSkuRepository.saveAll(skuList);
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,11 @@ import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -62,6 +64,9 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
|
||||||
private final PasswordEncoder passwordEncoder;
|
private final PasswordEncoder passwordEncoder;
|
||||||
private final UserService userService;
|
private final UserService userService;
|
||||||
|
|
||||||
|
// 正则表达式:(\u4e00-\u9fa5) 表示匹配一个中文字符,.* 表示匹配零个或多个任意字符
|
||||||
|
private final Pattern pattern = Pattern.compile("[\\u4e00-\\u9fa5]");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String,Object> queryAll(TbPlussShopStaffQueryCriteria criteria, Pageable pageable){
|
public Map<String,Object> queryAll(TbPlussShopStaffQueryCriteria criteria, Pageable pageable){
|
||||||
Page<TbPlussShopStaff> page = tbPlussShopStaffRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
Page<TbPlussShopStaff> page = tbPlussShopStaffRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||||
|
|
@ -95,6 +100,21 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
|
||||||
if (!PhoneUtil.validator(resources.getPhone())){
|
if (!PhoneUtil.validator(resources.getPhone())){
|
||||||
throw new BadRequestException("手机号格式有误");
|
throw new BadRequestException("手机号格式有误");
|
||||||
}
|
}
|
||||||
|
if (userRepository.findByUsername(resources.getAccount()) != null) {
|
||||||
|
throw new BadRequestException("员工账号已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pattern.matcher(resources.getCode()).find()) {
|
||||||
|
throw new BadRequestException("员工编号不能包含中文");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resources.getRoleId()==null) {
|
||||||
|
throw new BadRequestException("请选择角色");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resources.getMaxDiscountAmount().compareTo(new BigDecimal(100000000L)) > 0) {
|
||||||
|
throw new BadRequestException("最大优惠金额过大");
|
||||||
|
}
|
||||||
resources.setCreatedAt(Instant.now().toEpochMilli());
|
resources.setCreatedAt(Instant.now().toEpochMilli());
|
||||||
|
|
||||||
//添加收银系统后台账号
|
//添加收银系统后台账号
|
||||||
|
|
@ -106,7 +126,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
|
||||||
user.setPassword(passwordEncoder.encode(resources.getPassword()));
|
user.setPassword(passwordEncoder.encode(resources.getPassword()));
|
||||||
resources.setPassword(MD5Utils.md5(resources.getPassword()));
|
resources.setPassword(MD5Utils.md5(resources.getPassword()));
|
||||||
}
|
}
|
||||||
user.setUsername(resources.getAccount());
|
user.setUsername(resources.getShopId() + "@" +resources.getAccount());
|
||||||
user.setNickName(resources.getName());
|
user.setNickName(resources.getName());
|
||||||
user.setPhone(resources.getPhone());
|
user.setPhone(resources.getPhone());
|
||||||
user.setEnabled(true);
|
user.setEnabled(true);
|
||||||
|
|
@ -117,11 +137,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
|
||||||
|
|
||||||
Set<Role> roles = new HashSet<>();
|
Set<Role> roles = new HashSet<>();
|
||||||
Role role = new Role();
|
Role role = new Role();
|
||||||
if(resources.getRoleId()!=null){
|
role.setId(resources.getRoleId());
|
||||||
role.setId(resources.getRoleId());
|
|
||||||
}else {
|
|
||||||
role.setId(2l);
|
|
||||||
}
|
|
||||||
roles.add(role);
|
roles.add(role);
|
||||||
user.setRoles(roles);
|
user.setRoles(roles);
|
||||||
|
|
||||||
|
|
@ -130,9 +146,6 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
|
||||||
job.setId(10L);
|
job.setId(10L);
|
||||||
jobs.add(job);
|
jobs.add(job);
|
||||||
user.setJobs(jobs);
|
user.setJobs(jobs);
|
||||||
if (userRepository.findByUsername(user.getUsername()) != null) {
|
|
||||||
throw new BadRequestException("员工账号已存在");
|
|
||||||
}
|
|
||||||
userRepository.save(user);
|
userRepository.save(user);
|
||||||
return tbPlussShopStaffMapper.toDto(tbPlussShopStaffRepository.save(resources));
|
return tbPlussShopStaffMapper.toDto(tbPlussShopStaffRepository.save(resources));
|
||||||
}
|
}
|
||||||
|
|
@ -143,14 +156,18 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
|
||||||
if (StringUtils.isBlank(resources.getPassword())) {
|
if (StringUtils.isBlank(resources.getPassword())) {
|
||||||
resources.setPassword(null);
|
resources.setPassword(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pattern.matcher(resources.getCode()).find()) {
|
||||||
|
throw new BadRequestException("员工编号不能包含中文");
|
||||||
|
}
|
||||||
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(resources.getId()).orElseGet(TbPlussShopStaff::new);
|
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(resources.getId()).orElseGet(TbPlussShopStaff::new);
|
||||||
User sysUser = userRepository.findByUsername(tbPlussShopStaff.getAccount());
|
User sysUser = userRepository.findByUsername(resources.getShopId()+"@"+tbPlussShopStaff.getAccount());
|
||||||
if(!tbPlussShopStaff.getAccount().equals(resources.getAccount())){
|
if(!tbPlussShopStaff.getAccount().equals(resources.getAccount())){
|
||||||
if (userRepository.findByUsername(resources.getAccount()) != null) {
|
if (userRepository.findByUsername(resources.getAccount()) != null) {
|
||||||
throw new BadRequestException("员工账号不可重复");
|
throw new BadRequestException("员工账号不可重复");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resources.setUpdatedAt(Instant.now().toEpochMilli());
|
resources.setUpdatedAt(System.currentTimeMillis());
|
||||||
ValidationUtil.isNull( tbPlussShopStaff.getId(),"TbPlussShopStaff","id",resources.getId());
|
ValidationUtil.isNull( tbPlussShopStaff.getId(),"TbPlussShopStaff","id",resources.getId());
|
||||||
tbPlussShopStaff.copy(resources);
|
tbPlussShopStaff.copy(resources);
|
||||||
if (StringUtils.isNotBlank(resources.getPassword())) {
|
if (StringUtils.isNotBlank(resources.getPassword())) {
|
||||||
|
|
@ -162,7 +179,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
|
||||||
Role role = new Role();
|
Role role = new Role();
|
||||||
role.setId(resources.getRoleId());
|
role.setId(resources.getRoleId());
|
||||||
roles.add(role);
|
roles.add(role);
|
||||||
sysUser.setUsername(resources.getAccount());
|
sysUser.setUsername(resources.getShopId()+"@"+resources.getAccount());
|
||||||
sysUser.setRoles(roles);
|
sysUser.setRoles(roles);
|
||||||
sysUser.setNickName(resources.getName());
|
sysUser.setNickName(resources.getName());
|
||||||
if (StringUtils.isNotBlank(resources.getPassword())) {
|
if (StringUtils.isNotBlank(resources.getPassword())) {
|
||||||
|
|
@ -210,4 +227,4 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
|
||||||
}
|
}
|
||||||
FileUtil.downloadExcel(list, response);
|
FileUtil.downloadExcel(list, response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,7 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
|
||||||
User user = new User();
|
User user = new User();
|
||||||
user.setPassword(passwordEncoder.encode(resources.getPassword()));
|
user.setPassword(passwordEncoder.encode(resources.getPassword()));
|
||||||
user.setUsername(resources.getAccount());
|
user.setUsername(resources.getAccount());
|
||||||
|
user.setNickName(resources.getShopName());
|
||||||
user.setPhone(resources.getPhone());
|
user.setPhone(resources.getPhone());
|
||||||
user.setCreateBy("admin");
|
user.setCreateBy("admin");
|
||||||
user.setEnabled(true);
|
user.setEnabled(true);
|
||||||
|
|
@ -240,6 +241,7 @@ public class TbShopInfoServiceImpl implements TbShopInfoService {
|
||||||
TbShopInfo tbShopInfo = tbShopInfoRepository.findById(resources.getId()).orElseGet(TbShopInfo::new);
|
TbShopInfo tbShopInfo = tbShopInfoRepository.findById(resources.getId()).orElseGet(TbShopInfo::new);
|
||||||
if (!resources.getShopName().equals(tbShopInfo.getShopName())) {
|
if (!resources.getShopName().equals(tbShopInfo.getShopName())) {
|
||||||
shopStaffRepository.updateNameById(resources.getShopName(),resources.getId().toString());
|
shopStaffRepository.updateNameById(resources.getShopName(),resources.getId().toString());
|
||||||
|
userRepository.updateNickName(resources.getAccount(),resources.getShopName());
|
||||||
}
|
}
|
||||||
ValidationUtil.isNull( tbShopInfo.getId(),"TbShopInfo","id",resources.getId());
|
ValidationUtil.isNull( tbShopInfo.getId(),"TbShopInfo","id",resources.getId());
|
||||||
tbShopInfo.copy(resources);
|
tbShopInfo.copy(resources);
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,10 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat
|
||||||
@Query(value = "update sys_user set enabled = 0 where username = ?1",nativeQuery = true)
|
@Query(value = "update sys_user set enabled = 0 where username = ?1",nativeQuery = true)
|
||||||
void upEnableByusername(String username);
|
void upEnableByusername(String username);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query(value = "update sys_user set nick_name = ?2 where username = ?1",nativeQuery = true)
|
||||||
|
void updateNickName(String username, String nickName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改邮箱
|
* 修改邮箱
|
||||||
* @param username 用户名
|
* @param username 用户名
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ public class ${className}Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询${apiAlias}")
|
|
||||||
@ApiOperation("查询${apiAlias}")
|
@ApiOperation("查询${apiAlias}")
|
||||||
public ResponseEntity<Object> query${className}(${className}QueryCriteria criteria, Pageable pageable){
|
public ResponseEntity<Object> query${className}(${className}QueryCriteria criteria, Pageable pageable){
|
||||||
return new ResponseEntity<>(${changeClassName}Service.queryAll(criteria,pageable),HttpStatus.OK);
|
return new ResponseEntity<>(${changeClassName}Service.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue