فهرست منبع

已经注销主体机构,需要通过运单管理,批量运单开票成功,不在取票

mashengyi 4 ماه پیش
والد
کامیت
d6ce5582ee

+ 52 - 5
src/main/java/com/jkcredit/invoice/controller/business/NoCarController.java

@@ -1,5 +1,4 @@
 package com.jkcredit.invoice.controller.business;
-import com.jkcredit.invoice.service.nocar.WayBillFileService;
 import cn.afterturn.easypoi.excel.ExcelImportUtil;
 import cn.afterturn.easypoi.excel.entity.ImportParams;
 import com.alibaba.fastjson.JSON;
@@ -13,6 +12,7 @@ import com.jkcredit.invoice.model.entity.customer.CustomerOper;
 import com.jkcredit.invoice.model.entity.invoice.BillInvoice;
 import com.jkcredit.invoice.model.entity.user.User;
 import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
+import com.jkcredit.invoice.model.entity.waybill.NoCarWayBillFileInfo;
 import com.jkcredit.invoice.model.vo.CodeAndNumVo;
 import com.jkcredit.invoice.service.calculateinfor.NoCarCalculateInfoService;
 import com.jkcredit.invoice.service.customer.CustomerOperService;
@@ -22,6 +22,7 @@ import com.jkcredit.invoice.service.nocar.NoCarBillWayImportService;
 import com.jkcredit.invoice.service.nocar.NoCarBillWayService;
 import com.jkcredit.invoice.service.nocar.NoCarRecService;
 import com.jkcredit.invoice.service.nocar.NocarInvoiceService;
+import com.jkcredit.invoice.service.nocar.WayBillFileService;
 import com.jkcredit.invoice.util.Base64Utils;
 import com.jkcredit.invoice.util.DateUtil;
 import com.jkcredit.invoice.util.RespR;
@@ -35,20 +36,42 @@ import org.apache.poi.util.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.NotNull;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.URLEncoder;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import com.jkcredit.invoice.model.entity.waybill.NoCarWayBillFileInfo;
-import static com.jkcredit.invoice.common.CommonConst.*;
+
+import static com.jkcredit.invoice.common.CommonConst.COMMA;
+import static com.jkcredit.invoice.common.CommonConst.COMMAS;
+import static com.jkcredit.invoice.common.CommonConst.EIGHT;
+import static com.jkcredit.invoice.common.CommonConst.FIVE;
+import static com.jkcredit.invoice.common.CommonConst.FOR;
+import static com.jkcredit.invoice.common.CommonConst.NINE;
+import static com.jkcredit.invoice.common.CommonConst.NULL;
+import static com.jkcredit.invoice.common.CommonConst.ONE;
+import static com.jkcredit.invoice.common.CommonConst.SEVEN;
+import static com.jkcredit.invoice.common.CommonConst.SIX;
+import static com.jkcredit.invoice.common.CommonConst.TEN;
+import static com.jkcredit.invoice.common.CommonConst.THREE;
+import static com.jkcredit.invoice.common.CommonConst.TWO;
 
 @Api(tags = "无车操作")
 @RestController
@@ -291,6 +314,30 @@ public class NoCarController {
 
     }
 
+
+    /**
+     * 注销企业进行批量更新运单为开票完成
+     *
+     * @return 用户集合
+     */
+    @PostMapping("/updateStatusByCompany")
+    @ApiOperation(value = "注销企业进行批量更新运单为开票完成", notes = "注销企业进行批量更新运单为开票完成")
+    @LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
+    public RespR updateStatusByCompany(@NotNull(message = "注销企业发票更新状态失败,不能为空") String noCarWayBillStr) {
+        List<NoCarWayBill> noCarWayBills = JSON.parseArray(noCarWayBillStr, NoCarWayBill.class);
+        if (noCarWayBills != null && noCarWayBills.size() > 0) {
+            noCarWayBills.stream().forEach(noCarWayBill -> {
+                try {
+                    noCarWayBill.setBillwayStatus(3);//开票完成
+                    noCarService.updateByBillNumEnd(noCarWayBill);
+                } catch (Exception e) {
+                    log.info("注销企业进行批量更新运单为开票完成失败" + e.getMessage());
+                }
+            });
+        }
+        return new RespR("更新成功");
+    }
+
     /**
      * 分页查询异常运单信息
      *

+ 1 - 0
src/main/java/com/jkcredit/invoice/credit/SimpleCoreFilter.java

@@ -173,6 +173,7 @@ public class SimpleCoreFilter implements Filter {
             "/noCar/findImportBillWay",
             "/noCar/findBatchFileList",
             "/noCar/updateStatus",
+            "/noCar/updateStatusByCompany",
             "/noCar/findBatchList",
             "/noCar/findNocarInvoicesStatic",
             "/noCar/findNocarInvoicesHis",

+ 8 - 0
src/main/java/com/jkcredit/invoice/service/lowerservice/NoCarService.java

@@ -124,4 +124,12 @@ public interface NoCarService {
      * @return
      */
     RespR getInvoiceByWayBillOwnerNumReal(NoCarWayBill noCarWayBill1, boolean b);
+
+    /**
+     * 根据运单号更新运单信息
+     *
+     * @param noCarWayBill 运单
+     */
+    void updateByBillNumEnd(NoCarWayBill noCarWayBill);
+
 }

+ 6 - 1
src/main/java/com/jkcredit/invoice/service/lowerservice/impl/NoCarServiceImpl.java

@@ -1288,7 +1288,7 @@ public class NoCarServiceImpl implements NoCarService {
             noCarWayBill.setUpdateTime(DateUtil.getCurrentDateStr());
             noCarWaybillMapper.updateByBillNum(noCarWayBill);
         }
-        byte isKf =1;
+        byte isKf = 1;
         if (countCalculateInfo(noCarWayBill, isKf, responseRespR)) {
             return new RespR(responseRespR.getData());
         }
@@ -1296,5 +1296,10 @@ public class NoCarServiceImpl implements NoCarService {
         return new RespR("success");
     }
 
+    @Override
+    public void updateByBillNumEnd(NoCarWayBill noCarWayBill) {
+        noCarWaybillMapper.updateByBillNumEnd(noCarWayBill);
+    }
+
 
 }