|
@@ -48,16 +48,16 @@ import static com.jkcredit.invoice.common.CommonConst.*;
|
|
|
@RequestMapping(value = {"/noCar"})
|
|
|
@Slf4j
|
|
|
/**
|
|
|
-* @Description 无车操作
|
|
|
-* @Author mashengyi
|
|
|
-* @Date 2022/2/8 18:15
|
|
|
-* @Param
|
|
|
-* @Return
|
|
|
-* @Exception
|
|
|
-*
|
|
|
-*/
|
|
|
+ * @Description 无车操作
|
|
|
+ * @Author mashengyi
|
|
|
+ * @Date 2022/2/8 18:15
|
|
|
+ * @Param
|
|
|
+ * @Return
|
|
|
+ * @Exception
|
|
|
+ *
|
|
|
+ */
|
|
|
public class NoCarController {
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
NoCarRecService noCarRecService;
|
|
|
|
|
@@ -82,230 +82,239 @@ public class NoCarController {
|
|
|
CustomerOperService customerOperService;
|
|
|
@Autowired
|
|
|
private CheckHasAuthRole checkHasAuthRole;
|
|
|
+
|
|
|
/**
|
|
|
* 分页查询无车备案信息
|
|
|
*
|
|
|
- * @param page 参数集
|
|
|
+ * @param page 参数集
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/findCarRec")
|
|
|
- @ApiOperation(value="分页查询无车/自有车备案信息", notes="分页查询无车/自有车备案信息")
|
|
|
+ @ApiOperation(value = "分页查询无车/自有车备案信息", notes = "分页查询无车/自有车备案信息")
|
|
|
@LoginRequired
|
|
|
- public RespR getCustomersByPage(Page page, CustomerCarRec customerCarRec,User user) {
|
|
|
+ public RespR getCustomersByPage(Page page, CustomerCarRec customerCarRec, User user) {
|
|
|
try {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,customerCarRec.getCustomerName());
|
|
|
- if(!StringUtils.isEmpty(customerCarRec.getStartTime()) && !NULL.equals(customerCarRec.getStartTime())){
|
|
|
- String [] res = customerCarRec.getStartTime().split(",");
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, customerCarRec.getCustomerName());
|
|
|
+ if (!StringUtils.isEmpty(customerCarRec.getStartTime()) && !NULL.equals(customerCarRec.getStartTime())) {
|
|
|
+ String[] res = customerCarRec.getStartTime().split(",");
|
|
|
customerCarRec.setStartTime(res[0]);
|
|
|
- customerCarRec.setEndTime(res[1].replace("00:00:00","23:59:59"));
|
|
|
- }else{
|
|
|
+ customerCarRec.setEndTime(res[1].replace("00:00:00", "23:59:59"));
|
|
|
+ } else {
|
|
|
customerCarRec.setStartTime(null);
|
|
|
}
|
|
|
RespR respR = new RespR(noCarRecService.findByPageAndCarRec(page, customerCarRec));
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
- public void setTimeDue(NoCarWayBill noCarWayBill){
|
|
|
- if(!StringUtils.isEmpty(noCarWayBill.getStartBegin()) && !NULL.equals(noCarWayBill.getStartBegin())){
|
|
|
- String [] res = noCarWayBill.getStartBegin().split(",");
|
|
|
+
|
|
|
+ public void setTimeDue(NoCarWayBill noCarWayBill) {
|
|
|
+ if (!StringUtils.isEmpty(noCarWayBill.getStartBegin()) && !NULL.equals(noCarWayBill.getStartBegin())) {
|
|
|
+ String[] res = noCarWayBill.getStartBegin().split(",");
|
|
|
noCarWayBill.setStartBegin(res[0]);
|
|
|
- noCarWayBill.setStartEnd(res[1].replace("00:00:00","23:59:59"));
|
|
|
- }else{
|
|
|
+ noCarWayBill.setStartEnd(res[1].replace("00:00:00", "23:59:59"));
|
|
|
+ } else {
|
|
|
noCarWayBill.setStartBegin(null);
|
|
|
}
|
|
|
- if(!StringUtils.isEmpty(noCarWayBill.getEndBegin()) && !NULL.equals(noCarWayBill.getEndBegin())){
|
|
|
- String [] res = noCarWayBill.getEndBegin().split(",");
|
|
|
+ if (!StringUtils.isEmpty(noCarWayBill.getEndBegin()) && !NULL.equals(noCarWayBill.getEndBegin())) {
|
|
|
+ String[] res = noCarWayBill.getEndBegin().split(",");
|
|
|
noCarWayBill.setEndBegin(res[0]);
|
|
|
- noCarWayBill.setEndEnd(res[1].replace("00:00:00","23:59:59"));
|
|
|
- }else{
|
|
|
+ noCarWayBill.setEndEnd(res[1].replace("00:00:00", "23:59:59"));
|
|
|
+ } else {
|
|
|
noCarWayBill.setEndBegin(null);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void setTimeDue2(NoCarWayBill noCarWayBill){
|
|
|
- if(NULL.equals(noCarWayBill.getStartBegin())){
|
|
|
+ public void setTimeDue2(NoCarWayBill noCarWayBill) {
|
|
|
+ if (NULL.equals(noCarWayBill.getStartBegin())) {
|
|
|
noCarWayBill.setStartBegin(null);
|
|
|
}
|
|
|
- if(NULL.equals(noCarWayBill.getStartEnd())){
|
|
|
+ if (NULL.equals(noCarWayBill.getStartEnd())) {
|
|
|
noCarWayBill.setStartEnd(null);
|
|
|
}
|
|
|
- if(NULL.equals(noCarWayBill.getEndBegin())){
|
|
|
+ if (NULL.equals(noCarWayBill.getEndBegin())) {
|
|
|
noCarWayBill.setEndBegin(null);
|
|
|
}
|
|
|
- if(NULL.equals(noCarWayBill.getEndEnd())){
|
|
|
+ if (NULL.equals(noCarWayBill.getEndEnd())) {
|
|
|
noCarWayBill.setEndEnd(null);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 分页查询运单信息
|
|
|
*
|
|
|
- * @param page 参数集
|
|
|
+ * @param page 参数集
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/findBillWay")
|
|
|
- @ApiOperation(value="分页查询无车运单信息", notes="分页查询无车运单信息")
|
|
|
+ @ApiOperation(value = "分页查询无车运单信息", notes = "分页查询无车运单信息")
|
|
|
@LoginRequired
|
|
|
- public RespR findBillWay(Page page, NoCarWayBill noCarWayBill,User user) {
|
|
|
+ public RespR findBillWay(Page page, NoCarWayBill noCarWayBill, User user) {
|
|
|
try {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,noCarWayBill.getCustomerName());
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, noCarWayBill.getCustomerName());
|
|
|
setTimeDue(noCarWayBill);
|
|
|
setBillNums(noCarWayBill);
|
|
|
RespR respR = new RespR(noCarBillWayService.findByPageAndWayBill(page, noCarWayBill));
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void setBillNums(NoCarWayBill noCarWayBill){
|
|
|
+ public void setBillNums(NoCarWayBill noCarWayBill) {
|
|
|
String billNums = noCarWayBill.getBillNum();
|
|
|
- if(!StringUtils.isEmpty(billNums)){
|
|
|
- String [] billNumArr = billNums.split(",");
|
|
|
+ if (!StringUtils.isEmpty(billNums)) {
|
|
|
+ String[] billNumArr = billNums.split(",");
|
|
|
noCarWayBill.setBillNums(Arrays.asList(billNumArr));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 分页查询客户运单信息
|
|
|
*
|
|
|
- * @param page 参数集
|
|
|
+ * @param page 参数集
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/findBillWayCust")
|
|
|
- @ApiOperation(value="分页查询无车运单信息", notes="分页查询无车运单信息")
|
|
|
+ @ApiOperation(value = "分页查询无车运单信息", notes = "分页查询无车运单信息")
|
|
|
@LoginRequired
|
|
|
- public RespR findBillWayCust(Page page, NoCarWayBill noCarWayBill,User user) {
|
|
|
+ public RespR findBillWayCust(Page page, NoCarWayBill noCarWayBill, User user) {
|
|
|
try {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,noCarWayBill.getCustomerName());
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, noCarWayBill.getCustomerName());
|
|
|
setTimeDue2(noCarWayBill);
|
|
|
setBillNums(noCarWayBill);
|
|
|
noCarWayBill.setBatchNum("1");
|
|
|
RespR respR = new RespR(noCarBillWayService.findByPageAndWayBill(page, noCarWayBill));
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 分页查询运单信息
|
|
|
*
|
|
|
- * @param page 参数集
|
|
|
+ * @param page 参数集
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/findImportBillWay")
|
|
|
- @ApiOperation(value="分页查询无车运单信息", notes="分页查询无车运单信息")
|
|
|
+ @ApiOperation(value = "分页查询无车运单信息", notes = "分页查询无车运单信息")
|
|
|
@LoginRequired
|
|
|
- public RespR findImportBillWay(Page page, NoCarWayBill noCarWayBill,User user) {
|
|
|
+ public RespR findImportBillWay(Page page, NoCarWayBill noCarWayBill, User user) {
|
|
|
try {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,noCarWayBill.getCustomerName());
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, noCarWayBill.getCustomerName());
|
|
|
setTimeDue(noCarWayBill);
|
|
|
RespR respR = new RespR(noCarBillWayImportService.findByPageAndWayBill(page, noCarWayBill));
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 重新获取发票并更新状态
|
|
|
*
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/updateStatus")
|
|
|
- @ApiOperation(value="重新获取发票并更新状态", notes="重新获取发票并更新状态")
|
|
|
+ @ApiOperation(value = "重新获取发票并更新状态", notes = "重新获取发票并更新状态")
|
|
|
@LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
|
|
|
public RespR updateStatus(String noCarWayBillStr) {
|
|
|
- List<NoCarWayBill> noCarWayBills = JSON.parseArray(noCarWayBillStr,NoCarWayBill.class);
|
|
|
-
|
|
|
- if(noCarWayBills!=null && noCarWayBills.size()>0){
|
|
|
- noCarWayBills.stream().forEach(noCarWayBill -> {
|
|
|
- try {
|
|
|
- noCarWayBill.setBillwayStatus(-5);
|
|
|
- noCarService.getInvoiceByWayBillNumReal(noCarWayBill,false);
|
|
|
- }catch (Exception e){
|
|
|
- log.info("1111111111222222"+e.getMessage());
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- return new RespR("更新成功");
|
|
|
+ List<NoCarWayBill> noCarWayBills = JSON.parseArray(noCarWayBillStr, NoCarWayBill.class);
|
|
|
+
|
|
|
+ if (noCarWayBills != null && noCarWayBills.size() > 0) {
|
|
|
+ noCarWayBills.stream().forEach(noCarWayBill -> {
|
|
|
+ try {
|
|
|
+ noCarWayBill.setBillwayStatus(-5);
|
|
|
+ noCarService.getInvoiceByWayBillNumReal(noCarWayBill, false);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("1111111111222222" + e.getMessage());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return new RespR("更新成功");
|
|
|
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 分页查询异常运单信息
|
|
|
*
|
|
|
- * @param page 参数集
|
|
|
+ * @param page 参数集
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/findBillWayException")
|
|
|
- @ApiOperation(value="分页查询异常运单信息", notes="分页查询异常运单信息")
|
|
|
+ @ApiOperation(value = "分页查询异常运单信息", notes = "分页查询异常运单信息")
|
|
|
@LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
|
|
|
public RespR findBillWayException(Page page, NoCarWayBill noCarWayBill) {
|
|
|
try {
|
|
|
setTimeDue(noCarWayBill);
|
|
|
RespR respR = new RespR(noCarBillWayService.findByPageAndWayBillException(page, noCarWayBill));
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 分页查询无车运单信息
|
|
|
*
|
|
|
- * @param page 参数集
|
|
|
+ * @param page 参数集
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/findNocarInvoices")
|
|
|
- @ApiOperation(value="分页查询无车发票信息", notes="分页查询无车发票信息")
|
|
|
+ @ApiOperation(value = "分页查询无车发票信息", notes = "分页查询无车发票信息")
|
|
|
@LoginRequired
|
|
|
- public RespR findNocarInvoices(Page page, BillInvoice billInvoice,User user) {
|
|
|
+ public RespR findNocarInvoices(Page page, BillInvoice billInvoice, User user) {
|
|
|
try {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,billInvoice.getCustomerName());
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, billInvoice.getCustomerName());
|
|
|
setParams(billInvoice);
|
|
|
RespR respR = new RespR(nocarInvoiceService.findByPageAndInvoice(page, billInvoice));
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
- private void setParams(BillInvoice billInvoice){
|
|
|
- if(!StringUtils.isEmpty(billInvoice.getInvoiceMakeTime()) && !NULL.equals(billInvoice.getInvoiceMakeTime())){
|
|
|
- String [] res =billInvoice.getInvoiceMakeTime().split(",");
|
|
|
+
|
|
|
+ private void setParams(BillInvoice billInvoice) {
|
|
|
+ if (!StringUtils.isEmpty(billInvoice.getInvoiceMakeTime()) && !NULL.equals(billInvoice.getInvoiceMakeTime())) {
|
|
|
+ String[] res = billInvoice.getInvoiceMakeTime().split(",");
|
|
|
billInvoice.setInvoiceMakeStart(res[0]);
|
|
|
- billInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00","23:59:59"));
|
|
|
+ billInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00", "23:59:59"));
|
|
|
}
|
|
|
- if(!StringUtils.isEmpty(billInvoice.getCalculateTime()) && !NULL.equals(billInvoice.getCalculateTime())){
|
|
|
- String [] res =billInvoice.getCalculateTime().split(",");
|
|
|
+ if (!StringUtils.isEmpty(billInvoice.getCalculateTime()) && !NULL.equals(billInvoice.getCalculateTime())) {
|
|
|
+ String[] res = billInvoice.getCalculateTime().split(",");
|
|
|
billInvoice.setCalculateTimeStart(res[0]);
|
|
|
- billInvoice.setCalculateTimeEnd(res[1].replace("00:00:00","23:59:59"));
|
|
|
+ billInvoice.setCalculateTimeEnd(res[1].replace("00:00:00", "23:59:59"));
|
|
|
}
|
|
|
- if(!StringUtils.isEmpty(billInvoice.getWaybillNum())){
|
|
|
- String [] billNumArr = billInvoice.getWaybillNum().split(",");
|
|
|
+ if (!StringUtils.isEmpty(billInvoice.getWaybillNum())) {
|
|
|
+ String[] billNumArr = billInvoice.getWaybillNum().split(",");
|
|
|
billInvoice.setWaybillNums(Arrays.asList(billNumArr));
|
|
|
}
|
|
|
- if(!StringUtils.isEmpty(billInvoice.getPlateNum())){
|
|
|
- String [] plateNums = billInvoice.getPlateNum().split(COMMA);
|
|
|
+ if (!StringUtils.isEmpty(billInvoice.getPlateNum())) {
|
|
|
+ String[] plateNums = billInvoice.getPlateNum().split(COMMA);
|
|
|
billInvoice.setPlateNums(Arrays.asList(plateNums));
|
|
|
}
|
|
|
- if(!StringUtils.isEmpty(billInvoice.getInvoiceCode()) && billInvoice.getInvoiceCode().indexOf(COMMAS)>0){
|
|
|
- String [] invoiceCodeArr = billInvoice.getInvoiceCode().split(",");
|
|
|
- String [] invoiceNumArr=null;
|
|
|
- if( billInvoice.getInvoiceNum()!=null){
|
|
|
- invoiceNumArr = billInvoice.getInvoiceNum().split(",");
|
|
|
+ if (!StringUtils.isEmpty(billInvoice.getInvoiceCode()) && billInvoice.getInvoiceCode().indexOf(COMMAS) > 0) {
|
|
|
+ String[] invoiceCodeArr = billInvoice.getInvoiceCode().split(",");
|
|
|
+ String[] invoiceNumArr = null;
|
|
|
+ if (billInvoice.getInvoiceNum() != null) {
|
|
|
+ invoiceNumArr = billInvoice.getInvoiceNum().split(",");
|
|
|
}
|
|
|
List<CodeAndNumVo> codeAndNumVos = new ArrayList<>();
|
|
|
- for (int i=0;i<invoiceCodeArr.length;i++){
|
|
|
+ for (int i = 0; i < invoiceCodeArr.length; i++) {
|
|
|
CodeAndNumVo codeAndNumVo = new CodeAndNumVo();
|
|
|
codeAndNumVo.setCode(invoiceCodeArr[i]);
|
|
|
- if(invoiceNumArr!=null && invoiceNumArr.length>=i+1){
|
|
|
+ if (invoiceNumArr != null && invoiceNumArr.length >= i + 1) {
|
|
|
codeAndNumVo.setNum(invoiceNumArr[i]);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
codeAndNumVo.setNum("");
|
|
|
}
|
|
|
codeAndNumVos.add(codeAndNumVo);
|
|
@@ -314,26 +323,27 @@ public class NoCarController {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 批量查询无车发票信息
|
|
|
*
|
|
|
- * @param file 参数集
|
|
|
+ * @param file 参数集
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/batchImportNocarInvoices")
|
|
|
- @ApiOperation(value="批量查询无车发票信息", notes="批量查询无车发票信息")
|
|
|
+ @ApiOperation(value = "批量查询无车发票信息", notes = "批量查询无车发票信息")
|
|
|
@LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
|
|
|
public RespR batchImportNocarInvoices(@RequestParam("file") MultipartFile file) {
|
|
|
try {
|
|
|
ImportParams params = new ImportParams();
|
|
|
params.setTitleRows(1);
|
|
|
params.setHeadRows(1);
|
|
|
- List<BillInvoice> list = ExcelImportUtil.importExcel(file.getInputStream(), BillInvoice.class,params) ;
|
|
|
+ List<BillInvoice> list = ExcelImportUtil.importExcel(file.getInputStream(), BillInvoice.class, params);
|
|
|
RespR respR = nocarInvoiceService.findImportNocarInvoices(list);
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -341,372 +351,374 @@ public class NoCarController {
|
|
|
/**
|
|
|
* 批量查询无车运单信息
|
|
|
*
|
|
|
- * @param file 参数集
|
|
|
+ * @param file 参数集
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/batchImportNocarBillWay")
|
|
|
- @ApiOperation(value="批量查询无车运单信息", notes="批量查询无车运单信息")
|
|
|
+ @ApiOperation(value = "批量查询无车运单信息", notes = "批量查询无车运单信息")
|
|
|
@LoginRequired(role = AuthenticationInterceptor.AUTH_ADMIN)
|
|
|
public RespR batchImportNocarBillWay(@RequestParam("file") MultipartFile file) {
|
|
|
try {
|
|
|
ImportParams params = new ImportParams();
|
|
|
params.setTitleRows(1);
|
|
|
params.setHeadRows(1);
|
|
|
- List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class,params) ;
|
|
|
+ List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class, params);
|
|
|
RespR respR = noCarBillWayService.findImportNocarBillWay(list);
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 分页查询无车运单统计信息
|
|
|
*
|
|
|
- * @param billInvoice
|
|
|
+ * @param billInvoice
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/findNocarInvoicesStatic")
|
|
|
- @ApiOperation(value="分页查询无车发票统计信息", notes="分页查询无车发票统计信息")
|
|
|
+ @ApiOperation(value = "分页查询无车发票统计信息", notes = "分页查询无车发票统计信息")
|
|
|
@LoginRequired
|
|
|
- public RespR findNocarInvoicesStatic(BillInvoice billInvoice,User user) {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,billInvoice.getCustomerName());
|
|
|
+ public RespR findNocarInvoicesStatic(BillInvoice billInvoice, User user) {
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, billInvoice.getCustomerName());
|
|
|
try {
|
|
|
- if(!StringUtils.isEmpty(billInvoice.getInvoiceMakeTime()) && !NULL.equals(billInvoice.getInvoiceMakeTime())){
|
|
|
- String [] res =billInvoice.getInvoiceMakeTime().split(",");
|
|
|
+ if (!StringUtils.isEmpty(billInvoice.getInvoiceMakeTime()) && !NULL.equals(billInvoice.getInvoiceMakeTime())) {
|
|
|
+ String[] res = billInvoice.getInvoiceMakeTime().split(",");
|
|
|
billInvoice.setInvoiceMakeStart(res[0]);
|
|
|
- billInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00","23:59:59"));
|
|
|
+ billInvoice.setInvoiceMakeEnd(res[1].replace("00:00:00", "23:59:59"));
|
|
|
}
|
|
|
- if(!StringUtils.isEmpty(billInvoice.getCalculateTime()) && !NULL.equals(billInvoice.getCalculateTime())){
|
|
|
- String [] res =billInvoice.getCalculateTime().split(",");
|
|
|
+ if (!StringUtils.isEmpty(billInvoice.getCalculateTime()) && !NULL.equals(billInvoice.getCalculateTime())) {
|
|
|
+ String[] res = billInvoice.getCalculateTime().split(",");
|
|
|
billInvoice.setCalculateTimeStart(res[0]);
|
|
|
- billInvoice.setCalculateTimeEnd(res[1].replace("00:00:00","23:59:59"));
|
|
|
+ billInvoice.setCalculateTimeEnd(res[1].replace("00:00:00", "23:59:59"));
|
|
|
}
|
|
|
RespR respR = new RespR(nocarInvoiceService.findInvoiceStatics(billInvoice));
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 批量运单导入
|
|
|
*
|
|
|
- * @param file 参数集
|
|
|
+ * @param file 参数集
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/batchImprotBillWay")
|
|
|
- @ApiOperation(value="批量运单导入", notes="批量运单导入")
|
|
|
+ @ApiOperation(value = "批量运单导入", notes = "批量运单导入")
|
|
|
@LoginRequired
|
|
|
- public RespR batchImprotBillWay(@RequestParam("file") MultipartFile file,String customerName,User user) {
|
|
|
+ public RespR batchImprotBillWay(@RequestParam("file") MultipartFile file, String customerName, User user) {
|
|
|
try {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,customerName);
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, customerName);
|
|
|
ImportParams params = new ImportParams();
|
|
|
params.setTitleRows(1);
|
|
|
params.setHeadRows(1);
|
|
|
params.setKeyIndex(2);
|
|
|
- List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class,params) ;
|
|
|
+ List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class, params);
|
|
|
buildDate(list);
|
|
|
- RespR respR = noCarBillWayService.batchBillWayStart(list,customerName);
|
|
|
+ RespR respR = noCarBillWayService.batchBillWayStart(list, customerName);
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 批量运单导入
|
|
|
*
|
|
|
- * @param file 参数集
|
|
|
+ * @param file 参数集
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/batchImprotHistoryBillWay")
|
|
|
- @ApiOperation(value="批量历史运单导入", notes="批量历史运单导入")
|
|
|
+ @ApiOperation(value = "批量历史运单导入", notes = "批量历史运单导入")
|
|
|
@LoginRequired
|
|
|
- public RespR batchImprotHistoryBillWay(@RequestParam("file") MultipartFile file,String customerName,User user) {
|
|
|
+ public RespR batchImprotHistoryBillWay(@RequestParam("file") MultipartFile file, String customerName, User user) {
|
|
|
try {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,customerName);
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, customerName);
|
|
|
ImportParams params = new ImportParams();
|
|
|
params.setTitleRows(1);
|
|
|
params.setHeadRows(1);
|
|
|
params.setKeyIndex(2);
|
|
|
- List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class,params);
|
|
|
- log.info("batchImprotHistoryBillWay数量"+list.size());
|
|
|
+ List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class, params);
|
|
|
+ log.info("batchImprotHistoryBillWay数量" + list.size());
|
|
|
buildDate(list);
|
|
|
- RespR respR = noCarBillWayService.batchHsitoryBillWay(list,customerName);
|
|
|
+ RespR respR = noCarBillWayService.batchHsitoryBillWay(list, customerName);
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 批量运单导入
|
|
|
*
|
|
|
- * @param file 参数集
|
|
|
+ * @param file 参数集
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/batchImprotEndBillWay")
|
|
|
- @ApiOperation(value="批量运单结束", notes="批量运单结束")
|
|
|
+ @ApiOperation(value = "批量运单结束", notes = "批量运单结束")
|
|
|
@LoginRequired
|
|
|
- public RespR batchImprotEndBillWay(@RequestParam("file") MultipartFile file,String customerName,User user) {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,customerName);
|
|
|
+ public RespR batchImprotEndBillWay(@RequestParam("file") MultipartFile file, String customerName, User user) {
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, customerName);
|
|
|
try {
|
|
|
ImportParams params = new ImportParams();
|
|
|
params.setTitleRows(1);
|
|
|
params.setHeadRows(1);
|
|
|
params.setKeyIndex(2);
|
|
|
- List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class,params);
|
|
|
+ List<NoCarWayBill> list = ExcelImportUtil.importExcel(file.getInputStream(), NoCarWayBill.class, params);
|
|
|
buildDateEnd(list);
|
|
|
- log.info("batchImprotEndBillWay数量"+list.size());
|
|
|
- RespR respR = noCarBillWayService.batchBillWayEnd(list,customerName);
|
|
|
+ log.info("batchImprotEndBillWay数量" + list.size());
|
|
|
+ RespR respR = noCarBillWayService.batchBillWayEnd(list, customerName);
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
- public void buildDate(List<NoCarWayBill> list){
|
|
|
+
|
|
|
+ public void buildDate(List<NoCarWayBill> list) {
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
int i = 0;
|
|
|
String strError = "";
|
|
|
- for(int j = 0 ;j<list.size();j++){
|
|
|
+ for (int j = 0; j < list.size(); j++) {
|
|
|
|
|
|
NoCarWayBill noCarWayBill = list.get(j);
|
|
|
try {
|
|
|
- if(null == noCarWayBill){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查数据是否未传递");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查数据是否未传递";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查数据是否未传递");
|
|
|
+ if (null == noCarWayBill) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查数据是否未传递");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查数据是否未传递";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查数据是否未传递");
|
|
|
}
|
|
|
- if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getBillNum())){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getBillNum())) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
|
|
|
}
|
|
|
- if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getPlateNum())){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查车牌号码是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查车牌号码是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查车牌号码是否未输入或者输入是否正确");
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getPlateNum())) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查车牌号码是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查车牌号码是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查车牌号码是否未输入或者输入是否正确");
|
|
|
}
|
|
|
- if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getPlateColor())){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确");
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getPlateColor())) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查车牌颜色是否未输入或者输入是否正确");
|
|
|
}
|
|
|
- if( null == noCarWayBill.getStartTimeDate()){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确");
|
|
|
+ if (null == noCarWayBill.getStartTimeDate()) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单开始时间是否未输入或者输入是否正确");
|
|
|
}
|
|
|
- if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getSourceAddr())){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确");
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getSourceAddr())) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单开始地址是否未输入或者输入是否正确");
|
|
|
}
|
|
|
- if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getDestAddr())){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getDestAddr())) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
|
|
|
}
|
|
|
- if(null == noCarWayBill.getPredictEndTimeDate()){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确");
|
|
|
+ if (null == noCarWayBill.getPredictEndTimeDate()) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单预计完成时间是否未输入或者输入是否正确");
|
|
|
}
|
|
|
- if(null == noCarWayBill.getFeeD()){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单费用是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查运单费用是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单费用是否未输入或者输入是否正确");
|
|
|
+ if (null == noCarWayBill.getFeeD()) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单费用是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查运单费用是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单费用是否未输入或者输入是否正确");
|
|
|
}
|
|
|
- if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getTaxplayerCode())){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查税号是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查税号是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查税号是否未输入或者输入是否正确");
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getTaxplayerCode())) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查税号是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查税号是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查税号是否未输入或者输入是否正确");
|
|
|
}
|
|
|
noCarWayBill.setStartTime(format.format(noCarWayBill.getStartTimeDate()));
|
|
|
noCarWayBill.setPredictEndTime(format.format(noCarWayBill.getPredictEndTimeDate()));
|
|
|
- if(noCarWayBill.getFeeD() !=null){
|
|
|
- noCarWayBill.setFee(Math.round(noCarWayBill.getFeeD()*100));
|
|
|
+ if (noCarWayBill.getFeeD() != null) {
|
|
|
+ noCarWayBill.setFee(Math.round(noCarWayBill.getFeeD() * 100));
|
|
|
}
|
|
|
noCarWayBill.setTaxplayerCode(noCarWayBill.getTaxplayerCode().trim());
|
|
|
noCarWayBill.setBillNum(noCarWayBill.getBillNum().trim());
|
|
|
- }catch (Exception e){
|
|
|
- sb.append(noCarWayBill.getBillNum()+"#");
|
|
|
+ } catch (Exception e) {
|
|
|
+ sb.append(noCarWayBill.getBillNum() + "#");
|
|
|
log.error(noCarWayBill.getBillNum());
|
|
|
i++;
|
|
|
}
|
|
|
}
|
|
|
- if(i>0){
|
|
|
- log.error(org.apache.commons.lang3.StringUtils.isBlank(strError)?"buildDateError"+sb.toString()+"第"+i+"行数据存在错误,请检查文件中数据,金额是否有空的,时间是否全是时间格式":"buildDateError"+sb.toString()+strError);
|
|
|
- throw new RuntimeException(org.apache.commons.lang3.StringUtils.isBlank(strError)?"第"+i+"行数据存在错误,请检查文件中数据,金额是否有空的,时间是否全是时间格式":strError);
|
|
|
+ if (i > 0) {
|
|
|
+ log.error(org.apache.commons.lang3.StringUtils.isBlank(strError) ? "buildDateError" + sb.toString() + "第" + i + "行数据存在错误,请检查文件中数据,金额是否有空的,时间是否全是时间格式" : "buildDateError" + sb.toString() + strError);
|
|
|
+ throw new RuntimeException(org.apache.commons.lang3.StringUtils.isBlank(strError) ? "第" + i + "行数据存在错误,请检查文件中数据,金额是否有空的,时间是否全是时间格式" : strError);
|
|
|
}
|
|
|
}
|
|
|
- public void buildDateEnd(List<NoCarWayBill> list){
|
|
|
+
|
|
|
+ public void buildDateEnd(List<NoCarWayBill> list) {
|
|
|
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
int i = 0;
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
String strError = "";
|
|
|
- for(int j = 0 ;j<list.size();j++){
|
|
|
+ for (int j = 0; j < list.size(); j++) {
|
|
|
NoCarWayBill noCarWayBill = list.get(j);
|
|
|
|
|
|
- try{
|
|
|
- if(null == noCarWayBill){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查数据是否未传递");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查数据是否未传递";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查数据是否未传递");
|
|
|
+ try {
|
|
|
+ if (null == noCarWayBill) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查数据是否未传递");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查数据是否未传递";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查数据是否未传递");
|
|
|
}
|
|
|
- if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getBillNum())){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getBillNum())) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单编号是否未输入或者输入是否正确");
|
|
|
}
|
|
|
- if(null == noCarWayBill.getActEndTimeDate()){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确");
|
|
|
+ if (null == noCarWayBill.getActEndTimeDate()) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单实际结束时间是否未输入或者输入是否正确");
|
|
|
}
|
|
|
- if(org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getDestAddr())){
|
|
|
- log.error("buildDateError"+sb.toString()+"第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
|
|
|
- strError = "第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确";
|
|
|
- throw new RuntimeException("第"+(j+1)+"行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
|
|
|
+ if (org.apache.commons.lang3.StringUtils.isBlank(noCarWayBill.getDestAddr())) {
|
|
|
+ log.error("buildDateError" + sb.toString() + "第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
|
|
|
+ strError = "第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确";
|
|
|
+ throw new RuntimeException("第" + (j + 1) + "行数据存在错误,请检查运单目的地址是否未输入或者输入是否正确");
|
|
|
}
|
|
|
noCarWayBill.setPredictEndTime(format.format(noCarWayBill.getActEndTimeDate()));
|
|
|
- }catch (Exception e){
|
|
|
- sb.append(noCarWayBill.getBillNum()+"#");
|
|
|
+ } catch (Exception e) {
|
|
|
+ sb.append(noCarWayBill.getBillNum() + "#");
|
|
|
log.error(noCarWayBill.getBillNum());
|
|
|
i++;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if(i>0){
|
|
|
+ if (i > 0) {
|
|
|
|
|
|
- log.error(org.apache.commons.lang3.StringUtils.isBlank(strError)?"buildDateError"+sb.toString()+"第"+i+"行数据存在错误,请检查文件中数据,时间是否全是时间格式":"buildDateError"+sb.toString()+strError);
|
|
|
- throw new RuntimeException(org.apache.commons.lang3.StringUtils.isBlank(strError)?"第"+i+"行数据存在错误,请检查文件中数据,时间是否全是时间格式":strError);
|
|
|
+ log.error(org.apache.commons.lang3.StringUtils.isBlank(strError) ? "buildDateError" + sb.toString() + "第" + i + "行数据存在错误,请检查文件中数据,时间是否全是时间格式" : "buildDateError" + sb.toString() + strError);
|
|
|
+ throw new RuntimeException(org.apache.commons.lang3.StringUtils.isBlank(strError) ? "第" + i + "行数据存在错误,请检查文件中数据,时间是否全是时间格式" : strError);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 分页查询无车计费信息
|
|
|
*
|
|
|
- * @param page 参数集
|
|
|
+ * @param page 参数集
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/findBatchList")
|
|
|
- @ApiOperation(value="运单批次号查询", notes="运单批次号查询")
|
|
|
+ @ApiOperation(value = "运单批次号查询", notes = "运单批次号查询")
|
|
|
@LoginRequired
|
|
|
- public RespR findBatchList(Page page, CustomerOper customerOper,User user) {
|
|
|
+ public RespR findBatchList(Page page, CustomerOper customerOper, User user) {
|
|
|
try {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,customerOper.getCustomerName());
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, customerOper.getCustomerName());
|
|
|
RespR respR = new RespR(customerOperService.findAllCustomerOper(page, customerOper));
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 分页查询无车计费信息
|
|
|
*
|
|
|
- * @param page 参数集
|
|
|
+ * @param page 参数集
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/findNocarCalculateInfo")
|
|
|
- @ApiOperation(value="分页查询无车计费信息", notes="分页查询无车计费信息")
|
|
|
+ @ApiOperation(value = "分页查询无车计费信息", notes = "分页查询无车计费信息")
|
|
|
@LoginRequired
|
|
|
- public RespR findNocarCalculateInfo(Page page, NoCarCalculateInfor carCalculateInfor,User user) {
|
|
|
+ public RespR findNocarCalculateInfo(Page page, NoCarCalculateInfor carCalculateInfor, User user) {
|
|
|
try {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,carCalculateInfor.getCustomId());
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, carCalculateInfor.getCustomId());
|
|
|
setTimeDue1(carCalculateInfor);
|
|
|
RespR respR = new RespR(noCarCalculateInfoService.findByPageAndCalculateInfor(page, carCalculateInfor));
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 分页查询无车计费统计信息
|
|
|
*
|
|
|
- * @param carCalculateInfor 参数集
|
|
|
+ * @param carCalculateInfor 参数集
|
|
|
* @return 用户集合
|
|
|
*/
|
|
|
@PostMapping("/findNocarCalculateInfoStatis")
|
|
|
- @ApiOperation(value="分页查询无车计费统计信息", notes="分页查询无车计费统计信息")
|
|
|
+ @ApiOperation(value = "分页查询无车计费统计信息", notes = "分页查询无车计费统计信息")
|
|
|
@LoginRequired
|
|
|
- public RespR findNocarCalculateInfoStatis(NoCarCalculateInfor carCalculateInfor,User user) {
|
|
|
+ public RespR findNocarCalculateInfoStatis(NoCarCalculateInfor carCalculateInfor, User user) {
|
|
|
try {
|
|
|
- checkHasAuthRole.checkCustomerRole(user,carCalculateInfor.getCustomId());
|
|
|
+ checkHasAuthRole.checkCustomerRole(user, carCalculateInfor.getCustomId());
|
|
|
setTimeDue1(carCalculateInfor);
|
|
|
RespR respR = new RespR(noCarCalculateInfoService.findNocarCalculateInfoStatis(carCalculateInfor));
|
|
|
return respR;
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new RespR(false,e.getMessage());
|
|
|
+ return new RespR(false, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@GetMapping("/templateDownload")
|
|
|
- @ApiOperation(value="模板下载", notes="模板下载")
|
|
|
- public RespR contractDownload(String fileName,HttpServletResponse response){
|
|
|
- if(ONE.equals(fileName)){
|
|
|
- fileName = "运单模板.xlsx";
|
|
|
- }else if(TWO.equals(fileName)){
|
|
|
- fileName = "运单结束模板.xlsx";
|
|
|
- }else if(THREE.equals(fileName)){
|
|
|
- fileName = "历史运单模板.xlsx";
|
|
|
- }else if(FOR.equals(fileName)){
|
|
|
- fileName = "无车发票查询模板.xlsx";
|
|
|
- }else if(FIVE.equals(fileName)){
|
|
|
- fileName = "无车运单查询模板.xlsx";
|
|
|
- }else if(SIX.equals(fileName)){
|
|
|
- fileName = "自有车交易查询模板.xlsx";
|
|
|
- }else if(SEVEN.equals(fileName)){
|
|
|
- fileName = "自有车发票查询模板.xlsx";
|
|
|
- }else if(EIGHT.equals(fileName)){
|
|
|
- fileName = "自有车按交易查询申请模板.xlsx";
|
|
|
- }
|
|
|
- OutputStream outputStream = null;
|
|
|
- InputStream inputStream = null;
|
|
|
- try {
|
|
|
- File file = new File("/home/app/excel/"+fileName);
|
|
|
- inputStream = new FileInputStream(file);
|
|
|
- response.setHeader("Content-Disposition", "attachment;filename="+ URLEncoder.encode(fileName, "UTF-8"));
|
|
|
- outputStream = response.getOutputStream();
|
|
|
- IOUtils.copy(inputStream, outputStream);
|
|
|
- response.flushBuffer();
|
|
|
- return new RespR(true);
|
|
|
- } catch (IOException e) {
|
|
|
-
|
|
|
- } finally {
|
|
|
- IOUtils.closeQuietly(inputStream);
|
|
|
- IOUtils.closeQuietly(outputStream);
|
|
|
- }
|
|
|
+ @ApiOperation(value = "模板下载", notes = "模板下载")
|
|
|
+ public RespR contractDownload(String fileName, HttpServletResponse response) {
|
|
|
+ if (ONE.equals(fileName)) {
|
|
|
+ fileName = "运单模板.xlsx";
|
|
|
+ } else if (TWO.equals(fileName)) {
|
|
|
+ fileName = "运单结束模板.xlsx";
|
|
|
+ } else if (THREE.equals(fileName)) {
|
|
|
+ fileName = "历史运单模板.xlsx";
|
|
|
+ } else if (FOR.equals(fileName)) {
|
|
|
+ fileName = "无车发票查询模板.xlsx";
|
|
|
+ } else if (FIVE.equals(fileName)) {
|
|
|
+ fileName = "无车运单查询模板.xlsx";
|
|
|
+ } else if (SIX.equals(fileName)) {
|
|
|
+ fileName = "自有车交易查询模板.xlsx";
|
|
|
+ } else if (SEVEN.equals(fileName)) {
|
|
|
+ fileName = "自有车发票查询模板.xlsx";
|
|
|
+ } else if (EIGHT.equals(fileName)) {
|
|
|
+ fileName = "自有车按交易查询申请模板.xlsx";
|
|
|
+ }
|
|
|
+ OutputStream outputStream = null;
|
|
|
+ InputStream inputStream = null;
|
|
|
+ try {
|
|
|
+ File file = new File("/home/app/excel/" + fileName);
|
|
|
+ inputStream = new FileInputStream(file);
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ IOUtils.copy(inputStream, outputStream);
|
|
|
+ response.flushBuffer();
|
|
|
+ return new RespR(true);
|
|
|
+ } catch (IOException e) {
|
|
|
+
|
|
|
+ } finally {
|
|
|
+ IOUtils.closeQuietly(inputStream);
|
|
|
+ IOUtils.closeQuietly(outputStream);
|
|
|
+ }
|
|
|
return new RespR(false);
|
|
|
}
|
|
|
- public void setTimeDue1(NoCarCalculateInfor carCalculateInfor){
|
|
|
- if(!StringUtils.isEmpty(carCalculateInfor.getInvoiceMakeTime()) && !NULL.equals(carCalculateInfor.getInvoiceMakeTime())){
|
|
|
- String [] res = carCalculateInfor.getInvoiceMakeTime().split(",");
|
|
|
+
|
|
|
+ public void setTimeDue1(NoCarCalculateInfor carCalculateInfor) {
|
|
|
+ if (!StringUtils.isEmpty(carCalculateInfor.getInvoiceMakeTime()) && !NULL.equals(carCalculateInfor.getInvoiceMakeTime())) {
|
|
|
+ String[] res = carCalculateInfor.getInvoiceMakeTime().split(",");
|
|
|
carCalculateInfor.setInvoiceMakeStart(res[0]);
|
|
|
- carCalculateInfor.setInvoiceMakeEnd(res[1].replace("00:00:00","23:59:59"));
|
|
|
- }else{
|
|
|
+ carCalculateInfor.setInvoiceMakeEnd(res[1].replace("00:00:00", "23:59:59"));
|
|
|
+ } else {
|
|
|
carCalculateInfor.setInvoiceMakeTime(null);
|
|
|
}
|
|
|
- if(!StringUtils.isEmpty(carCalculateInfor.getCalculateTime()) && !NULL.equals(carCalculateInfor.getCalculateTime())){
|
|
|
- String [] res = carCalculateInfor.getCalculateTime().split(",");
|
|
|
+ if (!StringUtils.isEmpty(carCalculateInfor.getCalculateTime()) && !NULL.equals(carCalculateInfor.getCalculateTime())) {
|
|
|
+ String[] res = carCalculateInfor.getCalculateTime().split(",");
|
|
|
carCalculateInfor.setCalculateStart(res[0]);
|
|
|
- carCalculateInfor.setCalculateEnd(res[1].replace("00:00:00","23:59:59"));
|
|
|
- }else{
|
|
|
+ carCalculateInfor.setCalculateEnd(res[1].replace("00:00:00", "23:59:59"));
|
|
|
+ } else {
|
|
|
carCalculateInfor.setCalculateTime(null);
|
|
|
}
|
|
|
}
|