Browse Source

修改开票申请流程

gmcs 3 months ago
parent
commit
e84efd4265

+ 10 - 0
ruoyi-modules/hh-basic/src/main/java/com/hh/pms/sae/domain/BsSupplier.java

@@ -212,6 +212,8 @@ public class BsSupplier extends BaseEntity {
     @Excel(name = "纳税人识别号")
     @Excel(name = "纳税人识别号")
     private String hEncode;
     private String hEncode;
 
 
+    private Integer pType;
+
     public String gethLoginAccount() {
     public String gethLoginAccount() {
         return hLoginAccount;
         return hLoginAccount;
     }
     }
@@ -492,6 +494,14 @@ public class BsSupplier extends BaseEntity {
         this.hEncode = hEncode;
         this.hEncode = hEncode;
     }
     }
 
 
+    public Integer getpType() {
+        return pType;
+    }
+
+    public void setpType(Integer pType) {
+        this.pType = pType;
+    }
+
     @Override
     @Override
     public String toString() {
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 4 - 1
ruoyi-modules/hh-basic/src/main/resources/mapper/BsSupplierMapper.xml

@@ -124,7 +124,8 @@
                material,
                material,
                need_to_uppwd,
                need_to_uppwd,
                bankinfo_status,
                bankinfo_status,
-               h_encode
+               h_encode,
+               p_type
         from bs_supplier
         from bs_supplier
     </sql>
     </sql>
 
 
@@ -386,6 +387,7 @@
             <if test="needToUppwd != null">need_to_uppwd = #{needToUppwd},</if>
             <if test="needToUppwd != null">need_to_uppwd = #{needToUppwd},</if>
             <if test="bankinfoStatus != null">bankinfo_status = #{bankinfoStatus},</if>
             <if test="bankinfoStatus != null">bankinfo_status = #{bankinfoStatus},</if>
             <if test="hEncode != null">h_encode = #{hEncode},</if>
             <if test="hEncode != null">h_encode = #{hEncode},</if>
+            <if test="pType != null">p_type = #{pType},</if>
         </trim>
         </trim>
         where hid = #{hid}
         where hid = #{hid}
     </update>
     </update>
@@ -486,4 +488,5 @@
     <select id = "getSupplierByName" parameterType="String">
     <select id = "getSupplierByName" parameterType="String">
         select * from bs_supplier where h_name like concat('%', #{company}, '%')
         select * from bs_supplier where h_name like concat('%', #{company}, '%')
     </select>
     </select>
+
 </mapper>
 </mapper>

+ 44 - 10
ruoyi-modules/hh-bidding/src/main/java/com/hh/bidding/controller/BidWinnerController.java

@@ -6,8 +6,10 @@ import java.util.List;
 import java.io.IOException;
 import java.io.IOException;
 import javax.servlet.http.HttpServletResponse;
 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.IBidTenderService;
+import com.hh.bidding.service.IBidWinningResultsService;
 import com.ruoyi.common.core.constant.SecurityConstants;
 import com.ruoyi.common.core.constant.SecurityConstants;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.system.api.RemotePlanService;
 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.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 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.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
-import com.hh.bidding.domain.BidWinner;
 import com.hh.bidding.service.IBidWinnerService;
 import com.hh.bidding.service.IBidWinnerService;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -59,6 +53,13 @@ public class BidWinnerController extends BaseController
     @Autowired
     @Autowired
     private RemotePlanService remotePlanService;
     private RemotePlanService remotePlanService;
 
 
+    @Autowired
+    private IBidInvoiceService bidInvoiceService;
+
+    @Autowired
+    private IBidWinningResultsService bidWinningResultsService;
+
+
     public Long getOwnerdept() {
     public Long getOwnerdept() {
         Long r = 0L;
         Long r = 0L;
         List<Long> ids = remoteUserService.getDeptIds(SecurityUtils.getUserId(), 1, "COMPANY", SecurityConstants.INNER);
         List<Long> ids = remoteUserService.getDeptIds(SecurityUtils.getUserId(), 1, "COMPANY", SecurityConstants.INNER);
@@ -438,4 +439,37 @@ public class BidWinnerController extends BaseController
         }
         }
         return getDataTable(list);
         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));
+    }
 }
 }

+ 65 - 9
ruoyi-modules/hh-bidding/src/main/java/com/hh/bidding/domain/BsSupplier.java

