|
@@ -12,10 +12,13 @@ import com.fs.company.param.CompanyTrafficRecordChargeParam;
|
|
|
import com.fs.company.param.CompanyTrafficRecordQueryParam;
|
|
|
import com.fs.company.service.ICompanyTrafficRecordService;
|
|
|
import com.fs.framework.web.service.TokenService;
|
|
|
+import com.fs.hisStore.config.MedicalMallConfig;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RestController
|
|
@@ -28,6 +31,27 @@ public class CompanyTrafficController extends BaseController {
|
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private MedicalMallConfig medicalMallConfig;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 每天扣除流量余额
|
|
|
+ * */
|
|
|
+ @Scheduled(cron = "0 0 0 * * ?")
|
|
|
+ public void refreshTraffic(){
|
|
|
+ if("1".equals(medicalMallConfig.getStatics()))
|
|
|
+ companyTrafficRecordService.refreshTraffic();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 重启时重新计算并更新公司缓存
|
|
|
+ * */
|
|
|
+ @PostConstruct
|
|
|
+ public void init() {
|
|
|
+ if("1".equals(medicalMallConfig.getStatics()))
|
|
|
+ companyTrafficRecordService.init();
|
|
|
+ }
|
|
|
+
|
|
|
/** 充值流量 */
|
|
|
@PreAuthorize("@ss.hasPermi('company:traffic:charge')")
|
|
|
@Log(title = "公司流量充值", businessType = BusinessType.INSERT)
|