45 changed files with 587 additions and 764 deletions
@ -1,103 +0,0 @@ |
|||
package com.qs.serve.modules.bms.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.bms.entity.BmsErpInfo; |
|||
import com.qs.serve.modules.bms.service.BmsErpInfoService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 基础档案 ERP信息 |
|||
* @author YenHex |
|||
* @since 2022-10-13 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("bms/erpInfo") |
|||
public class BmsErpInfoController { |
|||
|
|||
private BmsErpInfoService bmsErpInfoService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('bms:erpInfo:query')") |
|||
public R<PageVo<BmsErpInfo>> getPage(BmsErpInfo param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<BmsErpInfo> erpInfoWrapper = new LambdaQueryWrapper<>(param); |
|||
List<BmsErpInfo> list = bmsErpInfoService.list(erpInfoWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "ERP信息", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('bms:erpInfo:query')") |
|||
public R<BmsErpInfo> getById(@PathVariable("id") String id){ |
|||
BmsErpInfo bmsErpInfo = bmsErpInfoService.getById(id); |
|||
return R.ok(bmsErpInfo); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.BASE, title = "ERP信息", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('bms:erpInfo:update')") |
|||
public R<?> updateById(@RequestBody @Valid BmsErpInfo param){ |
|||
boolean result = bmsErpInfoService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增ERP信息 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.BASE, title = "ERP信息", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('bms:erpInfo:insert')") |
|||
public R<?> save(@RequestBody @Valid BmsErpInfo param){ |
|||
boolean result = bmsErpInfoService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除ERP信息 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "ERP信息", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('bms:erpInfo:delete')") |
|||
public R<?> deleteById(@PathVariable("id") Long id){ |
|||
boolean result = bmsErpInfoService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -1,103 +0,0 @@ |
|||
package com.qs.serve.modules.bms.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.qs.serve.common.model.annotation.SysLog; |
|||
import com.qs.serve.common.model.dto.PageVo; |
|||
import com.qs.serve.common.model.dto.R; |
|||
import com.qs.serve.common.model.enums.BizType; |
|||
import com.qs.serve.common.model.enums.SystemModule; |
|||
import com.qs.serve.common.util.PageUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import com.qs.serve.modules.bms.entity.BmsSupplierUser; |
|||
import com.qs.serve.modules.bms.service.BmsSupplierUserService; |
|||
|
|||
import javax.validation.Valid; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 基础档案 客户分配 |
|||
* @author YenHex |
|||
* @since 2022-10-13 |
|||
*/ |
|||
@Slf4j |
|||
@AllArgsConstructor |
|||
@RestController |
|||
@RequestMapping("bms/supplierUser") |
|||
public class BmsSupplierUserController { |
|||
|
|||
private BmsSupplierUserService bmsSupplierUserService; |
|||
|
|||
/** |
|||
* 翻页查询 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@GetMapping("/page") |
|||
@PreAuthorize("hasRole('bms:supplierUser:query')") |
|||
public R<PageVo<BmsSupplierUser>> getPage(BmsSupplierUser param){ |
|||
PageUtil.startPage(); |
|||
LambdaQueryWrapper<BmsSupplierUser> supplierUserWrapper = new LambdaQueryWrapper<>(param); |
|||
List<BmsSupplierUser> list = bmsSupplierUserService.list(supplierUserWrapper); |
|||
return R.byPageHelperList(list); |
|||
} |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商分配", biz = BizType.QUERY) |
|||
@PreAuthorize("hasRole('bms:supplierUser:query')") |
|||
public R<BmsSupplierUser> getById(@PathVariable("id") String id){ |
|||
BmsSupplierUser bmsSupplierUser = bmsSupplierUserService.getById(id); |
|||
return R.ok(bmsSupplierUser); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 根据ID更新 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/updateById") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商分配", biz = BizType.UPDATE) |
|||
@PreAuthorize("hasRole('bms:supplierUser:update')") |
|||
public R<?> updateById(@RequestBody @Valid BmsSupplierUser param){ |
|||
boolean result = bmsSupplierUserService.updateById(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 新增供应商分配 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/save") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商分配", biz = BizType.INSERT) |
|||
@PreAuthorize("hasRole('bms:supplierUser:insert')") |
|||
public R<?> save(@RequestBody @Valid BmsSupplierUser param){ |
|||
boolean result = bmsSupplierUserService.save(param); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
/** |
|||
* 删除供应商分配 |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@DeleteMapping("/deleteById/{id}") |
|||
@SysLog(module = SystemModule.BASE, title = "供应商分配", biz = BizType.DELETE) |
|||
@PreAuthorize("hasRole('bms:supplierUser:delete')") |
|||
public R<?> deleteById(@PathVariable("id") Long id){ |
|||
boolean result = bmsSupplierUserService.removeById(id); |
|||
return R.isTrue(result); |
|||
} |
|||
|
|||
} |
|||
|
@ -1,77 +0,0 @@ |
|||
package com.qs.serve.modules.bms.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* ERP信息 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-13 |
|||
*/ |
|||
@Data |
|||
@TableName("bms_erp_info") |
|||
public class BmsErpInfo implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** ERP编码 */ |
|||
@NotBlank(message = "ERP编码不能为空") |
|||
@Length(max = 20,message = "ERP编码长度不能超过20字") |
|||
private String code; |
|||
|
|||
/** ERP名称 */ |
|||
@NotBlank(message = "ERP名称不能为空") |
|||
@Length(max = 20,message = "ERP名称长度不能超过20字") |
|||
private String name; |
|||
|
|||
/** 备注 */ |
|||
@Length(max = 255,message = "备注长度不能超过255字") |
|||
private String remark; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 最后更新时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
} |
|||
|
@ -1,76 +0,0 @@ |
|||
package com.qs.serve.modules.bms.entity; |
|||
|
|||
import java.time.LocalDateTime; |
|||
import java.io.Serializable; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* 供应商分配 实体类 |
|||
* @author YenHex |
|||
* @since 2022-10-13 |
|||
*/ |
|||
@Data |
|||
@TableName("bms_supplier_user") |
|||
public class BmsSupplierUser implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** id */ |
|||
@TableId(type = IdType.AUTO) |
|||
private Long id; |
|||
|
|||
/** 供应商id */ |
|||
@NotNull(message = "供应商id不能为空") |
|||
private Long supplierId; |
|||
|
|||
/** 用户id */ |
|||
@NotBlank(message = "用户id不能为空") |
|||
@Length(max = 32,message = "用户id长度不能超过32字") |
|||
private String userId; |
|||
|
|||
/** 备注 */ |
|||
@Length(max = 255,message = "备注长度不能超过255字") |
|||
private String remark; |
|||
|
|||
/** 创建时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private LocalDateTime createTime; |
|||
|
|||
/** 最后更新时间 */ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private LocalDateTime updateTime; |
|||
|
|||
/** 所属租户 */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String tenantId; |
|||
|
|||
/** 逻辑删除标记(0:显示;1:隐藏) */ |
|||
@JsonIgnore |
|||
@JsonProperty |
|||
private String delFlag; |
|||
|
|||
/** 创建人 */ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
/** 更新人 */ |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
} |
|||
|
@ -0,0 +1,23 @@ |
|||
package com.qs.serve.modules.bms.entity.bo; |
|||
|
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2022/10/11 |
|||
*/ |
|||
@Data |
|||
public class BmsSupplierParentBo { |
|||
|
|||
/** id */ |
|||
@NotBlank |
|||
private String id; |
|||
|
|||
/** 父级id,0表总公司无上级 */ |
|||
private Long pid; |
|||
|
|||
} |
@ -1,14 +0,0 @@ |
|||
package com.qs.serve.modules.bms.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.bms.entity.BmsErpInfo; |
|||
|
|||
/** |
|||
* ERP信息 Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-13 |
|||
*/ |
|||
public interface BmsErpInfoMapper extends BaseMapper<BmsErpInfo> { |
|||
|
|||
} |
|||
|
@ -1,14 +0,0 @@ |
|||
package com.qs.serve.modules.bms.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierUser; |
|||
|
|||
/** |
|||
* 供应商分配 Mapper |
|||
* @author YenHex |
|||
* @date 2022-10-13 |
|||
*/ |
|||
public interface BmsSupplierUserMapper extends BaseMapper<BmsSupplierUser> { |
|||
|
|||
} |
|||
|
@ -1,16 +0,0 @@ |
|||
package com.qs.serve.modules.bms.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.bms.entity.BmsErpInfo; |
|||
|
|||
/** |
|||
* ERP信息 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-13 |
|||
*/ |
|||
public interface BmsErpInfoService extends IService<BmsErpInfo> { |
|||
|
|||
BmsErpInfo getByCode(String code); |
|||
|
|||
} |
|||
|
@ -1,25 +0,0 @@ |
|||
package com.qs.serve.modules.bms.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplier; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierUser; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 供应商分配 服务接口 |
|||
* @author YenHex |
|||
* @date 2022-10-13 |
|||
*/ |
|||
public interface BmsSupplierUserService extends IService<BmsSupplierUser> { |
|||
|
|||
/** |
|||
* 检查当前微信人员是否有操作供应商权限 |
|||
* @param supplierId |
|||
* @return |
|||
*/ |
|||
boolean checkWxUserSupplier(Long supplierId); |
|||
boolean checkWxUserSupplier(Long supplierId,String userId); |
|||
|
|||
} |
|||
|
@ -1,28 +0,0 @@ |
|||
package com.qs.serve.modules.bms.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.bms.entity.BmsErpInfo; |
|||
import com.qs.serve.modules.bms.service.BmsErpInfoService; |
|||
import com.qs.serve.modules.bms.mapper.BmsErpInfoMapper; |
|||
|
|||
/** |
|||
* ERP信息 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-13 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class BmsErpInfoServiceImpl extends ServiceImpl<BmsErpInfoMapper,BmsErpInfo> implements BmsErpInfoService { |
|||
|
|||
@Override |
|||
public BmsErpInfo getByCode(String code) { |
|||
|
|||
return null; |
|||
} |
|||
|
|||
} |
|||
|
@ -1,49 +0,0 @@ |
|||
package com.qs.serve.modules.bms.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import com.qs.serve.modules.wx.entity.WxUser; |
|||
import com.qs.serve.modules.wx.service.WxUserService; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.qs.serve.modules.bms.entity.BmsSupplierUser; |
|||
import com.qs.serve.modules.bms.service.BmsSupplierUserService; |
|||
import com.qs.serve.modules.bms.mapper.BmsSupplierUserMapper; |
|||
|
|||
/** |
|||
* 供应商分配 服务实现类 |
|||
* @author YenHex |
|||
* @since 2022-10-13 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class BmsSupplierUserServiceImpl extends ServiceImpl<BmsSupplierUserMapper,BmsSupplierUser> implements BmsSupplierUserService { |
|||
|
|||
private WxUserService wxUserService; |
|||
|
|||
@Override |
|||
public boolean checkWxUserSupplier(Long supplierId) { |
|||
return checkWxUserSupplier(supplierId,null); |
|||
} |
|||
|
|||
@Override |
|||
public boolean checkWxUserSupplier(Long supplierId, String userId) { |
|||
if(supplierId!=null){ |
|||
WxUser wxUser = wxUserService.getCurrentWxUser(true); |
|||
if(wxUser!=null){ |
|||
LambdaQueryWrapper<BmsSupplierUser> lqw = new LambdaQueryWrapper<>(); |
|||
lqw.eq(BmsSupplierUser::getUserId,wxUser.getSysUserId()); |
|||
lqw.eq(BmsSupplierUser::getSupplierId,supplierId); |
|||
boolean exist = this.count(lqw) > 0L; |
|||
if(userId!=null){ |
|||
return exist&&wxUser.getSysUserId().equals(userId); |
|||
} |
|||
return exist; |
|||
} |
|||
} |
|||
return false; |
|||
} |
|||
} |
|||
|
@ -0,0 +1,25 @@ |
|||
package com.qs.serve.modules.goods.entity.vo; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author YenHex |
|||
* @since 2022/10/24 |
|||
*/ |
|||
@Data |
|||
public class GoodSkuBatchResult { |
|||
|
|||
/** |
|||
* 结果 0-正常 其它为失败 |
|||
*/ |
|||
private Integer errorCode; |
|||
|
|||
private String message; |
|||
|
|||
private String productCode; |
|||
|
|||
private String invCode; |
|||
|
|||
private String name; |
|||
|
|||
} |
Loading…
Reference in new issue