Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-api-cloud
This commit is contained in:
commit
2b0c2fab1b
31 files changed
+435
-297
No files matched your search
+3
@@ -120,4 +120,7 @@ public class BoxesBookingEntity extends Model<BoxesBookingEntity> {
|
||||
|
||||
@Schema(description="流程实例id")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description="审核原因")
|
||||
private String checkReason;
|
||||
}
|
||||
+9
-6
@@ -2,6 +2,7 @@ package com.bsd.pjcloud.canteen.controller;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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;
|
||||
@@ -13,6 +14,8 @@ import com.bsd.pjcloud.canteen.service.BoxesBookingService;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordParamDto;
|
||||
import com.bsd.pjcloud.flow.task.utils.GetCheckReasonUtils;
|
||||
import com.bsd.pjcloud.flow.task.vo.CheckStatusAndReasonVo;
|
||||
import org.apache.seata.spring.annotation.GlobalTransactional;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
@@ -138,20 +141,20 @@ public class BoxesBookingController {
|
||||
|
||||
@PostMapping("/flow-callback")
|
||||
@Operation(summary = "流程节点回调通知")
|
||||
@Inner
|
||||
public R createBooking(@RequestBody ProcessNodeRecordParamDto processNodeRecordParamDto) {
|
||||
|
||||
@Inner(value = false)
|
||||
@Transactional
|
||||
public R flowCallback(@RequestBody ProcessNodeRecordParamDto processNodeRecordParamDto) {
|
||||
String processInstanceId = processNodeRecordParamDto.getProcessInstanceId();
|
||||
BoxesBookingEntity boxesBookingEntity = new BoxesBookingEntity();
|
||||
boxesBookingEntity.setProcessInstanceId(processInstanceId);
|
||||
boxesBookingEntity.setCheckStatus(TaskCheckStatusEnum.RESULT.getCode());
|
||||
System.out.println("***************************");
|
||||
System.out.println(processNodeRecordParamDto.getData());
|
||||
// boxesBookingService.update()
|
||||
LambdaQueryWrapper<BoxesBookingEntity> boxesBookingEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
boxesBookingEntityLambdaQueryWrapper.eq(BoxesBookingEntity::getProcessInstanceId, processInstanceId);
|
||||
CheckStatusAndReasonVo checkReason = GetCheckReasonUtils.getCheckReason(processNodeRecordParamDto);
|
||||
boxesBookingEntity.setCheckStatus(checkReason.getCheckStatus());
|
||||
boxesBookingEntity.setCheckReason(checkReason.getCheckReason());
|
||||
boxesBookingService.update(boxesBookingEntity,boxesBookingEntityLambdaQueryWrapper);
|
||||
System.out.println(processNodeRecordParamDto);
|
||||
return R.ok();
|
||||
|
||||
}
|
||||
|
||||
@@ -21,5 +21,6 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="processInstanceId" column="process_instance_id"/>
|
||||
<result property="checkReason" column="check_reason"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.flow.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserRootDto {
|
||||
|
||||
private long id;
|
||||
|
||||
private String name;
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.bsd.pjcloud.flow.task.utils;
|
||||
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordParamDto;
|
||||
import com.bsd.pjcloud.flow.task.dto.UserRootDto;
|
||||
import com.bsd.pjcloud.flow.task.vo.CheckStatusAndReasonVo;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public class GetCheckReasonUtils {
|
||||
|
||||
public static CheckStatusAndReasonVo getCheckReason(ProcessNodeRecordParamDto dto) {
|
||||
String statusKey = dto.getNodeId() + "_approve_condition";
|
||||
try {
|
||||
JsonNode jsonNode = new ObjectMapper().readTree(dto.getData());
|
||||
Boolean changeStatus = jsonNode.get(statusKey).asBoolean();
|
||||
String approveDesc = Optional.ofNullable(jsonNode).map(node -> node.get("approveDesc")).filter(JsonNode::isTextual).map(JsonNode::asText).orElse("");
|
||||
// String approveDesc = jsonNode.get("approveDesc").toString();
|
||||
CheckStatusAndReasonVo checkStatusAndReasonVo = new CheckStatusAndReasonVo();
|
||||
checkStatusAndReasonVo.setCheckStatus(changeStatus ? TaskCheckStatusEnum.RESULT.getCode() : TaskCheckStatusEnum.REJECT.getCode());
|
||||
checkStatusAndReasonVo.setCheckReason(approveDesc);
|
||||
return checkStatusAndReasonVo;
|
||||
} catch (Exception e) {
|
||||
// 处理解析异常
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.bsd.pjcloud.flow.task.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CheckStatusAndReasonVo {
|
||||
|
||||
private String checkStatus;
|
||||
|
||||
|
||||
private String checkReason;
|
||||
}
|
||||
+4
-1
@@ -3,10 +3,13 @@ package com.bsd.pjcloud.supermarket.api.feign;
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpCategorySimpleVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zjf
|
||||
* @date 2018/6/22
|
||||
@@ -22,6 +25,6 @@ public interface RemoteSupermarketCategoryService {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/supermarketCategory/simpleAll")
|
||||
R getSimpleAll();
|
||||
R<List<SmErpCategorySimpleVo>> getSimpleAll();
|
||||
|
||||
}
|
||||
+5
-2
@@ -20,11 +20,14 @@
|
||||
package com.bsd.pjcloud.supermarket.api.feign;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpSpuDetailsVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SpuVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -44,7 +47,7 @@ public interface RemoteSupermarketSpuService {
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/supermarketSpu/ad/selectListAll")
|
||||
R getSupermarketSpuScope(@RequestBody SupermarketSpuQueryDTO supermarketSpuQueryDTO);
|
||||
R<Page<SpuVo>> getSupermarketSpuScope(@RequestParam Page page, @RequestBody SupermarketSpuQueryDTO supermarketSpuQueryDTO);
|
||||
|
||||
|
||||
|
||||
@@ -54,7 +57,7 @@ public interface RemoteSupermarketSpuService {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/supermarketSpu/ad/SpuDetails")
|
||||
R getSupermarketSpuDetailById(@RequestParam("id")Long id);
|
||||
R<SmErpSpuDetailsVo> getSupermarketSpuDetailById(@RequestParam("id")Long id);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.bsd.pjcloud.supermarket.constant;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public final class SupermarketFlowConstant {
|
||||
|
||||
/**
|
||||
* 补货申请
|
||||
*/
|
||||
public static final String SUPERMARKET_BHSQ_FLOW= "SUPERMARKET_BHSQ_FLOW";
|
||||
|
||||
|
||||
/**
|
||||
* 补货申请
|
||||
*/
|
||||
public static final String SUPERMARKET_CGDD_FLOW= "SUPERMARKET_CGDD_FLOW";
|
||||
|
||||
|
||||
/**
|
||||
* 补货申请
|
||||
*/
|
||||
public static final String SUPERMARKET_CGRK_FLOW= "SUPERMARKET_CGRK_FLOW";
|
||||
|
||||
/**
|
||||
* 补货申请
|
||||
*/
|
||||
public static final String SUPERMARKET_CGTH_FLOW= "SUPERMARKET_CGTH_FLOW";
|
||||
|
||||
|
||||
|
||||
}
|
||||
-6
@@ -45,10 +45,4 @@ public class SupermarketSpuQueryDTO {
|
||||
@Schema(description="商品性质(字典)")
|
||||
private String productNature;
|
||||
|
||||
|
||||
/**
|
||||
* 商户id
|
||||
*/
|
||||
@Schema(description="商户id")
|
||||
private Long merchantId;
|
||||
}
|
||||
+5
@@ -162,6 +162,11 @@ public class SmErpCgDdEntity extends Model<SmErpCgDdEntity> {
|
||||
@Schema(description="关联编码")
|
||||
private String linkCode;
|
||||
|
||||
@Schema(description="流程实例id")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description="审核原因")
|
||||
private String checkReason;
|
||||
|
||||
@Schema(description="商品名称")
|
||||
@TableField(exist = false)
|
||||
|
||||
+8
@@ -136,6 +136,12 @@ public class SmErpCgPlanEntity extends Model<SmErpCgPlanEntity> {
|
||||
@Schema(description="关联状态")
|
||||
private String linkStatus;
|
||||
|
||||
@Schema(description="流程实例id")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description="审核原因")
|
||||
private String checkReason;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description="商品名称")
|
||||
private String productName;
|
||||
@@ -144,4 +150,6 @@ public class SmErpCgPlanEntity extends Model<SmErpCgPlanEntity> {
|
||||
@TableField(exist = false)
|
||||
public String handlerUserName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.ad;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 商品辅助条码
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2024-12-23 10:15:43
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "商品辅助条码")
|
||||
public class SmErpAuxiliaryCodeVo {
|
||||
|
||||
|
||||
/**
|
||||
* 辅助条码id
|
||||
*/
|
||||
@Schema(description="辅助条码id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
@Schema(description="条码")
|
||||
private String barCode;
|
||||
|
||||
/**
|
||||
* spuID
|
||||
*/
|
||||
@Schema(description="spuID")
|
||||
private Long spuId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
@Schema(description="包装单位id")
|
||||
private Long unitId;
|
||||
|
||||
}
|
||||
+4
-63
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.erp;
|
||||
package com.bsd.pjcloud.supermarket.vo.ad;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description="ad Spuvo")
|
||||
public class SmErpSpuVo {
|
||||
public class SmErpSpuDetailsVo {
|
||||
|
||||
/**
|
||||
* 商品 SPU 编号,自增
|
||||
@@ -24,35 +24,12 @@ public class SmErpSpuVo {
|
||||
@Schema(description="货号")
|
||||
private String productCode;
|
||||
|
||||
/**
|
||||
* 自编码/条码
|
||||
*/
|
||||
@Schema(description="自编码/条码")
|
||||
private String barcode;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description="商品名称")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Schema(description="单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 商品简介
|
||||
*/
|
||||
@Schema(description="商品简介")
|
||||
private String introduction;
|
||||
|
||||
/**
|
||||
* 商品详情
|
||||
*/
|
||||
@Schema(description="商品详情")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 商品分类编号
|
||||
@@ -66,26 +43,11 @@ public class SmErpSpuVo {
|
||||
@Schema(description="商品封面图")
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 商品轮播图地址
|
||||
数组,以逗号分隔
|
||||
最多上传15张
|
||||
*/
|
||||
@Schema(description="商品轮播图地址")
|
||||
private String sliderPicUrls;
|
||||
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
@Schema(description="总库存")
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
@Schema(description="赠送积分")
|
||||
private Integer giveIntegral;
|
||||
@Schema(description="剩余库存")
|
||||
private Double stock;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
@@ -121,13 +83,6 @@ public class SmErpSpuVo {
|
||||
@Schema(description="货商id")
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@@ -135,20 +90,6 @@ public class SmErpSpuVo {
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
@Schema(description = "销量")
|
||||
private Integer salesCount;
|
||||
+1
-48
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.erp;
|
||||
package com.bsd.pjcloud.supermarket.vo.ad;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.bsd.pjcloud.common.core.util.MoneyDeserializer;
|
||||
@@ -18,7 +18,6 @@ import java.time.LocalDateTime;
|
||||
* @date 2024-12-26 11:06:54
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@Schema(description = "商品包装单位(sku)")
|
||||
public class SmErpUnitVo {
|
||||
|
||||
@@ -26,7 +25,6 @@ public class SmErpUnitVo {
|
||||
/**
|
||||
* 包装单位id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="包装单位id")
|
||||
private Long id;
|
||||
|
||||
@@ -64,16 +62,12 @@ public class SmErpUnitVo {
|
||||
* 进价/单位分
|
||||
*/
|
||||
@Schema(description="进价/单位分")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer purchasePrice;
|
||||
|
||||
/**
|
||||
* 零售价/单位分
|
||||
*/
|
||||
@Schema(description="零售价/单位分")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer retailPrice;
|
||||
|
||||
/**
|
||||
@@ -86,24 +80,9 @@ public class SmErpUnitVo {
|
||||
* 促销价
|
||||
*/
|
||||
@Schema(description="促销价")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer promotionPrice;
|
||||
|
||||
/**
|
||||
* 成本价
|
||||
*/
|
||||
@Schema(description="成本价")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer costPrice;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建者")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
@@ -112,31 +91,5 @@ public class SmErpUnitVo {
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新者")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="是否删除")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@Schema(description="租户编号")
|
||||
private Long tenantId;
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.ad;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class SpuVo {
|
||||
/**
|
||||
* 商品 SPU 编号,自增
|
||||
*/
|
||||
@Schema(description="商品 SPU 编号,自增")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 货号
|
||||
*/
|
||||
@Schema(description="货号")
|
||||
private String productCode;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description="商品名称")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Schema(description="单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@Schema(description="规格")
|
||||
private String spec;
|
||||
|
||||
|
||||
/**
|
||||
* 商品分类编号
|
||||
*/
|
||||
@Schema(description="商品分类编号")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 商品封面图
|
||||
*/
|
||||
@Schema(description="商品封面图")
|
||||
private String picUrl;
|
||||
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
@Schema(description="剩余库存")
|
||||
private Double stock;
|
||||
|
||||
|
||||
/**
|
||||
* 商品性质(字典)
|
||||
*/
|
||||
@Schema(description="商品性质(字典)")
|
||||
private String productNature;
|
||||
|
||||
|
||||
/**
|
||||
* 零售价和促销价取基础单位的价格
|
||||
*/
|
||||
@Schema(description="零售价")
|
||||
private Integer retailPrice;
|
||||
|
||||
@Schema(description="促销价")
|
||||
private Integer promotionPrice;
|
||||
|
||||
|
||||
@Schema(description = "销量")
|
||||
private Integer salesCount;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.bsd.pjcloud.supermarket.vo.app;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpUnitVo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
-83
@@ -1,83 +0,0 @@
|
||||
package com.bsd.pjcloud.supermarket.vo.erp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 商品辅助条码
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2024-12-23 10:15:43
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("supermarket_auxiliary_code")
|
||||
@Schema(description = "商品辅助条码")
|
||||
public class SmErpAuxiliaryCodeVo {
|
||||
|
||||
|
||||
/**
|
||||
* 辅助条码id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="辅助条码id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
@Schema(description="条码")
|
||||
private String barCode;
|
||||
|
||||
/**
|
||||
* spuID
|
||||
*/
|
||||
@Schema(description="spuID")
|
||||
private Long spuId;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建者")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新者")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="是否删除")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@Schema(description="租户编号")
|
||||
private Long tenantId;
|
||||
}
|
||||
@@ -64,6 +64,17 @@
|
||||
<artifactId>pjcloud-supermarket-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-flow-task-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-common-seata</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-wallet-api</artifactId>
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@ public class SmErpCategoryController {
|
||||
*/
|
||||
@Operation(summary = "APP分类查询",description = "通过商户id获取该商户下的分类")
|
||||
@GetMapping("/app/simpleAll")
|
||||
public R getAppSimpleAll(@RequestParam("merchantId")Long merchantId) {
|
||||
public R<List<SmErpCategorySimpleVo>> getAppSimpleAll(@RequestParam("merchantId")Long merchantId) {
|
||||
List<SmErpCategoryEntity> list = smErpCategoryService.
|
||||
list(new LambdaQueryWrapper<SmErpCategoryEntity>().eq(SmErpCategoryEntity::getMerchantId, merchantId));
|
||||
List<SmErpCategorySimpleVo> bean = BeanUtils.toBean(list, SmErpCategorySimpleVo.class);
|
||||
|
||||
+23
@@ -4,11 +4,16 @@ import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordParamDto;
|
||||
import com.bsd.pjcloud.flow.task.utils.GetCheckReasonUtils;
|
||||
import com.bsd.pjcloud.flow.task.vo.CheckStatusAndReasonVo;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.CGPlanLinkQueryDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.ErpCgDDEditDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.ErpCgDDSaveDTO;
|
||||
@@ -28,6 +33,7 @@ import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -122,6 +128,23 @@ public class SmErpCgDdController {
|
||||
return R.ok(smErpCgDdService.saveCGDD(erpCgDDSaveDTO));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "回调" , description = "回调" )
|
||||
@SysLog("采购订单回调" )
|
||||
@PostMapping("/flow-callback")
|
||||
@Inner(value = false)
|
||||
@Transactional
|
||||
public R supermarketFlowCallback(@RequestBody ProcessNodeRecordParamDto processNodeRecordParamDto) {
|
||||
String processInstanceId = processNodeRecordParamDto.getProcessInstanceId();
|
||||
CheckStatusAndReasonVo checkReason = GetCheckReasonUtils.getCheckReason(processNodeRecordParamDto);
|
||||
smErpCgDdService.update(
|
||||
new LambdaUpdateWrapper<SmErpCgDdEntity>()
|
||||
.eq(SmErpCgDdEntity::getProcessInstanceId, processInstanceId)
|
||||
.set(SmErpCgDdEntity::getCheckStatus, checkReason.getCheckStatus())
|
||||
.set(SmErpCgDdEntity::getCheckReason, checkReason.getCheckReason())
|
||||
);
|
||||
return R.ok();
|
||||
}
|
||||
/**
|
||||
* 修改采购订单
|
||||
* @return R
|
||||
|
||||
+25
@@ -3,12 +3,18 @@ package com.bsd.pjcloud.supermarket.controller;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordParamDto;
|
||||
import com.bsd.pjcloud.flow.task.utils.GetCheckReasonUtils;
|
||||
import com.bsd.pjcloud.flow.task.vo.CheckStatusAndReasonVo;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.ErpCgPlanDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.ErpCgPlanEditDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.ErpCgPlanSaveDTO;
|
||||
@@ -22,6 +28,7 @@ import com.bsd.pjcloud.supermarket.service.SmErpUnitService;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.ErpUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.SmErpCgPlanVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.SmErpCgPlanItemVo;
|
||||
import org.apache.seata.spring.annotation.GlobalTransactional;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
@@ -104,6 +111,24 @@ public class SmErpCgPlanController {
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "回调" , description = "回调" )
|
||||
@SysLog("采购补货回调" )
|
||||
@PostMapping("/flow-callback")
|
||||
@Inner(value = false)
|
||||
@Transactional
|
||||
public R supermarketFlowCallback(@RequestBody ProcessNodeRecordParamDto processNodeRecordParamDto) {
|
||||
String processInstanceId = processNodeRecordParamDto.getProcessInstanceId();
|
||||
CheckStatusAndReasonVo checkReason = GetCheckReasonUtils.getCheckReason(processNodeRecordParamDto);
|
||||
smErpCgPlanService.update(
|
||||
new LambdaUpdateWrapper<SmErpCgPlanEntity>()
|
||||
.eq(SmErpCgPlanEntity::getProcessInstanceId, processInstanceId)
|
||||
.set(SmErpCgPlanEntity::getCheckStatus, checkReason.getCheckStatus())
|
||||
.set(SmErpCgPlanEntity::getCheckReason, checkReason.getCheckReason())
|
||||
);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询采购计划
|
||||
* @param id id
|
||||
|
||||
+6
-4
@@ -21,6 +21,8 @@ import com.bsd.pjcloud.supermarket.entity.SmErpStockEntity;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpUnitEntity;
|
||||
import com.bsd.pjcloud.supermarket.service.*;
|
||||
import com.bsd.pjcloud.supermarket.task.TaskStoreService;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpSpuDetailsVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SpuVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.erpspu.SmErpSpuSimpleVo;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -251,8 +253,8 @@ public class SmErpSpuController {
|
||||
@Operation(summary = "安卓机条件查询所有" , description = "安卓机条件查询所有" )
|
||||
@PostMapping("/ad/selectListAll" )
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_view')" )
|
||||
public R getSupermarketSpuByScope(@RequestBody SupermarketSpuQueryDTO supermarketSpuQueryDTO) {
|
||||
return R.ok(smErpSpuService.selectListAllScope(supermarketSpuQueryDTO));
|
||||
public R<Page<SpuVo>> getSupermarketSpuByScope(@ParameterObject Page page, @RequestBody SupermarketSpuQueryDTO supermarketSpuQueryDTO) {
|
||||
return R.ok(smErpSpuService.selectListAllScope(page,supermarketSpuQueryDTO));
|
||||
}
|
||||
|
||||
|
||||
@@ -261,9 +263,9 @@ public class SmErpSpuController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "条件查询所有" , description = "条件查询所有" )
|
||||
@Operation(summary = "spu详情" , description = "spu详情" )
|
||||
@GetMapping("/ad/SpuDetails" )
|
||||
public R getSupermarketSpuDetailById(@RequestParam("id")Long id) {
|
||||
public R<SmErpSpuDetailsVo> getSupermarketSpuDetailById(@RequestParam("id")Long id) {
|
||||
return R.ok(smErpSpuService.getSupermarketSpuDetailById(id));
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -1,12 +1,15 @@
|
||||
package com.bsd.pjcloud.supermarket.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpSpuEntity;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SpuVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,6 +41,6 @@ public interface SmErpSpuMapper extends PjcloudBaseMapper<SmErpSpuEntity> {
|
||||
return update(null, updateWrapper);
|
||||
}
|
||||
|
||||
List<SmErpSpuEntity> selectListAllScope(@Param("supermarketSpuQueryDTO") SupermarketSpuQueryDTO supermarketSpuQueryDTO
|
||||
Page<SpuVo> selectListAllScope(@ParameterObject Page page, @Param("supermarketSpuQueryDTO") SupermarketSpuQueryDTO supermarketSpuQueryDTO
|
||||
, DataScope dataScope);
|
||||
}
|
||||
+6
-2
@@ -1,6 +1,7 @@
|
||||
package com.bsd.pjcloud.supermarket.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
@@ -9,8 +10,11 @@ import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.ErpCgPlanDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.erpspu.SmErpSpuImportDto;
|
||||
import com.bsd.pjcloud.supermarket.entity.SmErpSpuEntity;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpSpuDetailsVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SpuVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.ErpSpuWithUnitPageVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.sm.smspu.SmErpPageScopeVo;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -49,7 +53,7 @@ public interface SmErpSpuService extends IService<SmErpSpuEntity> {
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
Object selectListAllScope(SupermarketSpuQueryDTO supermarketSpuQueryDTO);
|
||||
Page<SpuVo> selectListAllScope(@ParameterObject Page page, SupermarketSpuQueryDTO supermarketSpuQueryDTO);
|
||||
|
||||
|
||||
/**
|
||||
@@ -57,7 +61,7 @@ public interface SmErpSpuService extends IService<SmErpSpuEntity> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Object getSupermarketSpuDetailById(Long id);
|
||||
SmErpSpuDetailsVo getSupermarketSpuDetailById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+18
-3
@@ -9,6 +9,11 @@ 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.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.api.feign.RemoteFlowApiFlowService;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessInstanceParamDto;
|
||||
import com.bsd.pjcloud.flow.task.entity.Process;
|
||||
import com.bsd.pjcloud.supermarket.constant.SupermarketFlowConstant;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.ErpCgDDEditDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.ErpCgDDSaveDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgdd.SmCgDDEditItemDTO;
|
||||
@@ -48,8 +53,7 @@ public class SmErpCgDdServiceImpl extends ServiceImpl<SmErpCgDdMapper, SmErpCgDd
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
private final SmErpUnitMapper smErpUnitMapper;
|
||||
|
||||
|
||||
private final RemoteFlowApiFlowService remoteFlowApiFlowService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -59,10 +63,21 @@ public class SmErpCgDdServiceImpl extends ServiceImpl<SmErpCgDdMapper, SmErpCgDd
|
||||
smErpCgDdEntity.setDeptId(deptId);
|
||||
smErpCgDdEntity.setCheckStatus("0");
|
||||
smErpCgDdEntity.setDeptId(deptId);
|
||||
int insert = baseMapper.insert(smErpCgDdEntity);
|
||||
|
||||
List<SmCgDDSaveItemDTO> items = erpCgDDSaveDTO.getItems();
|
||||
List<SmErpCgDdItemEntity> cgPlanItemEntities = BeanUtils.toBean(items, SmErpCgDdItemEntity.class);
|
||||
|
||||
R<Process> processR = remoteFlowApiFlowService.getProcessByBusinessKey(SupermarketFlowConstant.SUPERMARKET_CGDD_FLOW);
|
||||
String flowId = processR.getData().getFlowId();
|
||||
ProcessInstanceParamDto processInstanceParamDto = new ProcessInstanceParamDto();
|
||||
processInstanceParamDto.setFlowId(flowId);
|
||||
R<String> stringR = remoteFlowApiFlowService.startProcessInstance(processInstanceParamDto);
|
||||
String processInstanceId = stringR.getData();
|
||||
smErpCgDdEntity.setProcessInstanceId(processInstanceId);
|
||||
smErpCgDdEntity.setCheckStatus(TaskCheckStatusEnum.PADDING.getCode());
|
||||
int insert = baseMapper.insert(smErpCgDdEntity);
|
||||
|
||||
|
||||
for (SmErpCgDdItemEntity cgPlanItemEntity : cgPlanItemEntities) {
|
||||
cgPlanItemEntity.setHId(smErpCgDdEntity.getId());
|
||||
cgPlanItemEntity.setDeptId(deptId);
|
||||
|
||||
+17
-2
@@ -9,6 +9,11 @@ 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.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.api.feign.RemoteFlowApiFlowService;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessInstanceParamDto;
|
||||
import com.bsd.pjcloud.flow.task.entity.Process;
|
||||
import com.bsd.pjcloud.supermarket.constant.SupermarketFlowConstant;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.ErpCgPlanEditDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.ErpCgPlanSaveDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.SmCgPlanEditItemDTO;
|
||||
@@ -48,7 +53,7 @@ public class SmErpCgPlanServiceImpl extends ServiceImpl<SmErpCgPlanMapper, SmErp
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
|
||||
|
||||
private final RemoteFlowApiFlowService remoteFlowApiFlowService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -58,8 +63,18 @@ public class SmErpCgPlanServiceImpl extends ServiceImpl<SmErpCgPlanMapper, SmErp
|
||||
smErpCgPlanEntity.setDeptId(deptId);
|
||||
smErpCgPlanEntity.setCheckStatus("0");
|
||||
smErpCgPlanEntity.setDeptId(deptId);
|
||||
int insert = baseMapper.insert(smErpCgPlanEntity);
|
||||
|
||||
|
||||
//发起流程
|
||||
R<Process> processR = remoteFlowApiFlowService.getProcessByBusinessKey(SupermarketFlowConstant.SUPERMARKET_BHSQ_FLOW);
|
||||
String flowId = processR.getData().getFlowId();
|
||||
ProcessInstanceParamDto processInstanceParamDto = new ProcessInstanceParamDto();
|
||||
processInstanceParamDto.setFlowId(flowId);
|
||||
R<String> stringR = remoteFlowApiFlowService.startProcessInstance(processInstanceParamDto);
|
||||
String processInstanceId = stringR.getData();
|
||||
smErpCgPlanEntity.setProcessInstanceId(processInstanceId);
|
||||
smErpCgPlanEntity.setCheckStatus(TaskCheckStatusEnum.PADDING.getCode());
|
||||
int insert = baseMapper.insert(smErpCgPlanEntity);
|
||||
List<SmCgPlanSaveItemDTO> items = erpCgPlanSaveDTO.getItems();
|
||||
List<SmErpCgPlanItemEntity> cgPlanItemEntities = BeanUtils.toBean(items, SmErpCgPlanItemEntity.class);
|
||||
for (SmErpCgPlanItemEntity cgPlanItemEntity : cgPlanItemEntities) {
|
||||
|
||||
+21
-14
@@ -2,6 +2,7 @@ package com.bsd.pjcloud.supermarket.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
@@ -16,18 +17,17 @@ import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.cgplan.ErpCgPlanDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.erpspu.SmErpSpuImportDto;
|
||||
import com.bsd.pjcloud.supermarket.dto.inventoryrecords.UpdateStockDTO;
|
||||
import com.bsd.pjcloud.supermarket.dto.supplier.SmErpSupplierImportDto;
|
||||
import com.bsd.pjcloud.supermarket.entity.*;
|
||||
import com.bsd.pjcloud.supermarket.mapper.*;
|
||||
import com.bsd.pjcloud.supermarket.service.*;
|
||||
import com.bsd.pjcloud.supermarket.task.TaskStoreService;
|
||||
import com.bsd.pjcloud.supermarket.validarot.ErpSpuValidator;
|
||||
import com.bsd.pjcloud.supermarket.validarot.SupplierValidator;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SpuVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.app.SupermarketAppSpuDetailsVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.app.SupermarketAppUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpAuxiliaryCodeVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpSpuVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.erp.SmErpUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpAuxiliaryCodeVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpSpuDetailsVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.ad.SmErpUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.ErpSpuWithUnitPageVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.cgplan.ErpUnitVo;
|
||||
import com.bsd.pjcloud.supermarket.vo.sm.smspu.SmErpPageScopeVo;
|
||||
@@ -36,6 +36,7 @@ import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
@@ -378,26 +379,32 @@ public class SmErpSpuServiceImpl extends ServiceImpl<SmErpSpuMapper, SmErpSpuEnt
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object selectListAllScope(SupermarketSpuQueryDTO supermarketSpuQueryDTO) {
|
||||
public Page<SpuVo> selectListAllScope(@ParameterObject Page page, SupermarketSpuQueryDTO supermarketSpuQueryDTO) {
|
||||
|
||||
List<SmErpSpuEntity> list = baseMapper.selectListAllScope(supermarketSpuQueryDTO, DataScope.of());
|
||||
List<SmErpSpuVo> bean = BeanUtils.toBean(list, SmErpSpuVo.class);
|
||||
return bean;
|
||||
Page<SpuVo> list = baseMapper.selectListAllScope(page,supermarketSpuQueryDTO, DataScope.of());
|
||||
return list;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSupermarketSpuDetailById(Long id) {
|
||||
public SmErpSpuDetailsVo getSupermarketSpuDetailById(Long id) {
|
||||
SmErpSpuEntity smErpSpuEntity = baseMapper.selectById(id);
|
||||
List<SmErpUnitEntity> smErpUnitEntityList = smErpUnitService.list(new LambdaQueryWrapper<SmErpUnitEntity>().eq(SmErpUnitEntity::getSpuId, id));
|
||||
List<SmErpAuxiliaryCodeEntity> supermarketAuxiliaryCodeEntities = smErpAuxiliaryCodeService.list(new LambdaQueryWrapper<SmErpAuxiliaryCodeEntity>().eq(SmErpAuxiliaryCodeEntity::getSpuId, id));
|
||||
SmErpSpuVo smErpSpuVo = BeanUtils.toBean(smErpSpuEntity, SmErpSpuVo.class);
|
||||
SmErpSpuDetailsVo smErpSpuDetailsVo = BeanUtils.toBean(smErpSpuEntity, SmErpSpuDetailsVo.class);
|
||||
List<SmErpUnitVo> smErpUnitVoList = BeanUtils.toBean(smErpUnitEntityList, SmErpUnitVo.class);
|
||||
List<SmErpAuxiliaryCodeVo> smErpAuxiliaryCodeVos = BeanUtils.toBean(supermarketAuxiliaryCodeEntities, SmErpAuxiliaryCodeVo.class);
|
||||
smErpSpuVo.setSupermarketUnitEntityList(smErpUnitVoList);
|
||||
smErpSpuVo.setSupermarketAuxiliaryCodeEntityList(smErpAuxiliaryCodeVos);
|
||||
return smErpSpuVo;
|
||||
smErpSpuDetailsVo.setSupermarketUnitEntityList(smErpUnitVoList);
|
||||
smErpSpuDetailsVo.setSupermarketAuxiliaryCodeEntityList(smErpAuxiliaryCodeVos);
|
||||
|
||||
//库存
|
||||
LambdaQueryWrapper<SmErpStockEntity> stocmEq = new LambdaQueryWrapper<SmErpStockEntity>()
|
||||
.eq(SmErpStockEntity::getErpSpuId, id);
|
||||
SmErpStockEntity smErpStockEntity = smErpStockMapper.selectOne(stocmEq);
|
||||
smErpSpuDetailsVo.setStock(smErpStockEntity.getCurrentStock());
|
||||
return smErpSpuDetailsVo;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
@@ -27,5 +27,7 @@
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="linkCode" column="link_code"/>
|
||||
<result property="linkStatus" column="link_status"/>
|
||||
<result property="processInstanceId" column="process_instance_id"/>
|
||||
<result property="checkReason" column="check_reason"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+2
@@ -22,5 +22,7 @@
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="linkStatus" column="link_status"/>
|
||||
<result property="processInstanceId" column="process_instance_id"/>
|
||||
<result property="checkReason" column="check_reason"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+27
-60
@@ -52,81 +52,48 @@
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="salesCount" column="sales_count"/>
|
||||
</resultMap>
|
||||
<!-- 基本字段映射 -->
|
||||
<sql id="BaseColumnList">
|
||||
id,
|
||||
product_code,
|
||||
barcode,
|
||||
product_name,
|
||||
unit,
|
||||
introduction,
|
||||
description,
|
||||
category_id,
|
||||
pic_url,
|
||||
slider_pic_urls,
|
||||
sort,
|
||||
status,
|
||||
cost_price,
|
||||
stock,
|
||||
give_integral,
|
||||
merchant_id,
|
||||
dept_id,
|
||||
specification,
|
||||
origin,
|
||||
packing_quantity,
|
||||
purchase_price,
|
||||
retail_price,
|
||||
member_price1,
|
||||
member_price2,
|
||||
member_price3,
|
||||
wholesale_price1,
|
||||
wholesale_price2,
|
||||
wholesale_price3,
|
||||
promotion_price,
|
||||
product_nature,
|
||||
archiver_signature,
|
||||
inventory_area,
|
||||
commission_rate,
|
||||
joint_deduction_rate,
|
||||
inventory_upper_limit,
|
||||
inventory_lower_limit,
|
||||
gross_margin,
|
||||
auxiliary_barcode_id,
|
||||
brand_id,
|
||||
supplier_id,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
tenant_id,
|
||||
sales_count
|
||||
</sql>
|
||||
|
||||
<select id="selectListAllScope" parameterType="com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO" resultMap="supermarketSpuMap">
|
||||
<select id="selectListAllScope" parameterType="com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO" resultType="com.bsd.pjcloud.supermarket.vo.ad.SpuVo">
|
||||
SELECT
|
||||
<include refid="BaseColumnList" />
|
||||
FROM supermarket_spu
|
||||
es.id,
|
||||
es.product_code,
|
||||
es.product_name,
|
||||
es.category_id,
|
||||
es.pic_url,
|
||||
es.product_nature,
|
||||
es.create_time,
|
||||
es.sales_count,
|
||||
u.unit,
|
||||
u.spec,
|
||||
u.retail_price,
|
||||
u.promotion_price,
|
||||
st.current_stock as stock
|
||||
FROM sm_erp_spu es
|
||||
left join sm_erp_unit u
|
||||
on es.id = u.spu_id and u.is_base=1
|
||||
left join sm_erp_stock st
|
||||
on es.id = st.erp_spu_id
|
||||
<where>
|
||||
u.status = 0 and es.status = 0
|
||||
<if test="supermarketSpuQueryDTO.id != null">
|
||||
AND id = #{supermarketSpuQueryDTO.id}
|
||||
AND es.id = #{supermarketSpuQueryDTO.id}
|
||||
</if>
|
||||
<if test="supermarketSpuQueryDTO.productCode != null">
|
||||
AND product_code = #{supermarketSpuQueryDTO.productCode}
|
||||
AND es.product_code = #{supermarketSpuQueryDTO.productCode}
|
||||
</if>
|
||||
<if test="supermarketSpuQueryDTO.barcode != null">
|
||||
AND barcode = #{supermarketSpuQueryDTO.barcode}
|
||||
AND u.barcode = #{supermarketSpuQueryDTO.barcode}
|
||||
</if>
|
||||
<if test="supermarketSpuQueryDTO.productName != null">
|
||||
AND product_name LIKE CONCAT('%', #{supermarketSpuQueryDTO.productName}, '%')
|
||||
AND es.product_name LIKE CONCAT('%', #{supermarketSpuQueryDTO.productName}, '%')
|
||||
</if>
|
||||
<if test="supermarketSpuQueryDTO.categoryId != null">
|
||||
AND category_id = #{supermarketSpuQueryDTO.categoryId}
|
||||
AND es.category_id = #{supermarketSpuQueryDTO.categoryId}
|
||||
</if>
|
||||
<if test="supermarketSpuQueryDTO.productNature != null">
|
||||
AND product_nature = #{supermarketSpuQueryDTO.productNature}
|
||||
AND es.product_nature = #{supermarketSpuQueryDTO.productNature}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC
|
||||
ORDER BY es.sort DESC
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user