@@ -61,7 +61,7 @@ public class BsSupplier extends BaseEntity {
     /**
     /**
      * 成立日期
      * 成立日期
      */
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @Excel(name = "成立日期", width = 30, dateFormat = "yyyy-MM-dd")
     @Excel(name = "成立日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date hStartTime;
     private Date hStartTime;
 
 
@@ -115,7 +115,7 @@ public class BsSupplier extends BaseEntity {
     /**
     /**
      * 营业执照有效期
      * 营业执照有效期
      */
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @Excel(name = "营业执照有效期", width = 30, dateFormat = "yyyy-MM-dd")
     @Excel(name = "营业执照有效期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date hExpiration;
     private Date hExpiration;
 
 
@@ -197,15 +197,24 @@ public class BsSupplier extends BaseEntity {
     @Excel(name = "供应商密码")
     @Excel(name = "供应商密码")
     private String hPassword;
     private String hPassword;
 
 
-    private BsOperator bsOperator;
+    /** 供应商分包种类 */
+    @Excel(name = "供应商分包种类")
+    private String material;
 
 
-    public BsOperator getBsOperator() {
-        return bsOperator;
-    }
+    /** 是否需要修改密码 0需要 1不需要 */
+    @Excel(name = "是否需要修改密码 0需要 1不需要")
+    private Long needToUppwd;
 
 
-    public void setBsOperator(BsOperator bsOperator) {
-        this.bsOperator = bsOperator;
-    }
+    /** 银行信息审核状态 1待审核 2已生效 3被驳回 */
+    @Excel(name = "银行信息审核状态 1待审核 2已生效 3被驳回")
+    private Long bankinfoStatus;
+
+    @Excel(name = "纳税人识别号")
+    private String hEncode;
+
+    private Integer pType;
+
+    private BsOperator bsOperator;
 
 
     public String gethLoginAccount() {
     public String gethLoginAccount() {
         return hLoginAccount;
         return hLoginAccount;
@@ -455,6 +464,53 @@ public class BsSupplier extends BaseEntity {
         return fClassify;
         return fClassify;
     }
     }
 
 
+    public String getMaterial() {
+        return material;
+    }
+
+    public void setMaterial(String material) {
+        this.material = material;
+    }
+
+    public Long getNeedToUppwd() {
+        return needToUppwd;
+    }
+
+    public void setNeedToUppwd(Long needToUppwd) {
+        this.needToUppwd = needToUppwd;
+    }
+
+    public Long getBankinfoStatus() {
+        return bankinfoStatus;
+    }
+
+    public void setBankinfoStatus(Long bankinfoStatus) {
+        this.bankinfoStatus = bankinfoStatus;
+    }
+
+    public String gethEncode() {
+        return hEncode;
+    }
+
+    public void sethEncode(String hEncode) {
+        this.hEncode = hEncode;
+    }
+
+    public Integer getpType() {
+        return pType;
+    }
+
+    public void setpType(Integer pType) {
+        this.pType = pType;
+    }
+
+    public BsOperator getBsOperator() {
+        return bsOperator;
+    }
+
+    public void setBsOperator(BsOperator bsOperator) {
+        this.bsOperator = bsOperator;
+    }
 
 
     @Override
     @Override
     public String toString() {
     public String toString() {

+ 2 - 0
ruoyi-modules/hh-bidding/src/main/java/com/hh/bidding/mapper/BidWinnerMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 
 import com.hh.bidding.domain.BidNotice;
 import com.hh.bidding.domain.BidNotice;
 import com.hh.bidding.domain.BidWinner;
 import com.hh.bidding.domain.BidWinner;
+import com.hh.bidding.domain.BsSupplier;
 
 
 /**
 /**
  * 中标人Mapper接口
  * 中标人Mapper接口
@@ -83,5 +84,6 @@ public interface BidWinnerMapper
 
 
     public List<BidWinner> selectWinnerByResults(BidWinner bidWinner);
     public List<BidWinner> selectWinnerByResults(BidWinner bidWinner);
 
 
+    public BsSupplier getSupplerByHid(Long hid);
 
 
 }
 }

+ 3 - 0
ruoyi-modules/hh-bidding/src/main/java/com/hh/bidding/service/IBidWinnerService.java

@@ -2,6 +2,7 @@ package com.hh.bidding.service;
 
 
 import java.util.List;
 import java.util.List;
 import com.hh.bidding.domain.BidWinner;
 import com.hh.bidding.domain.BidWinner;
+import com.hh.bidding.domain.BsSupplier;
 
 
 /**
 /**
  * 中标人Service接口
  * 中标人Service接口
@@ -78,4 +79,6 @@ public interface IBidWinnerService
     public BidWinner selectBidWinnerBySid(Long sid);
     public BidWinner selectBidWinnerBySid(Long sid);
 
 
     public List<BidWinner> selectWinnerByResults(BidWinner bidWinner);
     public List<BidWinner> selectWinnerByResults(BidWinner bidWinner);
+
+    public BsSupplier getSupplerByHid(Long hid);
 }
 }

+ 7 - 0
ruoyi-modules/hh-bidding/src/main/java/com/hh/bidding/service/impl/BidWinnerServiceImpl.java

@@ -1,6 +1,8 @@
 package com.hh.bidding.service.impl;
 package com.hh.bidding.service.impl;
 
 
 import java.util.List;
 import java.util.List;
+
+import com.hh.bidding.domain.BsSupplier;
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -112,4 +114,9 @@ public class BidWinnerServiceImpl implements IBidWinnerService
     public List<BidWinner> selectWinnerByResults(BidWinner bidWinner) {
     public List<BidWinner> selectWinnerByResults(BidWinner bidWinner) {
         return bidWinnerMapper.selectWinnerByResults(bidWinner);
         return bidWinnerMapper.selectWinnerByResults(bidWinner);
     }
     }
+
+    @Override
+    public BsSupplier getSupplerByHid(Long hid) {
+        return bidWinnerMapper.getSupplerByHid(hid);
+    }
 }
 }

+ 4 - 0
ruoyi-modules/hh-bidding/src/main/resources/mapper/BidWinnerMapper.xml

@@ -158,4 +158,8 @@
         </where>
         </where>
         order by r.gs_id desc
         order by r.gs_id desc
     </select>
     </select>
+
+    <select id="getSupplerByHid" resultType="com.hh.bidding.domain.BsSupplier">
+        select * from bs_supplier where hid = #{hid}
+    </select>
 </mapper>
 </mapper>