|
@@ -7,6 +7,7 @@ import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -75,14 +76,39 @@ public class ApiMerchantController extends BaseController {
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromLibId(merchant.getLibId());
|
|
consume.setFromMerchantId(merchant.getId());
|
|
consume.setFromMerchantId(merchant.getId());
|
|
- consume.setLibService(0);
|
|
|
|
|
|
+ consume.setLibService(merchant.getLibService());
|
|
consume.setPlatformService(0);
|
|
consume.setPlatformService(0);
|
|
consume.setType(7);
|
|
consume.setType(7);
|
|
consume.setSignType(merchant.getSignType());
|
|
consume.setSignType(merchant.getSignType());
|
|
|
|
+ consume.setComputeNum(merchant.getCurIsSummary());
|
|
consume.setRemarks("激活期扣费【服务包扣费】-来源开放接口");
|
|
consume.setRemarks("激活期扣费【服务包扣费】-来源开放接口");
|
|
consume.setCreateTime(new Date());
|
|
consume.setCreateTime(new Date());
|
|
libJoinConsumeService.save(consume);
|
|
libJoinConsumeService.save(consume);
|
|
- }
|
|
|
|
|
|
+ }else {
|
|
|
|
+
|
|
|
|
+ //自主激活的第一条都要记录,所以判断之前的数据是否有自主激活的,没有就保存一条。
|
|
|
|
+ boolean isActive=false;
|
|
|
|
+ for (TbLibJoinConsume tbLibJoinConsume : consumes) {
|
|
|
|
+ if(StringUtils.isNotEmpty(tbLibJoinConsume.getRemarks()) && tbLibJoinConsume.getRemarks().contains("来源开放接口")) {
|
|
|
|
+ isActive=true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(!isActive) {
|
|
|
|
+ //记录
|
|
|
|
+ TbLibJoinConsume consume=new TbLibJoinConsume();
|
|
|
|
+ consume.setFromLibId(merchant.getLibId());
|
|
|
|
+ consume.setFromMerchantId(merchant.getId());
|
|
|
|
+ consume.setLibService(merchant.getLibService());
|
|
|
|
+ consume.setPlatformService(0);
|
|
|
|
+ consume.setType(7);
|
|
|
|
+ consume.setSignType(merchant.getSignType());
|
|
|
|
+ consume.setComputeNum(merchant.getCurIsSummary());
|
|
|
|
+ consume.setRemarks("激活期扣费【服务包扣费】-来源开放接口");
|
|
|
|
+ consume.setCreateTime(new Date());
|
|
|
|
+ libJoinConsumeService.save(consume);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|