|
|
@@ -0,0 +1,64 @@
|
|
|
+package com.uas.platform.b2c.fa.settlement.controller;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.uas.platform.b2c.core.constant.SplitChar;
|
|
|
+import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
|
|
|
+import com.uas.platform.b2c.fa.settlement.model.BillSubmit;
|
|
|
+import com.uas.platform.b2c.fa.settlement.service.BillSubmitService;
|
|
|
+import com.uas.platform.core.logging.BufferedLoggerManager;
|
|
|
+import com.uas.platform.core.model.PageInfo;
|
|
|
+import com.uas.platform.core.model.PageParams;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 开票申请
|
|
|
+ * @author wangyc
|
|
|
+ * @version 2017/8/24 16:34 wangyc
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping(value = "/trade/billSubmit")
|
|
|
+public class BillSubmitController {
|
|
|
+
|
|
|
+ private final BillSubmitService billSubmitService;
|
|
|
+
|
|
|
+ private static final UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ public BillSubmitController (BillSubmitService billSubmitService) {
|
|
|
+ this.billSubmitService = billSubmitService;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增开票申请
|
|
|
+ * @param jsonObject 开票信息
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(method = RequestMethod.POST, produces = "application/json")
|
|
|
+ public List<BillSubmit> save(@RequestBody JSONObject jsonObject) {
|
|
|
+ String orderids = jsonObject.get("orderids").toString();
|
|
|
+ Long invoiceid = Long.valueOf(jsonObject.get("invoiceid").toString());
|
|
|
+ String[] orderidList = orderids.split(SplitChar.COMMA);
|
|
|
+ return billSubmitService.save(orderidList, invoiceid);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页获取发票申请
|
|
|
+ * @param params 分页参数
|
|
|
+ * @param keyword 关键词
|
|
|
+ * @param role 角色
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(method = RequestMethod.GET)
|
|
|
+ public Page<BillSubmit> getBillSubmits(PageParams params, String keyword, String role) {
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ logger.log("发票申请", "查找包含关键字的发票申请信息");
|
|
|
+ return billSubmitService.getAll(pageInfo, keyword, role);
|
|
|
+ }
|
|
|
+}
|