采购配置相关

20230922-ljl-fixBug
wangchaoxu 1 year ago
parent b6ecded227
commit 19763beff5

@ -0,0 +1,12 @@
package com.ms.api.dto.order;
import lombok.Data;
@Data
public class SavePurchaseSettingRequestDTO {
private PurchaseSettingDTO purchaseSetting;
private DsPurchaseSettingDTO dsPurchaseSetting;
}

@ -23,6 +23,10 @@ public class Ret {
this.data = data;
}
public static Ret success() {
return Ret.success(null);
}
public static Ret success(Map data) {
return new Ret("success", data);
}

@ -690,7 +690,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
return purchaseSettingDTO;
}
@Transactional
@Transactional(rollbackFor = Exception.class)
public boolean savePurchaseSetting(Long shopId, PurchaseSettingDTO purchaseSettingDTO) {
if (purchaseSettingDTO == null) {
return false;
@ -740,7 +740,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
purchaseSettingLog.setGmtModified(new Date());
purchaseSettingLogMapper.insertSelective(purchaseSettingLog);
return false;
return true;
}
public DsPurchaseSettingDTO getDsPurchaseSettingByShopId(Long shopId) {

@ -0,0 +1,51 @@
package com.ms.api.spi.order;
import com.jinritemai.cloud.base.api.BaseRequest;
import com.jinritemai.cloud.base.api.BaseResponse;
import com.jinritemai.cloud.base.api.ExtensionService;
import com.jinritemai.cloud.base.api.ExtensionServiceHandler;
import com.ms.api.common.Ret;
import com.ms.api.common.SPIBaseService;
import com.ms.api.dto.order.SavePurchaseSettingRequestDTO;
import com.ms.api.service.PurchaseOrderService;
import com.ms.api.tool.DsJsonRequestTemplate;
import com.ms.api.util.PurchaseOrderUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ExtensionService("savePurchaseSetting")
@Slf4j
@AllArgsConstructor
public class SavePurchaseSettingService extends SPIBaseService implements ExtensionServiceHandler<SavePurchaseSettingRequestDTO, Ret> {
@Autowired
private DsJsonRequestTemplate dsJsonRequestTemplate;
@Autowired
private PurchaseOrderUtil purchaseOrderUtil;
@Autowired
private PurchaseOrderService purchaseOrderService;
@Override
public BaseResponse<Ret> handle(BaseRequest<SavePurchaseSettingRequestDTO> req) {
initHandle(req);
Long shopId = Long.valueOf(this.shopId);
SavePurchaseSettingRequestDTO requestDTO = req.getData();
// purchaseSetting 为采购配置 【存储到下游 - 下游店铺级别配置 对应table: purchase_setting】 【包含 自动备注|自动发货】
purchaseOrderUtil.savePurchaseSetting(shopId, requestDTO.getPurchaseSetting());
// dsPurchaseSetting 分销采购配置【存储在下游 - 下游级别配置 对应table ds_purchase_setting】
return BaseResponse.<Ret>builder()
.success(true)
.message("success")
.data(Ret.success())
.code("10000")
.build();
}
}

@ -217,4 +217,7 @@ public class PurchaseOrderUtil {
return purchaseOrderService.getPurchaseSetting(operateShopId);
}
public boolean savePurchaseSetting(Long shopId, PurchaseSettingDTO purchaseSettingDTO) {
return purchaseOrderService.savePurchaseSetting(shopId, purchaseSettingDTO);
}
}

@ -100,27 +100,27 @@
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dsPurchaseSettingId != null">ds_purchase_setting_id = #{dsPurchaseSettingId,jdbcType=BIGINT},</if>
<if test="shopId != null">shop_id = #{shopId,jdbcType=BIGINT},</if>
<if test="isAutoPurchase != null">is_auto_purchase = #{isAutoPurchase,jdbcType=BOOLEAN},</if>
<if test="gmtIsAutoPurchase != null">gmt_is_auto_purchase = #{gmtIsAutoPurchase,jdbcType=TIMESTAMP},</if>
<if test="isAutoPay != null">is_auto_pay = #{isAutoPay,jdbcType=BOOLEAN},</if>
<if test="delayPurchaseMinute != null">delay_purchase_minute = #{delayPurchaseMinute,jdbcType=SMALLINT},</if>
<if test="isUseForbiddenPurchaseProfit != null">is_use_forbidden_purchase_profit = #{isUseForbiddenPurchaseProfit,jdbcType=BOOLEAN},</if>
<if test="forbiddenPurchaseProfit != null">forbidden_purchase_profit = #{forbiddenPurchaseProfit,jdbcType=DECIMAL},</if>
<if test="isUseForbiddenKeywords != null">is_use_forbidden_keywords = #{isUseForbiddenKeywords,jdbcType=BOOLEAN},</if>
<if test="forbiddenKeywords != null">forbidden_keywords = #{forbiddenKeywords,jdbcType=VARCHAR},</if>
<if test="isUseAllProduct != null">is_use_all_product = #{isUseAllProduct,jdbcType=BOOLEAN},</if>
<if test="isUsePartProduct != null">is_use_part_product = #{isUsePartProduct,jdbcType=BOOLEAN},</if>
<if test="dsPurchaseSettingId != null">#{dsPurchaseSettingId,jdbcType=BIGINT},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="isAutoPurchase != null">#{isAutoPurchase,jdbcType=BOOLEAN},</if>
<if test="gmtIsAutoPurchase != null">#{gmtIsAutoPurchase,jdbcType=TIMESTAMP},</if>
<if test="isAutoPay != null">#{isAutoPay,jdbcType=BOOLEAN},</if>
<if test="delayPurchaseMinute != null">#{delayPurchaseMinute,jdbcType=SMALLINT},</if>
<if test="isUseForbiddenPurchaseProfit != null">#{isUseForbiddenPurchaseProfit,jdbcType=BOOLEAN},</if>
<if test="forbiddenPurchaseProfit != null">#{forbiddenPurchaseProfit,jdbcType=DECIMAL},</if>
<if test="isUseForbiddenKeywords != null">#{isUseForbiddenKeywords,jdbcType=BOOLEAN},</if>
<if test="forbiddenKeywords != null">#{forbiddenKeywords,jdbcType=VARCHAR},</if>
<if test="isUseAllProduct != null">#{isUseAllProduct,jdbcType=BOOLEAN},</if>
<if test="isUsePartProduct != null">#{isUsePartProduct,jdbcType=BOOLEAN},</if>
<if test="isPurchaseLogisticsUpdateToPlatform != null">is_purchase_logistics_update_to_platform = #{isPurchaseLogisticsUpdateToPlatform,jdbcType=BOOLEAN},</if>
<if test="deliveryTimeType != null">delivery_time_type = #{deliveryTimeType,jdbcType=VARCHAR},</if>
<if test="isForbidIsolationPurchase != null">is_forbid_isolation_purchase = #{isForbidIsolationPurchase,jdbcType=BOOLEAN},</if>
<if test="operateShopId != null">operate_shop_id = #{operateShopId,jdbcType=BIGINT},</if>
<if test="operateMemberId != null">operate_member_id = #{operateMemberId,jdbcType=VARCHAR},</if>
<if test="actionSource != null">action_source = #{actionSource,jdbcType=VARCHAR},</if>
<if test="operateIp != null">operate_ip = #{operateIp,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},</if>
<if test="deliveryTimeType != null">#{deliveryTimeType,jdbcType=VARCHAR},</if>
<if test="isForbidIsolationPurchase != null">#{isForbidIsolationPurchase,jdbcType=BOOLEAN},</if>
<if test="operateShopId != null">#{operateShopId,jdbcType=BIGINT},</if>
<if test="operateMemberId != null">#{operateMemberId,jdbcType=VARCHAR},</if>
<if test="actionSource != null">#{actionSource,jdbcType=VARCHAR},</if>
<if test="operateIp != null">#{operateIp,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.DsPurchaseSetting">

@ -26,12 +26,12 @@
select
<include refid="Base_Column_List" />
from purchase_setting_log
where purchase_setting_log_id = #{purchaseSettingLogId,jdbcType=BIGINT}
where purchase_setting_log_id = #{purchaseSettingLogId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from purchase_setting_log
where purchase_setting_log_id = #{purchaseSettingLogId,jdbcType=BIGINT}
where purchase_setting_log_id = #{purchaseSettingLogId,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="purchase_setting_log_id" keyProperty="purchaseSettingLogId" parameterType="com.ms.dal.entity.PurchaseSettingLog" useGeneratedKeys="true">
insert into purchase_setting_log
@ -47,26 +47,26 @@
<insert id="insertSelective" keyColumn="purchase_setting_log_id" keyProperty="purchaseSettingLogId" parameterType="com.ms.dal.entity.PurchaseSettingLog" useGeneratedKeys="true">
insert into purchase_setting_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseSettingLogId != null">purchaseSettingLogId,</if>
<if test="shopId != null">shopId,</if>
<if test="purchaseSettingLogId != null">purchase_setting_log_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="source != null">source,</if>
<if test="data != null">data,</if>
<if test="beforeData != null">beforeData,</if>
<if test="operateShopId != null">operateShopId,</if>
<if test="operateIp != null">operateIp,</if>
<if test="gmtCreate != null">gmtCreate,</if>
<if test="gmtModified != null">gmtModified,</if>
<if test="beforeData != null">before_data,</if>
<if test="operateShopId != null">operate_shop_id,</if>
<if test="operateIp != null">operate_ip,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseSettingLogId != null">purchase_setting_log_id = #{purchaseSettingLogId,jdbcType=BIGINT},</if>
<if test="shopId != null">shop_id = #{shopId,jdbcType=BIGINT},</if>
<if test="source != null">source = #{source,jdbcType=VARCHAR},</if>
<if test="data != null">data = #{data,jdbcType=VARCHAR},</if>
<if test="beforeData != null">before_data = #{beforeData,jdbcType=VARCHAR},</if>
<if test="operateShopId != null">operate_shop_id = #{operateShopId,jdbcType=BIGINT},</if>
<if test="operateIp != null">operate_ip = #{operateIp,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},</if>
<if test="purchaseSettingLogId != null">#{purchaseSettingLogId,jdbcType=BIGINT},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="source != null">#{source,jdbcType=VARCHAR},</if>
<if test="data != null">#{data,jdbcType=VARCHAR},</if>
<if test="beforeData != null">#{beforeData,jdbcType=VARCHAR},</if>
<if test="operateShopId != null">#{operateShopId,jdbcType=BIGINT},</if>
<if test="operateIp != null">#{operateIp,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.PurchaseSettingLog">
@ -97,11 +97,11 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
</if>
</set>
where purchase_setting_log_id = #{purchaseSettingLogId,jdbcType=BIGINT}
where purchase_setting_log_id = #{purchaseSettingLogId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ms.dal.entity.PurchaseSettingLog">
update purchase_setting_log
set
set
shop_id = #{shopId,jdbcType=BIGINT},
source = #{source,jdbcType=VARCHAR},
data = #{data,jdbcType=VARCHAR},
@ -110,6 +110,6 @@
operate_ip = #{operateIp,jdbcType=VARCHAR},
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where purchase_setting_log_id = #{purchaseSettingLogId,jdbcType=BIGINT}
where purchase_setting_log_id = #{purchaseSettingLogId,jdbcType=BIGINT}
</update>
</mapper>

@ -60,34 +60,34 @@
<insert id="insertSelective" keyColumn="purchase_setting_id" keyProperty="purchaseSettingId" parameterType="com.ms.dal.entity.PurchaseSetting" useGeneratedKeys="true">
insert into purchase_setting
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseSettingId != null">purchaseSettingId,</if>
<if test="shopId != null">shopId,</if>
<if test="isAppendShopRemark != null">isAppendShopRemark,</if>
<if test="appendShopRemarkTpl != null">appendShopRemarkTpl,</if>
<if test="isAppendShopNote != null">isAppendShopNote,</if>
<if test="appendShopNoteTpl != null">appendShopNoteTpl,</if>
<if test="shopRemarkFlag != null">shopRemarkFlag,</if>
<if test="isAutoFillRemark != null">isAutoFillRemark,</if>
<if test="autoFillRemarkTpl != null">autoFillRemarkTpl,</if>
<if test="isAutoFillOrderMemo != null">isAutoFillOrderMemo,</if>
<if test="autoFillOrderMemoTpl != null">autoFillOrderMemoTpl,</if>
<if test="gmtCreate != null">gmtCreate,</if>
<if test="gmtModified != null">gmtModified,</if>
<if test="purchaseSettingId != null">purchasesetting_id,</if>
<if test="shopId != null">shop_id,</if>
<if test="isAppendShopRemark != null">is_append_shop_remark,</if>
<if test="appendShopRemarkTpl != null">append_shop_remark_tpl,</if>
<if test="isAppendShopNote != null">is_append_shop_note,</if>
<if test="appendShopNoteTpl != null">append_shop_note_tpl,</if>
<if test="shopRemarkFlag != null">shop_remark_flag,</if>
<if test="isAutoFillRemark != null">is_auto_fill_remark,</if>
<if test="autoFillRemarkTpl != null">auto_fill_remark_tpl,</if>
<if test="isAutoFillOrderMemo != null">is_auto_fill_order_memo,</if>
<if test="autoFillOrderMemoTpl != null">auto_fill_order_memo_tpl,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="gmtModified != null">gmt_modified,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseSettingId != null">purchase_setting_id = #{purchaseSettingId,jdbcType=BIGINT},</if>
<if test="shopId != null">shop_id = #{shopId,jdbcType=BIGINT},</if>
<if test="isAppendShopRemark != null">is_append_shop_remark = #{isAppendShopRemark,jdbcType=BOOLEAN},</if>
<if test="appendShopRemarkTpl != null">append_shop_remark_tpl = #{appendShopRemarkTpl,jdbcType=VARCHAR},</if>
<if test="isAppendShopNote != null">is_append_shop_note = #{isAppendShopNote,jdbcType=BOOLEAN},</if>
<if test="appendShopNoteTpl != null">append_shop_note_tpl = #{appendShopNoteTpl,jdbcType=VARCHAR},</if>
<if test="shopRemarkFlag != null">shop_remark_flag = #{shopRemarkFlag,jdbcType=TINYINT},</if>
<if test="isAutoFillRemark != null">is_auto_fill_remark = #{isAutoFillRemark,jdbcType=BOOLEAN},</if>
<if test="autoFillRemarkTpl != null">auto_fill_remark_tpl = #{autoFillRemarkTpl,jdbcType=VARCHAR},</if>
<if test="isAutoFillOrderMemo != null">is_auto_fill_order_memo = #{isAutoFillOrderMemo,jdbcType=BOOLEAN},</if>
<if test="autoFillOrderMemoTpl != null">auto_fill_order_memo_tpl = #{autoFillOrderMemoTpl,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},</if>
<if test="shopId != null">#{shopId,jdbcType=BIGINT},</if>
<if test="isAppendShopRemark != null">#{isAppendShopRemark,jdbcType=BOOLEAN},</if>
<if test="appendShopRemarkTpl != null">#{appendShopRemarkTpl,jdbcType=VARCHAR},</if>
<if test="isAppendShopNote != null">#{isAppendShopNote,jdbcType=BOOLEAN},</if>
<if test="appendShopNoteTpl != null">#{appendShopNoteTpl,jdbcType=VARCHAR},</if>
<if test="shopRemarkFlag != null">#{shopRemarkFlag,jdbcType=TINYINT},</if>
<if test="isAutoFillRemark != null">#{isAutoFillRemark,jdbcType=BOOLEAN},</if>
<if test="autoFillRemarkTpl != null">#{autoFillRemarkTpl,jdbcType=VARCHAR},</if>
<if test="isAutoFillOrderMemo != null">#{isAutoFillOrderMemo,jdbcType=BOOLEAN},</if>
<if test="autoFillOrderMemoTpl != null">#{autoFillOrderMemoTpl,jdbcType=VARCHAR},</if>
<if test="gmtCreate != null">#{gmtCreate,jdbcType=TIMESTAMP},</if>
<if test="gmtModified != null">#{gmtModified,jdbcType=TIMESTAMP},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ms.dal.entity.PurchaseSetting">

Loading…
Cancel
Save