123
This commit is contained in:
@@ -69,6 +69,15 @@ public class PayTrdConfigController extends BaseController {
|
||||
return toAjax(payTrdConfigService.save(bo));
|
||||
}
|
||||
|
||||
@SaCheckPermission("cai:payTrdConfig:edit")
|
||||
@Log(title = "四方支付配置启用和关闭", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/enableStatus")
|
||||
public R<Void> enableStatus(@Validated(AddGroup.class) @RequestBody PayTrdConfig bo) {
|
||||
payTrdConfigService.enableStatus(bo.getId(), bo.getEnableStatus());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改四方支付配置
|
||||
*/
|
||||
|
||||
@@ -18,4 +18,6 @@ public interface PayTrdConfigService extends IService<PayTrdConfig> {
|
||||
JSONObject queryOrder(String orderNo, String trdPayType);
|
||||
|
||||
JSONObject resetOrder(String orderNo, String trdPayType);
|
||||
|
||||
void enableStatus(Long id, Integer enableStatus);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.tencentcloudapi.gme.v20180711.models.AppStatisticsItem;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -160,4 +161,19 @@ public class PayTrdConfigServiceImpl extends ServiceImpl<PayTrdConfigMapper, Pay
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void enableStatus(Long id, Integer enableStatus) {
|
||||
if(enableStatus.equals(0)){
|
||||
this.update(Wrappers.lambdaUpdate(PayTrdConfig.class).eq(PayTrdConfig::getId, id)
|
||||
.set(PayTrdConfig::getEnableStatus, enableStatus));
|
||||
} else if(enableStatus.equals(1)){
|
||||
this.update(Wrappers.lambdaUpdate(PayTrdConfig.class).ne(PayTrdConfig::getId, id)
|
||||
.eq(PayTrdConfig::getEnableStatus, 1)
|
||||
.set(PayTrdConfig::getEnableStatus, 0));
|
||||
this.update(Wrappers.lambdaUpdate(PayTrdConfig.class).eq(PayTrdConfig::getId, id)
|
||||
.set(PayTrdConfig::getEnableStatus, 1));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user