## 同步发货未合单查询处理;全网产品库存同步;

This commit is contained in:
cabbage 2025-08-12 11:11:35 +08:00
parent f67f38a089
commit fec3bc2530
31 changed files with 474 additions and 726 deletions

View File

@ -7,7 +7,6 @@ import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.annotation.RepeatSubmitSimple; import com.hzs.common.core.annotation.RepeatSubmitSimple;
import com.hzs.common.core.constant.CacheConstants; import com.hzs.common.core.constant.CacheConstants;
import com.hzs.common.core.constant.EnumsPrefixConstants; import com.hzs.common.core.constant.EnumsPrefixConstants;
import com.hzs.common.core.constant.msg.CommonMsgConstants;
import com.hzs.common.core.constant.msg.SaOrderMsgConstants; import com.hzs.common.core.constant.msg.SaOrderMsgConstants;
import com.hzs.common.core.enums.*; import com.hzs.common.core.enums.*;
import com.hzs.common.core.service.RedisService; import com.hzs.common.core.service.RedisService;
@ -19,7 +18,6 @@ import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo; import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.sale.ext.SaOrderExt; import com.hzs.common.domain.sale.ext.SaOrderExt;
import com.hzs.common.domain.sale.ext.SaOrderItemsExt; import com.hzs.common.domain.sale.ext.SaOrderItemsExt;
import com.hzs.common.domain.sale.order.SaOrder;
import com.hzs.common.domain.sale.order.SaOrderItems; import com.hzs.common.domain.sale.order.SaOrderItems;
import com.hzs.common.domain.sale.order.SaOrderSelfLog; import com.hzs.common.domain.sale.order.SaOrderSelfLog;
import com.hzs.common.security.service.UserTokenService; import com.hzs.common.security.service.UserTokenService;
@ -50,11 +48,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @Description: 发货清单未合单控制器 * 发货清单未合单控制器
* @Author: jiang chao
* @Time: 2022/10/28 11:24
* @Classname: SaDeliverOrderController
* @PackageName: com.hzs.sale.deliver.controller.manage
*/ */
@RestController @RestController
@RequestMapping("/manage/deliver-unhandled") @RequestMapping("/manage/deliver-unhandled")
@ -102,23 +96,10 @@ public class SaDeliverUnhandledController extends BaseController {
Integer pkCountry = SecurityUtils.getPkCountry(); Integer pkCountry = SecurityUtils.getPkCountry();
// 返回数据
List<DeliverUnhandledVO> resultList = new ArrayList<>();
// 未合单目前查询状态已付款 // 未合单目前查询状态已付款
param.setOrderStatusList(Collections.singletonList(EOrderStatus.PAY.getValue())); param.setOrderStatusList(Collections.singletonList(EOrderStatus.PAY.getValue()));
// 查询语句已经写死查询在售此处可以直接赋空
if (StringUtils.isNotEmpty(param.getOriginalOrderCode())) { param.setPreSaleStatus(null);
// 原单号不为空则需要查询
LambdaQueryWrapper<SaOrder> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SaOrder::getOrderCode, param.getOriginalOrderCode());
queryWrapper.eq(SaOrder::getPkCountry, pkCountry);
SaOrder querySaOrder = iSaOrderService.getOne(queryWrapper);
if (null == querySaOrder) {
return getDataTable(resultList);
}
param.setPkOriginalOrder(querySaOrder.getPkId());
}
// 获取管理员权限角色地区范围体系列表团队列表 // 获取管理员权限角色地区范围体系列表团队列表
UserAuthorityDTO userAuthorityDTO = iUserServiceApi.getUserAuthority(SecurityUtils.getUserId()).getData(); UserAuthorityDTO userAuthorityDTO = iUserServiceApi.getUserAuthority(SecurityUtils.getUserId()).getData();
@ -127,7 +108,7 @@ public class SaDeliverUnhandledController extends BaseController {
param.setTeamList(userAuthorityDTO.getUserTeamList()); param.setTeamList(userAuthorityDTO.getUserTeamList());
startPage(); startPage();
resultList = iSaOrderItemsService.queryDeliverUnhandledList(param, pkCountry); List<DeliverUnhandledVO> resultList = iSaOrderItemsService.queryDeliverUnhandledList(param, pkCountry);
// 当查询有数据才进行处理 // 当查询有数据才进行处理
if (resultList.size() > 0) { if (resultList.size() > 0) {
@ -157,25 +138,10 @@ public class SaDeliverUnhandledController extends BaseController {
Integer pkCountry = SecurityUtils.getPkCountry(); Integer pkCountry = SecurityUtils.getPkCountry();
// 返回数据
List<DeliverUnhandledVO> resultList = new ArrayList<>();
// 未合单目前查询状态已付款 // 未合单目前查询状态已付款
param.setOrderStatusList(Collections.singletonList(EOrderStatus.PAY.getValue())); param.setOrderStatusList(Collections.singletonList(EOrderStatus.PAY.getValue()));
// 查询语句已经写死查询在售此处可以直接赋空
if (StringUtils.isNotEmpty(param.getOriginalOrderCode())) { param.setPreSaleStatus(null);
// 原单号不为空则需要查询
LambdaQueryWrapper<SaOrder> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SaOrder::getOrderCode, param.getOriginalOrderCode());
queryWrapper.eq(SaOrder::getPkCountry, pkCountry);
SaOrder querySaOrder = iSaOrderService.getOne(queryWrapper);
if (null == querySaOrder) {
ExcelUtil<DeliverUnhandledVO> util = new ExcelUtil<>(DeliverUnhandledVO.class);
util.exportExcel(response, resultList, "发货清单未合单导出");
return;
}
param.setPkOriginalOrder(querySaOrder.getPkId());
}
// 获取管理员权限角色地区范围体系列表团队列表 // 获取管理员权限角色地区范围体系列表团队列表
UserAuthorityDTO userAuthorityDTO = iUserServiceApi.getUserAuthority(SecurityUtils.getUserId()).getData(); UserAuthorityDTO userAuthorityDTO = iUserServiceApi.getUserAuthority(SecurityUtils.getUserId()).getData();
@ -183,7 +149,7 @@ public class SaDeliverUnhandledController extends BaseController {
param.setVertexIdList(userAuthorityDTO.getVertexIdList()); param.setVertexIdList(userAuthorityDTO.getVertexIdList());
param.setTeamList(userAuthorityDTO.getUserTeamList()); param.setTeamList(userAuthorityDTO.getUserTeamList());
resultList = iSaOrderItemsService.queryDeliverUnhandledList(param, pkCountry); List<DeliverUnhandledVO> resultList = iSaOrderItemsService.queryDeliverUnhandledList(param, pkCountry);
// 当查询有数据才进行处理 // 当查询有数据才进行处理
if (resultList.size() > 0) { if (resultList.size() > 0) {

View File

@ -8,11 +8,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* @Description: 未合单列表查询入参 * 未合单列表查询入参
* @Author: jiang chao
* @Time: 2022/10/21 17:26
* @Classname: DeliverOrderItemParam
* @PackageName: com.hzs.sale.deliver.param
*/ */
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@ -153,15 +149,6 @@ public class DeliverUnhandledParam extends BaseAuthorityEntity {
*/ */
private String specsName; private String specsName;
/**
* 原单号
*/
private String originalOrderCode;
/**
* 原单号ID
*/
private Long pkOriginalOrder;
/** /**
* 发货仓库 * 发货仓库
*/ */
@ -181,4 +168,9 @@ public class DeliverUnhandledParam extends BaseAuthorityEntity {
*/ */
private Integer systemType; private Integer systemType;
/**
* 非售商品列表
*/
private List<Integer> pkWaresList;
} }

View File

@ -11,11 +11,7 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
* @Description: 发货单未合并列表VO * 发货单未合并列表VO
* @Author: jiang chao
* @Time: 2022/11/4 11:29
* @Classname: DeliverUnhandledVO
* @PackageName: com.hzs.sale.deliver.vo
*/ */
@Data @Data
public class DeliverUnhandledVO { public class DeliverUnhandledVO {
@ -240,18 +236,12 @@ public class DeliverUnhandledVO {
@Excel(name = "预售状态") @Excel(name = "预售状态")
private String preSaleStatusVal; private String preSaleStatusVal;
/**
* 原单号
*/
@Excel(name = "原单号")
private String originalOrderCode;
/** /**
* 备注 * 备注
*/ */
@Excel(name = "备注") @Excel(name = "备注")
private String remark; private String remark;
/** /**
* 创建时间 * 创建时间
*/ */

View File

@ -407,8 +407,7 @@ public abstract class ParentOrderController extends BaseController {
* @return boolean * @return boolean
*/ */
protected Boolean checkRecMsgBoolean(OrderParam orderParam) { protected Boolean checkRecMsgBoolean(OrderParam orderParam) {
if (orderParam.getDeliveryWay() != null && (EDelivery.COMPANY_PICKED_UP.getValue() == orderParam.getDeliveryWay() || if (orderParam.getDeliveryWay() != null && (EDelivery.COMPANY_PICKED_UP.getValue() == orderParam.getDeliveryWay())) {
EDelivery.SHOP_PICKED_UP.getValue() == orderParam.getDeliveryWay())) {
orderParam.setTransType(null); orderParam.setTransType(null);
return orderParam.getSpecialArea() != null return orderParam.getSpecialArea() != null
&& orderParam.getOrderItemsParams() != null && orderParam.getOrderItemsParams() != null

View File

@ -39,14 +39,6 @@ import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/**
* @BelongsProject: hzs_cloud
* @BelongsPackage: com.hzs.sale.order.controller.manage
* @Author: yh
* @CreateTime: 2023-04-11 10:22
* @Description:
* @Version: 1.0
*/
@RestController @RestController
@RequestMapping("/manage/order-charge-log") @RequestMapping("/manage/order-charge-log")
public class SaOrderChargeLogController extends BaseController { public class SaOrderChargeLogController extends BaseController {
@ -137,7 +129,7 @@ public class SaOrderChargeLogController extends BaseController {
Map<Long, VertexDTO> vertexMap = vertexAll.getData().stream().collect(Collectors.toMap(VertexDTO::getPkId, Function.identity())); Map<Long, VertexDTO> vertexMap = vertexAll.getData().stream().collect(Collectors.toMap(VertexDTO::getPkId, Function.identity()));
Map<String, String> transactionMap = transactionCommonService.exportEnumTransaction(EApproveRechargeStatus.values(), EPresaleStatus.values(), Map<String, String> transactionMap = transactionCommonService.exportEnumTransaction(EApproveRechargeStatus.values(), EPresaleStatus.values(),
ESupplyWay.values(), EDelivery.values(), EOrderStatus.values(), EPlaceDept.values(), ECustomerType.values(), EApprovalBusiness.values(), EDelivery.values(), EOrderStatus.values(), EPlaceDept.values(), ECustomerType.values(), EApprovalBusiness.values(),
EOrderType.values(), ETransportType.values(), EYesNo.values(), EShippingChannel.values(), EUnit.values(), ESignSource.values(), EOrderSource.values()); EOrderType.values(), ETransportType.values(), EYesNo.values(), EShippingChannel.values(), EUnit.values(), ESignSource.values(), EOrderSource.values());
for (SaOrderChargeLogExt orderChargeLogExt : list) { for (SaOrderChargeLogExt orderChargeLogExt : list) {
@ -246,9 +238,7 @@ public class SaOrderChargeLogController extends BaseController {
orderChargeLogVo.setDeliveryWayStr(transactionMap.get(EDelivery.getDelivery(orderChargeLogExt.getDeliveryWay()).getKey())); orderChargeLogVo.setDeliveryWayStr(transactionMap.get(EDelivery.getDelivery(orderChargeLogExt.getDeliveryWay()).getKey()));
} }
//销售方式 //销售方式
if (orderChargeLogExt.getOperateScope() != null && ESupplyWay.getESupplyWay(orderChargeLogExt.getOperateScope()) != null) { orderChargeLogVo.setOperateScopeStr(ESupplyWay.getLabelByVal(orderChargeLogExt.getOperateScope()));
orderChargeLogVo.setOperateScopeStr(transactionMap.get(ESupplyWay.getESupplyWay(orderChargeLogExt.getOperateScope()).getKey()));
}
// 运输方式 // 运输方式
List<String> tranList = new ArrayList<>(); List<String> tranList = new ArrayList<>();
if (orderChargeLogExt.getIsLandTrans() != null && orderChargeLogExt.getIsLandTrans().equals(0)) { if (orderChargeLogExt.getIsLandTrans() != null && orderChargeLogExt.getIsLandTrans().equals(0)) {
@ -357,7 +347,7 @@ public class SaOrderChargeLogController extends BaseController {
Map<Long, VertexDTO> vertexMap = vertexAll.getData().stream().collect(Collectors.toMap(VertexDTO::getPkId, Function.identity())); Map<Long, VertexDTO> vertexMap = vertexAll.getData().stream().collect(Collectors.toMap(VertexDTO::getPkId, Function.identity()));
Map<String, String> transactionMap = transactionCommonService.exportEnumTransaction(EApproveRechargeStatus.values(), EPresaleStatus.values(), Map<String, String> transactionMap = transactionCommonService.exportEnumTransaction(EApproveRechargeStatus.values(), EPresaleStatus.values(),
ESupplyWay.values(), EDelivery.values(), EOrderStatus.values(), EPlaceDept.values(), ECustomerType.values(), EApprovalBusiness.values(), EDelivery.values(), EOrderStatus.values(), EPlaceDept.values(), ECustomerType.values(), EApprovalBusiness.values(),
EOrderType.values(), ETransportType.values(), EYesNo.values(), EShippingChannel.values(), EUnit.values(), ESignSource.values(), EOrderSource.values()); EOrderType.values(), ETransportType.values(), EYesNo.values(), EShippingChannel.values(), EUnit.values(), ESignSource.values(), EOrderSource.values());
for (SaOrderChargeLogExt orderChargeLogExt : list) { for (SaOrderChargeLogExt orderChargeLogExt : list) {
@ -468,9 +458,7 @@ public class SaOrderChargeLogController extends BaseController {
orderChargeLogVo.setDeliveryWayStr(transactionMap.get(EDelivery.getDelivery(orderChargeLogExt.getDeliveryWay()).getKey())); orderChargeLogVo.setDeliveryWayStr(transactionMap.get(EDelivery.getDelivery(orderChargeLogExt.getDeliveryWay()).getKey()));
} }
//销售方式 //销售方式
if (orderChargeLogExt.getOperateScope() != null && ESupplyWay.getESupplyWay(orderChargeLogExt.getOperateScope()) != null) { orderChargeLogVo.setOperateScopeStr(ESupplyWay.getLabelByVal(orderChargeLogExt.getOperateScope()));
orderChargeLogVo.setOperateScopeStr(transactionMap.get(ESupplyWay.getESupplyWay(orderChargeLogExt.getOperateScope()).getKey()));
}
// 运输方式 // 运输方式
List<String> tranList = new ArrayList<>(); List<String> tranList = new ArrayList<>();
if (orderChargeLogExt.getIsLandTrans() != null && orderChargeLogExt.getIsLandTrans().equals(0)) { if (orderChargeLogExt.getIsLandTrans() != null && orderChargeLogExt.getIsLandTrans().equals(0)) {

View File

@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hzs.common.core.annotation.AccessPermissions; import com.hzs.common.core.annotation.AccessPermissions;
import com.hzs.common.core.annotation.Log; import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.EnumsPrefixConstants;
import com.hzs.common.core.enums.*; import com.hzs.common.core.enums.*;
import com.hzs.common.core.utils.DateUtils; import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.core.utils.StringUtils; import com.hzs.common.core.utils.StringUtils;
@ -15,7 +14,6 @@ import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.sale.ext.SaOrderItemsExt; import com.hzs.common.domain.sale.ext.SaOrderItemsExt;
import com.hzs.common.domain.sale.order.SaOrderRemarks; import com.hzs.common.domain.sale.order.SaOrderRemarks;
import com.hzs.common.security.utils.SecurityUtils; import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.service.ITransactionCommonService;
import com.hzs.sale.order.controller.ParentOrderController; import com.hzs.sale.order.controller.ParentOrderController;
import com.hzs.sale.order.dto.OrderBusinessTemplate; import com.hzs.sale.order.dto.OrderBusinessTemplate;
import com.hzs.sale.order.param.*; import com.hzs.sale.order.param.*;
@ -47,8 +45,6 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
public class SaOrderController extends ParentOrderController { public class SaOrderController extends ParentOrderController {
@Autowired
private ITransactionCommonService iTransactionCommonService;
@Autowired @Autowired
private ISaOrderService iSaOrderService; private ISaOrderService iSaOrderService;
@Autowired @Autowired
@ -116,43 +112,18 @@ public class SaOrderController extends ParentOrderController {
waresOrderVo.setDeliveryWayStr(eDelivery.getLabel()); waresOrderVo.setDeliveryWayStr(eDelivery.getLabel());
} }
} }
// 运输方式
if (waresOrderVo.getTranType() != null) {
waresOrderVo.setTranTypeStr(ETransportType.getETransportType(waresOrderVo.getTranType()).getLabel());
}
// 预售状态
if (waresOrderVo.getPreSaleStatus() != null) {
waresOrderVo.setPreSaleStatusStr(EPresaleStatus.getEPresaleStatus(waresOrderVo.getPreSaleStatus()).getLabel());
}
// 订单状态
if (waresOrderVo.getOrderStatus() != null) {
EOrderStatus orderStatusEnum = EOrderStatus.getEOrderStatus(waresOrderVo.getOrderStatus());
if (orderStatusEnum != null) {
waresOrderVo.setOrderStatusStr(orderStatusEnum.getLabel());
}
}
// 支付方式
if (waresOrderVo.getPayType() != null) {
EOrderPayType eOrderPayType = EOrderPayType.getEnumByValue(waresOrderVo.getPayType());
if (null != eOrderPayType) {
waresOrderVo.setPayTypeStr(eOrderPayType.getLabel());
}
}
// 订单类型 // 订单类型
if (waresOrderVo.getOrderType() != null) { waresOrderVo.setOrderTypeStr(EOrderType.getLabelByValue(waresOrderVo.getOrderType()));
EOrderType eOrderType = EOrderType.getEnumByValue(waresOrderVo.getOrderType()); // 发货方式
if (null != eOrderType) { waresOrderVo.setDeliveryWayStr(EDelivery.getLabelByValue(waresOrderVo.getDeliveryWay()));
waresOrderVo.setOrderTypeStr(eOrderType.getLabel()); // 运输方式
} waresOrderVo.setTranTypeStr(ETransportType.getLabelByValue(waresOrderVo.getTranType()));
} // 预售状态
// 供应方式 waresOrderVo.setPreSaleStatusStr(EPresaleStatus.getLabelByValue(waresOrderVo.getPreSaleStatus()));
if (StringUtils.isNotBlank(waresOrderVo.getOperateScope())) { // 订单状态
ESupplyWay eSupplyWay = ESupplyWay.getESupplyWay(Integer.parseInt(waresOrderVo.getOperateScope())); waresOrderVo.setOrderStatusStr(EOrderStatus.getLabelByValue(waresOrderVo.getOrderStatus()));
if (null != eSupplyWay) { // 支付方式
waresOrderVo.setOperateScope(eSupplyWay.getLabel()); waresOrderVo.setPayTypeStr(EOrderPayType.getLabelByValue(waresOrderVo.getPayType()));
}
}
} }
return getDataTable(resultList); return getDataTable(resultList);
} }
@ -187,8 +158,6 @@ public class SaOrderController extends ParentOrderController {
waresOrderParam.setTeamList(userAuthorityDTO.getUserTeamList()); waresOrderParam.setTeamList(userAuthorityDTO.getUserTeamList());
List<WaresOrderVo> resultList = iSaOrderService.selectByOrderInfoList(waresOrderParam); List<WaresOrderVo> resultList = iSaOrderService.selectByOrderInfoList(waresOrderParam);
// 获取需要翻译的枚举翻译
Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(EOrderType.values(), EShippingChannel.values());
for (WaresOrderVo waresOrderVo : resultList) { for (WaresOrderVo waresOrderVo : resultList) {
// //
if (waresOrderVo.getRecProvince() != null) { if (waresOrderVo.getRecProvince() != null) {
@ -202,39 +171,18 @@ public class SaOrderController extends ParentOrderController {
if (waresOrderVo.getRecCountry() != null) { if (waresOrderVo.getRecCountry() != null) {
waresOrderVo.setRecCountryName(areaMap.get(waresOrderVo.getRecCountry())); waresOrderVo.setRecCountryName(areaMap.get(waresOrderVo.getRecCountry()));
} }
// 发货方式
waresOrderVo.setDeliveryWayStr(EDelivery.getDelivery(waresOrderVo.getDeliveryWay()).getLabel());
// 运输方式
if (waresOrderVo.getTranType() != null && ETransportType.getETransportType(waresOrderVo.getTranType()) != null) {
waresOrderVo.setTranTypeStr(ETransportType.getETransportType(waresOrderVo.getTranType()).getLabel());
}
// 预售状态
if (waresOrderVo.getPreSaleStatus() != null && EPresaleStatus.getEPresaleStatus(waresOrderVo.getPreSaleStatus()) != null) {
waresOrderVo.setPreSaleStatusStr(EPresaleStatus.getEPresaleStatus(waresOrderVo.getPreSaleStatus()).getLabel());
}
// 订单状态
if (waresOrderVo.getOrderStatus() != null) {
EOrderStatus orderStatusEnum = EOrderStatus.getEOrderStatus(waresOrderVo.getOrderStatus());
if (orderStatusEnum != null) {
waresOrderVo.setOrderStatusStr(orderStatusEnum.getLabel());
}
}
// 支付方式
if (waresOrderVo.getPayType() != null) {
waresOrderVo.setPayTypeStr(EOrderPayType.getEnumByValue(waresOrderVo.getPayType()).getLabel());
}
// 订单类型 // 订单类型
if (waresOrderVo.getOrderType() != null) { waresOrderVo.setOrderTypeVal(EOrderType.getLabelByValue(waresOrderVo.getOrderType()));
waresOrderVo.setOrderTypeVal(transactionMap.get(EnumsPrefixConstants.ORDER_TYPE + waresOrderVo.getOrderType())); // 发货方式
} waresOrderVo.setDeliveryWayStr(EDelivery.getLabelByValue(waresOrderVo.getDeliveryWay()));
// 供应方式 // 运输方式
if (StringUtils.isNotBlank(waresOrderVo.getOperateScope()) && ESupplyWay.getESupplyWay(Integer.parseInt(waresOrderVo.getOperateScope())) != null) { waresOrderVo.setTranTypeStr(ETransportType.getLabelByValue(waresOrderVo.getTranType()));
waresOrderVo.setOperateScope(ESupplyWay.getESupplyWay(Integer.parseInt(waresOrderVo.getOperateScope())).getLabel()); // 预售状态
} waresOrderVo.setPreSaleStatusStr(EPresaleStatus.getLabelByValue(waresOrderVo.getPreSaleStatus()));
// 发货类型 // 订单状态
waresOrderVo.setShippingChannelVal(transactionMap.get(EnumsPrefixConstants.E_SHIPPING_CHANNEL + waresOrderVo.getShippingChannel())); waresOrderVo.setOrderStatusStr(EOrderStatus.getLabelByValue(waresOrderVo.getOrderStatus()));
waresOrderVo.setLogisticsCode(waresOrderVo.getLogisticsCode()); // 支付方式
waresOrderVo.setLogisticsCompany(waresOrderVo.getLogisticsCompany()); waresOrderVo.setPayTypeStr(EOrderPayType.getLabelByValue(waresOrderVo.getPayType()));
} }
ExcelUtil<WaresOrderVo> util = new ExcelUtil<>(WaresOrderVo.class, iMenuColumnServiceApi.queryMenuColumn("Commodity", SecurityUtils.getUserId()).getData()); ExcelUtil<WaresOrderVo> util = new ExcelUtil<>(WaresOrderVo.class, iMenuColumnServiceApi.queryMenuColumn("Commodity", SecurityUtils.getUserId()).getData());
util.exportExcel(response, resultList, "商品订单导出"); util.exportExcel(response, resultList, "商品订单导出");
@ -261,8 +209,6 @@ public class SaOrderController extends ParentOrderController {
waresOrderParam.setEndCreateDate(DateUtils.getEndTime(waresOrderParam.getEndCreateDate())); waresOrderParam.setEndCreateDate(DateUtils.getEndTime(waresOrderParam.getEndCreateDate()));
} }
// 获取需要翻译的枚举翻译
Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(EDelivery.values(), ESupplyWay.values());
Map<Integer, String> areaMap = iAreaServiceApi.getAreaMap(SecurityUtils.getPkCountry()).getData(); Map<Integer, String> areaMap = iAreaServiceApi.getAreaMap(SecurityUtils.getPkCountry()).getData();
startPage(); startPage();
@ -281,42 +227,23 @@ public class SaOrderController extends ParentOrderController {
waresOrderVo.setRecCountryName(areaMap.get(waresOrderVo.getRecCountry())); waresOrderVo.setRecCountryName(areaMap.get(waresOrderVo.getRecCountry()));
} }
// 发货方式 // 发货方式
if (null != waresOrderVo.getDeliveryWay()) { waresOrderVo.setDeliveryWayStr(EDelivery.getLabelByValue(waresOrderVo.getDeliveryWay()));
waresOrderVo.setDeliveryWayStr(transactionMap.get(EnumsPrefixConstants.DELIVERY + waresOrderVo.getDeliveryWay()));
}
// 运输方式 // 运输方式
if (waresOrderVo.getTranType() != null) { waresOrderVo.setTranTypeStr(ETransportType.getLabelByValue(waresOrderVo.getTranType()));
waresOrderVo.setTranTypeStr(ETransportType.getETransportType(waresOrderVo.getTranType()).getLabel());
}
// 预售状态 // 预售状态
if (waresOrderVo.getPreSaleStatus() != null) { waresOrderVo.setPreSaleStatusStr(EPresaleStatus.getLabelByValue(waresOrderVo.getPreSaleStatus()));
waresOrderVo.setPreSaleStatusStr(EPresaleStatus.getEPresaleStatus(waresOrderVo.getPreSaleStatus()).getLabel());
}
// 订单状态 // 订单状态
if (waresOrderVo.getOrderStatus() != null) { waresOrderVo.setOrderStatusStr(EOrderStatus.getLabelByValue(waresOrderVo.getOrderStatus()));
waresOrderVo.setOrderStatusStr(EOrderStatus.getEOrderStatus(waresOrderVo.getOrderStatus()).getLabel());
}
// 支付方式 // 支付方式
if (waresOrderVo.getPayType() != null) { waresOrderVo.setPayTypeStr(EOrderPayType.getLabelByValue(waresOrderVo.getPayType()));
waresOrderVo.setPayTypeStr(EOrderPayType.getEnumByValue(waresOrderVo.getPayType()).getLabel());
}
// 订单类型 // 订单类型
if (waresOrderVo.getOrderType() != null) { waresOrderVo.setOrderTypeStr(EOrderType.getLabelByValue(waresOrderVo.getOrderType()));
waresOrderVo.setOrderTypeStr(EOrderType.getEnumByValue(waresOrderVo.getOrderType()).getLabel());
}
// 供应方式 // 供应方式
if (StringUtils.isNotBlank(waresOrderVo.getOperateScope())) { if (StringUtils.isNotBlank(waresOrderVo.getOperateScope())) {
waresOrderVo.setOperateScope(ESupplyWay.getESupplyWay(Integer.parseInt(waresOrderVo.getOperateScope())).getLabel()); waresOrderVo.setOperateScope(ESupplyWay.getLabelByVal(Integer.parseInt(waresOrderVo.getOperateScope())));
}
// 计算汇率
if (null != waresOrderVo.getInExchangeRate()) {
waresOrderVo.setOrderAchieve(waresOrderVo.getInExchangeRate().multiply(waresOrderVo.getOrderAchieve()));
} }
// 发货类型 // 发货类型
if (waresOrderVo.getShippingChannel() != null) { waresOrderVo.setShippingChannelStr(EShippingChannel.getLabelByValue(waresOrderVo.getShippingChannel()));
waresOrderVo.setShippingChannelStr(EShippingChannel.getEnumByValue(waresOrderVo.getShippingChannel()).getLabel());
}
// 计算产品总计 // 计算产品总计
waresOrderVo.setProductPriceTotal(waresOrderVo.getProductPrice().multiply(BigDecimal.valueOf(waresOrderVo.getQuantity()))); waresOrderVo.setProductPriceTotal(waresOrderVo.getProductPrice().multiply(BigDecimal.valueOf(waresOrderVo.getQuantity())));
} }
@ -348,8 +275,6 @@ public class SaOrderController extends ParentOrderController {
} }
Map<Integer, String> areaMap = iAreaServiceApi.getAreaMap(SecurityUtils.getPkCountry()).getData(); Map<Integer, String> areaMap = iAreaServiceApi.getAreaMap(SecurityUtils.getPkCountry()).getData();
// 获取需要翻译的枚举翻译
Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(EDelivery.values(), ESupplyWay.values());
List<WaresOrderVo> resultList = iSaOrderItemsService.selectByInvestmentList(waresOrderParam); List<WaresOrderVo> resultList = iSaOrderItemsService.selectByInvestmentList(waresOrderParam);
for (WaresOrderVo waresOrderVo : resultList) { for (WaresOrderVo waresOrderVo : resultList) {
@ -366,56 +291,23 @@ public class SaOrderController extends ParentOrderController {
waresOrderVo.setRecCountryName(areaMap.get(waresOrderVo.getRecCountry())); waresOrderVo.setRecCountryName(areaMap.get(waresOrderVo.getRecCountry()));
} }
// 发货方式 // 发货方式
if (waresOrderVo.getDeliveryWay() != null) { waresOrderVo.setDeliveryWayStr(EDelivery.getLabelByValue(waresOrderVo.getDeliveryWay()));
waresOrderVo.setDeliveryWayStr(transactionMap.get(EnumsPrefixConstants.DELIVERY + waresOrderVo.getDeliveryWay()));
}
// 运输方式 // 运输方式
if (waresOrderVo.getTranType() != null) { waresOrderVo.setTranTypeStr(ETransportType.getLabelByValue(waresOrderVo.getTranType()));
ETransportType transportType = ETransportType.getETransportType(waresOrderVo.getTranType());
if (transportType != null) {
waresOrderVo.setTranTypeStr(transportType.getLabel());
}
}
// 预售状态 // 预售状态
if (waresOrderVo.getPreSaleStatus() != null) { waresOrderVo.setPreSaleStatusStr(EPresaleStatus.getLabelByValue(waresOrderVo.getPreSaleStatus()));
EPresaleStatus presaleStatus = EPresaleStatus.getEPresaleStatus(waresOrderVo.getPreSaleStatus());
if (presaleStatus != null) {
waresOrderVo.setPreSaleStatusStr(presaleStatus.getLabel());
}
}
// 订单状态 // 订单状态
if (waresOrderVo.getOrderStatus() != null) { waresOrderVo.setOrderStatusStr(EOrderStatus.getLabelByValue(waresOrderVo.getOrderStatus()));
EOrderStatus orderStatus = EOrderStatus.getEOrderStatus(waresOrderVo.getOrderStatus());
if (orderStatus != null) {
waresOrderVo.setOrderStatusStr(orderStatus.getLabel());
}
}
// 支付方式 // 支付方式
if (waresOrderVo.getPayType() != null) { waresOrderVo.setPayTypeStr(EOrderPayType.getLabelByValue(waresOrderVo.getPayType()));
EOrderPayType orderPayType = EOrderPayType.getEnumByValue(waresOrderVo.getPayType());
if (orderPayType != null) {
waresOrderVo.setPayTypeStr(orderPayType.getLabel());
}
}
// 订单类型 // 订单类型
if (waresOrderVo.getOrderType() != null) { waresOrderVo.setOrderTypeStr(EOrderType.getLabelByValue(waresOrderVo.getOrderType()));
EOrderType orderType = EOrderType.getEnumByValue(waresOrderVo.getOrderType());
if (orderType != null) {
waresOrderVo.setOrderTypeStr(orderType.getLabel());
}
}
// 供应方式 // 供应方式
if (StringUtils.isNotBlank(waresOrderVo.getOperateScope()) && ESupplyWay.getESupplyWay(Integer.parseInt(waresOrderVo.getOperateScope())) != null) { if (StringUtils.isNotBlank(waresOrderVo.getOperateScope())) {
waresOrderVo.setOperateScope(ESupplyWay.getESupplyWay(Integer.parseInt(waresOrderVo.getOperateScope())).getLabel()); waresOrderVo.setOperateScope(ESupplyWay.getLabelByVal(Integer.parseInt(waresOrderVo.getOperateScope())));
} }
// 计算汇率
waresOrderVo.setOrderAchieve(waresOrderVo.getInExchangeRate().multiply(waresOrderVo.getOrderAchieve()));
// 发货类型 // 发货类型
if (waresOrderVo.getShippingChannel() != null) { waresOrderVo.setShippingChannelStr(EShippingChannel.getLabelByValue(waresOrderVo.getShippingChannel()));
waresOrderVo.setShippingChannelStr(EShippingChannel.getEnumByValue(waresOrderVo.getShippingChannel()).getLabel());
}
} }
List<WaresOrderInfoVo> waresOrderInfoList = resultList.stream().map(a -> { List<WaresOrderInfoVo> waresOrderInfoList = resultList.stream().map(a -> {
WaresOrderInfoVo waresOrderInfoVo = BeanUtil.copyProperties(a, WaresOrderInfoVo.class); WaresOrderInfoVo waresOrderInfoVo = BeanUtil.copyProperties(a, WaresOrderInfoVo.class);
@ -627,7 +519,6 @@ public class SaOrderController extends ParentOrderController {
*/ */
@PostMapping("/single-item-stat-export") @PostMapping("/single-item-stat-export")
public void singleItemStatExport(SingleItemStatParam singleItemStatParam, HttpServletResponse response) { public void singleItemStatExport(SingleItemStatParam singleItemStatParam, HttpServletResponse response) {
if (StringUtils.isBlank(singleItemStatParam.getSkuCode()) if (StringUtils.isBlank(singleItemStatParam.getSkuCode())
&& StringUtils.isBlank(singleItemStatParam.getProductName()) && StringUtils.isBlank(singleItemStatParam.getProductName())
&& singleItemStatParam.getOrderType() == null && singleItemStatParam.getOrderType() == null

View File

@ -1,8 +1,11 @@
package com.hzs.sale.order.service.impl; package com.hzs.sale.order.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.codec.Base64Encoder;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -11,6 +14,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.activity.pick.param.AcPickQueryParam; import com.hzs.activity.pick.param.AcPickQueryParam;
import com.hzs.activity.pick.service.IAcPickService; import com.hzs.activity.pick.service.IAcPickService;
import com.hzs.common.core.config.BdConfig;
import com.hzs.common.core.constant.*; import com.hzs.common.core.constant.*;
import com.hzs.common.core.constant.msg.ConfigMsgConstants; import com.hzs.common.core.constant.msg.ConfigMsgConstants;
import com.hzs.common.core.constant.msg.MemberMsgConstants; import com.hzs.common.core.constant.msg.MemberMsgConstants;
@ -20,6 +24,7 @@ import com.hzs.common.core.exception.ServiceException;
import com.hzs.common.core.service.RedisService; import com.hzs.common.core.service.RedisService;
import com.hzs.common.core.utils.*; import com.hzs.common.core.utils.*;
import com.hzs.common.core.utils.reflect.ReflectUtils; import com.hzs.common.core.utils.reflect.ReflectUtils;
import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.domain.activity.pick.ext.AcPickExt; import com.hzs.common.domain.activity.pick.ext.AcPickExt;
import com.hzs.common.domain.member.account.CuMemberAccount; import com.hzs.common.domain.member.account.CuMemberAccount;
import com.hzs.common.domain.member.base.CuMember; import com.hzs.common.domain.member.base.CuMember;
@ -33,6 +38,7 @@ import com.hzs.common.domain.member.ext.CuMemberAccountExt;
import com.hzs.common.domain.member.ext.CuMemberExt; import com.hzs.common.domain.member.ext.CuMemberExt;
import com.hzs.common.domain.sale.ext.*; import com.hzs.common.domain.sale.ext.*;
import com.hzs.common.domain.sale.order.*; import com.hzs.common.domain.sale.order.*;
import com.hzs.common.domain.sale.product.BdProduct;
import com.hzs.common.domain.sale.wares.BdWares; import com.hzs.common.domain.sale.wares.BdWares;
import com.hzs.common.domain.system.base.BdCountry; import com.hzs.common.domain.system.base.BdCountry;
import com.hzs.common.domain.system.base.ext.BdProductStorehouseExt; import com.hzs.common.domain.system.base.ext.BdProductStorehouseExt;
@ -887,6 +893,9 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
} }
try { try {
// 同步全网产品库存
this.allProductSync(saOrderExt);
log.info("生产活动消息activity.exchange{}", JSONUtil.toJsonStr(saOrderExt)); log.info("生产活动消息activity.exchange{}", JSONUtil.toJsonStr(saOrderExt));
rabbitTemplate.convertAndSend(RabbitMqConstants.ACTIVITY_EXCHANGE, RabbitMqConstants.ACTIVITY_KEY, saOrderExt); rabbitTemplate.convertAndSend(RabbitMqConstants.ACTIVITY_EXCHANGE, RabbitMqConstants.ACTIVITY_KEY, saOrderExt);
// //计算奖金通过mq分发消息异步处理 // //计算奖金通过mq分发消息异步处理
@ -1015,6 +1024,9 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
throw new RuntimeException("保存会员失败!!!"); throw new RuntimeException("保存会员失败!!!");
} }
try { try {
// 同步全网产品库存
this.allProductSync(saOrderExt);
// rabbitTemplate.convertAndSend(RabbitMqConstants.ORDER_SECOND_EXCHANGE, RabbitMqConstants.ORDER_SECOND_KEY, saOrderExt); // rabbitTemplate.convertAndSend(RabbitMqConstants.ORDER_SECOND_EXCHANGE, RabbitMqConstants.ORDER_SECOND_KEY, saOrderExt);
rabbitTemplate.convertAndSend(RabbitMqConstants.ACTIVITY_EXCHANGE, RabbitMqConstants.ACTIVITY_KEY, saOrderExt); rabbitTemplate.convertAndSend(RabbitMqConstants.ACTIVITY_EXCHANGE, RabbitMqConstants.ACTIVITY_KEY, saOrderExt);
@ -1111,6 +1123,9 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
} }
try { try {
// 同步全网产品库存
this.allProductSync(saOrderExt);
if (EOrderType.RENEWAL_ORDER.getValue() == saOrderExt.getOrderType()) { if (EOrderType.RENEWAL_ORDER.getValue() == saOrderExt.getOrderType()) {
// 续约专区推送MQ // 续约专区推送MQ
rabbitTemplate.convertAndSend(RabbitMqConstants.MEMBER_CONTINUE_EXCHANGE, RabbitMqConstants.MEMBER_CONTINUE_KEY, rabbitTemplate.convertAndSend(RabbitMqConstants.MEMBER_CONTINUE_EXCHANGE, RabbitMqConstants.MEMBER_CONTINUE_KEY,
@ -2616,4 +2631,54 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
} }
} }
/**
* 同步全网产品库存
*
* @param saOrderExt
*/
private void allProductSync(SaOrderExt saOrderExt) {
if (EYesNo.NO.getIntValue() == BdConfig.getProductSync()) {
return;
}
Map<Integer, BdProduct> productMap = iBdProductService.queryProductMap(saOrderExt.getOrderItemsList().stream().map(SaOrderItems::getPkProduct).collect(Collectors.toSet()), null);
// 开启线程调用全网产品库存
// 请求参数
Map<String, Object> bodyMap = new HashMap<>();
bodyMap.put("source", BdConfig.getSysName());
bodyMap.put("orderCode", saOrderExt.getOrderCode());
List<Map<String, Object>> bodyDetailList = new ArrayList<>();
for (SaOrderItems saOrderItems : saOrderExt.getOrderItemsList()) {
Map<String, Object> detailMap = new HashMap<>();
detailMap.put("wmsCode", productMap.get(saOrderItems.getPkProduct()).getWmsCode());
detailMap.put("changeNum", saOrderItems.getQuantity());
bodyDetailList.add(detailMap);
}
bodyMap.put("detailList", bodyDetailList);
// 请求头
String header = Base64Encoder.encode(BdConfig.getSysName() + "!" + saOrderExt.getOrderCode());
ThreadUtils.threadPoolExecutor.submit(() -> {
log.info("同步产品,header: {}", header);
log.info("同步产品,bodyMap: {}", bodyMap);
HttpRequest httpRequest = HttpUtil.createPost(BdConfig.getProductSyncUrl());
httpRequest.header("authorization", header);
httpRequest.body(JSONUtil.toJsonStr(bodyMap));
httpRequest.setReadTimeout(5000);
String resultStr;
try {
resultStr = httpRequest.execute().body();
AjaxResult ajaxResult = JSONUtil.toBean(resultStr, AjaxResult.class);
log.info("同步产品,resultStr: {}", resultStr);
if (!ajaxResult.isSuccess()) {
resultStr = httpRequest.execute().body();
log.info("同步产品失败重试,resultStr: {}", resultStr);
}
} catch (Exception e) {
log.error("同步产品库存失败", e);
resultStr = httpRequest.execute().body();
log.info("同步产品异常重试,resultStr: {}", resultStr);
}
});
}
} }

View File

@ -38,6 +38,7 @@ public class WaresOrderInfoVo implements Serializable {
/** /**
* 重量 * 重量
*/ */
@BigDecimalFormat
@Excel(name = "重量(KG)") @Excel(name = "重量(KG)")
private BigDecimal weight; private BigDecimal weight;
/** /**
@ -157,7 +158,7 @@ public class WaresOrderInfoVo implements Serializable {
/** /**
* 省名称 * 省名称
*/ */
@Excel(name = "名称") @Excel(name = "")
private String recProvinceName; private String recProvinceName;
/** /**
* 市外键 * 市外键
@ -167,7 +168,7 @@ public class WaresOrderInfoVo implements Serializable {
/** /**
* 市名称 * 市名称
*/ */
@Excel(name = "名称") @Excel(name = "")
private String recCityName; private String recCityName;
/** /**
@ -178,7 +179,7 @@ public class WaresOrderInfoVo implements Serializable {
/** /**
* 县名称 * 县名称
*/ */
@Excel(name = "名称") @Excel(name = "")
private String recCountryName; private String recCountryName;
/** /**
* 详细地址 * 详细地址

View File

@ -303,10 +303,6 @@ public class WaresOrderVo implements Serializable {
* 重量 * 重量
*/ */
private BigDecimal weight; private BigDecimal weight;
/**
* 展示汇率
*/
private BigDecimal inExchangeRate;
/** /**
* 产品订单明细列表 * 产品订单明细列表
*/ */

View File

@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hzs.common.core.annotation.AccessPermissions; import com.hzs.common.core.annotation.AccessPermissions;
import com.hzs.common.core.annotation.Log; import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.EnumsPrefixConstants;
import com.hzs.common.core.domain.R; import com.hzs.common.core.domain.R;
import com.hzs.common.core.enums.*; import com.hzs.common.core.enums.*;
import com.hzs.common.core.utils.CreateNormsCodeUtils; import com.hzs.common.core.utils.CreateNormsCodeUtils;
@ -17,6 +16,7 @@ import com.hzs.common.core.web.domain.AjaxResult;
import com.hzs.common.core.web.page.TableDataInfo; import com.hzs.common.core.web.page.TableDataInfo;
import com.hzs.common.domain.sale.classify.BdSpecs; import com.hzs.common.domain.sale.classify.BdSpecs;
import com.hzs.common.domain.sale.ext.BdWaresDetailExt; import com.hzs.common.domain.sale.ext.BdWaresDetailExt;
import com.hzs.common.domain.sale.ext.BdWaresExt;
import com.hzs.common.domain.sale.ext.BdWaresSpecsRelationExt; import com.hzs.common.domain.sale.ext.BdWaresSpecsRelationExt;
import com.hzs.common.domain.sale.ext.BdWaresSpecsSkuExt; import com.hzs.common.domain.sale.ext.BdWaresSpecsSkuExt;
import com.hzs.common.domain.sale.product.BdAreaClassify; import com.hzs.common.domain.sale.product.BdAreaClassify;
@ -63,6 +63,8 @@ public class BdWaresController extends BaseController {
@DubboReference @DubboReference
IRangeServiceApi iRangeServiceApi; IRangeServiceApi iRangeServiceApi;
@Autowired
private IBdWaresService iBdWaresService;
@Autowired @Autowired
private IBdWaresAuthorizeService waresAuthorizeService; private IBdWaresAuthorizeService waresAuthorizeService;
@Autowired @Autowired
@ -82,8 +84,6 @@ public class BdWaresController extends BaseController {
@Autowired @Autowired
private IBdWaresSpecsPackService waresSpecsPackService; private IBdWaresSpecsPackService waresSpecsPackService;
@Autowired @Autowired
private IBdWaresService waresService;
@Autowired
private IBdWaresLabelService waresLabelService; private IBdWaresLabelService waresLabelService;
@Autowired @Autowired
private IBdWaresExtendService waresExtendService; private IBdWaresExtendService waresExtendService;
@ -98,9 +98,9 @@ public class BdWaresController extends BaseController {
@Autowired @Autowired
private IBdWaresAuthorityService waresAuthorityService; private IBdWaresAuthorityService waresAuthorityService;
@Autowired @Autowired
private UserTokenService userTokenService;
@Autowired
private IBdAreaClassifyService areaClassifyService; private IBdAreaClassifyService areaClassifyService;
@Autowired
private UserTokenService userTokenService;
/** /**
* 查询列表 * 查询列表
@ -113,10 +113,10 @@ public class BdWaresController extends BaseController {
public TableDataInfo list(WaresParams waresParams) { public TableDataInfo list(WaresParams waresParams) {
startPage(); startPage();
waresParams.setPkCountry(SecurityUtils.getPkCountry()); waresParams.setPkCountry(SecurityUtils.getPkCountry());
List<WaresVo> resultList = waresService.selectByWaresInfo(waresParams); List<WaresVo> resultList = iBdWaresService.selectByWaresInfo(waresParams);
if (CollectionUtil.isNotEmpty(resultList)) { if (CollectionUtil.isNotEmpty(resultList)) {
resultList.parallelStream().forEach(waresVo -> { resultList.parallelStream().forEach(waresVo -> {
WaresAuthorityVo waresAuthorityVo = waresService.getWaresAuthorityFirst(waresVo.getPkWares()); WaresAuthorityVo waresAuthorityVo = iBdWaresService.getWaresAuthorityFirst(waresVo.getPkWares());
if (waresAuthorityVo != null) { if (waresAuthorityVo != null) {
waresVo.setAuthorityType(waresAuthorityVo.getAuthorityType()); waresVo.setAuthorityType(waresAuthorityVo.getAuthorityType());
waresVo.setAuthorityTypeVal(EWaresPermissionType.getEnumByValue(waresAuthorityVo.getAuthorityType()).getLabel()); waresVo.setAuthorityTypeVal(EWaresPermissionType.getEnumByValue(waresAuthorityVo.getAuthorityType()).getLabel());
@ -138,21 +138,18 @@ public class BdWaresController extends BaseController {
@Log(module = EOperationModule.WARES_LIST, business = EOperationBusiness.WARES_LIST, method = EOperationMethod.EXPORT) @Log(module = EOperationModule.WARES_LIST, business = EOperationBusiness.WARES_LIST, method = EOperationMethod.EXPORT)
public void export(WaresParams waresParams, HttpServletResponse response) { public void export(WaresParams waresParams, HttpServletResponse response) {
waresParams.setPkCountry(SecurityUtils.getPkCountry()); waresParams.setPkCountry(SecurityUtils.getPkCountry());
List<WaresVo> resultList = waresService.selectByWaresInfo(waresParams); List<WaresVo> resultList = iBdWaresService.selectByWaresInfo(waresParams);
if (CollectionUtil.isNotEmpty(resultList)) { if (CollectionUtil.isNotEmpty(resultList)) {
// 获取需要翻译的枚举翻译
Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(ESpecialArea.values(), EYesNo.values(), ESupplyWay.values(), EPresaleStatus.values());
resultList.parallelStream().forEach(waresVo -> { resultList.parallelStream().forEach(waresVo -> {
// 所属专区 // 所属专区
waresVo.setSpecialAreaVal(transactionMap.get(EnumsPrefixConstants.SPECIAL_AREA + waresVo.getSpecialArea())); waresVo.setSpecialAreaVal(ESpecialArea.getLabelByValue(waresVo.getSpecialArea()));
// 供应方式 // 供应方式
waresVo.setOperateScopeVal(transactionMap.get(EnumsPrefixConstants.SUPPLY_WAY + waresVo.getOperateScope())); waresVo.setOperateScopeVal(ESupplyWay.getLabelByVal(waresVo.getOperateScope()));
// 预售状态 // 预售状态
waresVo.setPreSaleStatusVal(transactionMap.get(EnumsPrefixConstants.PRESALE_STATUS + waresVo.getPreSaleStatus())); waresVo.setPreSaleStatusVal(EPresaleStatus.getLabelByValue(waresVo.getPreSaleStatus()));
WaresAuthorityVo waresAuthorityVo = waresService.getWaresAuthorityFirst(waresVo.getPkWares()); WaresAuthorityVo waresAuthorityVo = iBdWaresService.getWaresAuthorityFirst(waresVo.getPkWares());
if (waresAuthorityVo != null) { if (waresAuthorityVo != null) {
waresVo.setAuthorityType(waresAuthorityVo.getAuthorityType()); waresVo.setAuthorityType(waresAuthorityVo.getAuthorityType());
waresVo.setAuthorityTypeVal(EWaresPermissionType.getEnumByValue(waresAuthorityVo.getAuthorityType()).getLabel()); waresVo.setAuthorityTypeVal(EWaresPermissionType.getEnumByValue(waresAuthorityVo.getAuthorityType()).getLabel());
@ -179,256 +176,6 @@ public class BdWaresController extends BaseController {
} }
ExcelUtil<WaresVo> util = new ExcelUtil<>(WaresVo.class); ExcelUtil<WaresVo> util = new ExcelUtil<>(WaresVo.class);
util.exportExcel(response, resultList, "商品信息导出"); util.exportExcel(response, resultList, "商品信息导出");
//导出
// Workbook workbook = new HSSFWorkbook();
// Sheet sheet = workbook.createSheet("Sheet1");
// // sheet.setColumnWidth(0,25 * 256);
//
// CellStyle style = workbook.createCellStyle();
// style.setAlignment(HorizontalAlignment.CENTER);
// style.setVerticalAlignment(VerticalAlignment.CENTER);
// createRowTitle(sheet, style);
//
// Integer num = 1;
// Map<String, Integer> countMap = new HashMap<>();
//
// for (int i = 0; i < resultList.size(); i++) {
// if (resultList.get(i).getWaresDetailList() != null) {
// // 加入判断 单个单元格无法合并
// if (num != num+resultList.get(i).getWaresDetailList().size()){
// if (resultList.get(i).getWaresDetailList().size() > 1){
// CellRangeAddress region0 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 0, 0);
// sheet.addMergedRegion(region0);
// CellRangeAddress region1 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 1, 1);
// sheet.addMergedRegion(region1);
// CellRangeAddress region2 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 2, 2);
// sheet.addMergedRegion(region2);
// CellRangeAddress region3 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 3, 3);
// sheet.addMergedRegion(region3);
// CellRangeAddress region4 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 4, 4);
// sheet.addMergedRegion(region4);
// CellRangeAddress region5 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 5, 5);
// sheet.addMergedRegion(region5);
// CellRangeAddress region6 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 6, 6);
// sheet.addMergedRegion(region6);
//
// CellRangeAddress region10 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 10, 10);
// sheet.addMergedRegion(region10);
// CellRangeAddress region11 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 11, 11);
// sheet.addMergedRegion(region11);
//
// CellRangeAddress region12 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 12, 12);
// sheet.addMergedRegion(region12);
// CellRangeAddress region13 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 13, 13);
// sheet.addMergedRegion(region13);
// CellRangeAddress region14 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 14, 14);
// sheet.addMergedRegion(region14);
// CellRangeAddress region15 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 15, 15);
// sheet.addMergedRegion(region15);
// CellRangeAddress region16 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 16, 16);
// sheet.addMergedRegion(region16);
// CellRangeAddress region17 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 17, 17);
// sheet.addMergedRegion(region17);
// CellRangeAddress region18 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 18, 18);
// sheet.addMergedRegion(region18);
// CellRangeAddress region19 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 19, 19);
// sheet.addMergedRegion(region19);
// CellRangeAddress region20 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 20, 20);
// sheet.addMergedRegion(region20);
// CellRangeAddress region21 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 21, 21);
// sheet.addMergedRegion(region21);
// CellRangeAddress region22 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 22, 22);
// sheet.addMergedRegion(region22);
// CellRangeAddress region23 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 23, 23);
// sheet.addMergedRegion(region23);
// CellRangeAddress region24 = new CellRangeAddress(num, num + resultList.get(i).getWaresDetailList().size(), 24, 24);
// sheet.addMergedRegion(region24);
//
// num += resultList.get(i).getWaresDetailList().size();
// }
// }
// for (WaresProductDetailVo waresProductDetailVo : resultList.get(i).getWaresDetailList()) {
// WaresVo waresVo = resultList.get(i);
// Row dataRow = sheet.createRow(num + 1);
// Cell cell0 = dataRow.createCell(0);
// cell0.setCellValue(waresVo.getWaresName());
// cell0.setCellStyle(style);
//
// Cell cell1 = dataRow.createCell(1);
// cell1.setCellValue(waresVo.getWaresCode());
// cell1.setCellStyle(style);
// Cell cell2 = dataRow.createCell(2);
// cell2.setCellValue(waresVo.getWaresPrice().toString());
// cell2.setCellStyle(style);
// Cell cell3 = dataRow.createCell(3);
// cell3.setCellValue(waresVo.getWaresAchieve().toString());
// cell3.setCellStyle(style);
// Cell cell4 = dataRow.createCell(4);
// cell4.setCellValue(waresVo.getAuthorityTypeVal());
// cell4.setCellStyle(style);
// Cell cell5 = dataRow.createCell(5);
// cell5.setCellValue(waresVo.getMemberCode());
// cell5.setCellStyle(style);
// Cell cell6 = dataRow.createCell(6);
// cell6.setCellValue(waresVo.getMemberName());
// cell6.setCellStyle(style);
// Cell cell7 = dataRow.createCell(7);
// cell7.setCellValue(waresProductDetailVo.getProductName());
// cell7.setCellStyle(style);
// Cell cell8 = dataRow.createCell(8);
// cell8.setCellValue(waresProductDetailVo.getProductCode());
// cell8.setCellStyle(style);
//
// Cell cell9 = dataRow.createCell(9);
// cell9.setCellValue(waresProductDetailVo.getProductQuantity());
// cell9.setCellStyle(style);
//
// Cell cell10 = dataRow.createCell(10);
// cell10.setCellValue(waresVo.getSpecialAreaVal());
// cell10.setCellStyle(style);
//
// if (waresVo.getIsSingle() != null) {
// if (waresVo.getIsSingle().equals(EYesNo.YES.getIntValue())) {
// Cell cell11 = dataRow.createCell(11);
// cell11.setCellValue("套装");
// cell11.setCellStyle(style);
// } else {
// Cell cell11 = dataRow.createCell(11);
// cell11.setCellValue("单品");
// cell11.setCellStyle(style);
// }
// }
// if (waresVo.getIsFreeMail() != null) {
// if (waresVo.getIsFreeMail().equals(EYesNo.YES.getIntValue())) {
// Cell cell12 = dataRow.createCell(12);
// cell12.setCellValue("包邮");
// cell12.setCellStyle(style);
// } else {
// Cell cell12 = dataRow.createCell(12);
// cell12.setCellValue("不包邮");
// cell12.setCellStyle(style);
// }
// }
// Cell cell13 = dataRow.createCell(13);
// cell13.setCellValue(waresVo.getClassifyName());
// cell13.setCellStyle(style);
//
// if (waresVo.getIsRecommend() != null) {
// if (waresVo.getIsRecommend().equals(EYesNo.YES.getIntValue())) {
// Cell cell14 = dataRow.createCell(14);
// cell14.setCellValue("推荐");
// cell14.setCellStyle(style);
// } else {
// Cell cell14 = dataRow.createCell(14);
// cell14.setCellValue("不推荐");
// cell14.setCellStyle(style);
// }
// } else {
// Cell cell14 = dataRow.createCell(14);
// cell14.setCellValue("不推荐");
// cell14.setCellStyle(style);
// }
//
// Cell cell15 = dataRow.createCell(15);
// cell15.setCellValue("供应方式");
// cell15.setCellStyle(style);
//
// if (waresVo.getIsSale() != null) {
// if (waresVo.getIsSale().equals(EYesNo.YES.getIntValue())) {
// Cell cell16 = dataRow.createCell(16);
// cell16.setCellValue("允许销售");
// cell16.setCellStyle(style);
// } else {
// Cell cell16 = dataRow.createCell(16);
// cell16.setCellValue("禁止销售");
// cell16.setCellStyle(style);
// }
// }
// if (waresVo.getIsPutOn() != null) {
// if (waresVo.getIsPutOn().equals(EYesNo.YES.getIntValue())) {
// Cell cell17 = dataRow.createCell(17);
// cell17.setCellValue("上架");
// cell17.setCellStyle(style);
// } else {
// Cell cell17 = dataRow.createCell(17);
// cell17.setCellValue("下架");
// cell17.setCellStyle(style);
// }
// }
// Cell cell18 = dataRow.createCell(18);
// cell18.setCellValue(waresVo.getPreSaleStatusVal());
// cell18.setCellStyle(style);
//
// Cell cell19 = dataRow.createCell(19);
// cell19.setCellValue(waresVo.getSales());
// cell19.setCellStyle(style);
//
// Cell cell20 = dataRow.createCell(20);
// cell20.setCellValue(waresVo.getActualSales());
// cell20.setCellStyle(style);
//
// if (waresVo.getArrivalTime() != null) {
// Cell cell21 = dataRow.createCell(21);
// cell21.setCellValue(waresVo.getArrivalTime());
// cell21.setCellStyle(style);
// }
// if (waresVo.getPutOnTime() != null) {
// Cell cell22 = dataRow.createCell(22);
// cell22.setCellValue(DateUtil.format(waresVo.getPutOnTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
// cell22.setCellStyle(style);
// }
// if (waresVo.getPutOffTime() != null) {
// Cell cell23 = dataRow.createCell(23);
// cell23.setCellValue(DateUtil.format(waresVo.getPutOffTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
// cell23.setCellStyle(style);
// }
//
// if (waresVo.getCreationTime() != null) {
// Cell cell24 = dataRow.createCell(24);
// cell24.setCellValue(DateUtil.format(waresVo.getCreationTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
// cell24.setCellStyle(style);
// }
//
// if (waresVo.getListingTime() != null) {
// Cell cell25 = dataRow.createCell(25);
// cell25.setCellValue(DateUtil.format(waresVo.getListingTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
// cell25.setCellStyle(style);
// }
// if (waresVo.getRemovalTime() != null) {
// Cell cell26 = dataRow.createCell(26);
// cell26.setCellValue(DateUtil.format(waresVo.getRemovalTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
// cell26.setCellStyle(style);
// }
// num += 1;
// }
// }
// }
//
// try {
// File file = new File("商品导出.xls");
//
// FileOutputStream fos = new FileOutputStream(file);
// workbook.write(fos);
// fos.close();
// String fileName = file.getName();
//
// response.setContentType("application/octet-stream");
// response.setHeader("Content-Disposition", "attachment; filename=\"" + file.getName() + "\"");
//
// FileInputStream fis = new FileInputStream(file);
// OutputStream out = response.getOutputStream();
// byte[] buffer = new byte[4096];
// int bytesRead = -1;
// while ((bytesRead = fis.read(buffer)) != -1) {
// out.write(buffer, 0, bytesRead);
// }
// fis.close();
// out.close();
//
//
// } catch (Exception e) {
// e.printStackTrace();
// }
} }
/** /**
@ -560,7 +307,7 @@ public class BdWaresController extends BaseController {
LambdaQueryWrapper<BdWares> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BdWares> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdWares::getWaresCode, wares.getWaresCode()); queryWrapper.eq(BdWares::getWaresCode, wares.getWaresCode());
queryWrapper.eq(BdWares::getSpecialArea, wares.getSpecialArea()); queryWrapper.eq(BdWares::getSpecialArea, wares.getSpecialArea());
if (waresService.count(queryWrapper) > 0) { if (iBdWaresService.count(queryWrapper) > 0) {
return AjaxResult.error("商品编号重复"); return AjaxResult.error("商品编号重复");
} }
} }
@ -660,8 +407,7 @@ public class BdWaresController extends BaseController {
if (!isPutOn) { if (!isPutOn) {
return AjaxResult.error("产品规格至少有一个上架"); return AjaxResult.error("产品规格至少有一个上架");
} }
// wares.setSort(0); iBdWaresService.saveWares(wares, userTokenService.getLoginUser());
waresService.saveWares(wares, userTokenService.getLoginUser());
return AjaxResult.success(wares.getWaresCode()); return AjaxResult.success(wares.getWaresCode());
} }
@ -688,7 +434,7 @@ public class BdWaresController extends BaseController {
queryWrapper.eq(BdWares::getWaresCode, waresParams.getWaresCode()); queryWrapper.eq(BdWares::getWaresCode, waresParams.getWaresCode());
queryWrapper.eq(BdWares::getSpecialArea, waresParams.getSpecialArea()); queryWrapper.eq(BdWares::getSpecialArea, waresParams.getSpecialArea());
queryWrapper.notIn(BdWares::getPkId, waresParams.getWaresId()); queryWrapper.notIn(BdWares::getPkId, waresParams.getWaresId());
if (waresService.count(queryWrapper) > 0) { if (iBdWaresService.count(queryWrapper) > 0) {
return AjaxResult.error("商品编号重复"); return AjaxResult.error("商品编号重复");
} }
} }
@ -704,17 +450,6 @@ public class BdWaresController extends BaseController {
if (waresParams.getCover1() == null) { if (waresParams.getCover1() == null) {
return AjaxResult.error("商品图片必传"); return AjaxResult.error("商品图片必传");
} }
// if (waresParams.getPkPrefixLabel() == null || waresParams.getPkCoolLabel() == null || waresParams.getPkGuaranteeLabel() == null || waresParams.getPkSellingPoint() == null){
// return AjaxResult.error(WaresMsgConstants.WARES_LABEL_DUPLICATE);
// }
// 检测排序重复
// QueryWrapper<BdWares> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("SORT", waresParams.getSort());
// queryWrapper.eq("PK_COUNTRY",SecurityUtils.getPkCountry());
// queryWrapper.notIn("PK_ID", waresParams.getWaresId());
// if (waresService.count(queryWrapper) > 0) {
// return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.HO_SORT_NOT_REPEAT));
// }
// 是否陆运 // 是否陆运
int isLandTrans = 1; int isLandTrans = 1;
@ -800,10 +535,7 @@ public class BdWaresController extends BaseController {
return AjaxResult.error("规格图片必传"); return AjaxResult.error("规格图片必传");
} }
} }
iBdWaresService.updateWares(waresParams, userTokenService.getLoginUser());
// waresParams.setSort(0);
waresService.updateWares(waresParams, userTokenService.getLoginUser());
// waresService.saveWaresModifyRecord(waresParams, userTokenService.getLoginUser(),EModifyRecordType.WARES_UPDATE.getValue());
return AjaxResult.success(waresParams.getWaresCode()); return AjaxResult.success(waresParams.getWaresCode());
} }
@ -816,7 +548,7 @@ public class BdWaresController extends BaseController {
@DeleteMapping("/{pkId}") @DeleteMapping("/{pkId}")
@Log(module = EOperationModule.WARES_LIST, business = EOperationBusiness.THIRD_WARES_LIST, method = EOperationMethod.DELETE) @Log(module = EOperationModule.WARES_LIST, business = EOperationBusiness.THIRD_WARES_LIST, method = EOperationMethod.DELETE)
public AjaxResult remove(@PathVariable Integer pkId) { public AjaxResult remove(@PathVariable Integer pkId) {
waresService.removeWares(pkId, userTokenService.getLoginUser()); iBdWaresService.removeWares(pkId, userTokenService.getLoginUser());
return AjaxResult.success(); return AjaxResult.success();
} }
@ -832,7 +564,7 @@ public class BdWaresController extends BaseController {
List<BdRangeExt> rsList = rangeDto.getData(); List<BdRangeExt> rsList = rangeDto.getData();
Map<Integer, BdRangeExt> rangeMap = rsList.stream().collect(Collectors.toMap(BdRangeExt::getPkId, Function.identity())); Map<Integer, BdRangeExt> rangeMap = rsList.stream().collect(Collectors.toMap(BdRangeExt::getPkId, Function.identity()));
BdWares wares = waresService.getById(pkId); BdWares wares = iBdWaresService.getById(pkId);
LambdaQueryWrapper<BdWaresExtend> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BdWaresExtend> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdWaresExtend::getPkWares, pkId); queryWrapper.eq(BdWaresExtend::getPkWares, pkId);
BdWaresExtend waresExtend = waresExtendService.getOne(queryWrapper); BdWaresExtend waresExtend = waresExtendService.getOne(queryWrapper);
@ -1008,15 +740,6 @@ public class BdWaresController extends BaseController {
LambdaQueryWrapper<BdWaresRange> waresRangeWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BdWaresRange> waresRangeWrapper = new LambdaQueryWrapper<>();
waresRangeWrapper.eq(BdWaresRange::getPkWares, pkId); waresRangeWrapper.eq(BdWaresRange::getPkWares, pkId);
int waresRangeCount = waresRangeService.count(waresRangeWrapper); int waresRangeCount = waresRangeService.count(waresRangeWrapper);
// 查询不存在的极差等级 (部分极差等级可能是后期添加导致商品和极差关联表不存在该极差信息)
// List<Integer> rangeArrayList = new ArrayList<>();
// Map<Integer, BdWaresRange> wrMap = rangeList.stream().collect(Collectors.toMap(BdWaresRange::getPkRange, Function.identity()));
// for (BdRangeExt bdRangeExt : rsList) {
// BdWaresRange bdWaresRange = wrMap.get(bdRangeExt.getPkId());
// if (bdWaresRange == null){
// rangeArrayList.add(bdWaresRange.getPkRange());
// }
// }
List<Integer> rgList = new ArrayList<>(); List<Integer> rgList = new ArrayList<>();
for (BdWaresRange bdWaresRange : rangeList) { for (BdWaresRange bdWaresRange : rangeList) {
if (bdWaresRange.getPkId() != null) { if (bdWaresRange.getPkId() != null) {
@ -1136,7 +859,7 @@ public class BdWaresController extends BaseController {
@Log(module = EOperationModule.WARES_LIST, business = EOperationBusiness.THIRD_WARES_LIST, method = EOperationMethod.UP_MOVE) @Log(module = EOperationModule.WARES_LIST, business = EOperationBusiness.THIRD_WARES_LIST, method = EOperationMethod.UP_MOVE)
public AjaxResult move(Integer waresId, Integer waresMoveType, Integer specialArea) { public AjaxResult move(Integer waresId, Integer waresMoveType, Integer specialArea) {
LoginUser loginUser = userTokenService.getLoginUser(); LoginUser loginUser = userTokenService.getLoginUser();
waresService.waresMove(waresId, waresMoveType, loginUser, specialArea); iBdWaresService.waresMove(waresId, waresMoveType, loginUser, specialArea);
return AjaxResult.success(); return AjaxResult.success();
} }
@ -1151,7 +874,7 @@ public class BdWaresController extends BaseController {
@Log(module = EOperationModule.WARES_LIST, business = EOperationBusiness.THIRD_WARES_LIST, method = EOperationMethod.TOP) @Log(module = EOperationModule.WARES_LIST, business = EOperationBusiness.THIRD_WARES_LIST, method = EOperationMethod.TOP)
public AjaxResult floatingRoof(Integer waresId) { public AjaxResult floatingRoof(Integer waresId) {
LoginUser loginUser = userTokenService.getLoginUser(); LoginUser loginUser = userTokenService.getLoginUser();
waresService.floatingRoof(waresId, loginUser); iBdWaresService.floatingRoof(waresId, loginUser);
return AjaxResult.success(); return AjaxResult.success();
} }
@ -1163,7 +886,7 @@ public class BdWaresController extends BaseController {
@GetMapping("botton-up") @GetMapping("botton-up")
public AjaxResult bottomUp(Integer waresId) { public AjaxResult bottomUp(Integer waresId) {
LoginUser loginUser = userTokenService.getLoginUser(); LoginUser loginUser = userTokenService.getLoginUser();
waresService.bottomUp(waresId, loginUser); iBdWaresService.bottomUp(waresId, loginUser);
return AjaxResult.success(); return AjaxResult.success();
} }
@ -1174,13 +897,13 @@ public class BdWaresController extends BaseController {
*/ */
@GetMapping("create-wares-code") @GetMapping("create-wares-code")
public AjaxResult createWaresCode() { public AjaxResult createWaresCode() {
String waresCode = CreateNormsCodeUtils.createWaresCode(waresService.getLastWaresCode()); String waresCode = CreateNormsCodeUtils.createWaresCode(iBdWaresService.getLastWaresCode());
return AjaxResult.success(waresCode); return AjaxResult.success(waresCode);
} }
@GetMapping("/getMaxSortNum") @GetMapping("/getMaxSortNum")
public AjaxResult getMaxSortNum() { public AjaxResult getMaxSortNum() {
return AjaxResult.success("请求成功!", waresService.getMaxSortNum()); return AjaxResult.success("请求成功!", iBdWaresService.getMaxSortNum());
} }
/** /**
@ -1191,7 +914,7 @@ public class BdWaresController extends BaseController {
@GetMapping("create-wares-sort") @GetMapping("create-wares-sort")
public AjaxResult createWaresSort() { public AjaxResult createWaresSort() {
Integer pkCountry = SecurityUtils.getPkCountry(); Integer pkCountry = SecurityUtils.getPkCountry();
Integer maxSort = waresService.getMaxSort(pkCountry); Integer maxSort = iBdWaresService.getMaxSort(pkCountry);
if (maxSort == null) { if (maxSort == null) {
maxSort = 0; maxSort = 0;
} }
@ -1209,7 +932,7 @@ public class BdWaresController extends BaseController {
queryWrapper.eq(BdWares::getWaresName, waresName); queryWrapper.eq(BdWares::getWaresName, waresName);
} }
queryWrapper.eq(BdWares::getPkCountry, SecurityUtils.getPkCountry()); queryWrapper.eq(BdWares::getPkCountry, SecurityUtils.getPkCountry());
List<BdWares> list = waresService.list(queryWrapper); List<BdWares> list = iBdWaresService.list(queryWrapper);
List<WaresEntnyOrderVo> resultList = new ArrayList<>(); List<WaresEntnyOrderVo> resultList = new ArrayList<>();
for (BdWares bdWares : list) { for (BdWares bdWares : list) {
WaresEntnyOrderVo waresEntnyOrderVo = new WaresEntnyOrderVo(); WaresEntnyOrderVo waresEntnyOrderVo = new WaresEntnyOrderVo();
@ -1310,7 +1033,7 @@ public class BdWaresController extends BaseController {
queryWrapper.like(BdWares::getWaresName, waresParams.getQueryName()).or().like(BdWares::getWaresCode, waresParams.getQueryName()); queryWrapper.like(BdWares::getWaresName, waresParams.getQueryName()).or().like(BdWares::getWaresCode, waresParams.getQueryName());
} }
queryWrapper.eq(BdWares::getPkCountry, SecurityUtils.getPkCountry()); queryWrapper.eq(BdWares::getPkCountry, SecurityUtils.getPkCountry());
List<BdWares> list = waresService.list(queryWrapper); List<BdWares> list = iBdWaresService.list(queryWrapper);
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@ -1322,7 +1045,7 @@ public class BdWaresController extends BaseController {
for (ComputeWaresPrice computeWaresPrice : computhParams.getComputeWaresPriceList()) { for (ComputeWaresPrice computeWaresPrice : computhParams.getComputeWaresPriceList()) {
computeWaresPrice.setPkWares(computhParams.getPkWares()); computeWaresPrice.setPkWares(computhParams.getPkWares());
} }
return AjaxResult.success(waresService.computeWaresPrice(computhParams.getComputeWaresPriceList())); return AjaxResult.success(iBdWaresService.computeWaresPrice(computhParams.getComputeWaresPriceList()));
} }
/** /**
@ -1334,7 +1057,7 @@ public class BdWaresController extends BaseController {
@Log(module = EOperationModule.WARES_LIST, business = EOperationBusiness.WARES_LIST, method = EOperationMethod.APPROVAL, remark = "商品新増审批") @Log(module = EOperationModule.WARES_LIST, business = EOperationBusiness.WARES_LIST, method = EOperationMethod.APPROVAL, remark = "商品新増审批")
@PostMapping("/wares-approve") @PostMapping("/wares-approve")
public AjaxResult waresApprove(@Valid @RequestBody WaresApproveParam param) { public AjaxResult waresApprove(@Valid @RequestBody WaresApproveParam param) {
waresService.update(Wrappers.<BdWares>lambdaUpdate() iBdWaresService.update(Wrappers.<BdWares>lambdaUpdate()
.eq(BdWares::getPkId, param.getPkWares()) .eq(BdWares::getPkId, param.getPkWares())
.eq(BdWares::getWaresStatus, EApproveStatus.ALREADY_SUBMIT.getValue()) .eq(BdWares::getWaresStatus, EApproveStatus.ALREADY_SUBMIT.getValue())
.set(BdWares::getWaresStatus, EApproveStatus.FINISH.getValue()) .set(BdWares::getWaresStatus, EApproveStatus.FINISH.getValue())
@ -1343,4 +1066,30 @@ public class BdWaresController extends BaseController {
return AjaxResult.success(); return AjaxResult.success();
} }
/**
* 非在售商品列表
*
* @param param
* @return
*/
@GetMapping("/list-no-sale")
public TableDataInfo listNoSale(WaresNoSaleParam param) {
List<WaresNoSaleVO> resultList = new ArrayList<>();
List<BdWaresExt> list = iBdWaresService.listWaresNoSale(param);
if (CollectionUtil.isNotEmpty(list)) {
for (BdWaresExt bdWaresExt : list) {
WaresNoSaleVO vo = BeanUtil.copyProperties(bdWaresExt, WaresNoSaleVO.class);
vo.setSpecialAreaVal(ESpecialArea.getLabelByValue(vo.getSpecialArea()));
vo.setPreSaleStatusVal(EPresaleStatus.getLabelByValue(vo.getPreSaleStatus()));
resultList.add(vo);
}
}
TableDataInfo tableDataInfo = getDataTable(list);
tableDataInfo.setRows(resultList);
return tableDataInfo;
}
} }

View File

@ -5,6 +5,7 @@ import com.hzs.common.domain.sale.ext.BdWaresExt;
import com.hzs.common.domain.sale.wares.BdWares; import com.hzs.common.domain.sale.wares.BdWares;
import com.hzs.common.domain.system.config.BdAgreement; import com.hzs.common.domain.system.config.BdAgreement;
import com.hzs.sale.index.controller.param.IndexWaresParam; import com.hzs.sale.index.controller.param.IndexWaresParam;
import com.hzs.sale.wares.param.WaresNoSaleParam;
import com.hzs.sale.wares.param.WaresParams; import com.hzs.sale.wares.param.WaresParams;
import com.hzs.sale.wares.vo.WaresAuthorityVo; import com.hzs.sale.wares.vo.WaresAuthorityVo;
import com.hzs.sale.wares.vo.WaresVo; import com.hzs.sale.wares.vo.WaresVo;
@ -157,4 +158,12 @@ public interface BdWaresMapper extends BaseMapper<BdWares> {
*/ */
List<BdWaresExt> listWaresNew(@Param("param") IndexWaresParam param); List<BdWaresExt> listWaresNew(@Param("param") IndexWaresParam param);
/**
* 查询非在售商品
*
* @param param
* @return
*/
List<BdWaresExt> listWaresNoSale(@Param("param") WaresNoSaleParam param);
} }

View File

@ -1,40 +0,0 @@
package com.hzs.sale.wares.param;/**
* @Description:
* @Author: yuhui
* @Time: 2023/5/22 14:22
* @Classname: ConfirmOrderWaresInfoParams
* @PackageName: com.hzs.sale.wares.param
*/
import lombok.Data;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.sale.wares.param
*@Author: yh
*@CreateTime: 2023-05-22 14:22
*@Description: TODO
*@Version: 1.0
*/
@Data
public class ConfirmOrderWaresInfoList {
/**
* 商品外键
*/
private Long pkTWares;
/**
* 商品sku外键
*/
private Long pkTWaresSku;
/**
* 商品数量
*/
private Integer quantity;
/**
* 渠道
*/
private Integer source;
}

View File

@ -1,26 +0,0 @@
package com.hzs.sale.wares.param;/**
* @Description:
* @Author: yuhui
* @Time: 2023/5/23 15:21
* @Classname: ConfirmOrderWaresInfoParams
* @PackageName: com.hzs.sale.wares.param
*/
import lombok.Data;
import java.util.List;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.sale.wares.param
*@Author: yh
*@CreateTime: 2023-05-23 15:21
*@Description: TODO
*@Version: 1.0
*/
@Data
public class ConfirmOrderWaresInfoParams {
private List<ConfirmOrderWaresInfoList> confirmOrderWaresInfoParamsList;
}

View File

@ -0,0 +1,24 @@
package com.hzs.sale.wares.param;
import lombok.Data;
/**
* 非在售商品查询
*/
@Data
public class WaresNoSaleParam {
/**
* 商品编号
*/
private String waresCode;
/**
* 商品名称
*/
private String waresName;
/**
* 商品状态
*/
private Integer preSaleStatus;
}

View File

@ -8,6 +8,7 @@ import com.hzs.common.domain.system.config.BdAgreement;
import com.hzs.common.domain.system.config.ext.BdRangeExt; import com.hzs.common.domain.system.config.ext.BdRangeExt;
import com.hzs.sale.index.controller.param.IndexWaresParam; import com.hzs.sale.index.controller.param.IndexWaresParam;
import com.hzs.sale.wares.param.ComputeWaresPrice; import com.hzs.sale.wares.param.ComputeWaresPrice;
import com.hzs.sale.wares.param.WaresNoSaleParam;
import com.hzs.sale.wares.param.WaresParams; import com.hzs.sale.wares.param.WaresParams;
import com.hzs.sale.wares.vo.RecommendWaresInfoVo; import com.hzs.sale.wares.vo.RecommendWaresInfoVo;
import com.hzs.sale.wares.vo.WaresAuthorityVo; import com.hzs.sale.wares.vo.WaresAuthorityVo;
@ -224,4 +225,12 @@ public interface IBdWaresService extends IService<BdWares> {
*/ */
List<BdWaresExt> listWares(IndexWaresParam param); List<BdWaresExt> listWares(IndexWaresParam param);
/**
* 查询非在售商品
*
* @param param
* @return
*/
List<BdWaresExt> listWaresNoSale(WaresNoSaleParam param);
} }

View File

@ -1633,7 +1633,11 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
@Override @Override
public List<BdWaresExt> listWares(IndexWaresParam param) { public List<BdWaresExt> listWares(IndexWaresParam param) {
return baseMapper.listWaresNew(param); return baseMapper.listWaresNew(param);
}
@Override
public List<BdWaresExt> listWaresNoSale(WaresNoSaleParam param) {
return baseMapper.listWaresNoSale(param);
} }
} }

View File

@ -0,0 +1,49 @@
package com.hzs.sale.wares.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* 非在售商品查询返回
*/
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class WaresNoSaleVO implements Serializable {
/**
* 商品ID
*/
private Integer pkId;
/**
* 商品图
*/
private String cover1;
/**
* 商品编号
*/
private String waresCode;
/**
* 商品名称
*/
private String waresName;
/**
* 商品专区
*/
private Integer specialArea;
private String specialAreaVal;
/**
* 商品状态
*/
private Integer preSaleStatus;
private String preSaleStatusVal;
}

View File

@ -71,14 +71,6 @@
so.remark, so.remark,
soi.creation_time, soi.creation_time,
so.pay_time, so.pay_time,
case
when so.PK_ORIGINAL_ORDER is not null then
(select sot.order_code
from sa_order sot
where sot.pk_id = so.PK_ORIGINAL_ORDER)
else
null
end original_order_code,
bs.name storehouse_name, bs.name storehouse_name,
bu.name unit_name bu.name unit_name
from SA_ORDER so from SA_ORDER so
@ -117,6 +109,15 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<!-- 在售 -->
and (bwe.pre_sale_status = 0
<if test="param.pkWaresList != null and param.pkWaresList.size > 0">
or soi.pk_wares in
<foreach collection="param.pkWaresList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
)
<!-- 地区权限处理 --> <!-- 地区权限处理 -->
<if test="param.areaScopeList != null and param.areaScopeList.size > 0"> <if test="param.areaScopeList != null and param.areaScopeList.size > 0">
and so.rec_province in and so.rec_province in
@ -131,9 +132,6 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="null != param.pkOriginalOrder">
and so.PK_ORIGINAL_ORDER = #{param.pkOriginalOrder}
</if>
</if> </if>
</foreach> </foreach>
order by creation_time desc, order_code desc order by creation_time desc, order_code desc
@ -171,14 +169,6 @@
so.remark, so.remark,
soi.creation_time, soi.creation_time,
so.pay_time, so.pay_time,
case
when so.PK_ORIGINAL_ORDER is not null then
(select sot.order_code
from sa_order sot
where sot.pk_id = so.PK_ORIGINAL_ORDER)
else
null
end original_order_code,
bs.name storehouse_name, bs.name storehouse_name,
bu.name unit_name, bu.name unit_name,
so.SYSTEM_TYPE so.SYSTEM_TYPE
@ -221,6 +211,15 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<!-- 在售 -->
and (bwe.pre_sale_status = 0
<if test="param.pkWaresList != null and param.pkWaresList.size > 0">
or soi.pk_wares in
<foreach collection="param.pkWaresList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
)
<!-- 地区权限处理 --> <!-- 地区权限处理 -->
<if test="param.areaScopeList != null and param.areaScopeList.size > 0"> <if test="param.areaScopeList != null and param.areaScopeList.size > 0">
and so.rec_province in and so.rec_province in
@ -235,9 +234,6 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="null != param.pkOriginalOrder">
and so.PK_ORIGINAL_ORDER = #{param.pkOriginalOrder}
</if>
order by soi.creation_time desc, so.order_code desc order by soi.creation_time desc, so.order_code desc
</if> </if>
</select> </select>
@ -443,6 +439,15 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<!-- 在售 -->
and (bwe.pre_sale_status = 0
<if test="param.pkWaresList != null and param.pkWaresList.size > 0">
or soi.pk_wares in
<foreach collection="param.pkWaresList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
)
<!-- 地区权限处理 --> <!-- 地区权限处理 -->
<if test="param.areaScopeList != null and param.areaScopeList.size > 0"> <if test="param.areaScopeList != null and param.areaScopeList.size > 0">
and so.rec_province in and so.rec_province in
@ -772,7 +777,6 @@
oi.SPECS_NAME specsName, oi.SPECS_NAME specsName,
bp.WEIGHT weight, bp.WEIGHT weight,
bp.SHIPPING_CHANNEL shippingChannel, bp.SHIPPING_CHANNEL shippingChannel,
bc.IN_EXCHANGE_RATE inExchangeRate,
oi.LOGISTICS_CODE logisticsCode, oi.LOGISTICS_CODE logisticsCode,
oi.LOGISTICS_COMPANY logisticsCompany, oi.LOGISTICS_COMPANY logisticsCompany,
m.MEMBER_CODE buyMemberCode, m.MEMBER_CODE buyMemberCode,
@ -786,7 +790,6 @@
ver.VERTEX_NAME vertexName ver.VERTEX_NAME vertexName
from sa_order_items oi from sa_order_items oi
left join sa_order so on oi.PK_ORDER = so.PK_ID left join sa_order so on oi.PK_ORDER = so.PK_ID
left join BD_CURRENCY bc on bc.PK_ID = so.PK_RATE
left join CU_MEMBER cm on cm.PK_ID = so.PK_MEMBER left join CU_MEMBER cm on cm.PK_ID = so.PK_MEMBER
left join BD_WARES_EXTEND we on we.PK_WARES = oi.PK_WARES left join BD_WARES_EXTEND we on we.PK_WARES = oi.PK_WARES
left join BD_WARES bw on bw.PK_ID = we.PK_WARES left join BD_WARES bw on bw.PK_ID = we.PK_WARES

View File

@ -426,4 +426,31 @@
order by bd.sort desc, bd.wares_price order by bd.sort desc, bd.wares_price
</select> </select>
<!-- 查询非在售商品 -->
<select id="listWaresNoSale" resultType="com.hzs.common.domain.sale.ext.BdWaresExt">
select bw.pk_id,
bw.cover1,
bw.wares_name,
bw.wares_code,
bw.special_area,
bwe.pre_sale_status
from bd_wares bw
inner join bd_wares_extend bwe
on bwe.pk_wares = bw.pk_id
where bw.del_flag = 0
and bwe.del_flag = 0
and bwe.is_put_on = 0
and bwe.pre_sale_status in (1, 3)
<if test="param.waresCode != null and param.waresCode != ''">
and bw.wares_code like '%' || #{param.waresCode} || '%'
</if>
<if test="param.waresName != null and param.waresName != ''">
and bw.wares_name like '%' || #{param.waresName} || '%'
</if>
<if test="param.preSaleStatus != null">
and bwe.pre_sale_status = #{param.preSaleStatus}
</if>
order by bw.wares_name
</select>
</mapper> </mapper>

View File

@ -359,14 +359,6 @@ public class EnumsInitController {
initList.add(this.createData(value.getKey(), value.getLabel())); initList.add(this.createData(value.getKey(), value.getLabel()));
} }
/**
* 供应方式
*/
for (ESupplyWay value : ESupplyWay.values()) {
initList.add(this.createData(value.getKey(), value.getLabel()));
}
/** /**
* 订单状态 * 订单状态
*/ */

View File

@ -5,8 +5,6 @@ import org.springframework.stereotype.Component;
/** /**
* 读取项目相关配置 * 读取项目相关配置
*
* @author hzs
*/ */
@Component @Component
@ConfigurationProperties(prefix = "bd") @ConfigurationProperties(prefix = "bd")
@ -39,6 +37,15 @@ public class BdConfig {
*/ */
private static String android; private static String android;
/**
* 商品同步是否开启0=开启1=不开启
*/
private static Integer productSync;
/**
* 商品同步地址
*/
private static String productSyncUrl;
public static String getSysName() { public static String getSysName() {
return sysName; return sysName;
} }
@ -87,4 +94,20 @@ public class BdConfig {
BdConfig.android = android; BdConfig.android = android;
} }
public static Integer getProductSync() {
return productSync;
}
public void setProductSync(Integer productSync) {
BdConfig.productSync = productSync;
}
public static String getProductSyncUrl() {
return productSyncUrl;
}
public void setProductSyncUrl(String productSyncUrl) {
BdConfig.productSyncUrl = productSyncUrl;
}
} }

View File

@ -21,16 +21,6 @@ public enum EDelivery {
*/ */
COMPANY_PICKED_UP(2, "公司自提", 0, EnumsPrefixConstants.DELIVERY + "2"), COMPANY_PICKED_UP(2, "公司自提", 0, EnumsPrefixConstants.DELIVERY + "2"),
/**
* 店铺自提
*/
SHOP_PICKED_UP(3, "店铺自提", 0, EnumsPrefixConstants.DELIVERY + "3"),
/**
* 店铺配送
*/
SHOP_DELIVERY(4, "店铺配送", 0, EnumsPrefixConstants.DELIVERY + "4"),
; ;
/** /**
@ -58,4 +48,18 @@ public enum EDelivery {
} }
return null; return null;
} }
public static String getLabelByValue(Integer value) {
if (null == value) {
return "";
}
for (EDelivery enums : EDelivery.values()) {
if (enums.getValue() == value) {
return enums.getLabel();
}
}
return "";
}
} }

View File

@ -40,19 +40,15 @@ public enum EOrderPayType {
*/ */
private final String key; private final String key;
public static String getLabelByValue(Integer value) {
/** if (null == value) {
* 根据值获取枚举 return "";
* }
* @param value
* @return
*/
public static EOrderPayType getEnumByValue(int value) {
for (EOrderPayType enums : EOrderPayType.values()) { for (EOrderPayType enums : EOrderPayType.values()) {
if (enums.getValue() == value) { if (enums.value == value) {
return enums; return enums.getLabel();
} }
} }
return null; return "";
} }
} }

View File

@ -4,7 +4,6 @@ import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -68,22 +67,6 @@ public enum EOrderStatus {
*/ */
private static List<EOrderStatus> apiList; private static List<EOrderStatus> apiList;
/**
* 获取会员前端列表
*
* @return
*/
public static List<EOrderStatus> getApiList() {
if (null == apiList) {
apiList = new ArrayList<>();
apiList.add(WAIT_PAY);
apiList.add(PAY);
apiList.add(DELIVERED);
apiList.add(RECEIVED);
}
return apiList;
}
public static EOrderStatus getEOrderStatus(int value) { public static EOrderStatus getEOrderStatus(int value) {
for (EOrderStatus eOrderStatus : EOrderStatus.values()) { for (EOrderStatus eOrderStatus : EOrderStatus.values()) {
if (eOrderStatus.value == value) { if (eOrderStatus.value == value) {
@ -93,4 +76,16 @@ public enum EOrderStatus {
return null; return null;
} }
public static String getLabelByValue(Integer value) {
if (null == value) {
return "";
}
for (EOrderStatus enums : EOrderStatus.values()) {
if (enums.value == value) {
return enums.getLabel();
}
}
return "";
}
} }

View File

@ -54,4 +54,16 @@ public enum EPresaleStatus {
return null; return null;
} }
public static String getLabelByValue(Integer value) {
if (null == value) {
return "";
}
for (EPresaleStatus enums : EPresaleStatus.values()) {
if (enums.getValue() == value) {
return enums.getLabel();
}
}
return "";
}
} }

View File

@ -5,7 +5,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
/** /**
* @Description: 产品发货渠道 * 产品发货渠道
*/ */
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
@ -44,4 +44,18 @@ public enum EShippingChannel {
} }
return TOTAL_WAREHOUSE; return TOTAL_WAREHOUSE;
} }
public static String getLabelByValue(Integer value) {
if (null == value) {
return "";
}
for (EShippingChannel enums : EShippingChannel.values()) {
if (enums.value == value) {
return enums.getLabel();
}
}
return "";
}
} }

View File

@ -1,15 +1,10 @@
package com.hzs.common.core.enums; package com.hzs.common.core.enums;
import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
/** /**
* @Description: 供应方式 * 供应方式
* @Author: jiang chao
* @Time: 2022/11/4 11:58
* @Classname: ESupplyWay
* @PackageName: com.hzs.common.core.enums
*/ */
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
@ -18,12 +13,12 @@ public enum ESupplyWay {
/** /**
* 自营 * 自营
*/ */
SELF(0, "自营", 0, EnumsPrefixConstants.SUPPLY_WAY + "0"), SELF(0, "自营", 0),
/** /**
* 非自营 * 非自营
*/ */
NO_SELF(1, "非自营", 0, EnumsPrefixConstants.SUPPLY_WAY + "1"), NO_SELF(1, "非自营", 0),
; ;
@ -39,18 +34,26 @@ public enum ESupplyWay {
* 是否启用0=,1= -- 来源EYesNo * 是否启用0=,1= -- 来源EYesNo
*/ */
private final int enable; private final int enable;
/**
* 国际化翻译key值
*/
private final String key;
public static ESupplyWay getESupplyWay(int value){ public static ESupplyWay getESupplyWay(int value) {
for (ESupplyWay eSupplyWay : ESupplyWay.values()) { for (ESupplyWay eSupplyWay : ESupplyWay.values()) {
if (eSupplyWay.value == value){ if (eSupplyWay.value == value) {
return eSupplyWay; return eSupplyWay;
} }
} }
return null; return null;
} }
public static String getLabelByVal(Integer value) {
if (null == value) {
return "";
}
for (ESupplyWay eSupplyWay : ESupplyWay.values()) {
if (eSupplyWay.getValue() == value) {
return eSupplyWay.getLabel();
}
}
return "";
}
} }

View File

@ -10,15 +10,24 @@ import lombok.Getter;
@Getter @Getter
public enum ESysName { public enum ESysName {
MANAGE("manage", "后台管理"),
/** /**
* 乐学 * 乐学
*/ */
LX("lx", "乐学"), LX("lx", "乐学CN"),
/** /**
* 北大 * 北大
*/ */
BD("bd", "北大"), BD("bd", "北大BD"),
/**
* 新零售
*/
BF("bf", "新零售BF"),
/**
* 新零售店铺
*/
BL("bl", "新零售店铺BL"),
; ;
@ -31,4 +40,23 @@ public enum ESysName {
*/ */
private final String label; private final String label;
public static ESysName getEnumByValue(String value) {
for (ESysName enums : ESysName.values()) {
if (enums.getValue().equals(value)) {
return enums;
}
}
return null;
}
public static String getLabelByValue(String value) {
for (ESysName enums : ESysName.values()) {
if (enums.getValue().equals(value)) {
return enums.getLabel();
}
}
return "";
}
} }

View File

@ -43,13 +43,16 @@ public enum ETransportType {
*/ */
private final String key; private final String key;
public static String getLabelByValue(Integer value) {
public static ETransportType getETransportType(int value) { if (null == value) {
for (ETransportType eTransportType : ETransportType.values()) { return "";
if (eTransportType.getValue() == value) { }
return eTransportType; for (ETransportType enums : ETransportType.values()) {
if (enums.value == value) {
return enums.getLabel();
} }
} }
return null; return "";
} }
} }

View File

@ -6,21 +6,12 @@ import org.springframework.stereotype.Component;
import java.util.concurrent.*; import java.util.concurrent.*;
/** /**
* Description: 线程工具类 * 线程工具类
* Author: jiang chao
* Time: 2022/8/30 10:10
* Classname: ThreadUtil
* PackageName: com.hzs.common.core.utils
*/ */
@Slf4j @Slf4j
@Component @Component
public class ThreadUtils { public class ThreadUtils {
/**
* 初始化创建4个长度的固定线程池
*/
public static ExecutorService executorService = Executors.newFixedThreadPool(4);
/** /**
* 创建线程池 * 创建线程池
*/ */

View File

@ -151,15 +151,6 @@ security:
- /member/manage/handle-business/online-petition-confirm - /member/manage/handle-business/online-petition-confirm
- /member/manage/member-empty/submit - /member/manage/member-empty/submit
- /member/manager/zeroRevoke/petition - /member/manager/zeroRevoke/petition
- /activity/manage/gift-benefits/save-petition
- /activity/manage/gift-benefits/up-petition
- /activity/manage/gift-benefits/del-petition
- /activity/manage/new-people/save-petition
- /activity/manage/new-people/up-petition
- /activity/manage/new-people/del-petition
- /activity/manage/ac-bean-rule-config/save-petition
- /activity/manage/ac-bean-rule-config/up-petition
- /activity/manage/ac-bean-rule-config/del-petition
- /activity/manage/tourism/online-petition - /activity/manage/tourism/online-petition
- /activity/manage/wares-rule-config/save-activity - /activity/manage/wares-rule-config/save-activity
- /activity/manage/wares-rule-config/update - /activity/manage/wares-rule-config/update