|
@@ -6,8 +6,10 @@ import java.util.List;
|
|
|
import java.io.IOException;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
-import com.hh.bidding.domain.BidTender;
|
|
|
+import com.hh.bidding.domain.*;
|
|
|
+import com.hh.bidding.service.IBidInvoiceService;
|
|
|
import com.hh.bidding.service.IBidTenderService;
|
|
|
+import com.hh.bidding.service.IBidWinningResultsService;
|
|
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
|
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
|
|
import com.ruoyi.system.api.RemotePlanService;
|
|
@@ -18,18 +20,10 @@ import org.aspectj.weaver.loadtime.Aj;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
-import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import com.ruoyi.common.log.annotation.Log;
|
|
|
import com.ruoyi.common.log.enums.BusinessType;
|
|
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|
|
-import com.hh.bidding.domain.BidWinner;
|
|
|
import com.hh.bidding.service.IBidWinnerService;
|
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
@@ -59,6 +53,13 @@ public class BidWinnerController extends BaseController
|
|
|
@Autowired
|
|
|
private RemotePlanService remotePlanService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IBidInvoiceService bidInvoiceService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IBidWinningResultsService bidWinningResultsService;
|
|
|
+
|
|
|
+
|
|
|
public Long getOwnerdept() {
|
|
|
Long r = 0L;
|
|
|
List<Long> ids = remoteUserService.getDeptIds(SecurityUtils.getUserId(), 1, "COMPANY", SecurityConstants.INNER);
|
|
@@ -438,4 +439,37 @@ public class BidWinnerController extends BaseController
|
|
|
}
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
+
|
|
|
+ // 同步开票信息
|
|
|
+ @PostMapping("/addInvoice")
|
|
|
+ public AjaxResult addInvoice(@RequestParam("wid") Long wid){
|
|
|
+ BidWinner bidWinner = bidWinnerService.selectBidWinnerByWid(wid);
|
|
|
+ Long hid = bidWinner.getHid();
|
|
|
+ Long sid = bidWinner.getSid();
|
|
|
+
|
|
|
+ BidWinningResults bidWinningResults = new BidWinningResults();
|
|
|
+ bidWinningResults.setSid(sid);
|
|
|
+ bidWinningResults.setHid(hid);
|
|
|
+ bidWinningResults.setGsState(1L);
|
|
|
+ List<BidWinningResults> bidWinningResultsList = bidWinningResultsService.selectWinningResults(bidWinningResults);
|
|
|
+
|
|
|
+ if(CollectionUtils.isEmpty(bidWinningResultsList)){
|
|
|
+ return error("查询异常");
|
|
|
+ }
|
|
|
+
|
|
|
+ BidWinningResults result = bidWinningResultsList.get(0);
|
|
|
+ BsSupplier suppler = bidWinnerService.getSupplerByHid(hid);
|
|
|
+
|
|
|
+ BidInvoice bidInvoice = new BidInvoice();
|
|
|
+ bidInvoice.setEncode(suppler.gethEncode());
|
|
|
+ bidInvoice.setBank(suppler.gethBank());
|
|
|
+ bidInvoice.setBankAccount(suppler.gethAccount());
|
|
|
+ bidInvoice.setAddress(suppler.gethAddress());
|
|
|
+ bidInvoice.setAmount(bidWinner.getServicePrice());
|
|
|
+
|
|
|
+ int i = bidInvoiceService.insertBidInvoice(bidInvoice);
|
|
|
+
|
|
|
+ bidWinner.setStatus(2L);
|
|
|
+ return toAjax(bidWinnerService.updateBidWinner(bidWinner));
|
|
|
+ }
|
|
|
}
|