package com.yc.MaintenanceFee.controller;
|
|
import com.yc.MaintenanceFee.entiy.*;
|
import com.yc.MaintenanceFee.entiy.Collection;
|
import com.yc.MaintenanceFee.service.InvoiceService;
|
import com.yc.MaintenanceFee.utils.BackMsg;
|
import com.yc.entity.DataSourceEntity;
|
import com.yc.multiData.MultiDataSource;
|
import com.yc.multiData.SpObserver;
|
import com.yc.sdk.shopping.util.SettingKey;
|
import com.yc.utils.SessionKey;
|
import org.apache.commons.lang3.StringUtils;
|
import org.commontemplate.util.MapSupport;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpSession;
|
import java.text.SimpleDateFormat;
|
import java.util.*;
|
import java.util.regex.Pattern;
|
|
/**
|
* 发票操作
|
*
|
* @USER: xinyb_
|
* @DATE: 2022-03-07 09:13
|
*/
|
@RestController
|
@RequestMapping("/invoice")
|
@CrossOrigin
|
public class InvoiceController {
|
private static final String DBID = "_338";
|
|
@Autowired
|
InvoiceService invoiceService;
|
|
/**
|
* 获取已经在收款单生成发票单的信息(获取发票单)
|
*
|
* @param request
|
* @return
|
*/
|
@RequestMapping("/getInvoiceInfo.do")
|
@ResponseBody
|
public BackMsg getInvoiceInfo(String startDate, String endDate, String docCode, Integer page, Integer limit, HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
List<InvoiceInfo> invoiceInfo = null;
|
try {
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
if (!StringUtils.isBlank(startDate)) {
|
Date d1 = sdf1.parse(startDate);
|
startDate = sdf1.format(d1);
|
}
|
if (!StringUtils.isBlank(endDate)) {
|
Date d2 = sdf1.parse(endDate);
|
endDate = sdf1.format(d2);
|
}
|
SpObserver.setDBtoInstance(DBID);
|
HttpSession session = request.getSession();
|
String dbId = (String) session.getAttribute(SessionKey.DATA_BASE_ID);
|
//获取发票信息
|
invoiceInfo = invoiceService.getInvoiceInfo(startDate, endDate, docCode, dbId);
|
Integer count = 0;
|
if (invoiceInfo == null || invoiceInfo.size() == 0) {
|
invoiceInfo = new ArrayList<>();
|
} else {
|
count = invoiceInfo.size();
|
Integer lim = page * limit >= count ? count : page * limit;
|
invoiceInfo = invoiceInfo.subList((page - 1) * limit, lim);
|
}
|
msg.setPageData(invoiceInfo, count);
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 获取指定发票单号信息
|
*
|
* @param docCode
|
* @param request
|
* @return
|
*/
|
@RequestMapping(value = "/getInvoice.do", method = RequestMethod.GET)
|
public BackMsg getInvoice(String docCode, HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
if (StringUtils.isBlank(docCode)) {
|
msg.setError("发票单号不能为空值并且不能是null值");
|
return msg;
|
}
|
SpObserver.setDBtoInstance(DBID);
|
//获取发票信息
|
InvoiceInfo invoiceInfo = invoiceService.getInvoice(docCode);
|
msg.setOk(invoiceInfo);
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 收款列表
|
*
|
* @param startDate
|
* @param endDate
|
* @param docCode
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value = "/collection.do", method = RequestMethod.GET)
|
public BackMsg getCollection(String startDate, String endDate, String docCode, Integer page, Integer limit, HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
List<Collection> collections = null;
|
try {
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
if (!StringUtils.isBlank(startDate)) {
|
Date d1 = sdf1.parse(startDate);
|
startDate = sdf1.format(d1);
|
}
|
if (!StringUtils.isBlank(endDate)) {
|
Date d2 = sdf1.parse(endDate);
|
endDate = sdf1.format(d2);
|
}
|
SpObserver.setDBtoInstance(DBID);
|
HttpSession session = request.getSession();
|
String dbId = (String) session.getAttribute(SessionKey.DATA_BASE_ID);
|
collections = invoiceService.getCollection(startDate, endDate, docCode, dbId);
|
int count = 0;
|
if (collections == null || collections.size() == 0) {
|
collections = new ArrayList<>();
|
} else {
|
count = collections.size();
|
Integer lim = page * limit >= count ? count : page * limit;
|
collections = collections.subList((page - 1) * limit, lim);
|
}
|
msg.setPageData(collections, count);
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 收款单合并生成发票单(创建发票单)
|
*
|
* @param param
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value = "/createInvoice.do", method = RequestMethod.POST)
|
public BackMsg createInvoice(@RequestBody FPParam param,
|
HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
if (param.getDocCode() == null || param.getDocCode().size() == 0) {
|
msg.setError("消费数据单号不能为空,请选择开票消费数据");
|
return msg;
|
}
|
if (StringUtils.isBlank(param.getInvoiceMedium())) {
|
msg.setError("请选择发票介质");
|
return msg;
|
}
|
if ("PaperInvoice".equals(param.getInvoiceMedium()) && (param.getSeq() == null || param.getSeq() == 0)) {
|
msg.setError("请选择收件地址");
|
return msg;
|
}
|
if(StringUtils.isNotBlank(param.getTel2())){//判断电话号是否正确
|
Pattern pattern = Pattern.compile("^1[3|4|5|7|8][0-9]{9}$");
|
if (!pattern.matcher(param.getTel2()).matches()){
|
msg.setError("请输入正确的收票电话号");
|
}
|
}
|
if(StringUtils.isNotBlank(param.getEmail())){//判断邮箱号是否正确
|
Pattern pattern = Pattern.compile("^([a-z0-9A-Z]+[-|_|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$");
|
if (!pattern.matcher(param.getEmail()).matches()){
|
msg.setError("请输入正确的收票邮箱");
|
}
|
}
|
param.setSeq(param.getSeq() == null ? 0 : param.getSeq());
|
HttpSession session = request.getSession();
|
param.setUserCode((String) session.getAttribute(SessionKey.USERCODE));
|
param.setUserName((String) session.getAttribute(SessionKey.USERNAME));
|
SpObserver.setDBtoInstance(DBID);
|
String fpCode = invoiceService.createInvoice(param);
|
if (StringUtils.isBlank(fpCode)) {
|
msg.setError("创建发票单失败!");
|
} else {
|
String[] fp = fpCode.split(";");
|
Map<String, Object> map = new HashMap<>();
|
if (fp.length == 3) {
|
map.put("formId", fp[0]);
|
map.put("formType", fp[1]);
|
map.put("docCode", fp[2]);
|
} else {
|
map.put("docCode", fpCode);
|
}
|
msg.setOk(map);
|
}
|
return msg;
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 获取发票抬头信息
|
*
|
* @param request
|
* @return
|
*/
|
@RequestMapping("/getInvoiceHeader.do")
|
public BackMsg getInvoiceHeader(HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
HttpSession session = request.getSession();
|
String dbId = (String) session.getAttribute(SessionKey.DATA_BASE_ID);
|
SpObserver.setDBtoInstance(DBID);
|
Map<String, Object> map = invoiceService.getInvoiceHeader(dbId);
|
if (map.get("invType") == null || "".equals(map.get("invType"))) {
|
//没值的情况
|
map = null;
|
}else{
|
DataSourceEntity dataSourceEntity=MultiDataSource.getDataSourceMap(dbId);
|
//获取系统设置的开票单位(收取维护费的公司)
|
map.put("billingCompany",dataSourceEntity.getMaintenanceFeeToDbId());
|
}
|
msg.setOk(map);
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 编辑发票抬头信息
|
*
|
* @param request
|
* @return
|
*/
|
@RequestMapping(value = "/invoiceHeader.do", method = RequestMethod.POST)
|
public BackMsg saveInvoiceHeader(@RequestBody Header header, HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
HttpSession session = request.getSession();
|
String dbId = (String) session.getAttribute(SessionKey.DATA_BASE_ID);
|
SpObserver.setDBtoInstance(DBID);
|
int count = invoiceService.saveInvoiceHeader(header, dbId);
|
if (count == 1) {
|
msg.setOk(count);
|
} else {
|
msg.setOk(-1);
|
}
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 编辑退票信息
|
*
|
* @param outTicket
|
* @param request
|
* @return
|
*/
|
@RequestMapping("/saveOutTicket.do")
|
public BackMsg saveOutTicket(@RequestBody OutTicket outTicket, HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
String error = "";
|
if (StringUtils.isBlank(outTicket.getReceivingName())) {
|
error += "请填写收件人名字。\n";
|
}
|
if (StringUtils.isBlank(outTicket.getReceivingTel())) {
|
error += "请填写收件人电话。\n";
|
}
|
if (StringUtils.isBlank(outTicket.getReceivingAddress())) {
|
error += "请填写收件人地址。\n";
|
}
|
if (StringUtils.isBlank(outTicket.getReason())) {
|
error += "请填写退票原因!\n";
|
}
|
if (StringUtils.isBlank(outTicket.getShipperCode())) {
|
error += "请填写快递公司。\n";
|
}
|
if (StringUtils.isBlank(outTicket.getLogisticsCode())) {
|
error += "请填写物流单号。\n";
|
}
|
if (StringUtils.isBlank(outTicket.getHDMemo())) {
|
error += "请填写备注。\n";
|
}
|
if (StringUtils.isBlank(outTicket.getFpCode())) {
|
error += "发票单号不能为空。";
|
}
|
if (outTicket.getFormId() == null || outTicket.getFormId() == 0) {
|
outTicket.setFormId(150504);
|
}
|
if (!StringUtils.isBlank(error)) {
|
msg.setError(error);
|
return msg;
|
}
|
HttpSession session = request.getSession();
|
String dbId = (String) session.getAttribute(SessionKey.DATA_BASE_ID);
|
outTicket.setUserCode((String) session.getAttribute(SessionKey.USERCODE));
|
outTicket.setUserName((String) session.getAttribute(SessionKey.USERNAME));
|
SpObserver.setDBtoInstance(DBID);
|
String doc = invoiceService.saveOutTicket(outTicket);
|
if (!StringUtils.isBlank(doc)) {
|
String[] fp = doc.split(";");
|
Map<String, Object> map = new HashMap<>();
|
if (fp.length == 3) {
|
map.put("formId", fp[0]);
|
map.put("formType", fp[1]);
|
map.put("docCode", fp[2]);
|
map.put("msg","退票提交成功");
|
} else {
|
map.put("docCode", doc);
|
}
|
msg.setOk(map);
|
} else {
|
msg.setOk("已执行退票过程,但返回值是空值!");
|
}
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
|
/**
|
* 获取客户地址信息
|
*
|
* @param request
|
* @return
|
*/
|
@RequestMapping("/getAddress.do")
|
public BackMsg getAddressInfo(HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
List<Map<String, Object>> list = null;
|
try {
|
HttpSession session = request.getSession();
|
String dbId = (String) session.getAttribute(SessionKey.DATA_BASE_ID);
|
SpObserver.setDBtoInstance(DBID);
|
list = invoiceService.getAddressInfo(dbId);
|
if (list == null) {
|
list = new ArrayList<>();
|
}
|
msg.setOk(list);
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 获取指定的地址信息
|
*
|
* @param seq
|
* @param request
|
* @return
|
*/
|
@RequestMapping("/selectAddress.do")
|
public BackMsg selectAddress(Integer seq, HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
if (seq == null || seq == 0) {
|
msg.setError("唯一编号不能为空");
|
return msg;
|
}
|
HttpSession session = request.getSession();
|
String dbId = (String) session.getAttribute(SessionKey.DATA_BASE_ID);
|
SpObserver.setDBtoInstance(DBID);
|
Map<String, Object> map = invoiceService.selectAddress(dbId, seq);
|
msg.setOk(map);
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
|
/**
|
* 编辑地址信息(保存,修改,删除)
|
*
|
* @param request
|
* @return
|
*/
|
@RequestMapping("/saveAddress.do")
|
public BackMsg saveAddress(@RequestBody Address address, HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
if (address.getOperation() == null || address.getOperation() < 0) {
|
msg.setError("操作类型错误!");
|
return msg;
|
}
|
if (address.getSeq() == null && (address.getOperation() == 0 || address.getOperation() == 2)) {
|
msg.setError("seq值不能为空!");
|
return msg;
|
}
|
HttpSession session = request.getSession();
|
String dbId = (String) session.getAttribute(SessionKey.DATA_BASE_ID);
|
SpObserver.setDBtoInstance(DBID);
|
int cont = invoiceService.saveAddress(address, dbId);
|
if (cont == 1) {
|
msg.setOk(cont);
|
} else {
|
msg.setOk(-1);
|
}
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 获取区域信息
|
*
|
* @param rowId
|
* @param request
|
* @return
|
*/
|
@RequestMapping("/getRegion.do")
|
public BackMsg getRegion(String rowId, HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
List<Map<String, Object>> list = null;
|
try {
|
SpObserver.setDBtoInstance(DBID);
|
list = invoiceService.getRegion(rowId);
|
if (list == null) {
|
list = new ArrayList<>();
|
}
|
msg.setOk(list);
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 返回收件人信息
|
*
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("/getReceiving.do")
|
public BackMsg getReceiving(HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
DataSourceEntity dataSourceEntity = MultiDataSource.getDataSourceMap(request);
|
if (dataSourceEntity.getMaintenanceFeeToDbId() != null) {
|
Map<String, Object> map = new HashMap<>();
|
switch (dataSourceEntity.getMaintenanceFeeToDbId()) {
|
case 1624:
|
map.put("name", "王先生");
|
map.put("tel", "13827778996");
|
map.put("address", "佛山市禅城区华宝南路13号国家火炬创新创业园C座713室");//"广东省佛山市禅城区张槎街道华宝南路13号国家火炬创新创业园C座713");
|
break;
|
case 338:
|
map.put("name", "邱先生");
|
map.put("tel", "15151935628");
|
map.put("address", "江苏省常州市天宁区红梅街道竹林西路天宁时代广场B座1407");
|
break;
|
default:
|
break;
|
}
|
msg.setOk(map);
|
} else {
|
msg.setError("请在数据源设置选择【收取维护费所属公司】");
|
return msg;
|
}
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
}
|
return msg;
|
}
|
|
/**
|
* 获取开票总金额
|
*
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("/getInvoiceAmount.do")
|
public BackMsg getInvoiceAmount(HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
HttpSession session = request.getSession();
|
String dbId = (String) session.getAttribute(SessionKey.DATA_BASE_ID);
|
SpObserver.setDBtoInstance(DBID);
|
double amount = invoiceService.getInvoiceAmount(dbId);
|
if (amount > 0) {
|
msg.setOk(amount);
|
} else {
|
msg.setOk(0);
|
}
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 已经开票后的发票浏览
|
*
|
* @param fpDocCode
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping("/InvoiceViewData.do")
|
public BackMsg getInvoiceViewData(String fpDocCode, HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
if (StringUtils.isBlank(fpDocCode)) {
|
msg.setError("预览发票单号不能为空。");
|
return msg;
|
}
|
Map<String, Object> map = new HashMap<>();
|
map.putAll(getView(request));
|
SpObserver.setDBtoInstance(DBID);
|
List<Map<String, Object>> list = invoiceService.getInvoiceViewData(fpDocCode);
|
if (list != null && list.size() > 0) {
|
map.put("data", list);
|
}
|
msg.setOk(map);
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
/**
|
* 未生成发票的信息预览
|
*
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value = "/getInvoiceView.do", method = RequestMethod.POST)
|
public BackMsg getInvoiceView(@RequestBody List<String> docCode, HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
try {
|
HttpSession session = request.getSession();
|
String dbId = (String) session.getAttribute(SessionKey.DATA_BASE_ID);
|
SpObserver.setDBtoInstance(DBID);
|
Map<String, Object> map = invoiceService.getInvoiceView(String.join(",", docCode), dbId);
|
map.putAll(getView(request));
|
// DataSourceEntity dataSourceEntity = MultiDataSource.getDataSourceMap(request);
|
// if (dataSourceEntity.getMaintenanceFeeToDbId() != null) {
|
// switch (dataSourceEntity.getMaintenanceFeeToDbId()) {
|
// case 338:
|
// map.put("invoiceName", "江苏增值税专用发票");
|
// map.put("name", "常州市巴士软件有限公司 ");
|
// map.put("identification", "91320402063290850X");
|
// map.put("addressTel", "江苏省常州市天宁区关河东路66号1018室 0519-83380880");
|
// map.put("bankNumber", "中国农业银行常州市九洲广场支行 611801040007777");
|
// map.put("seal1", SettingKey.getHostUrl(request) + "/images/seal/" + dataSourceEntity.getMaintenanceFeeToDbId() + "/jiangsu.png");
|
// map.put("seal2", SettingKey.getHostUrl(request) + "/images/seal/" + dataSourceEntity.getMaintenanceFeeToDbId() + "/jiangsuSeal.png");
|
// break;
|
// case 1624:
|
// map.put("invoiceName", "广东增值税普通发票");
|
// map.put("name", "佛山市盈晨软件有限公司 ");
|
// map.put("identification", "9144060478577219x6");
|
// map.put("addressTel", "佛山市禅城区华宝南路13号国家火炬创新创业园C座713室 0757-83384330");//"佛山市禅城区季华二路国家火炬创新创业园C栋713室 0757-83384330");
|
// map.put("bankNumber", "工商银行佛山明珠支行 2013020809100005421");
|
// map.put("seal1", SettingKey.getHostUrl(request) + "/images/seal/" + dataSourceEntity.getMaintenanceFeeToDbId() + "/guangdong.png");
|
// map.put("seal2", SettingKey.getHostUrl(request) + "/images/seal/" + dataSourceEntity.getMaintenanceFeeToDbId() + "/guangdongSeal.png");
|
// break;
|
// default:
|
// break;
|
// }
|
// } else {
|
// msg.setError("请在数据源设置【收取维护费所属公司】");
|
// return msg;
|
// }
|
map.put("uom", "元");
|
map.put("digit", 1);
|
map.put("taxRate", "3%");
|
msg.setOk(map);
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
|
private Map<String, Object> getView(HttpServletRequest request) {
|
Map<String, Object> map = new HashMap<>();
|
map.put("description", "*信息技术服务*软件维护");
|
try {
|
DataSourceEntity dataSourceEntity = MultiDataSource.getDataSourceMap(request);
|
if (dataSourceEntity.getMaintenanceFeeToDbId() != null) {
|
switch (dataSourceEntity.getMaintenanceFeeToDbId()) {
|
case 338:
|
map.put("invoiceName", "江苏增值税专用发票");
|
map.put("name", "常州市巴士软件有限公司 ");
|
map.put("identification", "91320402063290850X");
|
map.put("addressTel", "江苏省常州市天宁区关河东路66号1018室 0519-83380880");
|
map.put("bankNumber", "中国农业银行常州市九洲广场支行 611801040007777");
|
map.put("seal1", SettingKey.getHostUrl(request) + "/images/seal/" + dataSourceEntity.getMaintenanceFeeToDbId() + "/jiangsu.png");
|
map.put("seal2", SettingKey.getHostUrl(request) + "/images/seal/" + dataSourceEntity.getMaintenanceFeeToDbId() + "/jiangsuSeal.png");
|
break;
|
case 1624:
|
map.put("invoiceName", "广东增值税普通发票");
|
map.put("name", "佛山市盈晨软件有限公司 ");
|
map.put("identification", "9144060478577219x6");
|
map.put("addressTel", "佛山市禅城区华宝南路13号国家火炬创新创业园C座713室 0757-83384330");//"佛山市禅城区季华二路国家火炬创新创业园C栋713室 0757-83384330");
|
map.put("bankNumber", "工商银行佛山明珠支行 2013020809100005421");
|
map.put("seal1", SettingKey.getHostUrl(request) + "/images/seal/" + dataSourceEntity.getMaintenanceFeeToDbId() + "/guangdong.png");
|
map.put("seal2", SettingKey.getHostUrl(request) + "/images/seal/" + dataSourceEntity.getMaintenanceFeeToDbId() + "/guangdongSeal.png");
|
break;
|
default:
|
break;
|
}
|
} else {
|
throw new Exception("请在数据源设置【收取维护费所属公司】");
|
}
|
return map;
|
} catch (Exception e) {
|
return map;
|
}
|
}
|
|
/**
|
* 退票原因列 xin 2022-4-30 11:30:26
|
*
|
* @param request
|
* @param response
|
* @return
|
*/
|
@RequestMapping(value = "/Reason.do", method = RequestMethod.GET)
|
public BackMsg getReason(HttpServletRequest request, HttpServletResponse response) {
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Methods", "*");
|
BackMsg msg = new BackMsg();
|
Map<String, Object> M = new HashMap<>();
|
try {
|
SpObserver.setDBtoInstance(DBID);
|
List<Map<String, Object>> map = invoiceService.getReason();
|
M.put("R", map);
|
List<Map<String, Object>> lmap = invoiceService.getShipperCode();
|
M.put("L", lmap);
|
msg.setOk(M);
|
return msg;
|
} catch (Exception e) {
|
msg.setError(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
|
} finally {
|
SpObserver.setDBtoInstance();
|
}
|
return msg;
|
}
|
}
|