Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-api-cloud
This commit is contained in:
commit
0e5e5d31c5
15 files changed
+161
-14
No files matched your search
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.canteen.dto.boxes.admin;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "预约分页查询参数")
|
||||
public class BokingPageDTO {
|
||||
|
||||
private String userName;
|
||||
|
||||
private String mobile;
|
||||
|
||||
private String boxesName;
|
||||
}
|
||||
+8
@@ -123,4 +123,12 @@ public class BoxesBookingEntity extends Model<BoxesBookingEntity> {
|
||||
|
||||
@Schema(description="审核原因")
|
||||
private String checkReason;
|
||||
|
||||
@Schema(description="包厢名称")
|
||||
@TableField(exist = false)
|
||||
private String boxesName;
|
||||
|
||||
@Schema(description="用户名称")
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
}
|
||||
+1
@@ -113,4 +113,5 @@ public class BoxesInfoEntity extends Model<BoxesInfoEntity> {
|
||||
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
}
|
||||
+4
-6
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.canteen.dto.boxes.admin.BokingPageDTO;
|
||||
import com.bsd.pjcloud.canteen.vo.AppMakeSaveReqVO;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
@@ -49,17 +50,14 @@ public class BoxesBookingController {
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param boxesBooking 包厢预约记录表
|
||||
* @param bokingPageDTO 包厢预约记录表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('canteen_boxesBooking_view')" )
|
||||
public R getBoxesBookingPage(@ParameterObject Page page, @ParameterObject BoxesBookingEntity boxesBooking) {
|
||||
LambdaQueryWrapper<BoxesBookingEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(Objects.nonNull(boxesBooking.getBoxesId()),BoxesBookingEntity::getBoxesId,boxesBooking.getBoxesId());
|
||||
wrapper.like(Objects.nonNull(boxesBooking.getUserId()),BoxesBookingEntity::getUserId,boxesBooking.getUserId());
|
||||
return R.ok(boxesBookingService.page(page, wrapper));
|
||||
public R getBoxesBookingPage(@ParameterObject Page page, @ParameterObject BokingPageDTO bokingPageDTO) {
|
||||
return R.ok(boxesBookingService.pageScope(page, bokingPageDTO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
@@ -1,6 +1,8 @@
|
||||
package com.bsd.pjcloud.canteen.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.canteen.dto.boxes.admin.BokingPageDTO;
|
||||
import com.bsd.pjcloud.canteen.entity.BoxesBookingEntity;
|
||||
import com.bsd.pjcloud.canteen.vo.AppMakeSaveReqVO;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
@@ -14,4 +16,7 @@ public interface BoxesBookingService extends IService<BoxesBookingEntity> {
|
||||
* @return
|
||||
*/
|
||||
R createBooking(AppMakeSaveReqVO createReqVO);
|
||||
|
||||
|
||||
Object pageScope(Page page, BokingPageDTO bokingPageDTO);
|
||||
}
|
||||
+60
@@ -1,8 +1,16 @@
|
||||
package com.bsd.pjcloud.canteen.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.excel.util.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.canteen.constant.CanteenFlowConstant;
|
||||
import com.bsd.pjcloud.canteen.dto.boxes.admin.BokingPageDTO;
|
||||
import com.bsd.pjcloud.canteen.dto.flow.BxMarkingFlowDto;
|
||||
import com.bsd.pjcloud.canteen.entity.BoxesBookingEntity;
|
||||
import com.bsd.pjcloud.canteen.entity.BoxesInfoEntity;
|
||||
@@ -13,6 +21,7 @@ import com.bsd.pjcloud.canteen.service.BoxesBookingService;
|
||||
import com.bsd.pjcloud.canteen.vo.AppMakeSaveReqVO;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.resolver.ParamResolver;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.api.feign.RemoteFlowApiFlowService;
|
||||
@@ -20,10 +29,15 @@ import com.bsd.pjcloud.flow.task.dto.ProcessInstanceParamDto;
|
||||
import com.bsd.pjcloud.flow.task.entity.Process;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.beans.beancontext.BeanContext;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 包厢预约记录表
|
||||
@@ -43,6 +57,7 @@ public class BoxesBookingServiceImpl extends ServiceImpl<BoxesBookingMapper, Box
|
||||
|
||||
private final RemoteFlowApiFlowService remoteFlowApiFlowService;
|
||||
|
||||
private final RemoteUserService remoteUserService ;
|
||||
|
||||
@Override
|
||||
public R createBooking(AppMakeSaveReqVO createReqVO) {
|
||||
@@ -86,4 +101,49 @@ public class BoxesBookingServiceImpl extends ServiceImpl<BoxesBookingMapper, Box
|
||||
// 返回
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object pageScope(Page page, BokingPageDTO bokingPageDTO) {
|
||||
LambdaQueryWrapper<BoxesBookingEntity> wrapper = Wrappers.lambdaQuery();
|
||||
String mobile = bokingPageDTO.getMobile();
|
||||
String userName = bokingPageDTO.getUserName();
|
||||
String boxesName = bokingPageDTO.getBoxesName();
|
||||
if (StringUtils.isNotBlank(mobile) || StringUtils.isNotBlank(userName)){
|
||||
R<List<SysUser>> likeNameOrByMobileScope = remoteUserService.getLikeNameOrByMobileScope(userName, mobile);
|
||||
List<Long> userIds = likeNameOrByMobileScope.getData().stream().map(sysUser -> sysUser.getUserId()).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(userIds)){
|
||||
return new Page<>(page.getCurrent(), page.getSize());
|
||||
}
|
||||
wrapper.in(BoxesBookingEntity::getUserId,userIds);
|
||||
}
|
||||
if (StringUtils.isNotBlank(boxesName)){
|
||||
LambdaQueryWrapper<BoxesInfoEntity> boxesInfoEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
boxesInfoEntityLambdaQueryWrapper.like(BoxesInfoEntity::getName,boxesName);
|
||||
List<BoxesInfoEntity> boxesInfoEntities = boxesInfoMapper.selectListByScope(boxesInfoEntityLambdaQueryWrapper, DataScope.of());
|
||||
List<Long> boxesIds = boxesInfoEntities.stream().map(boxesInfoEntity -> boxesInfoEntity.getId()).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(boxesIds)){
|
||||
return new Page<>(page.getCurrent(), page.getSize());
|
||||
}
|
||||
wrapper.in(BoxesBookingEntity::getBoxesId,boxesIds);
|
||||
}
|
||||
Page pageData = baseMapper.selectPageByScope(page, wrapper, DataScope.of());
|
||||
List<BoxesBookingEntity> records = pageData.getRecords();
|
||||
Set<Long> boxesIds = records.stream().map(boxesBookingEntity -> boxesBookingEntity.getBoxesId()).collect(Collectors.toSet());
|
||||
Set<Long> usersIds = records.stream().map(boxesBookingEntity -> boxesBookingEntity.getUserId()).collect(Collectors.toSet());
|
||||
|
||||
|
||||
List<BoxesInfoEntity> boxesInfoEntities = boxesInfoMapper.selectByIds(boxesIds);
|
||||
Map<Long, BoxesInfoEntity> boxMap = boxesInfoEntities.stream()
|
||||
.collect(Collectors.toMap(BoxesInfoEntity::getId, entity -> entity));
|
||||
R<Map<Long, SysUser>> userMapData = remoteUserService.getUserMap(usersIds);
|
||||
Map<Long, SysUser> userMap = userMapData.getData();
|
||||
|
||||
if (!CollectionUtils.isEmpty(records)){
|
||||
records.stream().forEach(record -> {
|
||||
record.setBoxesName(boxMap.get(record.getBoxesId()) == null ? "" : boxMap.get(record.getBoxesId()).getName());
|
||||
record.setUserName(userMap.get(record.getUserId()) == null ? "" : userMap.get(record.getUserId()).getUsername());
|
||||
});
|
||||
}
|
||||
return pageData;
|
||||
}
|
||||
}
|
||||
+4
@@ -141,4 +141,8 @@ public class Process {
|
||||
@TableField("business_key")
|
||||
private String businessKey;
|
||||
|
||||
|
||||
// @Schema(description = "表单详情路由")
|
||||
// @TableField("form_detail")
|
||||
// private String formDetail;
|
||||
}
|
||||
+1
-1
@@ -225,7 +225,7 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
p.setAdminList(process.getAdminList());
|
||||
p.setRangeShow(stringBuilder.toString());
|
||||
p.setBusinessKey(process.getBusinessKey());
|
||||
|
||||
// p.setFormDetail(process.getFormDetail());
|
||||
this.save(p);
|
||||
|
||||
// 保存范围
|
||||
|
||||
+4
-4
@@ -40,22 +40,22 @@ public class SmErpSpuImportDto {
|
||||
private Integer packageNum; // 装数
|
||||
|
||||
@ExcelProperty("进价")
|
||||
private Integer purchasePrice; // 进价
|
||||
private Double purchasePrice; // 进价
|
||||
|
||||
@ExcelProperty("零售价")
|
||||
private Integer retailPrice; // 零售价
|
||||
private Double retailPrice; // 零售价
|
||||
|
||||
@ExcelProperty("货商")
|
||||
private String supplier; // 货商
|
||||
|
||||
@ExcelProperty("促销价")
|
||||
private Integer promotionPrice; // 促销价
|
||||
private Double promotionPrice; // 促销价
|
||||
|
||||
@ExcelProperty("商品性质")
|
||||
private String commodityNature; // 商品性质
|
||||
|
||||
@ExcelProperty("成本单价")
|
||||
private Integer costPrice; // 成本单价
|
||||
private Double costPrice; // 成本单价
|
||||
|
||||
@ExcelProperty("库存上限")
|
||||
private int inventoryUpperLimit; // 库存上限
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ public class SmErpSpuController {
|
||||
LambdaQueryWrapper<SmErpSpuEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(StringUtils.isNotBlank(supermarketSpu.getProductCode()), SmErpSpuEntity::getProductCode,supermarketSpu.getProductCode());
|
||||
wrapper.eq(StringUtils.isNotBlank(supermarketSpu.getBarcode()), SmErpSpuEntity::getBarcode,supermarketSpu.getBarcode());
|
||||
wrapper.eq(StringUtils.isNotBlank(supermarketSpu.getProductName()), SmErpSpuEntity::getProductName,supermarketSpu.getProductName());
|
||||
wrapper.like(StringUtils.isNotBlank(supermarketSpu.getProductName()), SmErpSpuEntity::getProductName,supermarketSpu.getProductName());
|
||||
return R.ok(smErpSpuService.pageScope(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
+20
-2
@@ -44,6 +44,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
@@ -644,8 +646,24 @@ public class SmErpSpuServiceImpl extends ServiceImpl<SmErpSpuMapper, SmErpSpuEnt
|
||||
// 处理单位数据
|
||||
SmErpUnitEntity unit = new SmErpUnitEntity();
|
||||
org.springframework.beans.BeanUtils.copyProperties(dto, unit);
|
||||
unit.setPurchasePrice(dto.getPurchasePrice()*100);
|
||||
unit.setRetailPrice(dto.getRetailPrice()*100);
|
||||
unit.setPurchasePrice( BigDecimal.valueOf(dto.getPurchasePrice())
|
||||
.multiply(BigDecimal.valueOf(100))
|
||||
.setScale(0, RoundingMode.HALF_UP) // 四舍五入
|
||||
.intValueExact());
|
||||
unit.setRetailPrice(
|
||||
BigDecimal.valueOf(dto.getRetailPrice())
|
||||
.multiply(BigDecimal.valueOf(100))
|
||||
.setScale(0, RoundingMode.HALF_UP)
|
||||
.intValueExact()
|
||||
);
|
||||
unit.setPromotionPrice(BigDecimal.valueOf(dto.getPromotionPrice())
|
||||
.multiply(BigDecimal.valueOf(100))
|
||||
.setScale(0, RoundingMode.HALF_UP)
|
||||
.intValueExact());
|
||||
unit.setCostPrice(BigDecimal.valueOf(dto.getCostPrice())
|
||||
.multiply(BigDecimal.valueOf(100))
|
||||
.setScale(0, RoundingMode.HALF_UP)
|
||||
.intValueExact());
|
||||
unit.setSpuId(spu.getId());
|
||||
unit.setIsBase(true);
|
||||
unitBatch.add(unit);
|
||||
|
||||
+10
@@ -20,11 +20,14 @@
|
||||
package com.bsd.pjcloud.admin.api.feign;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserDTO;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.vo.UserVO;
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.exception.ErrorCodes;
|
||||
import com.bsd.pjcloud.common.core.util.MsgUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -175,4 +178,11 @@ public interface RemoteUserService {
|
||||
*/
|
||||
@GetMapping("/user/getUserMap")
|
||||
R<Map<Long, SysUser>> getUserMap(@RequestParam(value = "userIds") Set<Long> userIds);
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/user/getLikeNameOrByMobileScope")
|
||||
R< List<SysUser>> getLikeNameOrByMobileScope(@RequestParam(value = "name",required = false) String name,
|
||||
@RequestParam(value = "mobile",required = false) String mobile);
|
||||
}
|
||||
+13
@@ -413,4 +413,17 @@ public class SysUserController {
|
||||
Map<Long, SysUser> userMap = list.stream().collect(Collectors.toMap(SysUser::getUserId, user -> user));
|
||||
return R.ok(userMap);
|
||||
}
|
||||
|
||||
|
||||
@Inner
|
||||
@GetMapping("/getLikeNameOrByMobileScope")
|
||||
public R< List<SysUser>> getLikeNameOrByMobileScope(@RequestParam(value = "name",required = false) String name,
|
||||
@RequestParam(value = "mobile",required = false) String mobile) {
|
||||
List<SysUser> user = userService.listScopeByLikeNameOrByMobileScope(Wrappers.<SysUser>query().lambda()
|
||||
.like(StringUtils.isNotBlank(name),SysUser::getName, name).eq(StringUtils.isNotBlank(mobile),SysUser::getPhone, mobile));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_USERINFO_EMPTY, name, mobile));
|
||||
}
|
||||
return R.ok(user);
|
||||
}
|
||||
}
|
||||
+8
@@ -210,4 +210,12 @@ public interface SysUserService extends IService<SysUser> {
|
||||
* 开启审批
|
||||
*/
|
||||
void applyFlow(SysUser user);
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户名或者手机号获取数据库权限的用户信息
|
||||
* @param eq
|
||||
* @return
|
||||
*/
|
||||
List<SysUser> listScopeByLikeNameOrByMobileScope(LambdaQueryWrapper<SysUser> eq);
|
||||
}
|
||||
+6
@@ -842,6 +842,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
baseMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUser> listScopeByLikeNameOrByMobileScope(LambdaQueryWrapper<SysUser> eq) {
|
||||
|
||||
return baseMapper.selectListByScope(eq, DataScope.of());
|
||||
}
|
||||
|
||||
private SysUserServiceImpl getSelf() {
|
||||
return SpringUtil.getBean(getClass());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user