修改套餐状态
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ public class BmsCustomerPriceSet extends BaseEntity
|
||||
/** 计价类型 FIXED=固定价 DISCOUNT=折扣 */
|
||||
private String setType;
|
||||
|
||||
/** 套餐状态 D草稿 A审核中 E生效 R驳回 S停用 */
|
||||
/** Package status D=pending-enable A=audit E=effective R=reject S=stopped */
|
||||
private String priceSetStatus;
|
||||
|
||||
/** 套餐生效日期 */
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class BmsPriceSetOption
|
||||
/** 计价类型 FIXED=固定价 DISCOUNT=折扣 */
|
||||
private String setType;
|
||||
|
||||
/** 套餐状态 D草稿 A审核中 E生效 R驳回 S停用 */
|
||||
/** Package status D=pending-enable A=audit E=effective R=reject S=stopped */
|
||||
private String status;
|
||||
|
||||
/** 生效日期 */
|
||||
|
||||
@@ -34,6 +34,9 @@ public interface IPrcPriceSetService
|
||||
|
||||
public int disable(Long priceSetId, String updateBy);
|
||||
|
||||
/** Re-enable a stopped package (S -> E). */
|
||||
public int enable(Long priceSetId, String updateBy);
|
||||
|
||||
/**
|
||||
* Activate a draft or reschedule a pending version with user-specified effectiveTime.
|
||||
* effectiveTime <= now -> EFFECT; future -> PENDING(3). Then refresh 0/3/1/2.
|
||||
|
||||
+18
@@ -49,6 +49,7 @@ import com.ruoyi.price.task.PrcPriceSetSaveAsyncRunner;
|
||||
@Service
|
||||
public class PrcPriceSetServiceImpl implements IPrcPriceSetService
|
||||
{
|
||||
/** Package status: D pending-enable / A audit / E effective / R reject / S stopped */
|
||||
private static final String STATUS_DRAFT = "D";
|
||||
private static final String STATUS_AUDIT = "A";
|
||||
private static final String STATUS_EFFECT = "E";
|
||||
@@ -271,6 +272,23 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService
|
||||
return setMapper.updatePrcPriceSetStatus(upd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int enable(Long priceSetId, String updateBy)
|
||||
{
|
||||
PrcPriceSet db = requireSet(priceSetId);
|
||||
if (STATUS_EFFECT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException(MessageUtils.message("price.set.enable.statusNotAllowed"));
|
||||
}
|
||||
PrcPriceSet upd = new PrcPriceSet();
|
||||
upd.setPriceSetId(priceSetId);
|
||||
upd.setStatus(STATUS_EFFECT);
|
||||
upd.setUpdateBy(updateBy);
|
||||
int rows = setMapper.updatePrcPriceSetStatus(upd);
|
||||
refreshVersionStatus(priceSetId);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int activateVersion(Long psvId, Date effectiveTime, String updateBy)
|
||||
|
||||
+1
-1
@@ -272,7 +272,7 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
|
||||
for (PrcCustomerPriceSet bind : binds)
|
||||
{
|
||||
PrcPriceSet set = priceSetMapper.selectPrcPriceSetById(bind.getPriceSetId());
|
||||
if (set == null || "S".equals(set.getStatus()))
|
||||
if (set == null || !"E".equals(set.getStatus()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user