|
@@ -26,10 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -297,6 +294,40 @@ public class ZsReimbursementInfoController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 提交时根据发票号查询是否已经或正在报销
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiLog(value = "根据发票号查询是否已经或正在报销")
|
|
|
+ @GetMapping("getEffectiveDataByNumbers")
|
|
|
+ @ApiOperation(value = "根据发票号查询是否已经或正在报销")
|
|
|
+ public Map<String,Object> getEffectiveDataByNumbers(String invoiceNumber,String id){
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("success",true);
|
|
|
+ map.put("message","数电发票正常");
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isNotBlank(invoiceNumber)){
|
|
|
+ String[] array = invoiceNumber.split(",");
|
|
|
+ // 将数组转换为 List
|
|
|
+ List<String> numberList = Arrays.asList(array);
|
|
|
+ Set<String> set = new HashSet<>();
|
|
|
+ if(numberList.size()>0){
|
|
|
+ List<String> repetitionMessageList = service.getEffectiveDataByNumbers(numberList,id);
|
|
|
+ for (String vatTax : repetitionMessageList) {
|
|
|
+ set.add(vatTax);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ArrayList<String> strings = Lists.newArrayList(set);
|
|
|
+ String result = String.join(",", strings);
|
|
|
+ if(result.length()>0){
|
|
|
+ map.put("success",false);
|
|
|
+ map.put("message","数电发票编号为:" + result + "已进行上报,无法重复上报");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 根据发票号查询是否已经或正在报销
|
|
|
* @return
|
|
|
*/
|