Forráskód Böngészése

因模块无用,删除航天开票相关代码

suntg 7 éve
szülő
commit
8fd848553c
32 módosított fájl, 7 hozzáadás és 7632 törlés
  1. 2 26
      src/main/java/com/uas/platform/b2b/controller/EnterpriseController.java
  2. 0 145
      src/main/java/com/uas/platform/b2b/controller/PiaoPlusNoticeController.java
  3. 0 837
      src/main/java/com/uas/platform/b2b/controller/SaleApBillOutController.java
  4. 0 18
      src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutDao.java
  5. 0 13
      src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutDoneDao.java
  6. 0 13
      src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutEndDao.java
  7. 0 20
      src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutInfoDao.java
  8. 0 26
      src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutItemDao.java
  9. 0 9
      src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutTodoDao.java
  10. 0 53
      src/main/java/com/uas/platform/b2b/erp/controller/BillOutController.java
  11. 0 489
      src/main/java/com/uas/platform/b2b/erp/model/BillOut.java
  12. 0 353
      src/main/java/com/uas/platform/b2b/erp/model/BillOutDetail.java
  13. 0 17
      src/main/java/com/uas/platform/b2b/erp/service/impl/BillOutService.java
  14. 0 81
      src/main/java/com/uas/platform/b2b/erp/service/impl/BillOutServiceImpl.java
  15. 0 571
      src/main/java/com/uas/platform/b2b/model/PurchaseApBillOut.java
  16. 0 322
      src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutDone.java
  17. 0 322
      src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutEnd.java
  18. 0 149
      src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutInfo.java
  19. 0 390
      src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutItem.java
  20. 0 100
      src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutTaxCode.java
  21. 0 322
      src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutTodo.java
  22. 0 163
      src/main/java/com/uas/platform/b2b/model/SoapInvoiceIssued.java
  23. 0 10
      src/main/java/com/uas/platform/b2b/search/SearchService.java
  24. 3 14
      src/main/java/com/uas/platform/b2b/search/SearchServiceImpl.java
  25. 2 13
      src/main/java/com/uas/platform/b2b/service/EnterpriseService.java
  26. 0 73
      src/main/java/com/uas/platform/b2b/service/PiaoPlusService.java
  27. 0 166
      src/main/java/com/uas/platform/b2b/service/PurchaseApBillOutService.java
  28. 0 132
      src/main/java/com/uas/platform/b2b/service/SOAPConsoleService.java
  29. 0 12
      src/main/java/com/uas/platform/b2b/service/impl/EnterpriseServiceImpl.java
  30. 0 965
      src/main/java/com/uas/platform/b2b/service/impl/PiaoPlusServiceImpl.java
  31. 0 508
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseApBillOutServiceImpl.java
  32. 0 1300
      src/main/java/com/uas/platform/b2b/service/impl/SOAPConsoleServiceImpl.java

+ 2 - 26
src/main/java/com/uas/platform/b2b/controller/EnterpriseController.java

@@ -2,7 +2,6 @@ package com.uas.platform.b2b.controller;
 
 import java.util.List;
 
-import com.uas.platform.b2b.model.PurchaseApBillOutInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
@@ -99,7 +98,7 @@ public class EnterpriseController {
 	/**
 	 * 新增或修改企业地址
 	 * 
-	 * @param shipAddress
+	 * @param ship
 	 * @return
 	 */
 	@RequestMapping(value = "/saveShipAddress", method = RequestMethod.POST)
@@ -134,7 +133,7 @@ public class EnterpriseController {
 	/**
 	 * 根据uu获取企业基本信息
 	 * 
-	 * @param enuu
+	 * @param bussinessCode
 	 * @return
 	 */
 	@RequestMapping(value = "/info/{bussinessCode}", method = RequestMethod.GET)
@@ -142,27 +141,4 @@ public class EnterpriseController {
 	private Enterprise getInfo(@PathVariable String bussinessCode) {
 		return enterpriseService.findByenBussinessCode(bussinessCode);
 	}
-
-	/**
-	 * 修改企业开票信息
-	 *
-	 * @return
-	 */
-	@RequestMapping(value = "/saveApBillOutInfo", method = RequestMethod.POST)
-	@ResponseBody
-	public void saveApBillOutInfo(@RequestBody String json) {
-		PurchaseApBillOutInfo apBillOutInfo = JSON.parseObject(json, PurchaseApBillOutInfo.class);
-		enterpriseService.saveApBillOutInfo(apBillOutInfo);
-	}
-
-	/**
-	 * 获取企业开票信息
-	 *
-	 * @return
-	 */
-	@RequestMapping(value = "/getApBillOutInfo/{enuu}", method = RequestMethod.GET)
-	@ResponseBody
-	public PurchaseApBillOutInfo getApBillOutInfo(@PathVariable Long enuu) {
-		return enterpriseService.getApBillOutInfo(enuu);
-	}
 }

+ 0 - 145
src/main/java/com/uas/platform/b2b/controller/PiaoPlusNoticeController.java

@@ -1,145 +0,0 @@
-package com.uas.platform.b2b.controller;
-
-import com.alibaba.fastjson.JSONObject;
-import com.uas.platform.b2b.service.PurchaseApBillOutService;
-import com.uas.platform.b2b.service.PurchaseApCheckService;
-import org.apache.commons.io.IOUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-
-/**
- * 票加加开票数据回传接口
- *
- * @author huangct
- * @time 创建时间:2018年03月07日
- */
-
-@SuppressWarnings("deprecation")
-@Controller
-@RequestMapping("/public/apBillOut")
-public class PiaoPlusNoticeController {
-
-	@Autowired
-	PurchaseApCheckService purchaseApCheckService;
-
-	@Autowired
-	private PurchaseApBillOutService purchaseApBillOutService;
-
-	/**
-	 * 电子发票开票成功通知
-	 * @param data
-	 * @return
-	 */
-	@RequestMapping(value = "/electricBillSuccessNotice", method = RequestMethod.POST)
-	@ResponseBody
-	public ModelMap electricBillSuccessNotice(@RequestParam("data") String data){
-		JSONObject noticeData = JSONObject.parseObject(data);
-		String taxpayerId = noticeData.getString("taxpayerId");
-		String billRequestNum = noticeData.getString("billRequestNum");
-		String orderNo = noticeData.getString("orderNo");
-		String reIssue = noticeData.getString("reIssue");//是否允许重开 0允许,1不允许
-		String code = noticeData.getString("code");
-		String resMsg = noticeData.getString("resMsg");
-
-
-		return null;
-	}
-
-	/**
-	 * 电子开票失败通知
-	 * @param data
-	 * @return
-	 */
-	@RequestMapping(value = "/electricBillFailNotice", method = RequestMethod.POST)
-	@ResponseBody
-	public ModelMap electricBillFailNotice(@RequestParam("data") String data){
-		JSONObject noticeData = JSONObject.parseObject(data);
-		String taxpayerId = noticeData.getString("taxpayerId");
-		String billRequestNum = noticeData.getString("billRequestNum");
-		String orderNo = noticeData.getString("orderNo");
-		String reIssue = noticeData.getString("reIssue");//是否允许重开 0允许,1不允许
-
-		//电子发票只有这俩个
-		String code = noticeData.getString("code");
-		String resMsg = noticeData.getString("resMsg");
-
-		return null;
-	}
-
-	/**
-	 * 纸质发票开票成功通知
-	 * @param request
-	 * @return
-	 */
-	@RequestMapping(value = "/paperBillSuccessNotice", method = RequestMethod.POST)
-	@ResponseBody
-	public JSONObject billSuccessNotice(HttpServletRequest request) throws IOException {
-		String data = IOUtils.toString(request.getInputStream(), request.getCharacterEncoding());
-		JSONObject jsonObject = new JSONObject();
-		JSONObject noticeData = JSONObject.parseObject(data);
-		String sysOrderNo = noticeData.getString("sysOrderNo");
-		String orderNo = noticeData.getString("orderNo");
-		String fpdm = noticeData.getString("fpdm");//发票代码
-		String code = noticeData.getString("code");//0000 成功
-		String fplx = noticeData.getString("fplx");
-		String billRequestNum = noticeData.getString("billRequestNum");//请求流水号
-		String totalMoney = noticeData.getString("totalMoney");
-		String reIssue = noticeData.getString("reIssue");//是否允许重开 0允许,1不允许
-		String resMsg = noticeData.getString("resMsg");
-		String taxpayerId = noticeData.getString("taxpayerId");
-		String fphm = noticeData.getString("fphm");//发票号码
-
-		//TODO 查询出错
-		/*PurchaseApBillOut apBillOut = purchaseApBillOutService.findByCode(sysOrderNo);
-
-		apBillOut.setNsrsbh(taxpayerId);
-		apBillOut.setInfoTypeCode(fpdm);
-		apBillOut.setInfoNumber(fphm);
-		apBillOut.setRequestCode(billRequestNum);
-		apBillOut.setReissue(reIssue);
-		apBillOut.setRetmsg(resMsg);
-
-		//修改开票单状态
-		apBillOut.setCheckStatus("已开票");
-
-		purchaseApBillOutService.save(apBillOut);*/
-
-		jsonObject.put("code", "0000");
-		jsonObject.put("resMsg", "开票成功!");
-
-		return jsonObject;
-	}
-
-	/**
-	 * 纸质开票失败通知
-	 * @param data
-	 * @return
-	 */
-	@RequestMapping(value = "/paperBillFailNotice", method = RequestMethod.POST)
-	@ResponseBody
-	public ModelMap billFailNotice(@RequestParam("data") String data){
-		JSONObject noticeData = JSONObject.parseObject(data);
-		String taxpayerId = noticeData.getString("taxpayerId");
-		String billRequestNum = noticeData.getString("billRequestNum");
-		String totalMoney = noticeData.getString("totalMoney");//税金合计
-		String fplx = noticeData.getString("fplx");//发票类型  1表示蓝票,2表示红票
-		String fpdm = noticeData.getString("fpdm");//发票代码  开票结果为成功时必填
-		String fphm = noticeData.getString("fphm");//发票号码  开票结果为成功时必填
-		String yfpdm = noticeData.getString("yfpdm");//原发票代码  开票类型为红票时必填
-		String yfphm = noticeData.getString("yfphm");//原发票号码  开票类型为红票时必填
-		String sysOrderNo = noticeData.getString("sysOrderNo");//BPM申请单编号  当前开票请求由BPM发起时回填,否则该字段为空。
-
-		String code = noticeData.getString("code");
-		String resMsg = noticeData.getString("resMsg");
-
-		return null;
-	}
-}

+ 0 - 837
src/main/java/com/uas/platform/b2b/controller/SaleApBillOutController.java

@@ -1,837 +0,0 @@
-package com.uas.platform.b2b.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.uas.platform.b2b.dao.CommonDao;
-import com.uas.platform.b2b.dao.PurchaseApBillOutDao;
-import com.uas.platform.b2b.dao.PurchaseApCheckItemInfoDao;
-import com.uas.platform.b2b.model.*;
-import com.uas.platform.b2b.search.SearchService;
-import com.uas.platform.b2b.service.*;
-import com.uas.platform.b2b.support.JxlsExcelView;
-import com.uas.platform.b2b.support.SystemSession;
-import com.uas.platform.b2b.support.UsageBufferedLogger;
-import com.uas.platform.core.exception.IllegalOperatorException;
-import com.uas.platform.core.logging.BufferedLoggerManager;
-import com.uas.platform.core.model.Constant;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.PageParams;
-import com.uas.platform.core.util.serializer.FlexJsonUtils;
-import com.uas.platform.core.web.bind.RequestState;
-import com.uas.search.b2b.model.MultiValue;
-import com.uas.search.b2b.model.SPage;
-import com.uas.search.b2b.model.Sort;
-import com.uas.search.b2b.model.Sort.Type;
-import com.uas.search.b2b.util.SearchConstants;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Sort.Direction;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.text.DecimalFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * 
- * 航天开票
- *
- */
-
-@SuppressWarnings("deprecation")
-@Controller
-@RequestMapping("/sale/apBillOut")
-public class SaleApBillOutController {
-
-	@Autowired
-	private ErpProdIODetailService erpProdIODetailService;
-
-	@Autowired
-	PurchaseApCheckService purchaseApCheckService;
-
-	@Autowired
-	private VendorService vendorService;
-
-	@Autowired
-	private UserService userService;
-
-	@Autowired
-	private SearchService searchService;
-
-	@Autowired
-	private  PurchaseApCheckItemInfoDao PurchaseApCheckItemInfoDao;
-
-	@Autowired
-	private PurchaseApBillOutService purchaseApBillOutService;
-
-	@Autowired
-	private CommonDao commonDao;
-
-    @Autowired
-    private PurchaseApBillOutDao purchaseApBillOutDao;
-
-	@Autowired
-	private SOAPConsoleService sOAPConsoleService;
-
-	@Autowired
-	private PiaoPlusService piaoPlusService;
-
-	private final static UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
-
-	/**
-	 * 打印对账单,增加打印次数
-	 * 
-	 * @param id
-	 * @return
-	 */
-	// 此方法只是更新了打印次数  目前处于弃用状态
-	@RequestMapping(value = "/printCount/{id}", method = RequestMethod.POST)
-	@ResponseBody
-	public ResponseEntity<String> printCount(@PathVariable("id") Long id) {
-		purchaseApCheckService.print(id);
-		logger.log("开票单", "打印开票单单据", id.toString());
-		return new ResponseEntity<String>(HttpStatus.OK);
-	}
-
-	/**
-	 * 得到所有的供应商信息便于筛选
-	 * 
-	 * @return
-	 */
-	@RequestMapping(value = "/getAllCustomers", method = RequestMethod.GET)
-	@ResponseBody
-	public Set<Object> getAllApChecksCustomers() {
-		Set<Object> set = new HashSet<>();
-		// 判断当前用户是否被客户分配
-		SearchFilter filter = userService.distribute();
-		// 不是管理员也没被分配客户是直接返回空
-		if (filter != null && filter.getDistribute() == null) {
-			return null;
-		}
-		Set<Role> roles = SystemSession.getUser().getRoles();
-		boolean isSys = false;
-		for (Role role : roles) {
-			if (role.getIssys() == 1) {
-				isSys = true;
-			}
-		}
-		if (!SystemSession.getUser().isSys() && !isSys) { // 不是管理员,被分配客户时
-			List<Vendor> vendors = userService.findChooseVendor(SystemSession.getUser().getUserUU());
-			if (!CollectionUtils.isEmpty(vendors)) {
-				for (Vendor v : vendors) {
-					if (v.getApcheck().equals(Constant.YES)) {// 只有开通了B2B对账的才筛选
-						set.add(v.getMyEnterprise().getEnName()); // 这里添加客户名称
-					}
-				}
-			} else {
-				return null;
-			}
-		} else {
-			List<Vendor> vendors = vendorService.findMyCustomers();
-			for (Vendor vendor : vendors) {
-				set.add(vendor.getMyEnterprise().getEnName());
-			}
-		}
-		return set;
-	}
-
-
-	@RequestMapping(value = "/getDoneByKeywords", method = RequestMethod.GET)
-	@ResponseBody
-	public Set<PurchaseApCheckItemInfo> getDoneApchecksByDate(Long fromDate, Long endDate, String keyword) {
-		List<Long> distributes = null;
-		// 判断当前用户是否被客户分配
-		if (!SystemSession.getUser().isSys()) {
-			List<Vendor> vendors = userService.findChooseVendor(SystemSession.getUser().getUserUU());
-			distributes = new ArrayList<Long>();
-			if (!CollectionUtils.isEmpty(vendors)) {
-				for (Vendor v : vendors) {
-					distributes.add(v.getMyEnUU());
-				}
-			} else {
-				return null;
-			}
-		}
-		List<PurchaseApCheckItem> purchaseApCheckItems = purchaseApCheckService.findDoneApCheckItems(distributes, keyword, fromDate, endDate);  //erpProdIODetailService.findDoneXlsApChecks(distributes, keyword, fromDate, endDate);
-
-		Set<PurchaseApCheckItemInfo> apCheckItems = new HashSet<PurchaseApCheckItemInfo>();
-		for (PurchaseApCheckItem purchaseApCheckItem : purchaseApCheckItems ){
-			Long id = purchaseApCheckItem.getId();
-			PurchaseApCheckItemInfo item = PurchaseApCheckItemInfoDao.findOne(id);
-			apCheckItems.add(item);
-		}
-		return apCheckItems;
-	}
-
-	/**
-	 * 保存生成的开票单主记录
-	 */
-	@RequestMapping(value = "/save", method = RequestMethod.POST)
-	@ResponseBody
-	public ModelMap saveApBillOut(@RequestBody String json) {
-		ModelMap map = new ModelMap();
-		List<String> alters = new ArrayList<String>();
-		JSONObject jsonObject = JSON.parseObject(json);
-		//提取数据来源单据信息
-		String sourceInfos = jsonObject.getString("sourceInfos");
-		List<HashMap<String, Object>> sourceInfoList = FlexJsonUtils.fromJsonArray(sourceInfos, HashMap.class);
-		jsonObject.remove("sourceInfos");
-		json = jsonObject.toJSONString();
-		PurchaseApBillOut apBillOut = FlexJsonUtils.fromJson(json, PurchaseApBillOut.class);
-		if (apBillOut != null) {
-			for (PurchaseApBillOutItem item : apBillOut.getItems()) {
-				List<PurchaseApBillOutItem> items = purchaseApBillOutService
-						.findBySourceTableAndSourceId(item.getSourceTable(), item.getSourceId());
-				for (PurchaseApBillOutItem newitem : items) {
-					if (newitem.getApBillOut().getCheckStatus().equals("未开票")) {
-						alters.add(newitem.getApBillOut().getCode());
-					}
-				}
-			}
-			if (alters.size() > 0) {
-				map.put("alters", alters);
-				throw new IllegalOperatorException("开票单" + alters + "存在未开票的单据,请先进行开票!");
-			} else {
-				apBillOut = purchaseApBillOutService.save(apBillOut,sourceInfoList);
-
-				logger.log("开票单", "多个单据生成同一张开票单", apBillOut.getRemark(), null, apBillOut.getId());
-				map.put("id", apBillOut.getId());
-				return map;
-			}
-		} else {
-			throw new IllegalOperatorException("保存失败!");
-		}
-	}
-
-	/**
-	 * 获得开票单,对应id
-	 * 
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
-	@ResponseBody
-	public PurchaseApBillOut getCreatedPurchaseApBillOutById(@PathVariable("id") Long id) {
-		logger.log("开票单", "查看单个开票单", null, null, id);
-		return purchaseApBillOutService.findById(id);
-	}
-
-	/**
-	 * 作为卖家,获取全部开票单(全部)
-	 * 
-	 * @param params
-	 * @param searchFilter
-	 * @return
-	 */
-	@RequestMapping(method = RequestMethod.GET)
-	@ResponseBody
-	public SPage<PurchaseApBillOut> getAllApBillOuts(PageParams params, String searchFilter) {
-		logger.log("开票单", "获取全部开票单据");
-		JSONObject jsonObject = JSONObject.parseObject(searchFilter);
-		String keyword = jsonObject.getString("keyword");
-		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
-		// 当前登录企业作为买家
-		pageParams.getFilters().put("pabo_enuu", SystemSession.getUser().getEnterprise().getUu());
-		// TODO 其他过滤条件
-		SearchFilter filter = userService.distribute();
-		if (filter != null && filter.getDistribute() == null) {
-			return null;
-		}
-		if (filter != null && !CollectionUtils.isEmpty(filter.getDistribute())) {
-			List<Object> list = new ArrayList<>();
-			for (Object object : filter.getDistribute()) {
-				list.add(object);
-			}
-			pageParams.getFilters().put("pabo_custuu", new MultiValue(list, true));
-		}
-		// 排序条件
-		List<Sort> sortList = new ArrayList<>();
-		sortList.add(new Sort("pabo_id", false, Type.INT, new Long(1)));
-		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
-		return searchService.searchPurchaseApBillOutIds(keyword, pageParams);
-	}
-
-	/**
-	 * 作为卖家,获取开票单(未开票)
-	 */
-	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
-	@ResponseBody
-	public SPage<PurchaseApBillOut> getTodoApBillOuts(PageParams params, String searchFilter) {
-		logger.log("开票单", "获取未开票的开票单据");
-		JSONObject jsonObject = JSONObject.parseObject(searchFilter);
-		String keyword = jsonObject.getString("keyword");
-		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
-		// 当前登录企业作为买家
-		pageParams.getFilters().put("pabo_enuu", SystemSession.getUser().getEnterprise().getUu());
-		// TODO 其他过滤条件
-		SearchFilter filter = userService.distribute();
-		if (filter != null && filter.getDistribute() == null) {
-			return null;
-		}
-		if (filter != null && !CollectionUtils.isEmpty(filter.getDistribute())) {
-			List<Object> list = new ArrayList<>();
-			for (Object object : filter.getDistribute()) {
-				list.add(object);
-			}
-			pageParams.getFilters().put("pabo_custuu", new MultiValue(list, true));
-		}
-		pageParams.getFilters().put("pabo_checkstatus", "未开票");
-		// 排序条件
-		List<Sort> sortList = new ArrayList<>();
-		// 如果日期为空,设置的默认时间2000/1/1 1:1:1
-		sortList.add(new Sort("pabo_recorddate", false, Type.LONG, new Long(946659661)));
-		sortList.add(new Sort("pabo_id", false, Type.INT, new Long(1)));
-		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
-		return searchService.searchPurchaseApBillOutIds(keyword, pageParams);
-	}
-
-	/**
-	 * 作为卖家,获取开票单(已开票)
-	 */
-	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
-	@ResponseBody
-	public SPage<PurchaseApBillOut> getDoneApBillOuts(PageParams params, String searchFilter) {
-		logger.log("开票单", "获取已开票的开票单据");
-		JSONObject jsonObject = JSONObject.parseObject(searchFilter);
-		String keyword = jsonObject.getString("keyword");
-		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
-		// 当前登录企业作为买家
-		pageParams.getFilters().put("pabo_enuu", SystemSession.getUser().getEnterprise().getUu());
-		// TODO 其他过滤条件
-		SearchFilter filter = userService.distribute();
-		if (filter != null && filter.getDistribute() == null) {
-			return null;
-		}
-		if (filter != null && !CollectionUtils.isEmpty(filter.getDistribute())) {
-			List<Object> list = new ArrayList<>();
-			for (Object object : filter.getDistribute()) {
-				list.add(object);
-			}
-			pageParams.getFilters().put("pabo_custuu", new MultiValue(list, true));
-		}
-		pageParams.getFilters().put("pabo_checkstatus", "已开票");
-		// 排序条件
-		List<Sort> sortList = new ArrayList<>();
-		sortList.add(new Sort("pabo_id", false, Type.INT, new Long(1)));
-		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
-		return searchService.searchPurchaseApBillOutIds(keyword, pageParams);
-	}
-
-	/**
-	 * 作为卖家,获取开票单(已作废)
-	 */
-	@RequestMapping(params = RequestState.END, method = RequestMethod.GET)
-	@ResponseBody
-	public SPage<PurchaseApBillOut> getEndApBillOuts(PageParams params, String searchFilter) {
-		logger.log("开票单", "获取已作废开票单据");
-		JSONObject jsonObject = JSONObject.parseObject(searchFilter);
-		String keyword = jsonObject.getString("keyword");
-		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, searchFilter);
-		// 当前登录企业作为买家
-		pageParams.getFilters().put("pabo_enuu", SystemSession.getUser().getEnterprise().getUu());
-		// TODO 其他过滤条件
-		SearchFilter filter = userService.distribute();
-		if (filter != null && filter.getDistribute() == null) {
-			return null;
-		}
-		if (filter != null && !CollectionUtils.isEmpty(filter.getDistribute())) {
-			List<Object> list = new ArrayList<>();
-			for (Object object : filter.getDistribute()) {
-				list.add(object);
-			}
-			pageParams.getFilters().put("pabo_custuu", new MultiValue(list, true));
-		}
-		List<Object> list = new ArrayList<>();
-		//list.add("不同意");
-		list.add("已作废");
-		pageParams.getFilters().put("pabo_checkstatus", new MultiValue(list, true));
-		// 排序条件
-		List<Sort> sortList = new ArrayList<>();
-		sortList.add(new Sort("pabo_id", false, Type.INT, new Long(1)));
-		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
-		return searchService.searchPurchaseApBillOutIds(keyword, pageParams);
-	}
-
-	/**
-	 * 导出 - 全部
-	 * 
-	 * @param searchFilter
-	 * @return
-	 */
-	@RequestMapping(value = "/allxls", method = RequestMethod.GET)
-	public ModelAndView exportApBillOut(String searchFilter) {
-		SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
-		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
-		pageInfo.sorting("recordDate", Direction.DESC);
-		pageInfo.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
-		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
-		ModelAndView modelAndView = new ModelAndView();
-		modelAndView.addObject("dateFormat", dateFormat);
-		modelAndView.addObject("state", "全部");
-		modelAndView.addObject("data",
-				purchaseApBillOutService.findAllByPageInfo(pageInfo, filter.getKeyword(), filter).getContent());
-		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/faApBillOut", "开票单列表_全部"));
-		logger.log("开票单", "导出Excel列表", "导出全部Excel列表");
-		return modelAndView;
-	}
-
-	/**
-	 * 导出 - 已开票
-	 * 
-	 * @param searchFilter
-	 * @return
-	 */
-	@RequestMapping(value = "/allxls", params = RequestState.DONE, method = RequestMethod.GET)
-	public ModelAndView exportApBillOutDone(String searchFilter) {
-		SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
-		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
-		pageInfo.sorting("recordDate", Direction.DESC);
-		pageInfo.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
-		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
-		ModelAndView modelAndView = new ModelAndView();
-		modelAndView.addObject("dateFormat", dateFormat);
-		modelAndView.addObject("state", "已开票");
-		modelAndView.addObject("data",
-				purchaseApBillOutService.findDoneByPageInfo(pageInfo, filter.getKeyword(), filter).getContent());
-		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/faApBillOut", "开票单列表_已开票"));
-		logger.log("开票单", "导出Excel列表", "导出已开票Excel列表");
-		return modelAndView;
-	}
-
-	/**
-	 * 导出 - 未开票
-	 * 
-	 * @param searchFilter
-	 * @return
-	 */
-	@RequestMapping(value = "/allxls", params = RequestState.TODO, method = RequestMethod.GET)
-	public ModelAndView exportApBillOutTodo(String searchFilter) {
-		SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
-		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
-		pageInfo.sorting("recordDate", Direction.DESC);
-		pageInfo.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
-		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
-		ModelAndView modelAndView = new ModelAndView();
-		modelAndView.addObject("dateFormat", dateFormat);
-		modelAndView.addObject("state", "未开票");
-		modelAndView.addObject("data",
-				purchaseApBillOutService.findTodoByPageInfo(pageInfo, filter.getKeyword(), filter).getContent());
-		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/faApBillOut", "开票单列表_未开票"));
-		logger.log("开票单", "导出Excel列表", "导出未开票Excel列表");
-		return modelAndView;
-	}
-
-	/**
-	 * 导出 - 已作废
-	 * 
-	 * @param searchFilter
-	 * @return
-	 */
-	@RequestMapping(value = "/allxls", params = RequestState.END, method = RequestMethod.GET)
-	public ModelAndView exportApBillOutEnd(String searchFilter) {
-		SearchFilter filter = FlexJsonUtils.fromJson(searchFilter, SearchFilter.class);
-		PageInfo pageInfo = new PageInfo(1, JxlsExcelView.MAX_SIZE, 0);
-		pageInfo.sorting("recordDate", Direction.DESC);
-		pageInfo.filter("enUu", SystemSession.getUser().getEnterprise().getUu());
-		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
-		ModelAndView modelAndView = new ModelAndView();
-		modelAndView.addObject("dateFormat", dateFormat);
-		modelAndView.addObject("state", "已作废");
-		modelAndView.addObject("data",
-				purchaseApBillOutService.findEndByPageInfo(pageInfo, filter.getKeyword(), filter).getContent());
-		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/faApBillOut", "开票单列表_已作废"));
-		logger.log("开票单", "导出Excel列表", "导出已作废Excel列表");
-		return modelAndView;
-	}
-
-	/**
-	 * 全部导出
-	 * 
-	 * @param keyword
-	 * @param fromDate
-	 * @param endDate
-	 * @return
-	 */
-	@RequestMapping(value = "/xls", method = RequestMethod.GET)
-	public ModelAndView export(String keyword, Long fromDate, Long endDate) {
-		List<Long> distributes = null;
-		// 判断当前用户是否被客户分配
-		if (!SystemSession.getUser().isSys()) {
-			List<Vendor> vendors = userService.findChooseVendor(SystemSession.getUser().getUserUU());
-			distributes = new ArrayList<Long>();
-			if (!CollectionUtils.isEmpty(vendors)) {
-				for (Vendor v : vendors) {
-					distributes.add(v.getMyEnUU());
-				}
-			} else {
-				return null;
-			}
-		}
-		ModelAndView modelAndView = new ModelAndView();
-		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
-		modelAndView.addObject("dateFormat", dateFormat);
-		modelAndView.addObject("data", erpProdIODetailService.findXlsApChecks(distributes, keyword, fromDate, endDate));
-		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/fa/faApCheck", "客户应收对账单"));
-		logger.log("客户应收对账单", "导出Excel列表", "导出全部Excel列表");
-		return modelAndView;
-	}
-
-    @RequestMapping(value = "/doExcel", method = RequestMethod.GET)
-    @ResponseBody
-	public void doTaxCodeExcel() {
-		Workbook workbook = null;
-		InputStream is = null;
-		try {
-			is = new FileInputStream("C:\\Users\\黄诚天\\Desktop\\税收分类编码.xlsx");
-			workbook = new XSSFWorkbook(is);
-		} catch (java.io.IOException e) {
-			e.printStackTrace();
-		}
-
-		Sheet sheet = workbook.getSheetAt(0);
-		int rowNum = sheet.getLastRowNum();
-		Row headerRow = sheet.getRow(0);
-        DecimalFormat df = new DecimalFormat("#.##");
-		if (headerRow != null) {
-			for (int r = 1; r <= rowNum; r++) {
-				Row row = sheet.getRow(r);
-				if (row != null && row.getCell(0) != null && row.getCell(0).getCellType() != Cell.CELL_TYPE_BLANK) {
-					String a = "",b,c,d,e,f,g,h = "";
-
-					if (row.getCell(0) != null) {
-						row.getCell(0).setCellType(Cell.CELL_TYPE_STRING);
-						a = row.getCell(0).getStringCellValue().trim();
-
-                        a = df.format(Double.parseDouble(a));
-					}
-
-					if (row.getCell(1) != null) {
-						row.getCell(1).setCellType(Cell.CELL_TYPE_STRING);
-						b = row.getCell(1).getStringCellValue().trim();
-					} else {
-						b = "";
-					}
-
-					if (row.getCell(2) != null) {
-						row.getCell(2).setCellType(Cell.CELL_TYPE_STRING);
-						c = row.getCell(2).getStringCellValue().trim();
-					} else {
-						c = "";
-					}
-
-					if (row.getCell(3) != null) {
-						row.getCell(3).setCellType(Cell.CELL_TYPE_STRING);
-						d = row.getCell(3).getStringCellValue().trim();
-					} else {
-						d = "";
-					}
-
-					if (row.getCell(4) != null) {
-						row.getCell(4).setCellType(Cell.CELL_TYPE_STRING);
-						e = row.getCell(4).getStringCellValue().trim();
-					} else {
-						e = "";
-					}
-
-					if (row.getCell(5) != null) {
-						row.getCell(5).setCellType(Cell.CELL_TYPE_STRING);
-						f = row.getCell(5).getStringCellValue().trim();
-					} else {
-						f = "";
-					}
-
-					if (row.getCell(6) != null) {
-						row.getCell(6).setCellType(Cell.CELL_TYPE_STRING);
-						g = row.getCell(6).getStringCellValue().trim();
-					} else {
-						g = "";
-					}
-
-					if (row.getCell(7) != null) {
-						row.getCell(7).setCellType(Cell.CELL_TYPE_STRING);
-						h = row.getCell(7).getStringCellValue().trim();
-
-						h = df.format(Double.parseDouble(a));
-					}
-
-					//purchaseApBillOutDao.saveData(a,b,c,d,e,f,g,h);
-
-				}
-			}
-		}
-
-	}
-
-	/**
-	 * 删除未开票单
-	 * @param id
-	 */
-	@RequestMapping(value = "/deleteApBillOut/{id}", method = RequestMethod.GET)
-	@ResponseBody
-	public void deleteApBillOut(@PathVariable("id") Long id){
-		purchaseApBillOutService.deleteApBillOut(id);
-		logger.log("开票单", "删除开票单", null, null, id);
-	}
-
-	/**
-	 * 开具发票
-	 * @return
-	 */
-	@RequestMapping(value = "/invoiceIssued/{id}", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap invoiceIssued(@PathVariable("id") Long id) {
-		ModelMap map = new ModelMap();
-		map = purchaseApBillOutService.doBillOut(id);
-		if (map.get("dbError") != null) {
-			logger.log("开票单", "开具发票", (String)map.get("dbError"), null, id);
-		}
-		return map;
-	}
-
-	/**
-	 * 启动开票服务
-	 * @return
-	 */
-	@RequestMapping(value = "/startBillOut", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap startBillOut() {
-		ModelMap map = new ModelMap();
-		map = sOAPConsoleService.startBillOut();
-		return map;
-	}
-
-	/**
-	 * 关闭开票服务
-	 * @return
-	 */
-	@RequestMapping(value = "/closeBillOut", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap closeBillOut() {
-		ModelMap map = new ModelMap();
-		map = sOAPConsoleService.closeBillOut();
-		return map;
-	}
-
-	/**
-	 * 获取每种发票的库存信息
-	 * @return
-	 */
-	@RequestMapping(value = "/getRepertoryMessage", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap getRepertoryMessage() {
-		ModelMap map = new ModelMap();
-		map = sOAPConsoleService.getRepertoryMessage();
-		return map;
-	}
-
-	/**
-	 * 发票打印
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/invoicePrint/{id}", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap invoicePrint(@PathVariable("id") Long id){
-		ModelMap map = new ModelMap();
-		PurchaseApBillOut apBillOut = purchaseApBillOutService.findById(id);
-		if (apBillOut == null) {
-			map.put("error", "不存在此开票单");
-			return map;
-		}
-		map = sOAPConsoleService.invoicePrint(apBillOut, 0);
-		return map;
-	}
-
-
-	/**
-	 * 清单打印
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/listPrint/{id}", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap listPrint(@PathVariable("id") Long id){
-		ModelMap map = new ModelMap();
-		PurchaseApBillOut apBillOut = purchaseApBillOutService.findById(id);
-		if (apBillOut == null) {
-			map.put("error", "不存在此开票单");
-			return map;
-		}
-		map = sOAPConsoleService.listPrint(apBillOut);
-		return map;
-	}
-
-	/**
-	 * 发票作废
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/InvoiceCancel/{id}", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap InvoiceCancel(@PathVariable("id") Long id){
-		ModelMap map = new ModelMap();
-		PurchaseApBillOut apBillOut = purchaseApBillOutService.findById(id);
-		if (apBillOut == null) {
-			map.put("error", "不存在此开票单");
-			return map;
-		}
-		map = purchaseApBillOutService.invoiceCancel(apBillOut);//sOAPConsoleService.InvoiceCancel(apBillOut);
-		if (map.get("dbError") != null) {
-			logger.log("开票单", "开具发票", (String)map.get("dbError"), null, id);
-			map.remove("dbError");
-			map.put("error","开票失败,系统错误,请联系管理员");
-		}
-		return map;
-	}
-
-	/**
-	 * 查询发票信息
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/queryInvoiceMessage/{id}/{qdbz}/{dybz}", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap queryInvoiceMessage(@PathVariable("id") Long id,
-										@PathVariable("qdbz") Integer qdbz,
-										@PathVariable("dybz") Integer dybz){
-		ModelMap map = new ModelMap();
-		PurchaseApBillOut apBillOut = purchaseApBillOutService.findById(id);
-		if (apBillOut == null) {
-			map.put("error", "不存在此开票单");
-			return map;
-		}
-		map = sOAPConsoleService.queryInvoiceMessage(apBillOut,qdbz,dybz);
-		return map;
-	}
-
-	/**
-	 * 查询库存信息
-	 * @return
-	 */
-	@RequestMapping(value = "/queryRepertyMessage", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap queryRepertyMessage() {
-		ModelMap map = new ModelMap();
-		map = sOAPConsoleService.queryRepertyMessage();
-		return map;
-	}
-
-	/**
-	 * 查询下一发票机库存信息
-	 * @return
-	 */
-	@RequestMapping(value = "/queryNextRepertyMessage", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap queryNextRepertyMessage() {
-		ModelMap map = new ModelMap();
-		map = sOAPConsoleService.queryNextRepertyMessage();
-		return map;
-	}
-
-	/**
-	 * 发票上传
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/invoiceUpload/{id}", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap invoiceUpload(@PathVariable("id") Long id){
-		ModelMap map = new ModelMap();
-		PurchaseApBillOut apBillOut = purchaseApBillOutService.findById(id);
-		if (apBillOut == null) {
-			map.put("error", "不存在此开票单");
-			return map;
-		}
-		map = sOAPConsoleService.invoiceUpload(apBillOut);
-		return map;
-	}
-
-	/**
-	 * 发票状态更新
-	 * @return
-	 */
-	@RequestMapping(value = "/invoiceStatusUpdate", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap invoiceStatusUpdate() {
-		ModelMap map = new ModelMap();
-		map = sOAPConsoleService.invoiceStatusUpdate();
-		return map;
-	}
-
-	/**
-	 * 单张发票查询
-	 * @param id
-	 * @return
-	 */
-	@RequestMapping(value = "/singleInvoiceQuery/{id}", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap singleInvoiceQuery(@PathVariable("id") Long id){
-		ModelMap map = new ModelMap();
-		PurchaseApBillOut apBillOut = purchaseApBillOutService.findById(id);
-		if (apBillOut == null) {
-			map.put("error", "不存在此开票单");
-			return map;
-		}
-		map = sOAPConsoleService.singleInvoiceQuery(apBillOut);
-		return map;
-	}
-
-	/**
-	 * 金税设备查询
-	 * @return
-	 */
-	@RequestMapping(value = "/taxEquipmentQuery", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap taxEquipmentQuery(){
-		ModelMap map = new ModelMap();
-		map = sOAPConsoleService.taxEquipmentQuery();
-		return map;
-	}
-
-	/**
-	 * 获取分类编码信息
-	 * @param spbm
-	 * @param version
-	 * @return
-	 */
-	@RequestMapping(value = "/taxCode/{spbm}/{version}", method = RequestMethod.GET)
-	@ResponseBody
-	public ModelMap taxCode(@PathVariable("spbm") String spbm,
-										@PathVariable("version") String version){
-		ModelMap map = new ModelMap();
-		PurchaseApBillOutTaxCode taxCode = purchaseApBillOutService.getTaxCode(spbm, version);
-		if (taxCode == null) {
-			map.put("error", "不存在此分类信息,请尽快联系管理员");
-			return map;
-		}
-
-		//科学计数转数字
-		String spbmStr = taxCode.getSpbm();
-		BigDecimal db = new BigDecimal(spbmStr);
-		String ii = db.toPlainString();
-		Long spbmLong = Long.parseLong(ii);
-
-		//数字转科学计数
-		String spbmBackStr = new BigDecimal(spbmLong).stripTrailingZeros().toString();
-
-		map.put("taxCode", taxCode);
-		map.put("spbmstr", spbmStr);
-		map.put("spbmLong", spbmLong);
-		map.put("spbmBackStr", spbmBackStr);
-
-		return map;
-	}
-}

+ 0 - 18
src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutDao.java

@@ -1,18 +0,0 @@
-package com.uas.platform.b2b.dao;
-
-import com.uas.platform.b2b.model.PurchaseApBillOut;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.jpa.repository.query.Procedure;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface PurchaseApBillOutDao extends JpaSpecificationExecutor<PurchaseApBillOut>, JpaRepository<PurchaseApBillOut, Long> {
-
-    @Procedure(procedureName = "TAXCODE_INSERT")
-    public void  saveData(String a,String b,String c,String d,String e,String f,String g,String h,String i,String j,String k,String l,String m,String n,String o,String p,String q,String s);
-
-    public List<PurchaseApBillOut> findByEnUuAndCode(long enUU, String bi_code);
-}

+ 0 - 13
src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutDoneDao.java

@@ -1,13 +0,0 @@
-package com.uas.platform.b2b.dao;
-
-import com.uas.platform.b2b.model.PurchaseApBillOut;
-import com.uas.platform.b2b.model.PurchaseApBillOutDone;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface PurchaseApBillOutDoneDao extends JpaSpecificationExecutor<PurchaseApBillOutDone>, JpaRepository<PurchaseApBillOutDone, Long> {
-
-
-}

+ 0 - 13
src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutEndDao.java

@@ -1,13 +0,0 @@
-package com.uas.platform.b2b.dao;
-
-import com.uas.platform.b2b.model.PurchaseApBillOutDone;
-import com.uas.platform.b2b.model.PurchaseApBillOutEnd;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface PurchaseApBillOutEndDao extends JpaSpecificationExecutor<PurchaseApBillOutEnd>, JpaRepository<PurchaseApBillOutEnd, Long> {
-
-
-}

+ 0 - 20
src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutInfoDao.java

@@ -1,20 +0,0 @@
-package com.uas.platform.b2b.dao;
-
-import com.uas.platform.b2b.model.PurchaseApBillOutInfo;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.stereotype.Repository;
-
-/**
- * 企业开票信息
- */
-@Repository
-public interface PurchaseApBillOutInfoDao extends JpaSpecificationExecutor<PurchaseApBillOutInfo>, JpaRepository<PurchaseApBillOutInfo, Long> {
-    /**
-     * 按所属企业及编号查找企业开票信息
-     *
-     * @param Uu
-     * @return
-     */
-    public PurchaseApBillOutInfo findByUu(Long Uu);
-}

+ 0 - 26
src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutItemDao.java

@@ -1,26 +0,0 @@
-package com.uas.platform.b2b.dao;
-
-import com.uas.platform.b2b.model.PurchaseApBillOutItem;
-import com.uas.platform.b2b.model.PurchaseApCheckItem;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface PurchaseApBillOutItemDao
-		extends JpaSpecificationExecutor<PurchaseApBillOutItem>, JpaRepository<PurchaseApBillOutItem, Long> {
-
-	/**
-	 * 通过sourceTable、sourceId判断是否已提交未对账
-	 *
-	 * @param sourceTable
-	 * @param sourceId
-	 * @return
-	 */
-	public List<PurchaseApBillOutItem> findBySourceTableAndSourceId(String sourceTable, Long sourceId);
-
-}

+ 0 - 9
src/main/java/com/uas/platform/b2b/dao/PurchaseApBillOutTodoDao.java

@@ -1,9 +0,0 @@
-package com.uas.platform.b2b.dao;
-
-import com.uas.platform.b2b.model.PurchaseApBillOutTodo;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-
-public interface PurchaseApBillOutTodoDao extends JpaSpecificationExecutor<PurchaseApBillOutTodo>, JpaRepository<PurchaseApBillOutTodo, Long> {
-
-}

+ 0 - 53
src/main/java/com/uas/platform/b2b/erp/controller/BillOutController.java

@@ -1,53 +0,0 @@
-package com.uas.platform.b2b.erp.controller;
-
-import com.uas.platform.b2b.erp.model.BillOut;
-import com.uas.platform.b2b.erp.service.impl.BillOutService;
-import com.uas.platform.b2b.erp.support.ErpBufferedLogger;
-import com.uas.platform.b2b.service.PurchaseApBillOutService;
-import com.uas.platform.core.logging.BufferedLoggerManager;
-import com.uas.platform.core.util.serializer.FlexJsonUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.List;
-
-/**
- * 应收开票数据接口
- *
- * @author huangct
- * 
- */
-@Controller
-@RequestMapping("/erp/purchase/BillOut")
-public class BillOutController {
-
-	@Autowired
-	private PurchaseApBillOutService purchaseApBillOutService;
-	
-	@Autowired
-	private BillOutService billOutService;
-
-	private final static ErpBufferedLogger logger = BufferedLoggerManager.getLogger(ErpBufferedLogger.class);
-
-	/**
-	 * 将ERP的应收开票写到平台
-	 * 
-	 * @param data
-	 * @return
-	 * @throws UnsupportedEncodingException
-	 */
-	@RequestMapping(method = RequestMethod.POST)
-	@ResponseBody
-	public void saveApBills(@RequestParam("data") String data) throws UnsupportedEncodingException {
-		String jsonStr = URLDecoder.decode(data, "UTF-8");
-		List<BillOut> billOuts = FlexJsonUtils.fromJsonArray(jsonStr, BillOut.class);
-		purchaseApBillOutService.saveByItem(billOutService.convertBillOuts(billOuts));
-		logger.log("应收开票单", "上传应收开票单", billOuts.size());
-	}
-}

+ 0 - 489
src/main/java/com/uas/platform/b2b/erp/model/BillOut.java

@@ -1,489 +0,0 @@
-package com.uas.platform.b2b.erp.model;
-
-import com.uas.platform.b2b.model.Product;
-import com.uas.platform.b2b.model.PurchaseApBillOut;
-import com.uas.platform.b2b.model.PurchaseApBillOutInfo;
-import com.uas.platform.b2b.model.PurchaseApBillOutItem;
-import com.uas.platform.b2b.support.SystemSession;
-import org.springframework.util.CollectionUtils;
-
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * ERP应收开票主表数据
- * @author huangct
- * @date 2018年2月08日10:14:24
- *
- */
-public class BillOut {
-    private String bi_id;
-    private String bi_code;
-    private Date bi_date;
-    private String bi_custcode;
-    private String bi_custname;
-    private String bi_sellercode;
-    private String bi_seller;
-    private Double bi_amount;
-    private String bi_recorder;
-    private Date bi_indate;
-    private String bi_status;
-    private String bi_remark;
-    private String bi_cop;
-    private String bi_currency;
-    private Double bi_rate;
-    private String bi_vouchercode;
-    private String bi_costvouchercode;
-    private String bi_departmentcode;
-    private String bi_department;
-    private String bi_refno;
-    private String bi_salekind;
-    private Double bi_taxdiffer;
-    private Double bi_taxamount;
-    private String bi_salemethod;
-    private String bi_discountamount;
-    private String bi_discount;
-    private String bi_catecode;
-    private String bi_catename;
-    private String bi_setkind;
-    private String bi_sendkind;
-    private String bi_tradecode;
-    private String bi_tradename;
-    private String bi_pricekind;
-    private String bi_pidepartmentcode;
-    private String bi_pidepartmentname;
-    private String bi_statuscode;
-    private Date bi_auditdate;
-    private String bi_auditer;
-    private String bi_paymentscode;
-    private String bi_paymentsmethod;
-    private Double bi_payamount;
-    private Date bi_postdate;
-    private String bi_postman;
-    private String bi_thispayamount;
-    private Date bi_paydate;
-    private List<BillOutDetail> details;
-    private Long bi_custuu;
-
-    public String getBi_id() {
-        return bi_id;
-    }
-
-    public void setBi_id(String bi_id) {
-        this.bi_id = bi_id;
-    }
-
-    public String getBi_code() {
-        return bi_code;
-    }
-
-    public void setBi_code(String bi_code) {
-        this.bi_code = bi_code;
-    }
-
-    public Date getBi_date() {
-        return bi_date;
-    }
-
-    public void setBi_date(Date bi_date) {
-        this.bi_date = bi_date;
-    }
-
-    public String getBi_custcode() {
-        return bi_custcode;
-    }
-
-    public void setBi_custcode(String bi_custcode) {
-        this.bi_custcode = bi_custcode;
-    }
-
-    public String getBi_custname() {
-        return bi_custname;
-    }
-
-    public void setBi_custname(String bi_custname) {
-        this.bi_custname = bi_custname;
-    }
-
-    public String getBi_sellercode() {
-        return bi_sellercode;
-    }
-
-    public void setBi_sellercode(String bi_sellercode) {
-        this.bi_sellercode = bi_sellercode;
-    }
-
-    public String getBi_seller() {
-        return bi_seller;
-    }
-
-    public void setBi_seller(String bi_seller) {
-        this.bi_seller = bi_seller;
-    }
-
-    public Double getBi_amount() {
-        return bi_amount;
-    }
-
-    public void setBi_amount(Double bi_amount) {
-        this.bi_amount = bi_amount;
-    }
-
-    public String getBi_recorder() {
-        return bi_recorder;
-    }
-
-    public void setBi_recorder(String bi_recorder) {
-        this.bi_recorder = bi_recorder;
-    }
-
-    public Date getBi_indate() {
-        return bi_indate;
-    }
-
-    public void setBi_indate(Date bi_indate) {
-        this.bi_indate = bi_indate;
-    }
-
-    public String getBi_status() {
-        return bi_status;
-    }
-
-    public void setBi_status(String bi_status) {
-        this.bi_status = bi_status;
-    }
-
-    public String getBi_remark() {
-        return bi_remark;
-    }
-
-    public void setBi_remark(String bi_remark) {
-        this.bi_remark = bi_remark;
-    }
-
-    public String getBi_cop() {
-        return bi_cop;
-    }
-
-    public void setBi_cop(String bi_cop) {
-        this.bi_cop = bi_cop;
-    }
-
-    public String getBi_currency() {
-        return bi_currency;
-    }
-
-    public void setBi_currency(String bi_currency) {
-        this.bi_currency = bi_currency;
-    }
-
-    public Double getBi_rate() {
-        return bi_rate;
-    }
-
-    public void setBi_rate(Double bi_rate) {
-        this.bi_rate = bi_rate;
-    }
-
-    public String getBi_vouchercode() {
-        return bi_vouchercode;
-    }
-
-    public void setBi_vouchercode(String bi_vouchercode) {
-        this.bi_vouchercode = bi_vouchercode;
-    }
-
-    public String getBi_costvouchercode() {
-        return bi_costvouchercode;
-    }
-
-    public void setBi_costvouchercode(String bi_costvouchercode) {
-        this.bi_costvouchercode = bi_costvouchercode;
-    }
-
-    public String getBi_departmentcode() {
-        return bi_departmentcode;
-    }
-
-    public void setBi_departmentcode(String bi_departmentcode) {
-        this.bi_departmentcode = bi_departmentcode;
-    }
-
-    public String getBi_department() {
-        return bi_department;
-    }
-
-    public void setBi_department(String bi_department) {
-        this.bi_department = bi_department;
-    }
-
-    public String getBi_refno() {
-        return bi_refno;
-    }
-
-    public void setBi_refno(String bi_refno) {
-        this.bi_refno = bi_refno;
-    }
-
-    public String getBi_salekind() {
-        return bi_salekind;
-    }
-
-    public void setBi_salekind(String bi_salekind) {
-        this.bi_salekind = bi_salekind;
-    }
-
-    public Double getBi_taxdiffer() {
-        return bi_taxdiffer;
-    }
-
-    public void setBi_taxdiffer(Double bi_taxdiffer) {
-        this.bi_taxdiffer = bi_taxdiffer;
-    }
-
-    public Double getBi_taxamount() {
-        return bi_taxamount;
-    }
-
-    public void setBi_taxamount(Double bi_taxamount) {
-        this.bi_taxamount = bi_taxamount;
-    }
-
-    public String getBi_salemethod() {
-        return bi_salemethod;
-    }
-
-    public void setBi_salemethod(String bi_salemethod) {
-        this.bi_salemethod = bi_salemethod;
-    }
-
-    public String getBi_discountamount() {
-        return bi_discountamount;
-    }
-
-    public void setBi_discountamount(String bi_discountamount) {
-        this.bi_discountamount = bi_discountamount;
-    }
-
-    public String getBi_discount() {
-        return bi_discount;
-    }
-
-    public void setBi_discount(String bi_discount) {
-        this.bi_discount = bi_discount;
-    }
-
-    public String getBi_catecode() {
-        return bi_catecode;
-    }
-
-    public void setBi_catecode(String bi_catecode) {
-        this.bi_catecode = bi_catecode;
-    }
-
-    public String getBi_catename() {
-        return bi_catename;
-    }
-
-    public void setBi_catename(String bi_catename) {
-        this.bi_catename = bi_catename;
-    }
-
-    public String getBi_setkind() {
-        return bi_setkind;
-    }
-
-    public void setBi_setkind(String bi_setkind) {
-        this.bi_setkind = bi_setkind;
-    }
-
-    public String getBi_sendkind() {
-        return bi_sendkind;
-    }
-
-    public void setBi_sendkind(String bi_sendkind) {
-        this.bi_sendkind = bi_sendkind;
-    }
-
-    public String getBi_tradecode() {
-        return bi_tradecode;
-    }
-
-    public void setBi_tradecode(String bi_tradecode) {
-        this.bi_tradecode = bi_tradecode;
-    }
-
-    public String getBi_tradename() {
-        return bi_tradename;
-    }
-
-    public void setBi_tradename(String bi_tradename) {
-        this.bi_tradename = bi_tradename;
-    }
-
-    public String getBi_pricekind() {
-        return bi_pricekind;
-    }
-
-    public void setBi_pricekind(String bi_pricekind) {
-        this.bi_pricekind = bi_pricekind;
-    }
-
-    public String getBi_pidepartmentcode() {
-        return bi_pidepartmentcode;
-    }
-
-    public void setBi_pidepartmentcode(String bi_pidepartmentcode) {
-        this.bi_pidepartmentcode = bi_pidepartmentcode;
-    }
-
-    public String getBi_pidepartmentname() {
-        return bi_pidepartmentname;
-    }
-
-    public void setBi_pidepartmentname(String bi_pidepartmentname) {
-        this.bi_pidepartmentname = bi_pidepartmentname;
-    }
-
-    public String getBi_statuscode() {
-        return bi_statuscode;
-    }
-
-    public void setBi_statuscode(String bi_statuscode) {
-        this.bi_statuscode = bi_statuscode;
-    }
-
-    public Date getBi_auditdate() {
-        return bi_auditdate;
-    }
-
-    public void setBi_auditdate(Date bi_auditdate) {
-        this.bi_auditdate = bi_auditdate;
-    }
-
-    public String getBi_auditer() {
-        return bi_auditer;
-    }
-
-    public void setBi_auditer(String bi_auditer) {
-        this.bi_auditer = bi_auditer;
-    }
-
-    public String getBi_paymentscode() {
-        return bi_paymentscode;
-    }
-
-    public void setBi_paymentscode(String bi_paymentscode) {
-        this.bi_paymentscode = bi_paymentscode;
-    }
-
-    public String getBi_paymentsmethod() {
-        return bi_paymentsmethod;
-    }
-
-    public void setBi_paymentsmethod(String bi_paymentsmethod) {
-        this.bi_paymentsmethod = bi_paymentsmethod;
-    }
-
-    public Double getBi_payamount() {
-        return bi_payamount;
-    }
-
-    public void setBi_payamount(Double bi_payamount) {
-        this.bi_payamount = bi_payamount;
-    }
-
-    public Date getBi_postdate() {
-        return bi_postdate;
-    }
-
-    public void setBi_postdate(Date bi_postdate) {
-        this.bi_postdate = bi_postdate;
-    }
-
-    public String getBi_postman() {
-        return bi_postman;
-    }
-
-    public void setBi_postman(String bi_postman) {
-        this.bi_postman = bi_postman;
-    }
-
-    public String getBi_thispayamount() {
-        return bi_thispayamount;
-    }
-
-    public void setBi_thispayamount(String bi_thispayamount) {
-        this.bi_thispayamount = bi_thispayamount;
-    }
-
-    public Date getBi_paydate() {
-        return bi_paydate;
-    }
-
-    public void setBi_paydate(Date bi_paydate) {
-        this.bi_paydate = bi_paydate;
-    }
-
-    public List<BillOutDetail> getDetails() {
-        return details;
-    }
-
-    public void setDetails(List<BillOutDetail> details) {
-        this.details = details;
-    }
-
-    public Long getBi_custuu() {
-        return bi_custuu;
-    }
-
-    public void setBi_custuu(Long bi_custuu) {
-        this.bi_custuu = bi_custuu;
-    }
-
-    public PurchaseApBillOut convert(PurchaseApBillOutInfo customerApBillOutInfo, PurchaseApBillOutInfo apBillOutInfo, List<Product> products) {
-        PurchaseApBillOut purchaseApBillOut = new PurchaseApBillOut();
-        purchaseApBillOut.setTaxSum(this.bi_taxamount);
-        purchaseApBillOut.setDiffer(this.bi_taxdiffer);
-        purchaseApBillOut.setRecordDate(this.bi_indate);
-        purchaseApBillOut.setRecorder(this.bi_recorder);
-        purchaseApBillOut.setCheckStatus("未开票");//未开票 已开票 已作废
-        purchaseApBillOut.setRemark(this.bi_remark);
-        purchaseApBillOut.setAuditDate(this.bi_auditdate);
-        //purchaseApBillOut.setResDate(null);//作废日期
-        //purchaseApBillOut.setResMan(null);//作废人
-        //purchaseApBillOut.setStatus(null);//状态 short
-        purchaseApBillOut.setAmount(this.bi_amount);
-        purchaseApBillOut.setPayAmount(this.bi_payamount);
-        purchaseApBillOut.setCurrency(this.bi_currency);
-        purchaseApBillOut.setRate(this.bi_rate);
-        //客户企业开票信息
-        purchaseApBillOut.setCustUu(this.bi_custuu);
-        if (customerApBillOutInfo != null) {
-            purchaseApBillOut.setCustomerApBillOutInfo(customerApBillOutInfo);
-        }
-        purchaseApBillOut.setCustName(this.bi_custname);
-        //当前企业开票信息
-        purchaseApBillOut.setEnUu(SystemSession.getUser().getEnterprise().getUu());
-        if (apBillOutInfo != null) {
-            purchaseApBillOut.setApBillOutInfo(apBillOutInfo);
-        }
-        purchaseApBillOut.setCode(this.bi_code);
-        //purchaseApBillOut.setPrint(null);//打印次数
-
-        if (!CollectionUtils.isEmpty(this.details)) {
-            Set<PurchaseApBillOutItem> purchaseApBillOutItems = new HashSet<PurchaseApBillOutItem>();
-            for (BillOutDetail billOutDetail : this.details) {
-                for (Product product : products) {
-                    if (SystemSession.getUser().getEnterprise().getUu().equals(product.getEnUU()) && billOutDetail.getArd_prodcode().equals(product.getCode())) {
-                        purchaseApBillOutItems.add(billOutDetail.convert(product));
-                    }
-                }
-            }
-            purchaseApBillOut.setItems(purchaseApBillOutItems);
-        }
-        return purchaseApBillOut;
-    }
-}

+ 0 - 353
src/main/java/com/uas/platform/b2b/erp/model/BillOutDetail.java

@@ -1,353 +0,0 @@
-package com.uas.platform.b2b.erp.model;
-
-import com.uas.platform.b2b.model.Product;
-import com.uas.platform.b2b.model.PurchaseApBillOutItem;
-
-/**
- * ERP应收开票从表数据
- * @author huangct
- * @date 2018年2月08日10:24:24
- *
- */
-public class BillOutDetail {
-    private String ard_id;
-    private String ard_biid;
-    private Short ard_detno;
-    private String ard_code;
-    private String ard_ordercode;
-    private Double ard_orderamount;
-    private String ard_aramount;
-    private String ard_havepay;
-    private Double ard_nowbalance;
-    private String ard_remark;
-    private String ard_description;
-    private String ard_emcode;
-    private String ard_catecode;
-    private String ard_diffamount;
-    private Long ard_orderdetno;
-    private String ard_prodcode;
-    private Double ard_nowqty;
-    private Double ard_qty;
-    private Double ard_price;
-    private Double ard_costprice;
-    private Double ard_taxrate;
-    private Double ard_nowprice;
-    private String ard_taxamount;
-    private String ard_discount;
-    private String ard_discountamount;
-    private String ard_status;
-    private String ard_statuscode;
-    private String ard_billprice;
-    private String ard_arprice;
-    private String ard_discountnetamount;
-    private String ard_discounttaxamount;
-    private Long ard_orderid;
-    private String ard_poststatus;
-    private String ard_adid;
-    private String ard_tempamount;
-
-    public String getArd_id() {
-        return ard_id;
-    }
-
-    public void setArd_id(String ard_id) {
-        this.ard_id = ard_id;
-    }
-
-    public String getArd_biid() {
-        return ard_biid;
-    }
-
-    public void setArd_biid(String ard_biid) {
-        this.ard_biid = ard_biid;
-    }
-
-    public Short getArd_detno() {
-        return ard_detno;
-    }
-
-    public void setArd_detno(Short ard_detno) {
-        this.ard_detno = ard_detno;
-    }
-
-    public String getArd_code() {
-        return ard_code;
-    }
-
-    public void setArd_code(String ard_code) {
-        this.ard_code = ard_code;
-    }
-
-    public String getArd_ordercode() {
-        return ard_ordercode;
-    }
-
-    public void setArd_ordercode(String ard_ordercode) {
-        this.ard_ordercode = ard_ordercode;
-    }
-
-    public Double getArd_orderamount() {
-        return ard_orderamount;
-    }
-
-    public void setArd_orderamount(Double ard_orderamount) {
-        this.ard_orderamount = ard_orderamount;
-    }
-
-    public String getArd_aramount() {
-        return ard_aramount;
-    }
-
-    public void setArd_aramount(String ard_aramount) {
-        this.ard_aramount = ard_aramount;
-    }
-
-    public String getArd_havepay() {
-        return ard_havepay;
-    }
-
-    public void setArd_havepay(String ard_havepay) {
-        this.ard_havepay = ard_havepay;
-    }
-
-    public Double getArd_nowbalance() {
-        return ard_nowbalance;
-    }
-
-    public void setArd_nowbalance(Double ard_nowbalance) {
-        this.ard_nowbalance = ard_nowbalance;
-    }
-
-    public String getArd_remark() {
-        return ard_remark;
-    }
-
-    public void setArd_remark(String ard_remark) {
-        this.ard_remark = ard_remark;
-    }
-
-    public String getArd_description() {
-        return ard_description;
-    }
-
-    public void setArd_description(String ard_description) {
-        this.ard_description = ard_description;
-    }
-
-    public String getArd_emcode() {
-        return ard_emcode;
-    }
-
-    public void setArd_emcode(String ard_emcode) {
-        this.ard_emcode = ard_emcode;
-    }
-
-    public String getArd_catecode() {
-        return ard_catecode;
-    }
-
-    public void setArd_catecode(String ard_catecode) {
-        this.ard_catecode = ard_catecode;
-    }
-
-    public String getArd_diffamount() {
-        return ard_diffamount;
-    }
-
-    public void setArd_diffamount(String ard_diffamount) {
-        this.ard_diffamount = ard_diffamount;
-    }
-
-    public Long getArd_orderdetno() {
-        return ard_orderdetno;
-    }
-
-    public void setArd_orderdetno(Long ard_orderdetno) {
-        this.ard_orderdetno = ard_orderdetno;
-    }
-
-    public String getArd_prodcode() {
-        return ard_prodcode;
-    }
-
-    public void setArd_prodcode(String ard_prodcode) {
-        this.ard_prodcode = ard_prodcode;
-    }
-
-    public Double getArd_nowqty() {
-        return ard_nowqty;
-    }
-
-    public void setArd_nowqty(Double ard_nowqty) {
-        this.ard_nowqty = ard_nowqty;
-    }
-
-    public Double getArd_qty() {
-        return ard_qty;
-    }
-
-    public void setArd_qty(Double ard_qty) {
-        this.ard_qty = ard_qty;
-    }
-
-    public Double getArd_price() {
-        return ard_price;
-    }
-
-    public void setArd_price(Double ard_price) {
-        this.ard_price = ard_price;
-    }
-
-    public Double getArd_costprice() {
-        return ard_costprice;
-    }
-
-    public void setArd_costprice(Double ard_costprice) {
-        this.ard_costprice = ard_costprice;
-    }
-
-    public Double getArd_taxrate() {
-        return ard_taxrate;
-    }
-
-    public void setArd_taxrate(Double ard_taxrate) {
-        this.ard_taxrate = ard_taxrate;
-    }
-
-    public Double getArd_nowprice() {
-        return ard_nowprice;
-    }
-
-    public void setArd_nowprice(Double ard_nowprice) {
-        this.ard_nowprice = ard_nowprice;
-    }
-
-    public String getArd_taxamount() {
-        return ard_taxamount;
-    }
-
-    public void setArd_taxamount(String ard_taxamount) {
-        this.ard_taxamount = ard_taxamount;
-    }
-
-    public String getArd_discount() {
-        return ard_discount;
-    }
-
-    public void setArd_discount(String ard_discount) {
-        this.ard_discount = ard_discount;
-    }
-
-    public String getArd_discountamount() {
-        return ard_discountamount;
-    }
-
-    public void setArd_discountamount(String ard_discountamount) {
-        this.ard_discountamount = ard_discountamount;
-    }
-
-    public String getArd_status() {
-        return ard_status;
-    }
-
-    public void setArd_status(String ard_status) {
-        this.ard_status = ard_status;
-    }
-
-    public String getArd_statuscode() {
-        return ard_statuscode;
-    }
-
-    public void setArd_statuscode(String ard_statuscode) {
-        this.ard_statuscode = ard_statuscode;
-    }
-
-    public String getArd_billprice() {
-        return ard_billprice;
-    }
-
-    public void setArd_billprice(String ard_billprice) {
-        this.ard_billprice = ard_billprice;
-    }
-
-    public String getArd_arprice() {
-        return ard_arprice;
-    }
-
-    public void setArd_arprice(String ard_arprice) {
-        this.ard_arprice = ard_arprice;
-    }
-
-    public String getArd_discountnetamount() {
-        return ard_discountnetamount;
-    }
-
-    public void setArd_discountnetamount(String ard_discountnetamount) {
-        this.ard_discountnetamount = ard_discountnetamount;
-    }
-
-    public String getArd_discounttaxamount() {
-        return ard_discounttaxamount;
-    }
-
-    public void setArd_discounttaxamount(String ard_discounttaxamount) {
-        this.ard_discounttaxamount = ard_discounttaxamount;
-    }
-
-    public Long getArd_orderid() {
-        return ard_orderid;
-    }
-
-    public void setArd_orderid(Long ard_orderid) {
-        this.ard_orderid = ard_orderid;
-    }
-
-    public String getArd_poststatus() {
-        return ard_poststatus;
-    }
-
-    public void setArd_poststatus(String ard_poststatus) {
-        this.ard_poststatus = ard_poststatus;
-    }
-
-    public String getArd_adid() {
-        return ard_adid;
-    }
-
-    public void setArd_adid(String ard_adid) {
-        this.ard_adid = ard_adid;
-    }
-
-    public String getArd_tempamount() {
-        return ard_tempamount;
-    }
-
-    public void setArd_tempamount(String ard_tempamount) {
-        this.ard_tempamount = ard_tempamount;
-    }
-
-    public PurchaseApBillOutItem convert(Product product) {
-        PurchaseApBillOutItem purchaseApBillOutItem = new PurchaseApBillOutItem();
-        purchaseApBillOutItem.setNumber(this.ard_detno);
-        //purchaseApBillOutItem.setStatus(null);//状态?
-        //purchaseApBillOutItem.setStatusCode(null);//状态码?
-        purchaseApBillOutItem.setNowPrice(this.ard_nowprice);//开票单价
-        //ard_nowbalance  开票金额
-        //ard_orderamount  发票金额
-        purchaseApBillOutItem.setCostPrice(this.ard_costprice);
-        purchaseApBillOutItem.setPrice(this.ard_price);//发票单价
-        purchaseApBillOutItem.setTaxrate(this.ard_taxrate);
-        purchaseApBillOutItem.setQty(this.ard_qty);
-        purchaseApBillOutItem.setNowQty(this.ard_nowqty);
-        purchaseApBillOutItem.setProduct(product);
-        purchaseApBillOutItem.setPrid(product.getId());
-        purchaseApBillOutItem.setProdCode(this.ard_prodcode);
-        purchaseApBillOutItem.setOrderCode(this.ard_ordercode);//发票单号  客户订单单号  ??
-        purchaseApBillOutItem.setOrderDetno(this.ard_orderdetno);
-        purchaseApBillOutItem.setCode(this.ard_code);
-        purchaseApBillOutItem.setOrderId(this.ard_orderid);//发票id  ??
-        //purchaseApBillOutItem.setOldQty(); //已开票数量 ??
-
-        return purchaseApBillOutItem;
-    }
-}

+ 0 - 17
src/main/java/com/uas/platform/b2b/erp/service/impl/BillOutService.java

@@ -1,17 +0,0 @@
-package com.uas.platform.b2b.erp.service.impl;
-
-import com.uas.platform.b2b.erp.model.BillOut;
-import com.uas.platform.b2b.model.PurchaseApBillOutItem;
-
-import java.util.List;
-
-public interface BillOutService {
-
-	/**
-	 * 将ERP系统的应收开票单,转为平台的应收开票单
-	 * 
-	 * @param billOuts
-	 * @return
-	 */
-	List<PurchaseApBillOutItem> convertBillOuts(List<BillOut> billOuts);
-}

+ 0 - 81
src/main/java/com/uas/platform/b2b/erp/service/impl/BillOutServiceImpl.java

@@ -1,81 +0,0 @@
-package com.uas.platform.b2b.erp.service.impl;
-
-import com.uas.platform.b2b.dao.ProductDao;
-import com.uas.platform.b2b.dao.PurchaseApBillOutDao;
-import com.uas.platform.b2b.dao.PurchaseApBillOutInfoDao;
-import com.uas.platform.b2b.erp.model.BillOut;
-import com.uas.platform.b2b.erp.model.BillOutDetail;
-import com.uas.platform.b2b.model.Product;
-import com.uas.platform.b2b.model.PurchaseApBillOut;
-import com.uas.platform.b2b.model.PurchaseApBillOutInfo;
-import com.uas.platform.b2b.model.PurchaseApBillOutItem;
-import com.uas.platform.b2b.support.SystemSession;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.CollectionUtils;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-@Service
-public class BillOutServiceImpl implements BillOutService {
-
-	@Autowired
-	private PurchaseApBillOutDao purchaseApBillOutDao;
-
-	@Autowired
-	private ProductDao productDao;
-
-	@Autowired
-	private PurchaseApBillOutInfoDao purchaseApBillOutInfoDao;
-
-
-	@Override
-	public List<PurchaseApBillOutItem> convertBillOuts(List<BillOut> billOuts) {
-		List<PurchaseApBillOutItem> apBillItems = new ArrayList<PurchaseApBillOutItem>();
-		long enUU = SystemSession.getUser().getEnterprise().getUu();
-		for (BillOut billOut : billOuts) {
-			List<PurchaseApBillOut> billOuts2 = purchaseApBillOutDao.findByEnUuAndCode(enUU, billOut.getBi_code());
-			//Enterprise vendor = enterpriseDao.findEnterpriseByUu(billOut.getAb_vendoruu());
-			if (billOuts2.size() == 0) {
-				Long custuu = billOut.getBi_custuu();
-				PurchaseApBillOutInfo customerApBillOutInfo = null;
-				PurchaseApBillOutInfo apBillOutInfo = purchaseApBillOutInfoDao.findByUu(enUU);
-				if (custuu != null) {
-					customerApBillOutInfo = purchaseApBillOutInfoDao.findByUu(custuu);
-				}
-
-				//获取物料
-				List<BillOutDetail> billOutDetails = billOut.getDetails();
-				List<Product> billOutProducts = new ArrayList<>();
-				if (!CollectionUtils.isEmpty(billOutDetails)) {
-					for (BillOutDetail billOutDetail : billOutDetails) {
-						List<Product> products = productDao.findByEnUUAndCode(enUU, billOutDetail.getArd_prodcode());
-						if (!CollectionUtils.isEmpty(products)) {
-							billOutProducts.add(products.get(0));
-						}
-					}
-				}
-
-
-				PurchaseApBillOut purchaseApBillOut = billOut.convert(customerApBillOutInfo, apBillOutInfo, billOutProducts);
-				Iterator<PurchaseApBillOutItem> items = purchaseApBillOut.getItems().iterator();
-				while (items.hasNext()) {
-					PurchaseApBillOutItem purchaseApBillOutItem = items.next();
-					List<Product> products = productDao.findByEnUUAndCode(enUU, purchaseApBillOutItem.getProduct().getCode());
-					if (products.size() > 0) {
-						purchaseApBillOutItem.setProduct(products.get(0));
-						purchaseApBillOutItem.setPrid(products.get(0).getId());
-						purchaseApBillOutItem.setApBillOut(purchaseApBillOut);
-						//TODO purchaseApBillOutItem.setErpDate(new Date());
-						apBillItems.add(purchaseApBillOutItem);
-					} else {
-						items.remove();
-					}
-				}
-			}
-		}
-		return apBillItems;
-	}
-}

+ 0 - 571
src/main/java/com/uas/platform/b2b/model/PurchaseApBillOut.java

@@ -1,571 +0,0 @@
-package com.uas.platform.b2b.model;
-
-import javax.persistence.*;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * ...
- */
-@Entity
-@Table(name = "purc$apbillout")
-public class PurchaseApBillOut implements Serializable {
-
-	/**
-	 * 序列号
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.AUTO)
-	@Column(name = "pabo_id")
-	private Long id;
-
-	/**
-	 * 税金合计
-	 */
-	@Column(name = "pabo_taxsum")
-	private Double taxSum;
-
-	/**
-	 * 税金差异
-	 */
-	@Column(name = "pabo_differ")
-	private Double differ;
-
-	/**
-	 * 对账起始日期
-	 */
-	@Column(name = "pabo_begindate")
-	private Date beginDate;
-
-	/**
-	 * 对账截止日期
-	 */
-	@Column(name = "pabo_enddate")
-	private Date endDate;
-
-	/**
-	 * 录单日期
-	 */
-	@Column(name = "pabo_recorddate")
-	private Date recordDate;
-
-	/**
-	 * 录单人
-	 */
-	@Column(name = "pabo_recorder")
-	private String recorder;
-
-
-	/**
-	 * 开票状态
-	 */
-	@Column(name = "pabo_checkstatus")
-	private String checkStatus;
-
-	/**
-	 * 备注
-	 */
-	@Column(name = "pabo_remark")
-	private String remark;
-
-	/**
-	 * 提交日期
-	 */
-	@Column(name = "pabo_auditdate")
-	private Date auditDate;
-
-	/**
-	 * 作废日期
-	 */
-	@Column(name = "pabo_resdate")
-	private Date resDate;
-
-	/**
-	 * 作废人
-	 */
-	@Column(name = "pabo_resman")
-	private String resMan;
-
-	/**
-	 * 状态
-	 */
-	@Column(name = "pabo_status")
-	private Short status;
-
-	/**
-	 * 开票金额
-	 */
-	@Column(name = "pabo_amount")
-	private Double amount;
-
-	/**
-	 * 已付款金额
-	 */
-	@Column(name = "pabo_payamount")
-	private Double payAmount;
-
-	/**
-	 * 币别
-	 */
-	@Column(name = "pabo_currency")
-	private String currency;
-
-	/**
-	 * 汇率
-	 */
-	@Column(name = "pabo_rate")
-	private Double rate;
-
-	@OneToOne(cascade = { CascadeType.REFRESH })
-	@JoinColumn(name = "pabo_custuu", insertable = false, updatable = false)
-	private PurchaseApBillOutInfo customerApBillOutInfo;
-
-	/**
-	 * 客户UU
-	 */
-	@Column(name = "pabo_custuu")
-	private Long custUu;
-
-	/**
-	 * 客户名称
-	 */
-	@Column(name = "pabo_custname")
-	private String custName;
-
-	@OneToOne(cascade = { CascadeType.REFRESH })
-	@JoinColumn(name = "pabo_enuu", insertable = false, updatable = false)
-	private PurchaseApBillOutInfo apBillOutInfo;
-
-	/**
-	 * 本企业UU
-	 */
-	@Column(name = "pabo_enuu")
-	private Long enUu;
-
-	/**
-	 * 单据编号
-	 */
-	@Column(name = "pabo_code")
-	private String code;
-
-	/**
-	 * 打印次数
-	 */
-	@Column(name = "pabo_print")
-	private Short print;
-
-	/**
-	 * 开票单明细行
-	 */
-	@OneToMany(mappedBy = "apBillOut", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE,
-			CascadeType.MERGE }, fetch = FetchType.EAGER)
-	@OrderBy("number")
-	private Set<PurchaseApBillOutItem> items;
-
-
-	//以下为开票接口返回信息
-
-	/**
-	 * 返回信息
-	 */
-	@Column(name = "pabo_retmsg")
-	private String retmsg;
-
-	/**
-	 * 开具的金额
-	 */
-	@Column(name = "pabo_infoamount")
-	private Double infoAmount;
-
-	/**
-	 * 开具的税额
-	 */
-	@Column(name = "pabo_infotaxamount")
-	private Double infoTaxAmount;
-
-	/**
-	 * 开票日期(格式:yyyy-mm-dd)
-	 */
-	@Column(name = "pabo_infodate")
-	private String infoDate;
-
-	/**
-	 * 开具的发票代码
-	 */
-	@Column(name = "pabo_infotypecode")
-	private String infoTypeCode;
-
-	/**
-	 * 开具的发票号码
-	 */
-	@Column(name = "pabo_infonumber")
-	private String infoNumber;
-
-	/**
-	 * 上一张发票代码
-	 */
-	@Column(name = "pabo_hisinfotypecode")
-	private String hisInfoTypeCode;
-
-	/**
-	 * 上一张发票号码
-	 */
-	@Column(name = "pabo_hisinfonumber")
-	private String hisInfoNumber;
-
-	/**
-	 * 上一张发票种类
-	 */
-	@Column(name = "pabo_hisinfokind")
-	private String hisInfoKind;
-
-	/**
-	 * 清单标志 0:非清单发票 1:清单发票
-	 */
-	@Column(name = "pabo_listflag")
-	private Integer listFlag;
-
-	/**
-	 * 销方税号
-	 */
-	@Column(name = "pabo_nsrsbh")
-	private String nsrsbh;
-
-	/**
-	 * 开票服务器号
-	 */
-	@Column(name = "pabo_kpfwqh")
-	private String kpfwqh;
-
-	/**
-	 * 开票点号
-	 */
-	@Column(name = "pabo_kpdh")
-	private String kpdh;
-
-	//票加加字段
-
-	/**
-	 * 请求流水号
-	 * @return
-	 */
-	@Column(name = "request_code")
-	private String requestCode;
-
-	/**
-	 * 是否允许重开  0允许,1不允许
-	 * @return
-	 */
-	@Column(name = "reissue")
-	private String reissue;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Double getTaxSum() {
-		return taxSum;
-	}
-
-	public void setTaxSum(Double taxSum) {
-		this.taxSum = taxSum;
-	}
-
-	public Double getDiffer() {
-		return differ;
-	}
-
-	public void setDiffer(Double differ) {
-		this.differ = differ;
-	}
-
-	public Date getRecordDate() {
-		return recordDate;
-	}
-
-	public void setRecordDate(Date recordDate) {
-		this.recordDate = recordDate;
-	}
-
-	public String getRecorder() {
-		return recorder;
-	}
-
-	public void setRecorder(String recorder) {
-		this.recorder = recorder;
-	}
-
-	public String getCheckStatus() {
-		return checkStatus;
-	}
-
-	public void setCheckStatus(String checkStatus) {
-		this.checkStatus = checkStatus;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Date getAuditDate() {
-		return auditDate;
-	}
-
-	public void setAuditDate(Date auditDate) {
-		this.auditDate = auditDate;
-	}
-
-	public Date getResDate() {
-		return resDate;
-	}
-
-	public void setResDate(Date resDate) {
-		this.resDate = resDate;
-	}
-
-	public String getResMan() {
-		return resMan;
-	}
-
-	public void setResMan(String resMan) {
-		this.resMan = resMan;
-	}
-
-	public Short getStatus() {
-		return status;
-	}
-
-	public void setStatus(Short status) {
-		this.status = status;
-	}
-
-	public Double getAmount() {
-		return amount;
-	}
-
-	public void setAmount(Double amount) {
-		this.amount = amount;
-	}
-
-	public Double getPayAmount() {
-		return payAmount;
-	}
-
-	public void setPayAmount(Double payAmount) {
-		this.payAmount = payAmount;
-	}
-
-	public String getCurrency() {
-		return currency;
-	}
-
-	public void setCurrency(String currency) {
-		this.currency = currency;
-	}
-
-	public Double getRate() {
-		return rate;
-	}
-
-	public void setRate(Double rate) {
-		this.rate = rate;
-	}
-
-	public Long getCustUu() {
-		return custUu;
-	}
-
-	public void setCustUu(Long custUu) {
-		this.custUu = custUu;
-	}
-
-	public String getCustName() {
-		return custName;
-	}
-
-	public void setCustName(String custName) {
-		this.custName = custName;
-	}
-
-	public Long getEnUu() {
-		return enUu;
-	}
-
-	public void setEnUu(Long enUu) {
-		this.enUu = enUu;
-	}
-
-	public String getCode() {
-		return code;
-	}
-
-	public void setCode(String code) {
-		this.code = code;
-	}
-
-	public Short getPrint() {
-		return print;
-	}
-
-	public void setPrint(Short print) {
-		this.print = print;
-	}
-
-	public Set<PurchaseApBillOutItem> getItems() {
-		return items;
-	}
-
-	public void setItems(Set<PurchaseApBillOutItem> items) {
-		this.items = items;
-	}
-
-	public PurchaseApBillOutInfo getCustomerApBillOutInfo() {
-		return customerApBillOutInfo;
-	}
-
-	public void setCustomerApBillOutInfo(PurchaseApBillOutInfo customerApBillOutInfo) {
-		this.customerApBillOutInfo = customerApBillOutInfo;
-	}
-
-	public PurchaseApBillOutInfo getApBillOutInfo() {
-		return apBillOutInfo;
-	}
-
-	public void setApBillOutInfo(PurchaseApBillOutInfo apBillOutInfo) {
-		this.apBillOutInfo = apBillOutInfo;
-	}
-
-	public String getRetmsg() {
-		return retmsg;
-	}
-
-	public void setRetmsg(String retmsg) {
-		this.retmsg = retmsg;
-	}
-
-	public Double getInfoAmount() {
-		return infoAmount;
-	}
-
-	public void setInfoAmount(Double infoAmount) {
-		this.infoAmount = infoAmount;
-	}
-
-	public Double getInfoTaxAmount() {
-		return infoTaxAmount;
-	}
-
-	public void setInfoTaxAmount(Double infoTaxAmount) {
-		this.infoTaxAmount = infoTaxAmount;
-	}
-
-	public String getInfoDate() {
-		return infoDate;
-	}
-
-	public void setInfoDate(String infoDate) {
-		this.infoDate = infoDate;
-	}
-
-	public String getInfoTypeCode() {
-		return infoTypeCode;
-	}
-
-	public void setInfoTypeCode(String infoTypeCode) {
-		this.infoTypeCode = infoTypeCode;
-	}
-
-	public String getInfoNumber() {
-		return infoNumber;
-	}
-
-	public void setInfoNumber(String infoNumber) {
-		this.infoNumber = infoNumber;
-	}
-
-	public String getHisInfoTypeCode() {
-		return hisInfoTypeCode;
-	}
-
-	public void setHisInfoTypeCode(String hisInfoTypeCode) {
-		this.hisInfoTypeCode = hisInfoTypeCode;
-	}
-
-	public String getHisInfoNumber() {
-		return hisInfoNumber;
-	}
-
-	public void setHisInfoNumber(String hisInfoNumber) {
-		this.hisInfoNumber = hisInfoNumber;
-	}
-
-	public String getHisInfoKind() {
-		return hisInfoKind;
-	}
-
-	public void setHisInfoKind(String hisInfoKind) {
-		this.hisInfoKind = hisInfoKind;
-	}
-
-	public Integer getListFlag() {
-		return listFlag;
-	}
-
-	public void setListFlag(Integer listFlag) {
-		this.listFlag = listFlag;
-	}
-
-	public String getNsrsbh() {
-		return nsrsbh;
-	}
-
-	public void setNsrsbh(String nsrsbh) {
-		this.nsrsbh = nsrsbh;
-	}
-
-	public String getKpfwqh() {
-		return kpfwqh;
-	}
-
-	public void setKpfwqh(String kpfwqh) {
-		this.kpfwqh = kpfwqh;
-	}
-
-	public String getKpdh() {
-		return kpdh;
-	}
-
-	public void setKpdh(String kpdh) {
-		this.kpdh = kpdh;
-	}
-
-	public String getRequestCode() {
-		return requestCode;
-	}
-
-	public void setRequestCode(String requestCode) {
-		this.requestCode = requestCode;
-	}
-
-	public String getReissue() {
-		return reissue;
-	}
-
-	public void setReissue(String reissue) {
-		this.reissue = reissue;
-	}
-}

+ 0 - 322
src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutDone.java

@@ -1,322 +0,0 @@
-package com.uas.platform.b2b.model;
-
-import org.hibernate.annotations.Where;
-
-import javax.persistence.*;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * ...
- */
-@Entity
-@Where(clause = "pabo_checkstatus = '已开票' ")
-@Table(name = "purc$apbillout")
-public class PurchaseApBillOutDone implements Serializable {
-
-	/**
-	 * 序列号
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.AUTO)
-	@Column(name = "pabo_id")
-	private Long id;
-
-	/**
-	 * 税金合计
-	 */
-	@Column(name = "pabo_taxsum")
-	private Double taxSum;
-
-	/**
-	 * 税金差异
-	 */
-	@Column(name = "pabo_differ")
-	private Double differ;
-
-	/**
-	 * 录单日期
-	 */
-	@Column(name = "pabo_recorddate")
-	private Date recordDate;
-
-	/**
-	 * 录单人
-	 */
-	@Column(name = "pabo_recorder")
-	private String recorder;
-
-
-	/**
-	 * 开票状态
-	 */
-	@Column(name = "pabo_checkstatus")
-	private String checkStatus;
-
-	/**
-	 * 备注
-	 */
-	@Column(name = "pabo_remark")
-	private String remark;
-
-	/**
-	 * 提交日期
-	 */
-	@Column(name = "pabo_auditdate")
-	private Date auditDate;
-
-	/**
-	 * 作废日期
-	 */
-	@Column(name = "pabo_resdate")
-	private Date resDate;
-
-	/**
-	 * 作废人
-	 */
-	@Column(name = "pabo_resman")
-	private String resMan;
-
-	/**
-	 * 状态
-	 */
-	@Column(name = "pabo_status")
-	private Short status;
-
-	/**
-	 * 开票金额
-	 */
-	@Column(name = "pabo_amount")
-	private Double amount;
-
-	/**
-	 * 已付款金额
-	 */
-	@Column(name = "pabo_payamount")
-	private Double payAmount;
-
-	/**
-	 * 币别
-	 */
-	@Column(name = "pabo_currency")
-	private String currency;
-
-	/**
-	 * 汇率
-	 */
-	@Column(name = "pabo_rate")
-	private Double rate;
-
-
-	/**
-	 * 客户UU
-	 */
-	@Column(name = "pabo_custuu")
-	private Long custUu;
-
-	/**
-	 * 客户名称
-	 */
-	@Column(name = "pabo_custname")
-	private String custName;
-
-	/**
-	 * 本企业UU
-	 */
-	@Column(name = "pabo_enuu")
-	private Long enUu;
-
-	/**
-	 * 单据编号
-	 */
-	@Column(name = "pabo_code")
-	private String code;
-
-	/**
-	 * 打印次数
-	 */
-	@Column(name = "pabo_print")
-	private Short print;
-
-	/**
-	 * 开票单明细行
-	 */
-	@OneToMany(mappedBy = "apBillOut", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE,
-			CascadeType.MERGE }, fetch = FetchType.EAGER)
-	@OrderBy("number")
-	private Set<PurchaseApBillOutItem> items;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Double getTaxSum() {
-		return taxSum;
-	}
-
-	public void setTaxSum(Double taxSum) {
-		this.taxSum = taxSum;
-	}
-
-	public Double getDiffer() {
-		return differ;
-	}
-
-	public void setDiffer(Double differ) {
-		this.differ = differ;
-	}
-
-	public Date getRecordDate() {
-		return recordDate;
-	}
-
-	public void setRecordDate(Date recordDate) {
-		this.recordDate = recordDate;
-	}
-
-	public String getRecorder() {
-		return recorder;
-	}
-
-	public void setRecorder(String recorder) {
-		this.recorder = recorder;
-	}
-
-	public String getCheckStatus() {
-		return checkStatus;
-	}
-
-	public void setCheckStatus(String checkStatus) {
-		this.checkStatus = checkStatus;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Date getAuditDate() {
-		return auditDate;
-	}
-
-	public void setAuditDate(Date auditDate) {
-		this.auditDate = auditDate;
-	}
-
-	public Date getResDate() {
-		return resDate;
-	}
-
-	public void setResDate(Date resDate) {
-		this.resDate = resDate;
-	}
-
-	public String getResMan() {
-		return resMan;
-	}
-
-	public void setResMan(String resMan) {
-		this.resMan = resMan;
-	}
-
-	public Short getStatus() {
-		return status;
-	}
-
-	public void setStatus(Short status) {
-		this.status = status;
-	}
-
-	public Double getAmount() {
-		return amount;
-	}
-
-	public void setAmount(Double amount) {
-		this.amount = amount;
-	}
-
-	public Double getPayAmount() {
-		return payAmount;
-	}
-
-	public void setPayAmount(Double payAmount) {
-		this.payAmount = payAmount;
-	}
-
-	public String getCurrency() {
-		return currency;
-	}
-
-	public void setCurrency(String currency) {
-		this.currency = currency;
-	}
-
-	public Double getRate() {
-		return rate;
-	}
-
-	public void setRate(Double rate) {
-		this.rate = rate;
-	}
-
-	public Long getCustUu() {
-		return custUu;
-	}
-
-	public void setCustUu(Long custUu) {
-		this.custUu = custUu;
-	}
-
-	public String getCustName() {
-		return custName;
-	}
-
-	public void setCustName(String custName) {
-		this.custName = custName;
-	}
-
-	public Long getEnUu() {
-		return enUu;
-	}
-
-	public void setEnUu(Long enUu) {
-		this.enUu = enUu;
-	}
-
-	public String getCode() {
-		return code;
-	}
-
-	public void setCode(String code) {
-		this.code = code;
-	}
-
-	public Short getPrint() {
-		return print;
-	}
-
-	public void setPrint(Short print) {
-		this.print = print;
-	}
-
-	public Set<PurchaseApBillOutItem> getItems() {
-		return items;
-	}
-
-	public void setItems(Set<PurchaseApBillOutItem> items) {
-		this.items = items;
-	}
-}

+ 0 - 322
src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutEnd.java

@@ -1,322 +0,0 @@
-package com.uas.platform.b2b.model;
-
-import org.hibernate.annotations.Where;
-
-import javax.persistence.*;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * ...
- */
-@Entity
-@Where(clause = "pabo_checkstatus = '已作废' ")
-@Table(name = "purc$apbillout")
-public class PurchaseApBillOutEnd implements Serializable {
-
-	/**
-	 * 序列号
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.AUTO)
-	@Column(name = "pabo_id")
-	private Long id;
-
-	/**
-	 * 税金合计
-	 */
-	@Column(name = "pabo_taxsum")
-	private Double taxSum;
-
-	/**
-	 * 税金差异
-	 */
-	@Column(name = "pabo_differ")
-	private Double differ;
-
-	/**
-	 * 录单日期
-	 */
-	@Column(name = "pabo_recorddate")
-	private Date recordDate;
-
-	/**
-	 * 录单人
-	 */
-	@Column(name = "pabo_recorder")
-	private String recorder;
-
-
-	/**
-	 * 开票状态
-	 */
-	@Column(name = "pabo_checkstatus")
-	private String checkStatus;
-
-	/**
-	 * 备注
-	 */
-	@Column(name = "pabo_remark")
-	private String remark;
-
-	/**
-	 * 提交日期
-	 */
-	@Column(name = "pabo_auditdate")
-	private Date auditDate;
-
-	/**
-	 * 作废日期
-	 */
-	@Column(name = "pabo_resdate")
-	private Date resDate;
-
-	/**
-	 * 作废人
-	 */
-	@Column(name = "pabo_resman")
-	private String resMan;
-
-	/**
-	 * 状态
-	 */
-	@Column(name = "pabo_status")
-	private Short status;
-
-	/**
-	 * 开票金额
-	 */
-	@Column(name = "pabo_amount")
-	private Double amount;
-
-	/**
-	 * 已付款金额
-	 */
-	@Column(name = "pabo_payamount")
-	private Double payAmount;
-
-	/**
-	 * 币别
-	 */
-	@Column(name = "pabo_currency")
-	private String currency;
-
-	/**
-	 * 汇率
-	 */
-	@Column(name = "pabo_rate")
-	private Double rate;
-
-
-	/**
-	 * 客户UU
-	 */
-	@Column(name = "pabo_custuu")
-	private Long custUu;
-
-	/**
-	 * 客户名称
-	 */
-	@Column(name = "pabo_custname")
-	private String custName;
-
-	/**
-	 * 本企业UU
-	 */
-	@Column(name = "pabo_enuu")
-	private Long enUu;
-
-	/**
-	 * 单据编号
-	 */
-	@Column(name = "pabo_code")
-	private String code;
-
-	/**
-	 * 打印次数
-	 */
-	@Column(name = "pabo_print")
-	private Short print;
-
-	/**
-	 * 开票单明细行
-	 */
-	@OneToMany(mappedBy = "apBillOut", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE,
-			CascadeType.MERGE }, fetch = FetchType.EAGER)
-	@OrderBy("number")
-	private Set<PurchaseApBillOutItem> items;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Double getTaxSum() {
-		return taxSum;
-	}
-
-	public void setTaxSum(Double taxSum) {
-		this.taxSum = taxSum;
-	}
-
-	public Double getDiffer() {
-		return differ;
-	}
-
-	public void setDiffer(Double differ) {
-		this.differ = differ;
-	}
-
-	public Date getRecordDate() {
-		return recordDate;
-	}
-
-	public void setRecordDate(Date recordDate) {
-		this.recordDate = recordDate;
-	}
-
-	public String getRecorder() {
-		return recorder;
-	}
-
-	public void setRecorder(String recorder) {
-		this.recorder = recorder;
-	}
-
-	public String getCheckStatus() {
-		return checkStatus;
-	}
-
-	public void setCheckStatus(String checkStatus) {
-		this.checkStatus = checkStatus;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Date getAuditDate() {
-		return auditDate;
-	}
-
-	public void setAuditDate(Date auditDate) {
-		this.auditDate = auditDate;
-	}
-
-	public Date getResDate() {
-		return resDate;
-	}
-
-	public void setResDate(Date resDate) {
-		this.resDate = resDate;
-	}
-
-	public String getResMan() {
-		return resMan;
-	}
-
-	public void setResMan(String resMan) {
-		this.resMan = resMan;
-	}
-
-	public Short getStatus() {
-		return status;
-	}
-
-	public void setStatus(Short status) {
-		this.status = status;
-	}
-
-	public Double getAmount() {
-		return amount;
-	}
-
-	public void setAmount(Double amount) {
-		this.amount = amount;
-	}
-
-	public Double getPayAmount() {
-		return payAmount;
-	}
-
-	public void setPayAmount(Double payAmount) {
-		this.payAmount = payAmount;
-	}
-
-	public String getCurrency() {
-		return currency;
-	}
-
-	public void setCurrency(String currency) {
-		this.currency = currency;
-	}
-
-	public Double getRate() {
-		return rate;
-	}
-
-	public void setRate(Double rate) {
-		this.rate = rate;
-	}
-
-	public Long getCustUu() {
-		return custUu;
-	}
-
-	public void setCustUu(Long custUu) {
-		this.custUu = custUu;
-	}
-
-	public String getCustName() {
-		return custName;
-	}
-
-	public void setCustName(String custName) {
-		this.custName = custName;
-	}
-
-	public Long getEnUu() {
-		return enUu;
-	}
-
-	public void setEnUu(Long enUu) {
-		this.enUu = enUu;
-	}
-
-	public String getCode() {
-		return code;
-	}
-
-	public void setCode(String code) {
-		this.code = code;
-	}
-
-	public Short getPrint() {
-		return print;
-	}
-
-	public void setPrint(Short print) {
-		this.print = print;
-	}
-
-	public Set<PurchaseApBillOutItem> getItems() {
-		return items;
-	}
-
-	public void setItems(Set<PurchaseApBillOutItem> items) {
-		this.items = items;
-	}
-}

+ 0 - 149
src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutInfo.java

@@ -1,149 +0,0 @@
-package com.uas.platform.b2b.model;
-
-import javax.persistence.*;
-import java.io.Serializable;
-
-/**
- * Created by 黄诚天 on 2017/7/13.
- *
- * 企业开票信息表,每个企业只能维护自己的,只能更新,不能删除.
- */
-
-@Table(name = "purc$apbilloutinfo")
-@Entity
-public class PurchaseApBillOutInfo implements Serializable {
-    /**
-     * 序列号
-     */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 企业uu
-     */
-    @Id
-    @Column(name = "pboi_uu")
-    private Long uu;
-
-    /**
-     * 公司名称
-     */
-    @Column(name = "pboi_name")
-    private String enName;
-
-    /**
-     * 纳税人识别号
-     */
-    @Column(name = "pboi_taxnr")
-    private String taxNr;
-
-    /**
-     * 银行账号
-     */
-    @Column(name = "pboi_bankaccountnr")
-    private String bankAccountNr;
-
-    /**
-     * 注册地址
-     */
-    @Column(name = "pboi_address")
-    private String address;
-
-    /**
-     * 公司电话
-     */
-    @Column(name = "pboi_tel")
-    private String tel;
-
-    /**
-     * 收款人
-     */
-    @Column(name = "pboi_payee")
-    private String payee;
-
-    /**
-     * 复款人
-     */
-    @Column(name = "pboi_checker")
-    private String checker;
-
-    /**
-     * 开票机IP地址
-     */
-    @Column(name = "pboi_ip")
-    private String ip;
-
-    public PurchaseApBillOutInfo() {
-    }
-
-    public Long getUu() {
-        return uu;
-    }
-
-    public void setUu(Long uu) {
-        this.uu = uu;
-    }
-
-    public String getEnName() {
-        return enName;
-    }
-
-    public void setEnName(String enName) {
-        this.enName = enName;
-    }
-
-    public String getTaxNr() {
-        return taxNr;
-    }
-
-    public void setTaxNr(String taxNr) {
-        this.taxNr = taxNr;
-    }
-
-    public String getBankAccountNr() {
-        return bankAccountNr;
-    }
-
-    public void setBankAccountNr(String bankAccountNr) {
-        this.bankAccountNr = bankAccountNr;
-    }
-
-    public String getAddress() {
-        return address;
-    }
-
-    public void setAddress(String address) {
-        this.address = address;
-    }
-
-    public String getTel() {
-        return tel;
-    }
-
-    public void setTel(String tel) {
-        this.tel = tel;
-    }
-
-    public String getPayee() {
-        return payee;
-    }
-
-    public void setPayee(String payee) {
-        this.payee = payee;
-    }
-
-    public String getChecker() {
-        return checker;
-    }
-
-    public void setChecker(String checker) {
-        this.checker = checker;
-    }
-
-    public String getIp() {
-        return ip;
-    }
-
-    public void setIp(String ip) {
-        this.ip = ip;
-    }
-}

+ 0 - 390
src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutItem.java

@@ -1,390 +0,0 @@
-package com.uas.platform.b2b.model;
-
-import com.alibaba.fastjson.annotation.JSONField;
-import org.codehaus.jackson.annotate.JsonIgnore;
-
-import javax.persistence.*;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * 买家应付(卖家应收)对账单明细
- */
-@Table(name = "purc$apbilloutitem")
-@Entity
-public class PurchaseApBillOutItem implements Serializable {
-
-	/**
-	 * 序列号
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.AUTO)
-	@Column(name = "pai_id")
-	private Long id;
-
-	/**
-	 * 行号
-	 */
-	@Column(name = "pai_number")
-	private Short number;
-
-	/**
-	 * 状态
-	 */
-	@Column(name = "pai_status")
-	private Integer status;
-
-	/**
-	 * 状态码
-	 */
-	@Column(name = "pai_statuscode")
-	private Integer statusCode;
-
-	/**
-	 * 开票单价
-	 */
-	@Column(name = "pai_nowprice")
-	private Double nowPrice;
-
-	/**
-	 * 成本单价
-	 */
-	@Column(name = "pai_costprice")
-	private Double costPrice;
-
-	/**
-	 * 发票单价
-	 */
-	@Column(name = "pai_price")
-	private Double price;
-
-	/**
-	 * 税率(%)
-	 */
-	@Column(name = "pai_taxrate")
-	private Double taxrate;
-
-	/**
-	 * 发票数量
-	 */
-	@Column(name = "pai_qty")
-	private Double qty;
-
-	/**
-	 * 开票数量
-	 */
-	@Column(name = "pai_nowqty")
-	private Double NowQty;
-
-	@OneToOne(cascade = { CascadeType.REFRESH })
-	@JoinColumn(name = "pai_prid", insertable = false, updatable = false)
-	private Product product;
-
-	/**
-	 * 客户物料ID
-	 */
-	@Column(name = "pai_prid")
-	private Long prid;
-
-	/**
-	 * 客户料号
-	 */
-	@Column(name = "pai_prodcode")
-	private String prodCode;
-
-	/**
-	 * 客户订单单号
-	 */
-	@Column(name = "pai_ordercode")
-	private String orderCode;
-
-	/**
-	 * 客户出入库类型
-	 */
-	@Column(name = "pai_orderclass")
-	private String orderClass;
-
-	/**
-	 * 客户订单序号
-	 */
-	@Column(name = "pai_orderdetno")
-	private Long orderDetno;
-
-	/**
-	 * 客户出入库单号
-	 */
-	@Column(name = "pai_inoutno")
-	private String inoutno;
-
-	/**
-	 * 出入库单序号
-	 */
-	@Column(name = "pai_inoutnodetno")
-	private Long inoutnodetno;
-
-	/**
-	 * 单据编号
-	 */
-	@Column(name = "pai_code")
-	private String code;
-
-	/**
-	 * 主表ID
-	 */
-	@Column(name = "pai_billoutid")
-	private Long billOutId;
-
-	/**
-	 * 发票ID
-	 */
-	@Column(name = "pai_orderid")
-	private Long orderId;
-
-	/**
-	 * 明细行数据来源表
-	 */
-	@Column(name = "pai_sourcetable")
-	private String sourceTable;
-
-	/**
-	 * 明细行数据来源对应ID
-	 */
-	@Column(name = "pai_sourceid")
-	private Long sourceId;
-
-	/**
-	 * 此次开票之前的开票数(用于作废开票单时)
-	 */
-	@Column(name = "pai_oldqty")
-	private Double oldQty;
-
-
-	/**
-	 * 开票账单主记录
-	 */
-	@ManyToOne(cascade = CascadeType.ALL, optional = true)
-	@JoinColumn(name = "pai_paboid", nullable = false)
-	private PurchaseApBillOut apBillOut;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Short getNumber() {
-		return number;
-	}
-
-	public void setNumber(Short number) {
-		this.number = number;
-	}
-
-	public Integer getStatus() {
-		return status;
-	}
-
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	public Integer getStatusCode() {
-		return statusCode;
-	}
-
-	public void setStatusCode(Integer statusCode) {
-		this.statusCode = statusCode;
-	}
-
-	public Double getNowPrice() {
-		return nowPrice;
-	}
-
-	public void setNowPrice(Double nowPrice) {
-		this.nowPrice = nowPrice;
-	}
-
-	public Double getCostPrice() {
-		return costPrice;
-	}
-
-	public void setCostPrice(Double costPrice) {
-		this.costPrice = costPrice;
-	}
-
-	public Double getPrice() {
-		return price;
-	}
-
-	public void setPrice(Double price) {
-		this.price = price;
-	}
-
-	public Double getTaxrate() {
-		return taxrate;
-	}
-
-	public void setTaxrate(Double taxrate) {
-		this.taxrate = taxrate;
-	}
-
-	public Double getQty() {
-		return qty;
-	}
-
-	public void setQty(Double qty) {
-		this.qty = qty;
-	}
-
-	public Double getNowQty() {
-		return NowQty;
-	}
-
-	public void setNowQty(Double nowQty) {
-		NowQty = nowQty;
-	}
-
-	public String getOrderCode() {
-		return orderCode;
-	}
-
-	public void setOrderCode(String orderCode) {
-		this.orderCode = orderCode;
-	}
-
-	public String getCode() {
-		return code;
-	}
-
-	public void setCode(String code) {
-		this.code = code;
-	}
-
-	public Long getBillOutId() {
-		return billOutId;
-	}
-
-	public void setBillOutId(Long billOutId) {
-		this.billOutId = billOutId;
-	}
-
-	public Long getPrid() {
-		return prid;
-	}
-
-	public void setPrid(Long prid) {
-		this.prid = prid;
-	}
-
-	public String getProdCode() {
-		return prodCode;
-	}
-
-	public void setProdCode(String prodCode) {
-		this.prodCode = prodCode;
-	}
-
-	public String getSourceTable() {
-		return sourceTable;
-	}
-
-	public void setSourceTable(String sourceTable) {
-		this.sourceTable = sourceTable;
-	}
-
-	public Long getSourceId() {
-		return sourceId;
-	}
-
-	public void setSourceId(Long sourceId) {
-		this.sourceId = sourceId;
-	}
-
-	public Double getOldQty() {
-		return oldQty;
-	}
-
-	public void setOldQty(Double oldQty) {
-		this.oldQty = oldQty;
-	}
-
-	public Long getOrderId() {
-		return orderId;
-	}
-
-	public void setOrderId(Long orderId) {
-		this.orderId = orderId;
-	}
-
-	public Product getProduct() {
-		return product;
-	}
-
-	public void setProduct(Product product) {
-		this.product = product;
-	}
-
-	@JSONField(serialize = false)
-	@JsonIgnore
-	public PurchaseApBillOut getApBillOut() {
-		return apBillOut;
-	}
-
-	public void setApBillOut(PurchaseApBillOut apBillOut) {
-		this.apBillOut = apBillOut;
-	}
-
-	public static List<PurchaseApBillOut> distinct(List<PurchaseApBillOutItem> items) {
-		List<PurchaseApBillOut> PurchaseApBillOuts = new ArrayList<PurchaseApBillOut>();
-		Set<Long> keys = new HashSet<Long>();
-		for (PurchaseApBillOutItem item : items) {
-			if (!keys.contains(item.apBillOut.getId())) {
-				PurchaseApBillOuts.add(item.apBillOut);
-				keys.add(item.apBillOut.getId());
-			}
-		}
-		return PurchaseApBillOuts;
-	}
-
-	public String getOrderClass() {
-		return orderClass;
-	}
-
-	public void setOrderClass(String orderClass) {
-		this.orderClass = orderClass;
-	}
-
-	public Long getOrderDetno() {
-		return orderDetno;
-	}
-
-	public void setOrderDetno(Long orderDetno) {
-		this.orderDetno = orderDetno;
-	}
-
-	public String getInoutno() {
-		return inoutno;
-	}
-
-	public void setInoutno(String inoutno) {
-		this.inoutno = inoutno;
-	}
-
-	public Long getInoutnodetno() {
-		return inoutnodetno;
-	}
-
-	public void setInoutnodetno(Long inoutnodetno) {
-		this.inoutnodetno = inoutnodetno;
-	}
-}

+ 0 - 100
src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutTaxCode.java

@@ -1,100 +0,0 @@
-package com.uas.platform.b2b.model;
-
-/**
- * Created by 黄诚天 on 2017-08-01.
- */
-public class PurchaseApBillOutTaxCode {
-    Integer id;
-    String spbm;
-    String spmc;
-    String zzssl;
-    String hzx;
-    String kyzt;
-    String zzstsgl;
-    String tjjbm;
-    String pid;
-    String version;
-
-    public PurchaseApBillOutTaxCode() {
-    }
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getSpbm() {
-        return spbm;
-    }
-
-    public void setSpbm(String spbm) {
-        this.spbm = spbm;
-    }
-
-    public String getSpmc() {
-        return spmc;
-    }
-
-    public void setSpmc(String spmc) {
-        this.spmc = spmc;
-    }
-
-    public String getZzssl() {
-        return zzssl;
-    }
-
-    public void setZzssl(String zzssl) {
-        this.zzssl = zzssl;
-    }
-
-    public String getHzx() {
-        return hzx;
-    }
-
-    public void setHzx(String hzx) {
-        this.hzx = hzx;
-    }
-
-    public String getKyzt() {
-        return kyzt;
-    }
-
-    public void setKyzt(String kyzt) {
-        this.kyzt = kyzt;
-    }
-
-    public String getZzstsgl() {
-        return zzstsgl;
-    }
-
-    public void setZzstsgl(String zzstsgl) {
-        this.zzstsgl = zzstsgl;
-    }
-
-    public String getTjjbm() {
-        return tjjbm;
-    }
-
-    public void setTjjbm(String tjjbm) {
-        this.tjjbm = tjjbm;
-    }
-
-    public String getPid() {
-        return pid;
-    }
-
-    public void setPid(String pid) {
-        this.pid = pid;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public void setVersion(String version) {
-        this.version = version;
-    }
-}

+ 0 - 322
src/main/java/com/uas/platform/b2b/model/PurchaseApBillOutTodo.java

@@ -1,322 +0,0 @@
-package com.uas.platform.b2b.model;
-
-import org.hibernate.annotations.Where;
-
-import javax.persistence.*;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
-
-/**
- * ...
- */
-@Entity
-@Where(clause = "pabo_checkstatus = '未开票' ")
-@Table(name = "purc$apbillout")
-public class PurchaseApBillOutTodo implements Serializable {
-
-	/**
-	 * 序列号
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * ID
-	 */
-	@Id
-	@GeneratedValue(strategy = GenerationType.AUTO)
-	@Column(name = "pabo_id")
-	private Long id;
-
-	/**
-	 * 税金合计
-	 */
-	@Column(name = "pabo_taxsum")
-	private Double taxSum;
-
-	/**
-	 * 税金差异
-	 */
-	@Column(name = "pabo_differ")
-	private Double differ;
-
-	/**
-	 * 录单日期
-	 */
-	@Column(name = "pabo_recorddate")
-	private Date recordDate;
-
-	/**
-	 * 录单人
-	 */
-	@Column(name = "pabo_recorder")
-	private String recorder;
-
-
-	/**
-	 * 开票状态
-	 */
-	@Column(name = "pabo_checkstatus")
-	private String checkStatus;
-
-	/**
-	 * 备注
-	 */
-	@Column(name = "pabo_remark")
-	private String remark;
-
-	/**
-	 * 提交日期
-	 */
-	@Column(name = "pabo_auditdate")
-	private Date auditDate;
-
-	/**
-	 * 作废日期
-	 */
-	@Column(name = "pabo_resdate")
-	private Date resDate;
-
-	/**
-	 * 作废人
-	 */
-	@Column(name = "pabo_resman")
-	private String resMan;
-
-	/**
-	 * 状态
-	 */
-	@Column(name = "pabo_status")
-	private Short status;
-
-	/**
-	 * 开票金额
-	 */
-	@Column(name = "pabo_amount")
-	private Double amount;
-
-	/**
-	 * 已付款金额
-	 */
-	@Column(name = "pabo_payamount")
-	private Double payAmount;
-
-	/**
-	 * 币别
-	 */
-	@Column(name = "pabo_currency")
-	private String currency;
-
-	/**
-	 * 汇率
-	 */
-	@Column(name = "pabo_rate")
-	private Double rate;
-
-
-	/**
-	 * 客户UU
-	 */
-	@Column(name = "pabo_custuu")
-	private Long custUu;
-
-	/**
-	 * 客户名称
-	 */
-	@Column(name = "pabo_custname")
-	private String custName;
-
-	/**
-	 * 本企业UU
-	 */
-	@Column(name = "pabo_enuu")
-	private Long enUu;
-
-	/**
-	 * 单据编号
-	 */
-	@Column(name = "pabo_code")
-	private String code;
-
-	/**
-	 * 打印次数
-	 */
-	@Column(name = "pabo_print")
-	private Short print;
-
-	/**
-	 * 开票单明细行
-	 */
-	@OneToMany(mappedBy = "apBillOut", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE,
-			CascadeType.MERGE }, fetch = FetchType.EAGER)
-	@OrderBy("number")
-	private Set<PurchaseApBillOutItem> items;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Double getTaxSum() {
-		return taxSum;
-	}
-
-	public void setTaxSum(Double taxSum) {
-		this.taxSum = taxSum;
-	}
-
-	public Double getDiffer() {
-		return differ;
-	}
-
-	public void setDiffer(Double differ) {
-		this.differ = differ;
-	}
-
-	public Date getRecordDate() {
-		return recordDate;
-	}
-
-	public void setRecordDate(Date recordDate) {
-		this.recordDate = recordDate;
-	}
-
-	public String getRecorder() {
-		return recorder;
-	}
-
-	public void setRecorder(String recorder) {
-		this.recorder = recorder;
-	}
-
-	public String getCheckStatus() {
-		return checkStatus;
-	}
-
-	public void setCheckStatus(String checkStatus) {
-		this.checkStatus = checkStatus;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Date getAuditDate() {
-		return auditDate;
-	}
-
-	public void setAuditDate(Date auditDate) {
-		this.auditDate = auditDate;
-	}
-
-	public Date getResDate() {
-		return resDate;
-	}
-
-	public void setResDate(Date resDate) {
-		this.resDate = resDate;
-	}
-
-	public String getResMan() {
-		return resMan;
-	}
-
-	public void setResMan(String resMan) {
-		this.resMan = resMan;
-	}
-
-	public Short getStatus() {
-		return status;
-	}
-
-	public void setStatus(Short status) {
-		this.status = status;
-	}
-
-	public Double getAmount() {
-		return amount;
-	}
-
-	public void setAmount(Double amount) {
-		this.amount = amount;
-	}
-
-	public Double getPayAmount() {
-		return payAmount;
-	}
-
-	public void setPayAmount(Double payAmount) {
-		this.payAmount = payAmount;
-	}
-
-	public String getCurrency() {
-		return currency;
-	}
-
-	public void setCurrency(String currency) {
-		this.currency = currency;
-	}
-
-	public Double getRate() {
-		return rate;
-	}
-
-	public void setRate(Double rate) {
-		this.rate = rate;
-	}
-
-	public Long getCustUu() {
-		return custUu;
-	}
-
-	public void setCustUu(Long custUu) {
-		this.custUu = custUu;
-	}
-
-	public String getCustName() {
-		return custName;
-	}
-
-	public void setCustName(String custName) {
-		this.custName = custName;
-	}
-
-	public Long getEnUu() {
-		return enUu;
-	}
-
-	public void setEnUu(Long enUu) {
-		this.enUu = enUu;
-	}
-
-	public String getCode() {
-		return code;
-	}
-
-	public void setCode(String code) {
-		this.code = code;
-	}
-
-	public Short getPrint() {
-		return print;
-	}
-
-	public void setPrint(Short print) {
-		this.print = print;
-	}
-
-	public Set<PurchaseApBillOutItem> getItems() {
-		return items;
-	}
-
-	public void setItems(Set<PurchaseApBillOutItem> items) {
-		this.items = items;
-	}
-}

+ 0 - 163
src/main/java/com/uas/platform/b2b/model/SoapInvoiceIssued.java

@@ -1,163 +0,0 @@
-package com.uas.platform.b2b.model;
-
-/**
- * Created by 黄诚天 on 2017/7/10.
- */
-public class SoapInvoiceIssued {
-    Integer SID;
-    String hisInfoKind;//上一张发票种类
-    String Cipher;//发票的密文
-    Double InfoAmount;//开具的金额
-    String retcode;//返回码
-    String retmsg;//返回信息
-    String InfoNumber;//开具的发票号码
-    String InfoDate;//开票日期(格式:yyyy-mm-dd)
-    String hisInfoNumber;//上一张发票号码
-    String Sign; //发票的签名值
-    Double InfoTaxAmount;//开具的税额
-    String hisInfoTypeCode;//上一张发票代码
-    Integer ListFlag;//清单标志 0:非清单发票 1:清单发票
-    String InfoTypeCode;//开具的发票代码
-    String nsrsbh;//销方税号
-    String kpfwqh;//开票服务器号
-    String kpdh;//开票点号
-
-    public SoapInvoiceIssued() {
-    }
-
-    public String getRetcode() {
-        return retcode;
-    }
-
-    public void setRetcode(String retcode) {
-        this.retcode = retcode;
-    }
-
-    public String getRetmsg() {
-        return retmsg;
-    }
-
-    public void setRetmsg(String retmsg) {
-        this.retmsg = retmsg;
-    }
-
-    public Double getInfoAmount() {
-        return InfoAmount;
-    }
-
-    public void setInfoAmount(Double infoAmount) {
-        this.InfoAmount = infoAmount;
-    }
-
-    public Double getInfoTaxAmount() {
-        return InfoTaxAmount;
-    }
-
-    public void setInfoTaxAmount(Double infoTaxAmount) {
-        this.InfoTaxAmount = infoTaxAmount;
-    }
-
-    public String getInfoDate() {
-        return InfoDate;
-    }
-
-    public void setInfoDate(String infoDate) {
-        this.InfoDate = infoDate;
-    }
-
-    public String getInfoTypeCode() {
-        return InfoTypeCode;
-    }
-
-    public void setInfoTypeCode(String infoTypeCode) {
-        this.InfoTypeCode = infoTypeCode;
-    }
-
-    public String getInfoNumber() {
-        return InfoNumber;
-    }
-
-    public void setInfoNumber(String infoNumber) {
-        this.InfoNumber = infoNumber;
-    }
-
-    public String getHisInfoTypeCode() {
-        return hisInfoTypeCode;
-    }
-
-    public void setHisInfoTypeCode(String hisInfoTypeCode) {
-        this.hisInfoTypeCode = hisInfoTypeCode;
-    }
-
-    public String getHisInfoNumber() {
-        return hisInfoNumber;
-    }
-
-    public void setHisInfoNumber(String hisInfoNumber) {
-        this.hisInfoNumber = hisInfoNumber;
-    }
-
-    public String getHisInfoKind() {
-        return hisInfoKind;
-    }
-
-    public void setHisInfoKind(String hisInfoKind) {
-        this.hisInfoKind = hisInfoKind;
-    }
-
-    public Integer getListFlag() {
-        return ListFlag;
-    }
-
-    public void setListFlag(Integer listFlag) {
-        this.ListFlag = listFlag;
-    }
-
-    public String getNsrsbh() {
-        return nsrsbh;
-    }
-
-    public void setNsrsbh(String nsrsbh) {
-        this.nsrsbh = nsrsbh;
-    }
-
-    public String getKpfwqh() {
-        return kpfwqh;
-    }
-
-    public void setKpfwqh(String kpfwqh) {
-        this.kpfwqh = kpfwqh;
-    }
-
-    public String getKpdh() {
-        return kpdh;
-    }
-
-    public void setKpdh(String kpdh) {
-        this.kpdh = kpdh;
-    }
-
-    public Integer getSID() {
-        return SID;
-    }
-
-    public void setSID(Integer SID) {
-        this.SID = SID;
-    }
-
-    public String getCipher() {
-        return Cipher;
-    }
-
-    public void setCipher(String cipher) {
-        this.Cipher = cipher;
-    }
-
-    public String getSign() {
-        return Sign;
-    }
-
-    public void setSign(String sign) {
-        this.Sign = sign;
-    }
-}

+ 0 - 10
src/main/java/com/uas/platform/b2b/search/SearchService.java

@@ -476,16 +476,6 @@ public interface SearchService {
 
 	Page<B2BCustomer> searchCustomerForErp(String keyword, PageParams pageParams);
 
-	/**
-	 *
-	 * 航天开票单
-	 *
-	 * @param keyword
-	 * @param pageParams
-	 * @return
-	 */
-	public SPage<PurchaseApBillOut> searchPurchaseApBillOutIds(String keyword, PageParams pageParams);
-
 	/**
 	 * 主动报价单已提交单据
 	 * 

+ 3 - 14
src/main/java/com/uas/platform/b2b/search/SearchServiceImpl.java

@@ -170,9 +170,6 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
 	@Autowired
 	private SaleTenderDao saleTenderDao;
 
-	@Autowired
-	private PurchaseApBillOutDao purchaseApBillOutDao;
-
 	@Autowired
 	private SaleQuotationDoneDao saleQuotationDoneDao;
 
@@ -420,6 +417,7 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
 		// factory.add(PredicateUtils.eq("inquiry.overdue", overdue, false));
 		// }
 		List<PurchaseInquiryItem> content = purchaseInquiryItemDao.findAll(new Specification<PurchaseInquiryItem>() {
+			@Override
 			public Predicate toPredicate(Root<PurchaseInquiryItem> root, CriteriaQuery<?> query,
 										 CriteriaBuilder builder) {
 				query.where(factory.toPredicate(root, query, builder));
@@ -443,6 +441,7 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
 		final PredicateFactory<PurchaseInquiryDetail> factory = new PredicateFactory<PurchaseInquiryDetail>();
 		factory.add(PredicateUtils.in("id", idsPage.getContent(), false));
 		List<PurchaseInquiryDetail> content = inquiryDetailDao.findAll(new Specification<PurchaseInquiryDetail>() {
+			@Override
 			public Predicate toPredicate(Root<PurchaseInquiryDetail> root, CriteriaQuery<?> query,
 										 CriteriaBuilder builder) {
 				query.where(factory.toPredicate(root, query, builder));
@@ -475,6 +474,7 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
 		return toSPage(idsPage, content);
 	}
 
+	@Override
 	public SPage<PurchaseOrderAll> findEnableToChange(String keyword, PageParams pageParams) {
 		SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$ORDERS, pageParams);
 		List<PurchaseOrderAll> content = purchaseOrderAllDao.findAll(idsPage.getContent());
@@ -1371,17 +1371,6 @@ public class SearchServiceImpl implements com.uas.platform.b2b.search.SearchServ
 		return kindService.findByNameCn(keyword).get(0);
 	}
 
-	/**
-	 * 航天开票单: purc$apbillout
-	 */
-	@Override
-	public SPage<PurchaseApBillOut> searchPurchaseApBillOutIds(String keyword, PageParams pageParams) {
-		SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.PURC$APBILLOUT, pageParams);
-		List<PurchaseApBillOut> content = purchaseApBillOutDao.findAll(idsPage.getContent());
-		sortByProperty(content, PurchaseApBillOut.class, "id", idsPage.getContent());
-		return toSPage(idsPage, content);
-	}
-
 	@Override
 	public SPage<SaleQuotationDone> searchSaleQuotationDoneIds(String keyword, PageParams pageParams) {
 		SPage<Long> idsPage = searchService.searchIds(keyword, Table_name.SALE$QUOTATION, pageParams);

+ 2 - 13
src/main/java/com/uas/platform/b2b/service/EnterpriseService.java

@@ -2,7 +2,6 @@ package com.uas.platform.b2b.service;
 
 import com.uas.platform.b2b.erp.model.EnterpriseNameAndUU;
 import com.uas.platform.b2b.model.Enterprise;
-import com.uas.platform.b2b.model.PurchaseApBillOutInfo;
 import com.uas.platform.core.model.PageInfo;
 import org.springframework.data.domain.Page;
 
@@ -116,7 +115,7 @@ public interface EnterpriseService {
 	/**
 	 * 通过邮箱查询企业
 	 * 
-	 * @param enMail
+	 * @param enEmail
 	 * @return
 	 */
 	public Enterprise findByenEmail(String enEmail);
@@ -124,7 +123,7 @@ public interface EnterpriseService {
 	/**
 	 * 根据营业执照号查询企业信息
 	 * 
-	 * @param businessCode
+	 * @param enBussinessCode
 	 * @return
 	 */
 	public Enterprise findByenBussinessCode(String enBussinessCode);
@@ -201,16 +200,6 @@ public interface EnterpriseService {
 
 	public Set<Enterprise> findByNameKey(String name);
 
-	/**
-	 * 修改企业开票信息
-	 *
-	 * @param apBillOutInfo
-	 * @return
-	 */
-	public PurchaseApBillOutInfo saveApBillOutInfo(PurchaseApBillOutInfo apBillOutInfo);
-
-    public PurchaseApBillOutInfo getApBillOutInfo(Long enuu);
-
 	/**
 	 * 通过注册时间查询企业注册信息
 	 *

+ 0 - 73
src/main/java/com/uas/platform/b2b/service/PiaoPlusService.java

@@ -1,73 +0,0 @@
-package com.uas.platform.b2b.service;
-
-import com.uas.platform.b2b.model.PurchaseApBillOut;
-import org.springframework.ui.ModelMap;
-
-/**
- * Created by 黄诚天 on 2018/02/25.
- *
- * 票加加服务接口
- */
-public interface PiaoPlusService {
-
-    /**
-     * 发票开具
-     *
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap invoiceIssued(PurchaseApBillOut apBillOut);
-
-    /**
-     * 发票作废  冲红
-     *
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap InvoiceCancel(PurchaseApBillOut apBillOut);
-
-    /**
-     * 查询发票信息
-     *
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap queryInvoiceMessage(PurchaseApBillOut apBillOut);
-
-    /**
-     * 开票统计
-     *
-     * @param queryDate 指定的统计月份。格式YYYYMM
-     * @return
-     */
-    public ModelMap querybillingcount(String queryDate);
-
-    /**
-     * 余票查询 查询金税盘剩余发票
-     * @return
-     */
-    public ModelMap queryBillLeftCount();
-
-    /**
-     * 发票打印  专票和普通,可以通过该接口打印纸质发票。目前仅支持百望税盘
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap printInvoice (PurchaseApBillOut apBillOut);
-
-    /**
-     * 快递单信息获取接口
-     * 外部系统,在开票成功后,可通过订单编号和税号,来获取某个订单的快递单号
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap queryDelivery(PurchaseApBillOut apBillOut);
-
-    /**
-     * 上传接口
-     * 用于在票加加产品纸质发票功能中,导入申请单时规范导入文件的格式与内容
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap uploadInvoice(PurchaseApBillOut apBillOut);
-}

+ 0 - 166
src/main/java/com/uas/platform/b2b/service/PurchaseApBillOutService.java

@@ -1,166 +0,0 @@
-package com.uas.platform.b2b.service;
-
-import com.uas.platform.b2b.model.*;
-import com.uas.platform.core.model.PageInfo;
-import org.springframework.data.domain.Page;
-import org.springframework.ui.ModelMap;
-
-import java.util.HashMap;
-import java.util.List;
-
-public interface PurchaseApBillOutService {
-
-	/**
-	 * 获取需要上传到供应商ERP的客户委外订单
-	 * 
-	 * @return
-	 */
-	//public List<PurchaseApBillOut> findNotUploadApBillOut();
-
-	/**
-	 * 平台的应收对账传到供应商ERP之后,修改平台里面的订单的上传状态
-	 * 
-	 * @param idArray
-	 */
-	//public void onApBillOutSuccess(String[] idArray);
-
-	/**
-	 * 批量保存开票单
-	 * 
-	 * @param checkItems
-	 * @return
-	 */
-	public void saveApBillOuts(List<PurchaseApBillOutItem> checkItems);
-
-	/**
-	 * 作废开票单
-	 * 
-	 * @param id
-	 */
-	public boolean cancelApBillOut(Long id);
-
-	/**
-	 * 保存生成的开票单主记录
-	 */
-	public PurchaseApBillOut save(PurchaseApBillOut purchaseApBillOut, List<HashMap<String, Object>> sourceInfoList);
-
-	/**
-	 * 根据ID获取生成的开票单
-	 * 
-	 * @param id
-	 * @return
-	 */
-	public PurchaseApBillOut findById(Long id);
-
-	/**
-	 * 根据来源表的ID更新来源单据已开票数
-	 */
-	public void updateApCheckItemBilled(List<HashMap<String, Object>> list);
-
-	/**
-	 * 根据开票单更新来源单据已开票数
-	 */
-	public void updateBilledByApBillOut(PurchaseApBillOut apBillOut);
-
-	/**
-	 * 删除新生成的开票单
-	 */
-	public void deleteApBillOut(Long id);
-
-	/**
-	 * 提交生成的未开票单
-	 */
-	public ModelMap doBillOut(Long id);
-
-	/**
-	 * 分页查找开票单,包括明细(全部)
-	 * 
-	 * @param pageInfo
-	 * @param keyword
-	 *            查找关键字
-	 * @return
-	 */
-	public Page<PurchaseApBillOut> findAllByPageInfo(PageInfo pageInfo, String keyword, SearchFilter searchFilter);
-
-	/**
-	 * 分页查找开票单,包括明细(未开票)
-	 * 
-	 * @param pageInfo
-	 * @param keyword
-	 *            查找关键字
-	 * @return
-	 */
-	public Page<PurchaseApBillOutTodo> findTodoByPageInfo(PageInfo pageInfo, String keyword, SearchFilter searchFilter);
-
-	/**
-	 * 分页查找开票单,包括明细(已开票)
-	 * 
-	 * @param pageInfo
-	 * @param keyword
-	 *            查找关键字
-	 * @return
-	 */
-	public Page<PurchaseApBillOutDone> findDoneByPageInfo(PageInfo pageInfo, String keyword, SearchFilter searchFilter);
-
-	/**
-	 * 分页查找开票单,包括明细(不同意 已作废 )
-	 * 
-	 * @param pageInfo
-	 * @param keyword
-	 *            查找关键字
-	 * @return
-	 */
-	public Page<PurchaseApBillOutEnd> findEndByPageInfo(PageInfo pageInfo, String keyword, SearchFilter searchFilter);
-
-	/**
-	 * 打印订单,订单打印此次 +1
-	 * 
-	 * @param id
-	 */
-	public void print(Long id);
-
-	/**
-	 * 通过sourceTable和sourceId判断是否存在未开票的单据
-	 * 
-	 * @param sourceTable
-	 * @param sourceId
-	 * @return
-	 */
-	public List<PurchaseApBillOutItem> findBySourceTableAndSourceId(String sourceTable, Long sourceId);
-
-	/**
-	 * 待处理的开票单
-	 * 
-	 * @return
-	 */
-	public long getCountByenUUAndStatus();
-
-	/**
-	 * 获取分类编码信息
-	 *
-	 * @return
-	 */
-	public PurchaseApBillOutTaxCode getTaxCode(String spbm, String version);
-
-	/**
-	 * 作废发票
-	 *
-	 * @return
-	 */
-	public ModelMap invoiceCancel(PurchaseApBillOut apBillOut);
-
-	/**
-	 * 保存开票明细
-	 **/
-	public void saveByItem(List<PurchaseApBillOutItem> apBillOutItems);
-
-	/**
-	 * 保存票加加返回的开票信息
-	 */
-	public void save(PurchaseApBillOut purchaseApBillOut);
-
-	/**
-	 * 根据单号获取开票信息
-	 **/
-	public PurchaseApBillOut findByCode(String orderNo);
-}

+ 0 - 132
src/main/java/com/uas/platform/b2b/service/SOAPConsoleService.java

@@ -1,132 +0,0 @@
-package com.uas.platform.b2b.service;
-
-import com.uas.platform.b2b.model.*;
-import org.springframework.ui.ModelMap;
-
-/**
- * Created by 黄诚天 on 2017/7/11.
- */
-public interface SOAPConsoleService {
-    /**
-     * 获取库存信息
-     *
-     * @param
-     * @return
-     */
-    public ModelMap getRepertoryMessage();
-
-    /**
-     * 发票开具
-     *
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap invoiceIssued(PurchaseApBillOut apBillOut);
-
-
-    /**
-     * 发票打印
-     *
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap invoicePrint(PurchaseApBillOut apBillOut, Integer PrintKind);
-
-    /**
-     * 清单打印
-     *
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap listPrint(PurchaseApBillOut apBillOut);
-
-    /**
-     * 发票作废
-     *
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap InvoiceCancel(PurchaseApBillOut apBillOut);
-
-    /**
-     * 查询发票信息
-     *
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap queryInvoiceMessage(PurchaseApBillOut apBillOut, Integer a, Integer b);
-
-    /**
-     * 查询库存信息
-     *
-     * @return
-     */
-    public ModelMap queryRepertyMessage();
-
-    /**
-     * 查询下一发票机库存信息
-     *
-     * @return
-     */
-    public ModelMap queryNextRepertyMessage();
-
-    /**
-     * 启动开票服务
-     *
-     * @return
-     */
-    public ModelMap startBillOut();
-
-    /**
-     * 关闭开票服务
-     *
-     * @return
-     */
-    public ModelMap closeBillOut();
-
-    /**
-     * 发票上传
-     *
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap invoiceUpload(PurchaseApBillOut apBillOut);
-
-    /**
-     * 发票状态更新
-     *
-     * @return
-     */
-    public ModelMap invoiceStatusUpdate();
-
-    /**
-     * 单张发票查询
-     *
-     * @param apBillOut
-     * @return
-     */
-    public ModelMap singleInvoiceQuery(PurchaseApBillOut apBillOut);
-
-    /**
-     * 机动车发票填开
-     *
-     * @param json
-     * @return
-     */
-    public SoapMotorInvoiceIssued motorInvoiceIssued(String json);
-
-    /**
-     * 机动车发票查询
-     *
-     * @param json
-     * @return
-     */
-    public SoapMotorInvoiceQuery motorInvoiceQuery(String json);
-
-    /**
-     * 查询金税设备
-     *
-     * @return
-     */
-    public ModelMap taxEquipmentQuery();
-}

+ 0 - 12
src/main/java/com/uas/platform/b2b/service/impl/EnterpriseServiceImpl.java

@@ -71,8 +71,6 @@ public class EnterpriseServiceImpl implements EnterpriseService {
 	private CommonDao commonDao;
 	@Autowired
 	private UserBaseInfoDao userBaseInfoDao;
-	@Autowired
-	private PurchaseApBillOutInfoDao purchaseApBillOutInfoDao;
 
 	static final String TEL_REGEXP = "^[0]{1}[0-9]{2,3}-[0-9]{7,8}|((\\(\\d{3}\\))|(\\d{3}\\-))?(13|15|18)\\d{9}$";
 
@@ -775,16 +773,6 @@ public class EnterpriseServiceImpl implements EnterpriseService {
 		}
 	}
 
-	@Override
-	public PurchaseApBillOutInfo saveApBillOutInfo(PurchaseApBillOutInfo apBillOutInfo) {
-		return purchaseApBillOutInfoDao.save(apBillOutInfo);
-	}
-
-    @Override
-    public PurchaseApBillOutInfo getApBillOutInfo(Long enuu) {
-        return purchaseApBillOutInfoDao.findByUu(enuu);
-    }
-
 	/**
 	 * 通过注册时间查询企业注册信息
 	 *

+ 0 - 965
src/main/java/com/uas/platform/b2b/service/impl/PiaoPlusServiceImpl.java

@@ -1,965 +0,0 @@
-package com.uas.platform.b2b.service.impl;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.uas.platform.b2b.dao.PurchaseApBillOutDao;
-import com.uas.platform.b2b.dao.PurchaseApBillOutInfoDao;
-import com.uas.platform.b2b.model.Product;
-import com.uas.platform.b2b.model.PurchaseApBillOut;
-import com.uas.platform.b2b.model.PurchaseApBillOutInfo;
-import com.uas.platform.b2b.model.PurchaseApBillOutItem;
-import com.uas.platform.b2b.service.PiaoPlusService;
-import com.uas.platform.b2b.support.SystemSession;
-import com.uas.platform.core.util.HttpUtil;
-import com.uas.ps.core.util.StringUtils;
-import com.uas.sso.common.encrypt.MD5;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.ui.ModelMap;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.text.DecimalFormat;
-import java.util.*;
-
-@Service
-public class PiaoPlusServiceImpl implements PiaoPlusService{
-    @Autowired
-    PurchaseApBillOutDao purchaseApBillOutDao;
-
-    @Autowired
-    PurchaseApBillOutInfoDao purchaseApBillOutInfoDao;
-
-    DecimalFormat df = new DecimalFormat("#.00");
-    private boolean isBaiWang = false;
-
-    @Override
-    public ModelMap invoiceIssued(PurchaseApBillOut apBillOut) {
-        ModelMap result = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-
-        String url = "http://test.fapiaoxx.com/icloud/invoice/issue.json";
-        String invoiceKind = "004";//004:专票,007:普票, 026:电子票.百望税盘必填
-        String eqptType = "1";//设备类型 0税控服务,1税控盘.百望税盘必填
-        String collectorPhone = "18770087064";
-        String category = "4";//发票分类
-        String drawer = SystemSession.getUser().getUserName();
-        String taxDiskCode = "";
-        String taxDiskPwd = "";
-        String taxSignPwd = "";
-
-        Set<PurchaseApBillOutItem> apBillOutItems = apBillOut.getItems();
-        //获取购方开票信息
-        PurchaseApBillOutInfo customerApBillOutInfo = apBillOut.getCustomerApBillOutInfo();
-        if (customerApBillOutInfo == null) {
-            result.put("error", errorMsg.append("获取不到购方开票信息,请先完善!"));
-            return result;
-        }
-        //获取销方开票信息
-        PurchaseApBillOutInfo apBillOutInfo = apBillOut.getApBillOutInfo();
-        if (apBillOutInfo == null) {
-            result.put("error", errorMsg.append("获取不到销方开票信息,请先完善!"));
-            return result;
-        }
-
-        //签名部分
-        List<String> paras = new ArrayList<>();
-        paras.add("buyerName=" + apBillOut.getCustName());
-        paras.add("collectorPhone=" + collectorPhone);//TODO 收票人手机
-        paras.add("drawer=" + drawer);//开票人
-        paras.add("orderNo=" + apBillOut.getCode());
-        //专票时以下参数参与签名
-//        if ("004".equals(invoiceKind)) {
-//            paras.add("buyerTaxpayerId=" + customerApBillOutInfo.getTaxNr());
-//            paras.add("buyerAddr=" + customerApBillOutInfo.getAddress());
-//            paras.add("buyerMobile=" + customerApBillOutInfo.getTel());
-//            paras.add("buyerAccountNo=" + customerApBillOutInfo.getBankAccountNr());
-//        }
-        paras.add("taxpayerId=" + apBillOutInfo.getTaxNr());
-        //百望税盘时以下参数参与 //TODO 判断
-        if (isBaiWang && "1".equals(eqptType)) {
-            paras.add("issueAddressCode=" + apBillOut.getKpdh());//TODO 开票点代码
-            paras.add("eqptType=" + eqptType);
-            paras.add("invoiceKind=" + invoiceKind);//TODO 发票种类编码
-            //百望税盘且设备类型eqptType为1参与
-            paras.add("taxDiskCode=" + taxDiskCode);//T税控盘编号
-            paras.add("taxDiskPwd=" + taxDiskPwd);//税控盘口令
-            paras.add("taxSignPwd=" + taxSignPwd);//税务数字证书密码
-        }
-        String[] paraArr = new String[paras.size()];
-        String timestamp = String.valueOf(System.currentTimeMillis());
-        paras.add("timestamp=" + timestamp);
-        String aa = paras.toString();
-        String sign = sign("test.fapiaoxx.com/icloud/invoice/issue.json", "POST", timestamp, paras.toArray(paraArr));
-
-        JSONObject paraMap = new JSONObject(16,true);
-        if (StringUtils.isEmpty(apBillOutInfo.getTaxNr())) {
-            result.put("error", errorMsg.append("获取不到纳税人识别号!"));
-        }
-        if (StringUtils.isEmpty(apBillOut.getCustName())) {
-            result.put("error", errorMsg.append("获取不到购买方名称!"));
-        }
-        if (StringUtils.isEmpty(collectorPhone)) {
-            result.put("error", errorMsg.append("获取不到收票人手机!"));
-        }
-        if (StringUtils.isEmpty(drawer)) {
-            result.put("error", errorMsg.append("获取不到开票人名称!"));
-        }
-        if (StringUtils.isEmpty(apBillOut.getCode())) {
-            result.put("error", errorMsg.append("获取不到订单号!"));
-        }
-          paraMap.put("taxpayerId", apBillOutInfo.getTaxNr());//纳税人识别号
-          paraMap.put("buyerName", apBillOut.getCustName());//购买方名称
-          paraMap.put("collectorPhone", collectorPhone);//TODO 收票人手机
-          paraMap.put("drawer", SystemSession.getUser().getUserName());//开票人
-          paraMap.put("orderNo", apBillOut.getCode());//订单号
-          paraMap.put("category", category);
-          paraMap.put("issueSource", "0");//开票来源
-          paraMap.put("mediumType", "2");//发票媒介类型
-        //以下为可为空字段
-          paraMap.put("buyerTaxpayerId", customerApBillOutInfo.getTaxNr());//购买方识别号
-          paraMap.put("buyerAddr", customerApBillOutInfo.getAddress());//购买方地址
-          paraMap.put("buyerMobile", customerApBillOutInfo.getTel());//购买方电话
-          paraMap.put("buyerAccountNo", customerApBillOutInfo.getBankAccountNr());//购买方银行及账号  开户行及账号
-          paraMap.put("buyerEmail", "");//购买方邮箱
-          paraMap.put("payee", customerApBillOutInfo.getPayee());//收款人
-          paraMap.put("checker", customerApBillOutInfo.getChecker());//复核人
-        if (isBaiWang && StringUtils.isEmpty(apBillOut.getKpdh())) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的开票点代码!"));
-        }
-        if (isBaiWang && StringUtils.isEmpty(eqptType)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的设备的类型!"));
-        }
-        if (isBaiWang && StringUtils.isEmpty(invoiceKind)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的开票的类型!"));
-        }
-        if (isBaiWang && "1".equals(eqptType) && StringUtils.isEmpty(taxDiskCode)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的税控盘编号!"));
-        }
-        if (isBaiWang && "1".equals(eqptType) && StringUtils.isEmpty(taxDiskPwd)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的税控盘口令!"));
-        }
-        if (isBaiWang && "1".equals(eqptType) && StringUtils.isEmpty(taxSignPwd)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的税务数字证书密码!"));
-        }
-        if (result.size() > 0) {
-            return result;
-        }
-          paraMap.put("invoiceKind", invoiceKind);//004:专票,007:普票,026:电子票.百望税盘必填
-          paraMap.put("remark", apBillOut.getRemark());
-
-        List<JSONObject> wares = new ArrayList<>();
-        for (PurchaseApBillOutItem apBillOutItem : apBillOutItems) {
-            // wares  商品行项目信息(发票明细)
-            Product product = apBillOutItem.getProduct();
-            product.setGoodstaxno((Math.random() + 50) + "");//TODO 商品编码
-            if (product == null) {
-                result.put("error", errorMsg.append("获取不到商品信息!"));
-                return result;
-            }
-            if (StringUtils.isEmpty(product.getTitle())) {
-                result.put("error", errorMsg.append("获取不到商品名称!"));
-            }
-            if (StringUtils.isEmpty(apBillOutItem.getNowQty())) {
-                result.put("error", errorMsg.append("获取不到商品开票数量!"));
-            }
-            if (StringUtils.isEmpty(apBillOutItem.getNowPrice())) {
-                result.put("error", errorMsg.append("获取不到商品开票单价!"));
-            }
-            if (StringUtils.isEmpty(product.getGoodstaxno())) {
-                result.put("error", errorMsg.append("获取不到商品编码!"));
-            }
-            if (StringUtils.isEmpty(apBillOutItem.getTaxrate())) {
-                result.put("error", errorMsg.append("获取不到商品税率!"));
-            }
-            JSONObject ware = new JSONObject(16, true);
-
-              ware.put("taxpayerId", apBillOutInfo.getTaxNr());//纳税人识别号
-              ware.put("wareName", product.getTitle());//商品名称
-              ware.put("count", apBillOutItem.getNowQty());//数量 整数
-              ware.put("unitPrice", apBillOutItem.getNowPrice());//单价 小数点后2位,以元为单位精确到分,含税价
-              ware.put("amount", "1.00");//金额
-              ware.put("wareNo", "1090232070000000000");//TODO product.getGoodstaxno() 商品编码  应与税局最新发行的商品和服务税收分类与编码相一致
-              ware.put("taxRate", 0.17);//0表示免税,两位小数,0.17
-            //否
-              ware.put("unit", product.getUnit());//单位
-              ware.put("standard", product.getSpec());//规格型号
-              ware.put("discountAmount", "");//优惠后总额
-              ware.put("yhzcbs", "");
-              ware.put("lslbs", "");
-              ware.put("zzstsgl", "");
-
-            wares.add(ware);
-        }
-
-        paraMap.put("wareListInfo", wares);
-
-        //调用票加加开票接口
-        try {
-            String a = paraMap.toString();
-            url = url + "?timestamp=" + timestamp + "&sign=" + sign;
-            String resultStr =  HttpUtil.sendPost(url, paraMap.toString());
-            JSONObject resultJo = JSON.parseObject(resultStr);
-            String code = resultJo.getString("code");//结果码 0000代表成功,其它为失败
-            String resMsg = resultJo.getString("resMsg");
-            String requestCode = resultJo.getString("requestCode");//请求流水号
-            String orderNo = resultJo.getString("orderNo");
-            if ("0000".equals(code)) {
-                apBillOut.setRetmsg(resMsg);
-                apBillOut.setRequestCode(requestCode);
-                //修改开票单状态
-                apBillOut.setCheckStatus("已开票");
-
-                try {
-                    purchaseApBillOutDao.save(apBillOut);
-                } catch (Exception e) {
-                    result.put("dbError","开具发票成功,但过程中数据库更新开票单失败,需要人工紧急处理,作废此开票单据");
-                }
-
-                result.put("apBillOut",apBillOut);
-            } else {
-                result.put("resultJo",resultJo);
-                //map.put("error","发票开具失败");
-                result.put("error",errorMsg.append(resMsg));
-            }
-        } catch (NullPointerException e) {
-            result.put("error",errorMsg.append("从票加加开票接口获取数据失败"));
-            e.printStackTrace();
-        } catch (Exception e) {
-            result.put("error",errorMsg.append("链接票加加开票接口失败"));
-            e.printStackTrace();
-        }
-
-        return result;
-    }
-
-    @Override
-    public ModelMap InvoiceCancel(PurchaseApBillOut apBillOut) {
-        ModelMap result = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-
-        String url = "http://192.168.253.75:8282/icloud/invoice/revoke.json";
-        String invoiceKind = "004";//004:专票,007:普票, 026:电子票.百望税盘必填
-        String eqptType = "1";//设备类型 0税控服务,1税控盘.百望税盘必填
-        String taxDiskCode = "";
-        String taxDiskPwd = "";
-        String taxSignPwd = "";
-
-        Set<PurchaseApBillOutItem> apBillOutItems = apBillOut.getItems();
-        //获取购方开票信息
-        PurchaseApBillOutInfo customerApBillOutInfo = apBillOut.getCustomerApBillOutInfo();
-        if (customerApBillOutInfo == null) {
-            result.put("error", errorMsg.append("获取不到购方开票信息,请先完善!"));
-            return result;
-        }
-        //获取销方开票信息
-        PurchaseApBillOutInfo apBillOutInfo = apBillOut.getApBillOutInfo();
-        if (apBillOutInfo == null) {
-            result.put("error", errorMsg.append("获取不到销方开票信息,请先完善!"));
-            return result;
-        }
-
-        //签名部分
-        List<String> paras = new ArrayList<>();
-        paras.add("orderNo=" + apBillOut.getCode());
-        paras.add("replacedInvoiceCode=" + apBillOut.getInfoTypeCode());
-        paras.add("replacedInvoiceNo=" + apBillOut.getInfoNumber());
-        paras.add("revokeReson=" + "");//冲红原因
-        paras.add("taxpayerId=" + apBillOutInfo.getTaxNr());
-        //百望税盘参与 //TODO 判断
-        if (isBaiWang) {
-            paras.add("eqptType=" + eqptType);
-            paras.add("issueAddressCode=" + apBillOut.getKpdh());//TODO 开票点代码
-            paras.add("invoiceKind=" + invoiceKind);//TODO 发票种类编码
-        }
-
-        if (isBaiWang && "1".equals(eqptType)) {
-            paras.add("taxDiskCode=" + taxDiskCode);// 税控盘编号
-            paras.add("taxDiskPwd=" + taxDiskPwd);// 税控盘口令
-            paras.add("taxSignPwd=" + taxSignPwd);// 税务数字证书密码
-        }
-
-        int kplx = -1;//TODO 开票类型
-        if (isBaiWang && kplx < 0 && "004".equals(invoiceKind)) {
-            paras.add("redInfoCode=" + "");//TODO 红字信息表编号
-        }
-
-        if (isBaiWang && "004".equals(invoiceKind)) {
-            paras.add("noticeOrderCode=" + "");//TODO 通知单编号
-        }
-
-        String[] paraArr = new String[paras.size()];
-        String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
-        String sign = sign("icloud/invoice/revoke.json", "POST", timestamp, paras.toArray(paraArr));
-
-        Map<String,Object> paraMap = new HashMap<>();
-        String revokeReson = "";
-        if (StringUtils.isEmpty(apBillOutInfo.getTaxNr())) {
-            result.put("error", errorMsg.append("获取不到纳税人识别号!"));
-        }
-        if (StringUtils.isEmpty(apBillOut.getInfoTypeCode())) {
-            result.put("error", errorMsg.append("获取不到原发票代码!"));
-        }
-        if (StringUtils.isEmpty(apBillOut.getInfoNumber())) {
-            result.put("error", errorMsg.append("获取不到原发票号码!"));
-        }
-        if (StringUtils.isEmpty(revokeReson)) {
-            result.put("error", errorMsg.append("获取不到冲红原因!"));
-        }
-        if (StringUtils.isEmpty(apBillOut.getCode())) {
-            result.put("error", errorMsg.append("获取不到订单号!"));
-        }
-        paraMap.put("taxpayerId", apBillOutInfo.getTaxNr());//纳税人识别号
-        paraMap.put("replacedInvoiceCode", apBillOut.getInfoTypeCode());//原发票代码
-        paraMap.put("replacedInvoiceNo", apBillOut.getInfoNumber());//原发票号码
-        paraMap.put("revokeReson", revokeReson);//冲红原因
-        paraMap.put("orderNo", apBillOut.getCode());//订单号
-        //以下为可为空字段
-        String issueAddressCode = apBillOut.getKpdh();
-        String redInfoCode = "";
-        String noticeOrderCode = "";
-        if (isBaiWang && StringUtils.isEmpty(issueAddressCode)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的开票点代码!"));
-        }
-        if (isBaiWang && StringUtils.isEmpty(eqptType)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的设备的类型!"));
-        }
-        if (isBaiWang && StringUtils.isEmpty(invoiceKind)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的开票的类型!"));
-        }
-        if (isBaiWang && "1".equals(eqptType) && StringUtils.isEmpty(taxDiskCode)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的税控盘编号!"));
-        }
-        if (isBaiWang && "1".equals(eqptType) && StringUtils.isEmpty(taxDiskPwd)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的税控盘口令!"));
-        }
-        if (isBaiWang && "1".equals(eqptType) && StringUtils.isEmpty(taxSignPwd)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时的税务数字证书密码!"));
-        }
-        if (isBaiWang && "004".equals(invoiceKind) && StringUtils.isEmpty(redInfoCode)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时专票冲红的红字信息表编号!"));
-        }
-        if (isBaiWang && "004".equals(invoiceKind) && StringUtils.isEmpty(noticeOrderCode)) {
-            result.put("error", errorMsg.append("获取不到百望税盘时专票冲红的通知单编号!"));
-        }
-        if (result.size() > 0) {
-            return result;
-        }
-        paraMap.put("issueAddressCode", issueAddressCode);//开票点代码  百望税盘必填
-        paraMap.put("eqptType", eqptType);//设备类型 0税控服务,1税控盘.百望税盘必填
-        paraMap.put("invoiceKind", invoiceKind);//004:专票,007:普票,026:电子票.百望税盘必填
-        paraMap.put("taxDiskCode", taxDiskCode);//税控盘编号  百望税盘且设备类型为1必填
-        paraMap.put("taxDiskPwd", taxDiskPwd);//税控盘口令  百望税盘且设备类型为1必填
-        paraMap.put("taxSignPwd", taxSignPwd);//税务数字证书密码  百望税盘且设备类型为1必填
-        paraMap.put("redInfoCode", redInfoCode);//红字信息表编号  百望税盘, 专票红冲时,必填。
-        paraMap.put("noticeOrderCode", noticeOrderCode);//通知单编号  百望税盘,专票红冲时,必填。
-
-
-        //调用票加加冲红接口
-        try {
-            HttpUtil.Response response = HttpUtil.sendPostRequest(url, paraMap);
-            JSONObject resultJo = JSON.parseObject(response.getResponseText());
-            String code = resultJo.getString("code");//结果码 0000代表成功,其它为失败
-            String resMsg = resultJo.getString("resMsg");
-            String requestCode = resultJo.getString("requestCode");//请求流水号
-            if ("0000".equals(code)) {
-                apBillOut.setRetmsg(resMsg);
-                apBillOut.setRequestCode(requestCode);
-                //修改开票单状态
-                apBillOut.setCheckStatus("已作废");
-
-                try {
-                    purchaseApBillOutDao.save(apBillOut);
-                } catch (Exception e) {
-                    result.put("dbError","冲红发票成功,但过程中数据库更新开票单失败,需要人工紧急处理,作废此开票单据");
-                }
-
-                result.put("apBillOut",apBillOut);
-            } else {
-                result.put("resultJo",resultJo);
-                result.put("error",errorMsg.append(resMsg));
-            }
-        } catch (NullPointerException e) {
-            result.put("error",errorMsg.append("从票加加开票接口获取数据失败"));
-            e.printStackTrace();
-        } catch (Exception e) {
-            result.put("error",errorMsg.append("链接票加加开票接口失败"));
-            e.printStackTrace();
-        }
-
-        return result;
-    }
-
-    @Override
-    public ModelMap queryInvoiceMessage(PurchaseApBillOut apBillOut) {
-        Map<String,Object> paraMap = new HashMap<>();
-        String url = "http://192.168.253.75:8282/icloud/invoice/query.json";
-        String invoiceKind = "004";//004:专票,007:普票, 026:电子票.百望税盘必填
-        String eqptType = "1";//设备类型 0税控服务,1税控盘.百望税盘必填
-
-        Set<PurchaseApBillOutItem> apBillOutItems = apBillOut.getItems();
-        //获取购方开票信息
-        PurchaseApBillOutInfo customerApBillOutInfo = apBillOut.getCustomerApBillOutInfo();
-        //获取销方开票信息
-        PurchaseApBillOutInfo apBillOutInfo = apBillOut.getApBillOutInfo();
-
-        //签名部分  发票代码+发票号码、订单号三选一.传入什么参数就用什么参数签名,为空不参与签名
-        List<String> paras = new ArrayList<>();
-        String invoiceCode = apBillOut.getInfoTypeCode();
-        String invoiceNum = apBillOut.getInfoNumber();
-        String orderNo = apBillOut.getCode();
-        String requestCode = "";//请求流水号
-        if (StringUtils.isEmpty(requestCode) && (StringUtils.isEmpty(invoiceCode) && StringUtils.isEmpty(invoiceNum)) && StringUtils.isEmpty(orderNo)) {
-            //TODO 为空不参与签名
-        } else if (!StringUtils.isEmpty(requestCode)){
-            paras.add("requestCode=" + requestCode);
-            paraMap.put("requestCode", requestCode);
-        } else if (!(StringUtils.isEmpty(invoiceNum) && StringUtils.isEmpty(invoiceCode))) {
-            paras.add("invoiceCode=" + invoiceCode);
-            paras.add("invoiceNum=" + invoiceNum);
-            paraMap.put("invoiceCode", invoiceCode);
-            paraMap.put("invoiceNum", invoiceNum);
-        } else if (!StringUtils.isEmpty(orderNo)) {
-            paras.add("orderNo=" + orderNo);
-            paraMap.put("orderNo", orderNo);
-        }
-
-        paras.add("taxpayerId=" + apBillOutInfo.getTaxNr());
-        String[] paraArr = new String[paras.size()];
-        String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
-        String sign = sign("icloud/invoice/query.json", "POST", timestamp, paras.toArray(paraArr));
-
-        paraMap.put("taxpayerId", apBillOutInfo.getTaxNr());//纳税人识别号
-        paraMap.put("needItem", false);//是否需要商品详情
-
-        //调用票加加查询开票接口
-        try {
-            HttpUtil.Response response = HttpUtil.sendPostRequest(url, paraMap);
-            JSONObject responseJo = JSON.parseObject(response.getResponseText());
-            String code = responseJo.getString("code");//0000代表开具成功,1111代表未开具,2222代表开具中,其它代表开具失败
-            String resMsg = responseJo.getString("resMsg");
-            //TODO 查询结果处理
-
-        } catch (NullPointerException e) {
-            System.out.print("error从票加加开票接口获取数据失败");
-            e.printStackTrace();
-        } catch (Exception e) {
-            System.out.print("error链接票加加开票接口失败");
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-
-    @Override
-    public ModelMap querybillingcount(String queryDate) {
-        Map<String,Object> paraMap = new HashMap<>();
-        String url = "http://192.168.253.75:8282/icloud/invoice/querybillingcount.json";
-        PurchaseApBillOutInfo apBillOutInfo = purchaseApBillOutInfoDao.findByUu(SystemSession.getUser().getEnterprise().getUu());
-        String taxpayerId = apBillOutInfo.getTaxNr();
-
-        //签名部分
-        List<String> paras = new ArrayList<>();
-        paras.add("taxpayerId=" + taxpayerId);
-        paras.add("queryDate=" + queryDate);
-        String[] paraArr = new String[paras.size()];
-        String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
-        String sign = sign("icloud/invoice/querybillingcount.json", "POST", timestamp, paras.toArray(paraArr));
-
-        paraMap.put("taxpayerId", taxpayerId);
-        paraMap.put("queryDate", queryDate);
-
-        //调用票加加统计开票接口
-        try {
-            HttpUtil.Response response = HttpUtil.sendPostRequest(url, paraMap);
-            JSONObject responseJo = JSON.parseObject(response.getResponseText());
-            String code = responseJo.getString("code");//0000代表成功其它代表失败
-            String resMsg = responseJo.getString("resMsg");
-            String totalCount = responseJo.getString("totalCount");//提交开票量
-            String totalSuccCount = responseJo.getString("totalSuccCount");//成功开票量
-            String totalMoney = responseJo.getString("totalMoney");//开票总金额
-
-        } catch (NullPointerException e) {
-            System.out.print("error从票加加开票接口获取数据失败");
-            e.printStackTrace();
-        } catch (Exception e) {
-            System.out.print("error链接票加加开票接口失败");
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-
-    @Override
-    public ModelMap queryBillLeftCount() {
-        Map<String,Object> paraMap = new HashMap<>();
-        String url = "http://192.168.253.75:8282/icloud/invoice/queryBillLeftCount.json";
-        String eqptType = "1";
-        PurchaseApBillOutInfo apBillOutInfo = purchaseApBillOutInfoDao.findByUu(SystemSession.getUser().getEnterprise().getUu());
-        String taxpayerId = apBillOutInfo.getTaxNr();
-
-        List<String> paras = new ArrayList<>();
-        paras.add("taxpayerId=" + taxpayerId);
-        paraMap.put("taxpayerId", taxpayerId);
-
-        if (isBaiWang) {
-            paras.add("eqptType=" + eqptType);
-            paras.add("machineCode=" + "");
-            paras.add("invoiceKind=" + "");
-            paraMap.put("eqptType", eqptType);//设备类型 0税控服务,1税控盘.百望税盘必填
-            paraMap.put("machineCode", "");//机器编号 百望税盘必填。 设备类型0为:核心板编号、1为:税盘编号
-            paraMap.put("invoiceKind", "");//004:专票,007:普票,026:电子票.百望税盘必填
-        }
-
-        if (isBaiWang && "0".equals(eqptType)) {
-            paras.add("teminalFlag=" + "");
-            paraMap.put("teminalFlag", "");//百望税盘且设备类型为0必填,开票点代码
-        }
-
-        if (isBaiWang && "1".equals(eqptType)) {
-            paras.add("taxDiskCode=" + "");
-            paras.add("taxDiskPwd=" + "");
-            paras.add("taxSignPwd=" + "");
-            paraMap.put("taxDiskCode", "");//税控盘编号  百望税盘且设备类型为1必填
-            paraMap.put("taxDiskPwd", "");//税控盘口令  百望税盘且设备类型为1必填
-            paraMap.put("taxSignPwd", "");//税务数字证书密码  百望税盘且设备类型为1必填
-        }
-
-        String[] paraArr = new String[paras.size()];
-        String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
-        String sign = sign("icloud/invoice/querybillingcount.json", "POST", timestamp, paras.toArray(paraArr));
-
-        //调用票加加统计开票接口
-        try {
-            HttpUtil.Response response = HttpUtil.sendPostRequest(url, paraMap);
-            JSONObject responseJo = JSON.parseObject(response.getResponseText());
-            String code = responseJo.getString("code");//0000代表成功其它代表失败
-            String resMsg = responseJo.getString("resMsg");
-            String leftInvoiceNum = responseJo.getString("leftInvoiceNum");//剩余发票量
-
-        } catch (NullPointerException e) {
-            System.out.print("error从票加加开票接口获取数据失败");
-            e.printStackTrace();
-        } catch (Exception e) {
-            System.out.print("error链接票加加开票接口失败");
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-
-    @Override
-    public ModelMap printInvoice(PurchaseApBillOut apBillOut) {
-        ModelMap result = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-
-        Map<String,Object> paraMap = new HashMap<>();
-        String url = "http://192.168.253.75:8282/icloud/invoice/printInvoice.json";
-        String invoiceKind = "004";//004:专票,007:普票, 026:电子票.百望税盘必填
-        String eqptType = "1";//设备类型 0税控服务,1税控盘.百望税盘必填
-        String taxDiskCode = "";
-        String taxDiskPwd = "";
-        String taxSignPwd = "";
-        String invoiceNum = "";//(税控盘必填)单张打印
-        String printKind = "";//(税控盘必填)0:发票打印,1:清单打印  (批量打印不支持清单打印)
-        String printType = "";//(税控盘必填)1:单张打印
-
-        Set<PurchaseApBillOutItem> apBillOutItems = apBillOut.getItems();
-        //获取购方开票信息
-        //PurchaseApBillOutInfo customerApBillOutInfo = apBillOut.getCustomerApBillOutInfo();
-        //获取销方开票信息
-        PurchaseApBillOutInfo apBillOutInfo = apBillOut.getApBillOutInfo();
-        if (apBillOutInfo == null) {
-            result.put("error", errorMsg.append("获取不到销方开票信息,请先完善!"));
-            return result;
-        }
-
-        //签名部分
-        List<String> paras = new ArrayList<>();
-        String issueAddressCode = apBillOut.getKpdh();
-        if (StringUtils.isEmpty(apBillOutInfo.getTaxNr())) {
-            result.put("error", errorMsg.append("获取不到纳税人识别号!"));
-        }
-        if (StringUtils.isEmpty(eqptType)) {
-            result.put("error", errorMsg.append("获取不到设备类型!"));
-        }
-        if (StringUtils.isEmpty(issueAddressCode)) {
-            result.put("error", errorMsg.append("获取不到开票点代码!"));
-        }
-        if (StringUtils.isEmpty(invoiceKind)) {
-            result.put("error", errorMsg.append("获取不到开票类型!"));
-        }
-        if (StringUtils.isEmpty(apBillOut.getInfoTypeCode())) {
-            result.put("error", errorMsg.append("获取不到发票代码!"));
-        }
-        paras.add("taxpayerId=" + apBillOutInfo.getTaxNr());
-        paras.add("eqptType="+ eqptType);
-        paras.add("issueAddressCode=" + issueAddressCode);//开票点代码
-        paras.add("invoiceKind=" + invoiceKind);//004:专票,007:普票
-        paras.add("invoiceCode=" + apBillOut.getInfoTypeCode());//发票代码
-
-        paraMap.put("taxpayerId", apBillOutInfo.getTaxNr());
-        paraMap.put("eqptType", eqptType);
-        paraMap.put("issueAddressCode", apBillOut.getKpdh());
-        paraMap.put("invoiceKind", invoiceKind);
-        paraMap.put("invoiceCode", apBillOut.getInfoTypeCode());
-
-        if ("1".equals(eqptType)) {
-            if (StringUtils.isEmpty(invoiceNum)) {
-                result.put("error", errorMsg.append("获取不到税控盘单张打印时发票号码!"));
-            }
-            if (StringUtils.isEmpty(printKind)) {
-                result.put("error", errorMsg.append("获取不到税控盘的打印类型设置!"));
-            }
-            if (StringUtils.isEmpty(printType)) {
-                result.put("error", errorMsg.append("获取不到税控盘打印方式!"));
-            }
-
-            paras.add("invoiceNum=" + invoiceNum);
-            paras.add("printKind=" + printKind);
-            paras.add("printType=" + printType);
-
-            paraMap.put("invoiceNum", invoiceNum);
-            paraMap.put("printKind", printKind);
-            paraMap.put("printType", printType);
-        }
-
-        if (isBaiWang && "1".equals(eqptType)) {
-            if (StringUtils.isEmpty(taxDiskCode)) {
-                result.put("error", errorMsg.append("获取不到百望税盘时的税控盘编号!"));
-            }
-            if (StringUtils.isEmpty(taxDiskPwd)) {
-                result.put("error", errorMsg.append("获取不到百望税盘时的税控盘口令!"));
-            }
-            if (StringUtils.isEmpty(taxSignPwd)) {
-                result.put("error", errorMsg.append("获取不到百望税盘时的税务数字证书密码!"));
-            }
-
-            paras.add("taxDiskCode=" + taxDiskCode);
-            paras.add("taxDiskPwd=" + taxDiskPwd);
-            paras.add("taxSignPwd=" + taxSignPwd);
-
-            paraMap.put("taxDiskCode", taxDiskCode);
-            paraMap.put("taxDiskPwd", taxDiskPwd);
-            paraMap.put("taxSignPwd", taxSignPwd);
-
-        }
-
-        String[] paraArr = new String[paras.size()];
-        String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
-        String sign = sign("icloud/invoice/printInvoice.json", "POST", timestamp, paras.toArray(paraArr));
-
-        //调用票加加发票打印接口
-        try {
-            HttpUtil.Response response = HttpUtil.sendPostRequest(url, paraMap);
-            JSONObject resultJo = JSON.parseObject(response.getResponseText());
-            String code = resultJo.getString("code");//0000代表成功其它代表失败
-            String resMsg = resultJo.getString("resMsg");
-            if ("0000".equals(code)) {
-                result.put("retmsg",resultJo.getString("retmsg"));
-                //添加打印次数
-                apBillOut.setPrint((short) ((apBillOut.getPrint() == null ? 0 : apBillOut.getPrint()) + 1));
-                try {
-                    purchaseApBillOutDao.save(apBillOut);
-                } catch (Exception e) {
-                    result.put("dbError","发票打印成功,但过程中数据库更新开票单打印次数失败,需要人工处理干预");
-                }
-            } else {
-                result.put("resultJo",resultJo);
-                result.put("error",errorMsg.append(resMsg));
-            }
-        } catch (NullPointerException e) {
-            result.put("error",errorMsg.append("从票加加开票接口获取数据失败"));
-            e.printStackTrace();
-        } catch (Exception e) {
-            result.put("error",errorMsg.append("链接票加加开票接口失败"));
-            e.printStackTrace();
-        }
-
-
-        return result;
-    }
-
-    @Override
-    public ModelMap queryDelivery(PurchaseApBillOut apBillOut) {
-        Map<String,Object> paraMap = new HashMap<>();
-        String url = "http://192.168.253.75:8282/imanager/manager/fetchDeliveryTrackingNumbers.ysy";
-        //获取销方开票信息
-        PurchaseApBillOutInfo apBillOutInfo = apBillOut.getApBillOutInfo();
-        String sysOrderNo = apBillOut.getCode();
-        String taxpayerId = apBillOutInfo.getTaxNr();
-        paraMap.put("sysOrderNo", sysOrderNo);
-        paraMap.put("taxpayerId", taxpayerId);
-
-        //调用票加加快递单信息获取接口
-        try {
-            HttpUtil.Response response = HttpUtil.sendPostRequest(url, paraMap);
-            JSONObject responseJo = JSON.parseObject(response.getResponseText());
-            String code = responseJo.getString("code");//0000代表成功其它代表失败
-            String resMsg = responseJo.getString("resMsg");
-            String data = responseJo.getString("data");
-            String remark = responseJo.getString("remark");
-            String businessName = responseJo.getString("businessName");
-            String number = responseJo.getString("number");
-        } catch (NullPointerException e) {
-            System.out.print("error从票加加开票接口获取数据失败");
-            e.printStackTrace();
-        } catch (Exception e) {
-            System.out.print("error链接票加加开票接口失败");
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-
-    @Override
-    public ModelMap uploadInvoice(PurchaseApBillOut apBillOut) {
-        ModelMap result = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-
-        //Map<String,Object> paraMap = new HashMap<>();
-        JSONObject paraMap = new JSONObject(16,true);
-        String url = "http://test.fapiaoxx.com/imanager/manager/getInvoiceInfoFromBPM.ysy";
-        //String eqptType = "1";//设备类型 0税控服务,1税控盘.百望税盘必填
-        String mediumType = "2";//1: 电子发票; 2: 纸质发票
-        String category = "4";//发票分类  1: 增值税专用发票; 4: 增值税普通发票(纸质);10: 增值税普通发票(电子)
-        boolean isZhuanpiao = true;
-
-        Set<PurchaseApBillOutItem> apBillOutItems = apBillOut.getItems();
-        //获取购方开票信息
-        PurchaseApBillOutInfo customerApBillOutInfo = apBillOut.getCustomerApBillOutInfo();
-        if (customerApBillOutInfo == null) {
-            result.put("error", errorMsg.append("获取不到购方开票信息,请先完善!"));
-            return result;
-        }
-        //获取销方开票信息
-        PurchaseApBillOutInfo apBillOutInfo = apBillOut.getApBillOutInfo();
-        if (apBillOutInfo == null) {
-            result.put("error", errorMsg.append("获取不到销方开票信息,请先完善!"));
-            return result;
-        }
-
-        //签名部分
-        List<String> paras = new ArrayList<>();
-        paras.add("sysOrderNo=" + apBillOut.getCode());
-        paras.add("taxpayerId=" + apBillOutInfo.getTaxNr());
-        String timestamp = String.valueOf(System.currentTimeMillis());
-        paras.add("timestamp=" + timestamp);
-        String[] paraArr = new String[paras.size()];
-        String sign = sign("test.fapiaoxx.com/imanager/manager/getInvoiceInfoFromBPM.ysy", "POST", timestamp, paras.toArray(paraArr));
-
-        if (StringUtils.isEmpty(apBillOut.getCode())) {
-            result.put("error", errorMsg.append("获取不到申请单编号!"));
-        }
-        if (StringUtils.isEmpty(mediumType)) {
-            result.put("error", errorMsg.append("获取不到发票媒介类型!"));
-        }
-        if (StringUtils.isEmpty(category)) {
-            result.put("error", errorMsg.append("获取不到发票分类!"));
-        }
-        if (StringUtils.isEmpty(apBillOutInfo.getTaxNr())) {
-            result.put("error", errorMsg.append("获取不到纳税人识别号!"));
-        }
-        if (StringUtils.isEmpty(customerApBillOutInfo.getEnName())) {
-            result.put("error", errorMsg.append("获取不到购买方名称!"));
-        }
-        paraMap.put("sysOrderNo", apBillOut.getCode());//申请单编号
-        paraMap.put("mediumType", mediumType);//发票媒介类型
-        paraMap.put("category", category);//发票分类
-        paraMap.put("taxpayerId", apBillOutInfo.getTaxNr());
-        paraMap.put("buyerName", customerApBillOutInfo.getEnName());
-        //以下为可为空字段
-        String buyerTaxpayerId = customerApBillOutInfo.getTaxNr();
-        String buyerAddr = apBillOutInfo.getAddress();
-        String buyerMobile = apBillOutInfo.getTel();
-        String buyerAccountNo = apBillOutInfo.getBankAccountNr();
-        if (isZhuanpiao) {
-            if (StringUtils.isEmpty(buyerTaxpayerId)) {
-                result.put("error", errorMsg.append("上传专票申请单时获取不到购买方识别号!"));
-            }
-            if (StringUtils.isEmpty(buyerAddr)) {
-                result.put("error", errorMsg.append("上传专票申请单时获取不到购买方地址!"));
-            }
-            if (StringUtils.isEmpty(buyerMobile)) {
-                result.put("error", errorMsg.append("上传专票申请单时获取不到购方电话!"));
-            }
-            if (StringUtils.isEmpty(buyerAccountNo)) {
-                result.put("error", errorMsg.append("上传专票申请单时获取不到购买方银行及账号!"));
-            }
-        } else {
-            if (StringUtils.isEmpty(buyerTaxpayerId)) {
-                buyerTaxpayerId = "";
-            }
-            if (StringUtils.isEmpty(buyerAddr)) {
-                buyerAddr = "";
-            }
-            if (StringUtils.isEmpty(buyerMobile)) {
-                buyerMobile = "";
-            }
-            if (StringUtils.isEmpty(buyerAccountNo)) {
-                buyerAccountNo = "";
-            }
-        }
-        paraMap.put("buyerTaxpayerId", buyerTaxpayerId);
-        paraMap.put("buyerAddr", buyerAddr);
-        paraMap.put("buyerMobile", buyerMobile);
-        paraMap.put("buyerAccountNo", buyerAccountNo);
-
-        if (StringUtils.isEmpty(apBillOutInfo.getChecker())) {
-            paraMap.put("checker", "");
-        } else {
-            paraMap.put("checker", apBillOutInfo.getChecker());
-        }
-
-        paraMap.put("drawer", "");
-
-        if (StringUtils.isEmpty(apBillOutInfo.getPayee())) {
-            paraMap.put("payee", "");
-        } else {
-            paraMap.put("payee", apBillOutInfo.getPayee());
-        }
-
-        if (StringUtils.isEmpty(apBillOut.getRemark())) {
-            paraMap.put("remark", "");
-        } else {
-            paraMap.put("remark", apBillOut.getRemark());
-        }
-
-        paraMap.put("urlAddress", "");//开票成功回调地址  用于回调开票成功信息
-        paraMap.put("settlementNum", "");//结算单号
-        paraMap.put("contractNum", "");//合同编号
-        paraMap.put("businessInfo", "");//业务信息
-
-        //明细
-        List<JSONObject> wares = new ArrayList<>();
-        for (PurchaseApBillOutItem apBillOutItem : apBillOutItems) {
-            // wares  商品行项目信息(发票明细)
-            Product product = apBillOutItem.getProduct();
-            product.setGoodstaxno((Math.random() + 50) + "");//TODO 商品编码
-            if (product == null) {
-                result.put("error", errorMsg.append("获取不到商品信息!"));
-                return result;
-            }
-            if (StringUtils.isEmpty(product.getTitle())) {
-                result.put("error", errorMsg.append("获取不到商品名称!"));
-            }
-            if (StringUtils.isEmpty(product.getGoodstaxno())) {
-                result.put("error", errorMsg.append("获取不到商品编码!"));
-            }
-            if (StringUtils.isEmpty(apBillOutItem.getNowQty())) {
-                result.put("error", errorMsg.append("获取不到商品开票数量!"));
-            }
-            if (StringUtils.isEmpty(apBillOutItem.getNowPrice())) {
-                result.put("error", errorMsg.append("获取不到商品开票单价!"));
-            }
-            if (StringUtils.isEmpty(apBillOutItem.getTaxrate())) {
-                result.put("error", errorMsg.append("获取不到商品税率!"));
-            }
-
-            JSONObject ware = new JSONObject(16, true);
-            ware.put("wareName", product.getTitle());//商品名称
-            ware.put("wareNo", "1090232070000000000");//TODO product.getGoodstaxno() 商品编码  应与税局最新发行的商品和服务税收分类与编码相一致
-            if (StringUtils.isEmpty(product.getSpec())) {
-                ware.put("standard", "");//规格型号
-            } else {
-                ware.put("standard", product.getSpec());//规格型号
-            }
-            if (StringUtils.isEmpty(product.getUnit())) {
-                ware.put("unit", "");//单位
-            } else {
-                ware.put("unit", product.getUnit());//单位
-            }
-            ware.put("count", apBillOutItem.getNowQty());//数量 整数
-            ware.put("unitPrice", apBillOutItem.getNowPrice());//单价 小数点后2位,以元为单位精确到分,含税价
-            ware.put("amount", 1.00);//价税合计金额
-            ware.put("taxRate", 0.17);//0表示免税,两位小数,0.17
-            wares.add(ware);
-        }
-
-        paraMap.put("invitem", wares);
-
-        if (result.size() > 0) {
-            return result;
-        }
-
-        //调用票加加上传接口
-        try {
-            String a = paraMap.toString();
-            url = url + "?timestamp=" + timestamp + "&sign=" + sign;
-            //HttpUtil.Response response = HttpUtil.sendPostRequest(url, paraMap);
-            String resultStr =  HttpUtil.sendPost(url, paraMap.toString());
-            JSONObject resultJo = JSON.parseObject(resultStr);
-            String code = resultJo.getString("code");//0000代表成功其它代表失败
-            String resMsg = resultJo.getString("resMsg");;
-
-            if ("0000".equals(code)) {
-                result.put("success", "发票上传成功,开票中!");
-                apBillOut.setRetmsg(resMsg);
-                //apBillOut.setCheckStatus("开票中");
-                try {
-                    purchaseApBillOutDao.save(apBillOut);
-                } catch (Exception e) {
-                    result.put("dbError","上传发票成功,但过程中数据库更新开票单失败,需要人工紧急处理,重新上传此开票单据");
-                }
-            }
-
-            result.put("resultJo",resultStr);
-        } catch (NullPointerException e) {
-            result.put("error",errorMsg.append("从票加加开票接口获取数据失败"));
-            e.printStackTrace();
-        } catch (Exception e) {
-            result.put("error",errorMsg.append("链接票加加开票接口失败"));
-            e.printStackTrace();
-        }
-
-        return null;
-    }
-
-    /**
-     * 生成签名
-     * @return
-     */
-    private String sign(String api, String httpMethod, String timestamp, String prars[]) {
-        StringBuilder content = new StringBuilder();
-        content.append(httpMethod);
-        //获取请求的url
-        content.append(api);
-        //参数按字典排序
-        content.append(sort(prars));
-        //content.append("timestamp=" + timestamp);
-        //String taxpayerKey = "626454404969499358070752";//优软
-        String taxpayerKey = "487843442563106693107397";//丰唐
-        content.append(taxpayerKey);
-
-        String sign = null;
-        try {
-            sign = MD5.toMD5(URLEncoder.encode(content.toString(),"UTF-8"));
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        return sign;
-    }
-
-    /**
-     * 按字典排序 升序
-     * @param a
-     */
-    public StringBuilder sort(String a[]) {
-        for (int i = 0; i < a.length - 1; i++) {
-            for (int j = i + 1; j < a.length; j++) {
-                if (a[j].compareTo(a[i]) < 0) {
-                    String temp = a[i];
-                    a[i] = a[j];
-                    a[j] = temp;
-                }
-            }
-        }
-
-        StringBuilder paras = new StringBuilder();
-        for (int i = 0; i < a.length; i++) {
-            paras.append(a[i]);
-        }
-
-        return paras;
-    }
-}

+ 0 - 508
src/main/java/com/uas/platform/b2b/service/impl/PurchaseApBillOutServiceImpl.java

@@ -1,508 +0,0 @@
-package com.uas.platform.b2b.service.impl;
-
-import com.uas.platform.b2b.dao.*;
-import com.uas.platform.b2b.model.*;
-import com.uas.platform.b2b.search.SearchService;
-import com.uas.platform.b2b.service.PiaoPlusService;
-import com.uas.platform.b2b.service.PurchaseApBillOutService;
-import com.uas.platform.b2b.service.SOAPConsoleService;
-import com.uas.platform.b2b.support.SystemSession;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.persistence.criteria.PredicateUtils;
-import com.uas.search.b2b.model.PageParams;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.ui.ModelMap;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.StringUtils;
-
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-@Service
-public class PurchaseApBillOutServiceImpl implements PurchaseApBillOutService {
-
-	@Autowired
-	PurchaseApBillOutDao purchaseApBillOutDao;
-
-	@Autowired
-	PurchaseApBillOutTodoDao purchaseApBillOutTodoDao;
-
-	@Autowired
-	PurchaseApBillOutDoneDao purchaseApBillOutDoneDao;
-
-	@Autowired
-	PurchaseApBillOutEndDao purchaseApBillOutEndDao;
-
-	@Autowired
-	PurchaseApBillOutItemDao purchaseApBillOutItemDao;
-
-	@Autowired
-	PurchaseApCheckItemDao purchaseApCheckItemDao;
-
-
-	@Autowired
-	private JdbcTemplate jdbcTemplate;
-
-	@Autowired
-	private CommonDao commonDao;
-
-	@Autowired
-	private SearchService searchService;
-
-	@Autowired
-	private ProductDao productDao;
-
-	@Autowired
-	private SOAPConsoleService soapConsoleService;
-
-	@Autowired
-	private PiaoPlusService piaoPlusService;
-
-	/*@Override
-	public List<PurchaseApCheck> findNotUploadAPcheck() {
-		return purchaseApCheckDao.findByCustUuAndStatusAndCheckStatus(SystemSession.getUser().getEnterprise().getUu(),
-				(short) Status.NOT_UPLOAD.value(), "未对账");
-	}
-
-	@Override
-	public void onApCheckSuccess(String[] idArray) {
-		for (String id : idArray) {
-			PurchaseApCheck apCheck = purchaseApCheckDao.findOne(Long.parseLong(id));
-			if (apCheck != null) {
-				apCheck.setStatus((short) Status.DOWNLOADED.value());
-				purchaseApCheckDao.save(apCheck);
-			}
-		}
-	}*/
-
-	@Override
-	public void saveApBillOuts(List<PurchaseApBillOutItem> checkItems) {
-		if (checkItems != null && checkItems.size() > 0) {
-			purchaseApBillOutItemDao.save(checkItems);
-		} else {
-
-		}
-	}
-
-	@Override
-	public boolean cancelApBillOut(Long id) {
-		/*PurchaseApBillOut check = purchaseApBillOutDao.findOne(id);
-		if (check != null) {
-			if (!CollectionUtils.isEmpty(check.getItems()) && check.getCheckStatus().equals("不同意")) {
-				for (PurchaseApBillOutItem item : check.getItems()) {
-					item.setCheckQty(0.0);
-					Double newYCheckQtyVal = item.getOldYCheckQty();
-					Long sourceIdVal = item.getSourceId();
-					String sourceTable = null;
-					String idName = null;
-					String yCheckQtyName = null;
-					if (item.getSourceTable() != null) {
-						sourceTable = item.getSourceTable();
-					} else {
-						sourceTable = "";
-					}
-					if (sourceTable.equals("purc$returnitem")) {
-						idName = "pri_id";
-						yCheckQtyName = "pri_ycheckqty";
-					} else if (sourceTable.equals("purc$acceptitem")) {
-						idName = "pai_id";
-						yCheckQtyName = "pai_ycheckqty";
-					} else if (sourceTable.equals("purc$badinitem")) {
-						idName = "pbi_id";
-						yCheckQtyName = "pbi_ycheckqty";
-					} else if (sourceTable.equals("purc$badoutitem")) {
-						idName = "poi_id";
-						yCheckQtyName = "poi_ycheckqty";
-					} else if (sourceTable.equals("make$acceptitem")) {
-						idName = "mai_id";
-						yCheckQtyName = "mai_ycheckqty";
-					} else if (sourceTable.equals("make$returnitem")) {
-						idName = "mri_id";
-						yCheckQtyName = "mri_ycheckqty";
-					} else if (sourceTable.equals("purc$apbilladjustment")) {
-						idName = "aa_id";
-						yCheckQtyName = "aa_ycheckqty";
-					}
-					String sql = "update " + sourceTable + " set " + yCheckQtyName + " = " + newYCheckQtyVal + " where "
-							+ idName + " = " + sourceIdVal;
-					jdbcTemplate.execute(sql);
-				}
-			}
-			check.setCheckStatus("已作废");
-			purchaseApBillOutDao.save(check);
-			return true;
-		}*/
-		return false;
-	}
-
-	@Override
-	public PurchaseApBillOut findById(Long id) {
-		return purchaseApBillOutDao.findOne(id);
-	}
-
-	@Override
-	public void updateApCheckItemBilled(List<HashMap<String, Object>> list) {
-		if (!CollectionUtils.isEmpty(list)) {
-			for (HashMap<String, Object> map : list) {
-				Set<String> keySet = map.keySet();
-				Double billedVal = null;
-				Long sourceIdVal = null;
-				String sourceTable = null;
-				String idName = null;
-				String billedName = null;
-				for (String key : keySet) {
-					if (key.equals("newBilledQty")) {
-						billedVal = Double.valueOf(map.get(key).toString());
-					} else if (key.equals("sourceId")) {
-						sourceIdVal = Long.parseLong(map.get(key).toString());
-					} else if (key.equals("sourceTable")) {
-						sourceTable = map.get(key).toString();
-					}
-				}
-				if (sourceTable.equals("PURC$APCHECKITEM")) {
-					idName = "pai_id";
-					billedName = "pai_billed";
-				}
-				String sql = "update " + sourceTable + " set " + billedName + " = " + billedVal + " where "
-						+ idName + " = " + sourceIdVal;
-				jdbcTemplate.execute(sql);
-
-			}
-		}
-	}
-
-	@Override
-	public void updateBilledByApBillOut(PurchaseApBillOut apBillOut) {
-		List<HashMap<String, Object>> list = new ArrayList<>();
-		for (PurchaseApBillOutItem item : apBillOut.getItems()) {
-			//items.add(item);
-
-			//查询当前开票数
-			Double nowQTY = item.getNowQty();
-			//查询对账单明细表中已开票数
-			Double oldBilledQty = purchaseApCheckItemDao.getBilledById(item.getSourceId());
-
-			//计算新的已开票数
-			Double newBilledQty = oldBilledQty - nowQTY;
-			HashMap<String, Object> map = new HashMap<>();
-			map.put("newBilledQty", newBilledQty);
-			map.put("sourceId", item.getSourceId());
-			map.put("sourceTable", item.getSourceTable());
-			list.add(map);
-		}
-
-		//更新新的已开票数到对账单明细表
-		this.updateApCheckItemBilled(list);
-	}
-
-	@Override
-	@Transactional
-	public void deleteApBillOut(Long id) {
-		PurchaseApBillOut apBillOut = purchaseApBillOutDao.findOne(id);
-		this.updateBilledByApBillOut(apBillOut);
-		purchaseApBillOutDao.delete(apBillOut);
-
-	}
-
-	@Override
-	public ModelMap doBillOut(Long id) {
-		ModelMap map = new ModelMap();
-		PurchaseApBillOut apBillOut = purchaseApBillOutDao.findOne(id);
-		if (apBillOut != null) {
-			//调用航天接口开具发票
-			//map =soapConsoleService.invoiceIssued(apBillOut);
-			//调用票加加上传接口
-			map = piaoPlusService.invoiceIssued(apBillOut);
-		} else {
-			map.put("error", "不存在此开票单");
-		}
-		return map;
-	}
-
-	@Override
-	@Transactional
-	public PurchaseApBillOut save(PurchaseApBillOut purchaseApBillOut, List<HashMap<String, Object>> sourceInfoList) {
-		purchaseApBillOut.setRecordDate(new Date());
-		Date d = new Date();
-		SimpleDateFormat sdf = new SimpleDateFormat("yyMMddhhmmss_SSS");
-		String code = sdf.format(d);
-		purchaseApBillOut.setCode(code);
-		purchaseApBillOut.setRecorder(SystemSession.getUser().getUserName());
-		Short number = 0;
-		List<PurchaseApBillOutItem> items = new ArrayList<PurchaseApBillOutItem>();
-		Double amount = 0.0; //开票单总开票金额
-
-		for (PurchaseApBillOutItem item : purchaseApBillOut.getItems()) {
-			//通过通过所属企业的ID和产品的编号查找产品ID并插入到开票明细表中
-			if (purchaseApBillOut.getCustUu() != null && item.getProdCode() != null) {
-				List<Product> products = productDao.findByEnUUAndCode(purchaseApBillOut.getCustUu(), item.getProdCode());
-				if (products.get(0) != null) {
-					item.setPrid(products.get(0).getId());
-				}
-			}
-
-			item.setNumber(++number);
-			item.setNowPrice(item.getNowQty()*item.getPrice());
-			item.setApBillOut(purchaseApBillOut);
-			items.add(item);
-			amount = amount + item.getNowPrice();
-		}
-
-		purchaseApBillOut.setAmount(amount);
-		items = purchaseApBillOutItemDao.save(items);
-		this.updateApCheckItemBilled(sourceInfoList);
-		/*if (!CollectionUtils.isEmpty(items)) {
-			ContextUtils.publishEvent(new PurchaseApBillOutSaveEvent(PurchaseApBillOutItem.distinct(items)));
-		}*/
-		return purchaseApBillOut;
-	}
-
-
-	@Override
-	public Page<PurchaseApBillOut> findAllByPageInfo(final PageInfo pageInfo, final String keyword,
-			SearchFilter searchFilter) {
-		if (searchFilter != null) {
-			if (!CollectionUtils.isEmpty(searchFilter.getDistribute()))
-				pageInfo.expression(PredicateUtils.in("vendUU", searchFilter.getDistribute(), false));
-			if (searchFilter.getFromDate() != null)
-				pageInfo.expression(PredicateUtils.gte("recordDate", new Date(searchFilter.getFromDate()), false));
-			if (searchFilter.getEndDate() != null)
-				pageInfo.expression(PredicateUtils.lte("recordDate", new Date(searchFilter.getEndDate()), false));
-		}
-		return purchaseApBillOutDao.findAll(new Specification<PurchaseApBillOut>() {
-			public Predicate toPredicate(Root<PurchaseApBillOut> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
-				if (StringUtils.hasText(keyword)) {
-					List<Object> lists = new ArrayList<>();
-					PageParams pageParams = new PageParams();
-					ModelMap map = new ModelMap();
-					map.put("pa_enuu", SystemSession.getUser().getEnterprise().getUu());
-					pageParams.setFilters(map);
-					for (PurchaseApBillOut list : searchService.searchPurchaseApBillOutIds(keyword, pageParams)
-							.getContent()) {
-						lists.add(list.getId());
-					}
-					pageInfo.expression(PredicateUtils.in("id", lists, false));
-				}
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	public Page<PurchaseApBillOutTodo> findTodoByPageInfo(final PageInfo pageInfo, final String keyword,
-			SearchFilter searchFilter) {
-		if (searchFilter != null) {
-			if (!CollectionUtils.isEmpty(searchFilter.getDistribute()))
-				pageInfo.expression(PredicateUtils.in("vendUU", searchFilter.getDistribute(), false));
-			if (searchFilter.getFromDate() != null)
-				pageInfo.expression(PredicateUtils.gte("recordDate", new Date(searchFilter.getFromDate()), false));
-			if (searchFilter.getEndDate() != null)
-				pageInfo.expression(PredicateUtils.lte("recordDate", new Date(searchFilter.getEndDate()), false));
-		}
-		return purchaseApBillOutTodoDao.findAll(new Specification<PurchaseApBillOutTodo>() {
-			public Predicate toPredicate(Root<PurchaseApBillOutTodo> root, CriteriaQuery<?> query,
-					CriteriaBuilder builder) {
-				if (StringUtils.hasText(keyword)) {
-					List<Object> lists = new ArrayList<>();
-					PageParams pageParams = new PageParams();
-					ModelMap map = new ModelMap();
-					map.put("pa_enuu", SystemSession.getUser().getEnterprise().getUu());
-					pageParams.setFilters(map);
-					for (PurchaseApBillOut list : searchService.searchPurchaseApBillOutIds(keyword, pageParams)
-							.getContent()) {
-						lists.add(list.getId());
-					}
-					pageInfo.expression(PredicateUtils.in("id", lists, false));
-				}
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	public Page<PurchaseApBillOutDone> findDoneByPageInfo(final PageInfo pageInfo, final String keyword,
-			SearchFilter searchFilter) {
-		if (searchFilter != null) {
-			if (!CollectionUtils.isEmpty(searchFilter.getDistribute()))
-				pageInfo.expression(PredicateUtils.in("vendUU", searchFilter.getDistribute(), false));
-			if (searchFilter.getFromDate() != null)
-				pageInfo.expression(PredicateUtils.gte("recordDate", new Date(searchFilter.getFromDate()), false));
-			if (searchFilter.getEndDate() != null)
-				pageInfo.expression(PredicateUtils.lte("recordDate", new Date(searchFilter.getEndDate()), false));
-		}
-		return purchaseApBillOutDoneDao.findAll(new Specification<PurchaseApBillOutDone>() {
-			public Predicate toPredicate(Root<PurchaseApBillOutDone> root, CriteriaQuery<?> query,
-					CriteriaBuilder builder) {
-				if (StringUtils.hasText(keyword)) {
-					List<Object> lists = new ArrayList<>();
-					PageParams pageParams = new PageParams();
-					ModelMap map = new ModelMap();
-					map.put("pa_enuu", SystemSession.getUser().getEnterprise().getUu());
-					pageParams.setFilters(map);
-					for (PurchaseApBillOut list : searchService.searchPurchaseApBillOutIds(keyword, pageParams)
-							.getContent()) {
-						lists.add(list.getId());
-					}
-					pageInfo.expression(PredicateUtils.in("id", lists, false));
-				}
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	public Page<PurchaseApBillOutEnd> findEndByPageInfo(final PageInfo pageInfo, final String keyword,
-			SearchFilter searchFilter) {
-		if (searchFilter != null) {
-			if (!CollectionUtils.isEmpty(searchFilter.getDistribute()))
-				pageInfo.expression(PredicateUtils.in("vendUU", searchFilter.getDistribute(), false));
-			if (searchFilter.getFromDate() != null)
-				pageInfo.expression(PredicateUtils.gte("recordDate", new Date(searchFilter.getFromDate()), false));
-			if (searchFilter.getEndDate() != null)
-				pageInfo.expression(PredicateUtils.lte("recordDate", new Date(searchFilter.getEndDate()), false));
-		}
-		return purchaseApBillOutEndDao.findAll(new Specification<PurchaseApBillOutEnd>() {
-			public Predicate toPredicate(Root<PurchaseApBillOutEnd> root, CriteriaQuery<?> query,
-					CriteriaBuilder builder) {
-				if (StringUtils.hasText(keyword)) {
-					List<Object> lists = new ArrayList<>();
-					PageParams pageParams = new PageParams();
-					ModelMap map = new ModelMap();
-					map.put("pa_enuu", SystemSession.getUser().getEnterprise().getUu());
-					pageParams.setFilters(map);
-					for (PurchaseApBillOut list : searchService.searchPurchaseApBillOutIds(keyword, pageParams)
-							.getContent()) {
-						lists.add(list.getId());
-					}
-					pageInfo.expression(PredicateUtils.in("id", lists, false));
-				}
-				query.where(pageInfo.getPredicates(root, query, builder));
-				return null;
-			}
-		}, pageInfo);
-	}
-
-	/**
-	 * 获取出入库单数据信息
-	 * 
-	 * @param sourceTable
-	 * @param idName
-	 * @param yCheckQtyName
-	 * @return
-	 */
-	public List<String> getSourceInfo(String sourceTable, String idName, String yCheckQtyName, String prodId) {
-		List<String> list = new ArrayList<String>();
-		/*if (sourceTable != null) {
-			if (sourceTable.equals("purc$returnitem")) {
-				idName = "pri_id";
-				yCheckQtyName = "pri_ycheckqty";
-				prodId = "pri_prodid";
-			} else if (sourceTable.equals("purc$acceptitem")) {
-				idName = "pai_id";
-				yCheckQtyName = "pai_ycheckqty";
-				prodId = "pai_prodid";
-			} else if (sourceTable.equals("purc$badinitem")) {
-				idName = "pbi_id";
-				yCheckQtyName = "pbi_ycheckqty";
-			} else if (sourceTable.equals("purc$badoutitem")) {
-				idName = "poi_id";
-				yCheckQtyName = "poi_ycheckqty";
-			} else if (sourceTable.equals("make$acceptitem")) {
-				idName = "mai_id";
-				yCheckQtyName = "mai_ycheckqty";
-			} else if (sourceTable.equals("make$returnitem")) {
-				idName = "mri_id";
-				yCheckQtyName = "mri_ycheckqty";
-			} else if (sourceTable.equals("purc$apbilladjustment")) {
-				idName = "aa_id";
-				yCheckQtyName = "aa_ycheckqty";
-			}
-			list.add(sourceTable);
-			list.add(idName);
-			list.add(yCheckQtyName);
-			list.add(prodId);
-		}*/
-		return list;
-	}
-
-	//处于弃用状态
-	@Override
-	public void print(Long id) {
-		PurchaseApBillOut apBillOut = purchaseApBillOutDao.findOne(id);
-		if (apBillOut != null) {
-			apBillOut.setPrint((short) ((apBillOut.getPrint() == null ? 0 : apBillOut.getPrint()) + 1));
-		}
-		purchaseApBillOutDao.save(apBillOut);
-
-	}
-
-	@Override
-	public List<PurchaseApBillOutItem> findBySourceTableAndSourceId(String sourceTable, Long sourceId) {
-		return purchaseApBillOutItemDao.findBySourceTableAndSourceId(sourceTable, sourceId);
-	}
-
-	@Override
-	public long getCountByenUUAndStatus() {
-		return 0;
-		//
-		//return purchaseApBillOutDao.getCountByenUUAndStatus(SystemSession.getUser().getEnterprise().getUu(), "未对账");
-	}
-
-	@Override
-	public PurchaseApBillOutTaxCode getTaxCode(String spbm, String version) {
-		//数据库中spbm的科学计数格式是没有“+”号,倘若传过来的科学计数包含加号,java会自动转换,不需要做处理
-		String sql = "select t.id id,t.spbm spbm,t.spmc spmc,t.zzssl zzssl,t.hzx hzx,t.kyzt kyzt,t.zzstsgl zzstsgl,t.tjjbm tjjbm,t.pid pid,t.version version " +
-				"from TAX$CLASSIFICATION t where t.spbm=" + spbm + " and t.version=" + version;
-		List<PurchaseApBillOutTaxCode> taxCodes = commonDao.query(sql, PurchaseApBillOutTaxCode.class);
-		if (taxCodes == null) {
-			return null;
-		} else {
-			if (taxCodes.size() < 1) {
-				return null;
-			}
-		}
-		PurchaseApBillOutTaxCode taxCode = taxCodes.get(0);
-		return taxCode;
-	}
-
-	@Override
-	@Transactional
-	public ModelMap invoiceCancel(PurchaseApBillOut apBillOut) {
-		ModelMap map = new ModelMap();
-		map = soapConsoleService.InvoiceCancel(apBillOut);
-		if ("6011".equals(map.get("retcode"))) {
-			this.updateBilledByApBillOut(apBillOut);
-		}
-		return map;
-	}
-
-	@Override
-	public void saveByItem(List<PurchaseApBillOutItem> apBillOutItems) {
-		List<PurchaseApBillOutItem> purchaseApBillOutItems = purchaseApBillOutItemDao.save(apBillOutItems);
-	}
-
-	@Override
-	public PurchaseApBillOut findByCode(String orderNo) {
-		long enUU = SystemSession.getUser().getEnterprise().getUu();
-		List<PurchaseApBillOut> list = purchaseApBillOutDao.findByEnUuAndCode(enUU, orderNo);
-		if (list.size() > 0) {
-			return list.get(0);
-		}
-		return null;
-	}
-
-	@Override
-	public void save(PurchaseApBillOut apBillOut) {
-		purchaseApBillOutDao.save(apBillOut);
-	}
-
-}

+ 0 - 1300
src/main/java/com/uas/platform/b2b/service/impl/SOAPConsoleServiceImpl.java

@@ -1,1300 +0,0 @@
-package com.uas.platform.b2b.service.impl;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.uas.platform.b2b.dao.PurchaseApBillOutDao;
-import com.uas.platform.b2b.dao.PurchaseApBillOutInfoDao;
-import com.uas.platform.b2b.model.*;
-import com.uas.platform.b2b.service.SOAPConsoleService;
-import com.uas.platform.b2b.support.SystemSession;
-import com.uas.platform.core.util.HttpUtil;
-
-import com.uas.sso.common.encrypt.base64.Base64;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.ui.ModelMap;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.Field;
-import java.net.*;
-import java.text.DecimalFormat;
-import java.util.*;
-
-
-/**
- * Created by 黄诚天 on 2017/7/10.
- */
-@Service
-public class SOAPConsoleServiceImpl implements SOAPConsoleService {
-
-    @Autowired
-    PurchaseApBillOutDao purchaseApBillOutDao;
-
-    @Autowired
-    PurchaseApBillOutInfoDao purchaseApBillOutInfoDao;
-
-    DecimalFormat df = new DecimalFormat("#.00");
-
-    //获取每种发票的库存信息
-    @Override
-    public ModelMap getRepertoryMessage() {
-        ModelMap map = new ModelMap();
-        Integer InfoKind = 0; //发票类型; 0-专票  2-普票
-
-        int SID = SoapSIDType.GETREPERTORYMEAASGE.getValue();
-        JSONObject SIDParam = new JSONObject();
-        SIDParam.put("InfoKind",InfoKind);
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-
-        if ("3011".equals(resultJo.getString("retcode"))) {
-            SoapRepertyMessage srm = JSONObject.parseObject(resultJo.toJSONString(),SoapRepertyMessage.class);
-            map.put("srm",srm);
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",resultJo.getString("error"));
-        } else {
-            map.put("error",resultJo.getString("retmsg"));
-        }
-
-        return map;
-    }
-
-    //发票开具
-    @Override
-    public ModelMap invoiceIssued(PurchaseApBillOut apBillOut) {
-        ModelMap map = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-
-        Integer invoiceType = 0;//专票
-        //获取购方开票信息
-        PurchaseApBillOutInfo customerApBillOutInfo = apBillOut.getCustomerApBillOutInfo();
-        String customerTaxNr = customerApBillOutInfo.getTaxNr();
-        //发票种类为普票时可以为空值,专票时为必填
-        if (invoiceType != 2 && customerTaxNr == null) {
-            map.put("error", errorMsg.append("获取不到购方税号"));
-        }
-
-        String customerName = customerApBillOutInfo.getEnName();
-        //普票时,若购方税号为空,则购方名称必填
-        if (invoiceType == 2 && customerTaxNr == null && customerName == null) {
-            map.put("error", errorMsg.append("获取不到购方名"));
-        }
-
-        String issuer = SystemSession.getUser().getUserName();
-        if (issuer == null) {
-            map.put("error", errorMsg.append("获取不到开票人信息"));
-        } else if (issuer.length() > 8) {
-            map.put("error", errorMsg.append("开票人名字不得超过八个字母或四个汉字"));
-        }
-
-        Boolean listed = false; //false:不开具清单 true:开具清单
-        if (listed == null) {
-            map.put("error", errorMsg.append("获取不到清单标志,系统无法判断是否开具清单"));
-
-        }
-
-        String customerAddressTel = customerApBillOutInfo.getAddress() + " " + customerApBillOutInfo.getTel();
-
-        //发票种类为普票时可以为空值,专票时为必填
-        if (invoiceType != 2 && customerAddressTel == null) {
-            map.put("error", errorMsg.append("获取不到购方地址电话"));
-        }
-
-        String customerBankAccountNr = customerApBillOutInfo.getBankAccountNr();
-        //发票种类为普票时可以为空值,专票时为必填
-        if (invoiceType != 2 && customerBankAccountNr == null) {
-            map.put("error", errorMsg.append("获取不到购方银行账户"));
-        }
-
-        //获取销方开票信息
-        PurchaseApBillOutInfo apBillOutInfo = apBillOut.getApBillOutInfo();
-        String sellerTaxNr = apBillOutInfo.getTaxNr();
-        String sellerBankAccountNr = apBillOutInfo.getBankAccountNr();
-        if (sellerBankAccountNr == null) {
-            sellerBankAccountNr = "";
-        }
-
-        String payee = apBillOutInfo.getPayee();
-        if (payee == null) {
-            map.put("error", errorMsg.append("获取不到收款人信息"));
-        } else if (payee.length() > 8) {
-            map.put("error", errorMsg.append("收款人名字不得超过八个字母或四个汉字"));
-        }
-
-        String checker = apBillOutInfo.getChecker();
-        if (checker == null) {
-            map.put("error", errorMsg.append("获取不到复核人信息"));
-        } else if (checker.length() > 8) {
-            map.put("error", errorMsg.append("复核人名字不得超过八个字母或四个汉字"));
-        }
-
-
-        String sellerAddressTel = apBillOutInfo.getAddress() + " " + apBillOutInfo.getTel();
-        if (sellerAddressTel == null) {
-            sellerAddressTel = "";
-        }
-
-        String documentNr = apBillOut.getCode();//TODO 数据来源  判断
-        if (documentNr == null) {
-            documentNr = "";
-        }
-
-        String memo = null;//TODO
-        if (memo == null) {
-            memo = "";
-        }
-
-        Integer CheckEWM = 0; //TODO
-
-
-        //获取明细信息
-        Set<PurchaseApBillOutItem> apBillOutItems = apBillOut.getItems();
-        PurchaseApBillOutItem[] items = new PurchaseApBillOutItem[apBillOutItems.size()];
-        apBillOutItems.toArray(items);
-        SoapInvoiceItem[] invoiceItems = new SoapInvoiceItem[apBillOutItems.size()];
-        for (int i = 0; i < items.length; i++) {
-            Product product = items[i].getProduct();
-            SoapInvoiceItem invoiceItem = new SoapInvoiceItem();
-
-            String productName = product.getTitle();
-            //productName = "测试商品";
-            if (productName == null) {
-                map.put("error", errorMsg.append("获取不到商品名称"));
-            } else {
-                invoiceItem.setProductName(productName);
-            }
-
-            Boolean includeTax = true;
-            if (includeTax == null) {
-                map.put("error", errorMsg.append("获取不到" + productName + "的含税标志"));
-            } else {
-                invoiceItem.setIncludeTax(includeTax);
-            }
-
-            Double taxRate = 0.17; //items[i].getTaxrate()/100
-            if (taxRate == null) {
-                map.put("error", errorMsg.append("获取不到" + productName + "的税率"));
-            } else {
-                invoiceItem.setTaxRate(taxRate);
-            }
-
-            Double value = items[i].getPrice() * items[i].getNowQty();
-            if (value == null) {
-                map.put("error", errorMsg.append("获取不到" + productName + "的金额"));
-            } else {
-                invoiceItem.setValue(Double.parseDouble(df.format(value)));
-            }
-            Double tax = (value*taxRate)/1.17;
-            if (tax == null) {
-                map.put("error", errorMsg.append("获取不到" + productName + "的税额"));
-            } else {
-                invoiceItem.setTax(Double.parseDouble(df.format(tax)));
-            }
-
-            String GoodsNoVer = product.getGoodsnover();
-            GoodsNoVer = "13.0";
-            if (GoodsNoVer == null) {
-                map.put("error", errorMsg.append("获取不到" + productName + "编码版本号"));
-            } else {
-                invoiceItem.setGoodsNoVer(GoodsNoVer);
-            }
-
-            String GoodsTaxNo = product.getGoodstaxno();
-            GoodsTaxNo = "109051303"; //1080413020000000000 //1090513030000000000
-            if (GoodsTaxNo == null) {
-                map.put("error", errorMsg.append("获取不到" + productName + "的税收分类编码"));
-            } else {
-                invoiceItem.setGoodsTaxNo(GoodsTaxNo);
-            }
-
-            String TaxPre = product.getTaxpre();
-            TaxPre = "0";
-            if (TaxPre == null) {
-                map.put("error", errorMsg.append("获取不到" + productName + "的是否享受优惠政策"));
-            } else {
-                invoiceItem.setTaxPre(TaxPre);
-            }
-
-            Double price = items[i].getPrice();//不能从产品库中获取单价
-            Double quantity = items[i].getNowQty();
-            //数量和单价要一起传或者一起不传,不能只传其中一个
-            if (price != null && quantity != null) {
-                invoiceItem.setPrice(price);
-                invoiceItem.setQuantity(quantity);
-            } else {
-                map.put("error", errorMsg.append("明细" + productName + "的单价或数量缺失"));
-            }
-
-            String productUnit = product.getUnit();
-            if (productUnit == null) {
-                productUnit = "";
-            }
-            invoiceItem.setProductUnit(productUnit);
-
-            String productSpec = product.getSpec();
-            if (productSpec == null) {
-                productSpec = "";
-            }
-            invoiceItem.setProductSpec(productSpec);
-
-            String TaxPreCon = product.getTaxprecon();
-            if (TaxPreCon == null) {
-                TaxPreCon = "";
-            }
-            invoiceItem.setTaxPreCon(TaxPreCon);
-
-            String ZeroTax = null; //TODO
-            if (ZeroTax == null) {
-                ZeroTax = "";
-            }
-            invoiceItem.setZeroTax(ZeroTax);
-
-            String CropGoodsNo = null; //TODO
-            if (CropGoodsNo == null) {
-                CropGoodsNo = "";
-            }
-            invoiceItem.setCropGoodsNo(CropGoodsNo);
-
-            //TaxDeduction 差额税使用,非差额税可以为空
-            String TaxDeduction = null; //TODO
-            if (TaxDeduction == null) {
-                TaxDeduction = "";
-            }
-            invoiceItem.setTaxDeduction(TaxDeduction);
-
-            invoiceItems[i] = invoiceItem;
-        }
-
-        int SID = SoapSIDType.INVOICEISSUED.getValue();
-        JSONObject SIDParam = new JSONObject(16,true);
-
-        SIDParam.put("invoiceType",invoiceType);
-        SIDParam.put("customerName",customerName);
-        SIDParam.put("customerTaxNr",customerTaxNr );
-        SIDParam.put("customerAddressTel",customerAddressTel);
-        SIDParam.put("customerBankAccountNr",customerBankAccountNr);
-        SIDParam.put("sellerBankAccountNr",sellerBankAccountNr);
-        SIDParam.put("sellerAddressTel",sellerAddressTel);
-        SIDParam.put("invoiceItems",invoiceItems);
-        SIDParam.put("documentNr",documentNr);
-        SIDParam.put("payee",payee);
-        SIDParam.put("checker",checker);
-        SIDParam.put("listed",listed);
-        SIDParam.put("issuer",issuer);
-        SIDParam.put("memo",memo);
-        SIDParam.put("CheckEWM",CheckEWM);
-
-        /*InvoiceParam invoiceParam = new InvoiceParam();
-        invoiceParam.setInvoiceType(invoiceType);
-        invoiceParam.setCustomerName(customerName);
-        invoiceParam.setCustomerTaxNr(customerTaxNr);
-        invoiceParam.setCustomerAddressTel(customerAddressTel);
-        invoiceParam.setCustomerBankAccountNr(customerBankAccountNr);
-        invoiceParam.setSellerBankAccountNr(sellerBankAccountNr);
-        invoiceParam.setSellerAddressTel(sellerAddressTel);
-        invoiceParam.setInvoiceItems(Arrays.asList(invoiceItems));
-        invoiceParam.setDocumentNr(documentNr);
-        invoiceParam.setPayee(payee);
-        invoiceParam.setChecker(checker);
-        invoiceParam.setListed(listed);
-        invoiceParam.setIssuer(issuer);
-        invoiceParam.setMemo(memo);
-        invoiceParam.setCheckEWM(CheckEWM);
-
-        String hehe = JsonUtil2.parse(invoiceParam);*/
-
-        /*SIDParam.put("sellerTaxNr",sellerTaxNr);
-        SIDParam.put("kpdh",kpdh);
-        SIDParam.put("kpfwqh",kpfwqh);*/
-
-        if (map.size() > 0) {
-            return map;
-        }
-
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-        if ("4011".equals(resultJo.getString("retcode"))) {
-            apBillOut.setRetmsg(resultJo.getString("retmsg"));
-            apBillOut.setInfoAmount(resultJo.getDouble("InfoAmount"));
-            apBillOut.setInfoTaxAmount(resultJo.getDouble("InfoTaxAmount"));
-            apBillOut.setInfoDate(resultJo.getString("InfoDate"));
-            apBillOut.setInfoTypeCode(resultJo.getString("InfoTypeCode"));
-            apBillOut.setInfoNumber(resultJo.getString("InfoNumber"));
-            apBillOut.setHisInfoTypeCode(resultJo.getString("hisInfoTypeCode"));
-            apBillOut.setHisInfoNumber(resultJo.getString("hisInfoNumber"));
-            apBillOut.setHisInfoKind(resultJo.getString("hisInfoKind"));
-            apBillOut.setListFlag(resultJo.getInteger("ListFlag"));
-            apBillOut.setNsrsbh(resultJo.getString("nsrsbh"));
-            apBillOut.setKpdh(resultJo.getString("kpdh"));
-            apBillOut.setKpfwqh(resultJo.getString("kpfwqh"));
-            //修改开票单状态
-            apBillOut.setCheckStatus("已开票");
-
-            try {
-                purchaseApBillOutDao.save(apBillOut);
-            } catch (Exception e) {
-                map.put("dbError","开具发票成功,但过程中数据库更新开票单失败,需要人工紧急处理,作废此开票单据");
-            }
-
-            map.put("apBillOut",apBillOut);
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",errorMsg.append(resultJo.getString("error")));
-        } else {
-            map.put("resultJo",resultJo);
-            //map.put("error","发票开具失败");
-            map.put("error",errorMsg.append(resultJo.getString("retmsg")));
-        }
-
-        String s = SIDParam.toString();
-
-        map.put("SIDParam",SIDParam.toJSONString());
-        return map;
-    }
-
-    //发票打印
-    @Override
-    public ModelMap invoicePrint(PurchaseApBillOut apBillOut, Integer PrintKind) {
-        ModelMap map = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-        Integer InfoKind = 0;//发票种类
-
-        String InfoNumber = apBillOut.getInfoNumber();
-        if (InfoNumber == null) {
-            map.put("error",errorMsg.append("获取发票号码失败"));
-        }
-
-        String InfoTypeCode = apBillOut.getInfoTypeCode();
-        if (InfoTypeCode == null) {
-            map.put("error",errorMsg.append("获取发票代码失败"));
-        }
-
-        //可为空,0:打印发票  1:打印清单(与SID=3效果一样)
-        if (PrintKind != null && PrintKind != 0 && PrintKind != 1) {
-            map.put("error",errorMsg.append("打印类型错误"));
-        }
-
-        if (map.size() > 0) {
-            return map;
-        }
-
-        int SID = SoapSIDType.INVOICEPRINT.getValue();
-        JSONObject SIDParam = new JSONObject(true);
-        if (InfoKind == null) {
-            SIDParam.put("InfoKind", "");
-        } else {
-            SIDParam.put("InfoKind", InfoKind);
-        }
-
-        SIDParam.put("InfoNumber", InfoNumber);
-        SIDParam.put("InfoTypeCode", InfoTypeCode);
-        SIDParam.put("PrintKind", PrintKind);
-
-        Integer ShowPrintDlg = 1;//可为空,固定值0:不弹出参数设置窗口1:弹出参数设置窗口
-        if (ShowPrintDlg == null) {
-            SIDParam.put("ShowPrintDlg", "");
-        } else {
-            SIDParam.put("ShowPrintDlg", ShowPrintDlg);
-        }
-
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-        if ("5011".equals(resultJo.getString("retcode"))) {
-            map.put("retmsg",resultJo.getString("retmsg"));
-
-            //添加打印次数
-            apBillOut.setPrint((short) ((apBillOut.getPrint() == null ? 0 : apBillOut.getPrint()) + 1));
-
-            try {
-                purchaseApBillOutDao.save(apBillOut);
-            } catch (Exception e) {
-                map.put("dbError","发票打印成功,但过程中数据库更新开票单打印次数失败,需要人工处理干预");
-            }
-
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",errorMsg.append(resultJo.getString("error")));
-        } else {
-            map.put("resultJo",resultJo);
-            //map.put("error","发票打印失败");
-            map.put("error",errorMsg.append(resultJo.getString("retmsg")));
-        }
-
-        return map;
-    }
-
-    //清单打印  (需发票中有清单(开票是可以选择是否开具清单))
-    @Override
-    public ModelMap listPrint(PurchaseApBillOut apBillOut) {
-        ModelMap map = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-        Integer InfoKind = 0;//发票种类
-
-        String InfoNumber = apBillOut.getInfoNumber();
-        if (InfoNumber == null) {
-            map.put("error",errorMsg.append("获取发票号码失败"));
-        }
-
-        String InfoTypeCode = apBillOut.getInfoTypeCode();
-        if (InfoTypeCode == null) {
-            map.put("error",errorMsg.append("获取发票代码失败"));
-        }
-
-        Integer ShowPrintDlg = 1;//可为空,固定值0:不弹出参数设置窗口1:弹出参数设置窗口
-
-        if (map.size() > 0) {
-            return map;
-        }
-
-        int SID = SoapSIDType.LISTPRINT.getValue();
-        JSONObject SIDParam = new JSONObject(true);
-        if (InfoKind == null) {
-            SIDParam.put("InfoKind", "");
-        } else {
-            SIDParam.put("InfoKind", InfoKind);
-        }
-        SIDParam.put("InfoNumber", InfoNumber);
-        SIDParam.put("InfoTypeCode", InfoTypeCode);
-        if (ShowPrintDlg == null) {
-            SIDParam.put("ShowPrintDlg", "");
-        } else {
-            SIDParam.put("ShowPrintDlg", ShowPrintDlg);
-        }
-
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-        if ("5011".equals(resultJo.getString("retcode"))) {
-            map.put("retmsg",resultJo.getString("retmsg"));
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",errorMsg.append(resultJo.getString("error")));
-        } else {
-            //map.put("error","清单打印失败");
-            map.put("error",errorMsg.append(resultJo.getString("retmsg")));
-        }
-
-        return map;
-    }
-
-    //发票作废
-    @Override
-    public ModelMap InvoiceCancel(PurchaseApBillOut apBillOut) {
-        ModelMap map = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-        Integer InfoKind = 0;//发票种类
-        String InfoNumber = apBillOut.getInfoNumber();
-        if (InfoNumber == null) {
-            map.put("error",errorMsg.append("获取发票号码失败"));
-        }
-
-        String InfoTypeCode = apBillOut.getInfoTypeCode();
-        if (InfoTypeCode == null) {
-            map.put("error",errorMsg.append("获取发票代码失败"));
-        }
-
-        if (map.size() > 0) {
-            return map;
-        }
-
-
-        int SID = SoapSIDType.INVOICECANCEL.getValue();
-        JSONObject SIDParam = new JSONObject();
-        if (InfoKind == null) {
-            SIDParam.put("InfoKind", "");
-        } else {
-            SIDParam.put("InfoKind", InfoKind);
-        }
-        SIDParam.put("InfoNumber", InfoNumber);
-        SIDParam.put("InfoTypeCode", InfoTypeCode);
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-
-        if ("6011".equals(resultJo.getString("retcode"))) {
-            map.put("retmsg",resultJo.getString("retmsg"));
-            map.put("retcode",resultJo.getString("retcode"));
-            //修改开票单状态
-            apBillOut.setCheckStatus("已作废");
-            apBillOut.setRetmsg(resultJo.getString("retmsg"));
-
-            try {
-                purchaseApBillOutDao.save(apBillOut);
-            } catch (Exception e) {
-                map.put("dbError","发票作废成功,但过程中数据库更新开票单失败,需要人工处理干预");
-            }
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",errorMsg.append(resultJo.getString("error")));
-        } else {
-            //map.put("error","发票作废失败");
-            map.put("error",errorMsg.append(resultJo.getString("retmsg")));
-        }
-
-        return map;
-    }
-
-    //查询发票信息  //ToDO 批量查询发票
-    @Override
-    public ModelMap queryInvoiceMessage(PurchaseApBillOut apBillOut, Integer mqdbz, Integer mdybz) {
-        ModelMap map = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-        Boolean flag = true;  //默认true为查询发票信息,false为批量发票查询
-
-        Integer fpzl = 0;//发票种类 0:专票2:普票
-        String xsdh = null;//销售单号  //TODO 是否必填
-        String gfmc = null;
-        String gfsh = null;
-        String kpjh = null;//开票机号  //TODO
-        String xfmc = null;//销方名称
-        String xfsh = null;//销方税号
-        String fpdm = null;//发票代码
-        String fphm = null;//发票号码
-        Integer zfbz = 0;//作废标志  //TODO(0未作废 1已作废)
-        Integer qdbz = mqdbz;//清单标志 默认0//TODO(0:非清单发票 1:清单发票)
-        //以下为非必填项
-        String kpdh = null; //TODO 对方说暂留
-        Integer dybz = mdybz;//打印标志  //TODO(1已打印 0未打印)
-        Integer bsbz = 0;//报税标志  //TODO
-        Integer RecNo = null; //TODO 对方说暂留
-        String BeginDate = null; //"2017-07-01";//开始日期yyyy-MM-dd//TODO
-        String EndDate = null; //"2017-08--30";//截至日期yyyy-MM-dd//TODO
-        //下面分页可根据需要传
-        Integer PageSize = null;//分页大小:一次查询返回的最大记录数//TODO
-        Integer PageIndex = null;//当前页序号,第一页为1
-
-        if (apBillOut != null) {
-            xsdh= apBillOut.getCode();
-            kpjh = apBillOut.getKpdh();
-            fpdm= apBillOut.getInfoTypeCode();
-            fphm = apBillOut.getInfoNumber();
-
-            PurchaseApBillOutInfo custApBillOutInfo = apBillOut.getCustomerApBillOutInfo();
-            if (custApBillOutInfo == null) {
-                map.put("error",errorMsg.append("获取购方企业开票信息失败"));
-            } else {
-                gfmc= custApBillOutInfo.getEnName();//购方名称
-                if (gfmc == null) {
-                    map.put("error",errorMsg.append("获取购方企业名称失败"));
-                }
-
-                gfsh= custApBillOutInfo.getTaxNr();//购方税号
-                if (gfsh == null) {
-                    map.put("error",errorMsg.append("获取购方企业税号失败"));
-                }
-            }
-
-            PurchaseApBillOutInfo apBillOutInfo = apBillOut.getApBillOutInfo();
-            if (apBillOutInfo == null) {
-                map.put("error",errorMsg.append("获取购方企业信息失败"));
-            } else {
-                xfmc= apBillOutInfo.getEnName();
-                if (xfmc == null) {
-                    map.put("error",errorMsg.append("获取销方企业名称失败"));
-                }
-
-                xfsh= apBillOutInfo.getTaxNr();
-                if (xfsh == null) {
-                    map.put("error",errorMsg.append("获取销方企业税号失败"));
-                }
-            }
-        }
-
-        if (xsdh == null) {
-            map.put("error",errorMsg.append("获取销售单号失败"));
-        }
-        if (fpdm == null) {
-            map.put("error",errorMsg.append("获取发票代码失败"));
-        }
-        if (fphm == null) {
-            map.put("error",errorMsg.append("获取发票号码失败"));
-        }
-        if (kpjh == null) {
-            map.put("error",errorMsg.append("获取开票机号失败"));
-        }
-        if (zfbz == null) {
-            map.put("error",errorMsg.append("获取作废标志失败"));
-        }
-        if (qdbz == null) {
-            map.put("error",errorMsg.append("获取清单标志失败"));
-        }
-
-        //批量查询发票 kpdh RecNo
-        if (xsdh == null && gfmc == null && gfsh == null &&
-            kpjh == null && xfmc == null && xfsh == null &&
-            fpdm == null && fphm == null && zfbz == null &&
-            qdbz == null && dybz == null && bsbz == null &&
-            fpzl != null && BeginDate != null && EndDate != null) {
-
-            map.clear();
-            flag = false;
-            //TODO 置""?
-
-        } else {
-            if (map.size() > 0) {
-                return map;
-            }
-        }
-
-        //非必填项
-        if (kpdh == null && flag) {
-            kpdh = "";
-        }
-        if (BeginDate == null && flag) {
-            BeginDate = "";
-        }
-        if (EndDate == null && flag) {
-            EndDate = "";
-        }
-
-
-        int SID = SoapSIDType.QUERYINVOICEMESSAGE.getValue();
-        JSONObject SIDParam = new JSONObject(true);
-        if (fpzl == null && flag) {
-            SIDParam.put("fpzl", "");
-        } else {
-            SIDParam.put("fpzl", fpzl);
-        }
-
-        SIDParam.put("xsdh", xsdh);
-        SIDParam.put("gfmc", gfmc);
-        SIDParam.put("gfsh", gfsh);
-        SIDParam.put("kpjh", kpjh);
-        SIDParam.put("xfmc", xfmc);
-        SIDParam.put("xfsh", xfsh);
-        SIDParam.put("fpdm", fpdm);
-        SIDParam.put("fphm", fphm);
-        SIDParam.put("kpdh", kpdh);
-        SIDParam.put("zfbz", zfbz);
-        SIDParam.put("qdbz", qdbz);
-
-        if (dybz == null && flag) {
-            SIDParam.put("dybz", "");
-        } else {
-            SIDParam.put("dybz", dybz);
-        }
-        if (bsbz == null && flag) {
-            SIDParam.put("bsbz", "");
-        } else {
-            SIDParam.put("bsbz", bsbz);
-        }
-        if (RecNo == null && flag) {
-            SIDParam.put("RecNo", "");
-        } else {
-            SIDParam.put("RecNo", RecNo);
-        }
-
-        SIDParam.put("BeginDate", BeginDate);
-        SIDParam.put("EndDate", EndDate);
-
-        if (PageSize == null && flag) {
-            SIDParam.put("PageSize", "");
-        } else {
-            SIDParam.put("PageSize", PageSize);
-        }
-        if (PageIndex == null && flag) {
-            SIDParam.put("PageIndex", "");
-        } else {
-            SIDParam.put("PageIndex", PageIndex);
-        }
-
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-
-        if ("0".equals(resultJo.getString("retcode"))) {
-            SoapQueryInvoiceMessage sqim = JSONObject.parseObject(resultJo.toJSONString(), SoapQueryInvoiceMessage.class);
-            map.put("sqim",sqim);
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",errorMsg.append(resultJo.getString("error")));
-        } else {
-            //map.put("error","查询发票失败");
-            map.put("error",errorMsg.append(resultJo.getString("retmsg")));
-        }
-
-        return map;
-    }
-
-    //查询库存信息 //TODO SoapQueryRepertyMessage字段类型Integet改为了String
-    @Override
-    public ModelMap queryRepertyMessage() {
-        ModelMap map = new ModelMap();
-        int SID = SoapSIDType.QUERYREPERTORYMEAASGE.getValue();
-        JSONObject resultJo = getSOAPJson(SID, null);
-
-        if ("0".equals(resultJo.getString("retcode"))) {
-            SoapQueryRepertyMessage sqrm = JSONObject.parseObject(resultJo.toJSONString(), SoapQueryRepertyMessage.class);
-            map.put("sqrm",sqrm);
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",resultJo.getString("error"));
-        } else {
-            //map.put("error","查询库存信息失败");
-            map.put("error",resultJo.getString("retmsg"));
-        }
-
-        return map;
-    }
-
-    //查询下一发票机库存信息  //TODO SoapQueryNextRepertyMessage Integer
-    @Override
-    public ModelMap queryNextRepertyMessage() {
-        ModelMap map = new ModelMap();
-        int SID = SoapSIDType.QUERYNEXTREPERTORYMEAASGE.getValue();
-        JSONObject resultJo = getSOAPJson(SID, null);
-
-        if ("1011".equals(resultJo.getString("retcode"))) {
-            SoapQueryNextRepertyMessage sqnrm = JSONObject.parseObject(resultJo.toJSONString(), SoapQueryNextRepertyMessage.class);
-            map.put("sqnrm",sqnrm);
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",resultJo.getString("error"));
-        } else {
-            //map.put("error","查询下一发票机库存信息失败");
-            map.put("error",resultJo.getString("retmsg"));
-        }
-
-        return map;
-    }
-
-    //启动开票服务
-    @Override
-    public ModelMap startBillOut() {
-        ModelMap map = new ModelMap();
-        int SID = SoapSIDType.STARTBILLOUT.getValue();
-        JSONObject resultJo = getSOAPJson(SID, null);
-
-        if ("1011".equals(resultJo.getString("retcode"))) {
-            SoapStartBillOut ssbo = JSONObject.parseObject(resultJo.toJSONString(), SoapStartBillOut.class);//TODO PtVer
-            map.put("ssbo",ssbo);
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",resultJo.getString("error"));
-        } else {
-            //map.put("error","启动开票服务信息失败");
-            map.put("error",resultJo.getString("retmsg"));
-        }
-
-        return map;
-    }
-
-    //关闭开票服务
-    @Override
-    public ModelMap closeBillOut() {
-        ModelMap map = new ModelMap();
-        int SID = SoapSIDType.CLOSEBILLOUT.getValue();
-        JSONObject resultJo = getSOAPJson(SID, null);
-
-        if ("0".equals(resultJo.getString("retcode"))) {
-            map.put("retmsg",resultJo.getString("retmsg"));
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",resultJo.getString("error"));
-        } else {
-            //map.put("error","关闭开票服务信息失败");
-            map.put("error",resultJo.getString("retmsg"));
-        }
-
-        return map;
-    }
-
-    //发票上传  //TODO
-    @Override
-    public ModelMap invoiceUpload(PurchaseApBillOut apBillOut) {
-        ModelMap map = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-        //TODO 获取属性值
-        String fpdm = apBillOut.getInfoTypeCode();//上传的发票代码
-        if (fpdm == null) {
-            map.put("error",errorMsg.append("获取上传的发票代码失败"));
-        }
-
-        String fphm = apBillOut.getInfoNumber();//上传的发票号码
-        if (fphm == null) {
-            map.put("error",errorMsg.append("获取上传的发票号码失败"));
-        }
-
-        if (map.size() > 0) {
-            return map;
-        }
-
-        int SID = SoapSIDType.INVOICEUPLOAD.getValue();
-        JSONObject SIDParam = new JSONObject(true);
-        SIDParam.put("fpdm", fpdm);
-        SIDParam.put("fphm", fphm);
-
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-
-        if ("0".equals(resultJo.getString("retcode"))) {
-            map.put("retmsg",resultJo.getString("retmsg"));
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",errorMsg.append(resultJo.getString("error")));
-        } else  {
-            //map.put("error","发票上传失败");
-            map.put("error",errorMsg.append(resultJo.getString("retmsg")));
-        }
-        return map;
-    }
-
-    //发票状态更新  //TODO 需先上传发票
-    @Override
-    public ModelMap invoiceStatusUpdate() {
-        ModelMap map = new ModelMap();
-        int SID = SoapSIDType.INVOICESTATUSUPDATE.getValue();
-        JSONObject resultJo = getSOAPJson(SID, null);
-
-        if ("8050".equals(resultJo.getString("retcode"))) {
-            SoapInvoiceStatusUpdate sisu = JSONObject.parseObject(resultJo.toJSONString(), SoapInvoiceStatusUpdate.class);
-            map.put("sisu",sisu);
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",resultJo.getString("error"));
-        } else {
-            //map.put("error","发票状态更新失败");
-            map.put("error",resultJo.getString("retmsg"));
-        }
-
-        return map;
-    }
-
-    //单张发票查询
-    @Override
-    public ModelMap singleInvoiceQuery(PurchaseApBillOut apBillOut) {
-        ModelMap map = new ModelMap();
-        StringBuilder errorMsg = new StringBuilder();
-        //注意:xsdbh与fpzl、fpdm、fphm是互斥条件,传销售单号就不按照fpzl,fpdm,fphm来查询
-        Integer fpzl = 0;//发票种类 0专票,2普票,11货运发票,12机动车发票,51电子发票  //TODO
-        String fpdm = apBillOut.getInfoTypeCode();//发票代码 10位
-        if (fpdm == null) {
-            fpdm = "";
-        }
-
-        String fphm = apBillOut.getInfoNumber();//发票号码8位
-        if (fphm == null) {
-            fphm = "";
-        }
-
-        //以下为非必填项
-        String xsdbh = null; //apBillOut.getCode();//销售单编号
-        if (xsdbh == null) {
-            xsdbh = "";
-        }
-
-        if (!((fpzl != null && !"".equals(fpdm) && !"".equals(fphm)) ^ (!"".equals(xsdbh)))) {
-            if (fpzl == null) {
-                map.put("error",errorMsg.append("获取发票种类失败"));
-            }
-            if ("".equals(fpdm)) {
-                map.put("error",errorMsg.append("获取发票代码失败"));
-            }
-            if ("".equals(fphm)) {
-                map.put("error",errorMsg.append("获取发票号码失败"));
-            }
-            if ("".equals(xsdbh)) {
-                map.put("error",errorMsg.append("获取销售单编号失败"));
-            }
-            map.put("error",errorMsg.append("销售单编号与发票种类、发票代码、发票号码是互斥条件"));
-        }
-
-        if (map.size() > 0) {
-            return map;
-        }
-
-        int SID = SoapSIDType.SINGLEINVOICEQUERY.getValue();
-        JSONObject SIDParam = new JSONObject(true);
-        SIDParam.put("xsdbh", xsdbh);
-        SIDParam.put("fpzl", fpzl);
-        SIDParam.put("fpdm", fpdm);
-        SIDParam.put("fphm", fphm);
-
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-
-        if ("0".equals(resultJo.getString("retcode"))) {
-            SoapSingleInvoiceQuery ssiq = JSONObject.parseObject(resultJo.toJSONString(), SoapSingleInvoiceQuery.class);
-            map.put("ssiq", ssiq);
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",errorMsg.append(resultJo.getString("error")));
-        } else {
-            //map.put("error","单张发票查询失败");
-            map.put("error",errorMsg.append(resultJo.getString("retmsg")));
-        }
-
-        return map;
-    }
-
-
-
-    //TODO 批处理接口 SID=20
-
-    //机动车发票填开
-    @Override
-    public SoapMotorInvoiceIssued motorInvoiceIssued(String json) {
-        String documentNr = "";//单据号
-        Integer CheckEWM = 0;//开票标志 0:开票 1:校验 2:空白作废
-        Integer infoKind = 12;//发票种类 12 为机动车 //TODO ?
-        String Jdckind = "1";//1 旧机动车,2新机动车
-        String infoClientName = "";//购货单位
-        String idCard = "";//身份证号、组织机构代码
-        String vehicleKind = "";//车辆类型
-        String brandModel = "";//厂牌型号
-        String originPlace = "";//产地
-        String vehicleNo = "";//车辆识别代号、车辆号码
-        //String documentNr = "";//销售单号  //TODO ?
-        String infoInvoicer = "";//开票人
-        Double amountTaxTotal = 0.0;//价税合计
-        Integer infoTaxRate = 0;//11标识11%
-
-        //以下为非必填项
-        String sellerTaxNr = null;//销方税号(可为空)
-        Integer kpdh = null;//开票点号(可为空)
-        Integer kpfwqh = 0;//开票服务器号
-        //以上信息传入则会比较是否一致,不一致就不能开票
-        String infoClientTaxCode = "";//新机动车纳税人识别号
-        String qualityCertificate = "";//合格证号
-        String impCertificateNo = "";//进口证明文书号
-        String commInspectionNo = "";//商标单号(商检单号)
-        String enginNo = "";//发动机号
-        String manufacturerName = "";//生产厂家名称
-        String sellerPhone = "";//销货单位电话
-        String sellerAccount = "";//销货单位账号
-        String sellerAddress = "";//地址
-        String sellerBank = "";//开户行
-        String tonnage = "";//吨位
-        String peopleNo = "";//限乘人数
-        String infoNotes = "";//备注
-        String GoodsNoVer = "";//税收分类编码版本号
-        String GoodsTaxNo = "";//税收分类编码
-        String TaxPre = "";//是否享受优惠政策
-        String TaxPreCon = "";//优惠正常内容(可不传)
-        String ZeroTax = "";//零税率标识(可不传)
-        String CropGoodsNo = "";//企业自编码(可不传)
-
-        JSONObject jo = JSON.parseObject(json);
-        //TODO 获取属性值
-
-        int SID = SoapSIDType.MOTORINVOICEISSUED.getValue();
-        JSONObject SIDParam = new JSONObject();
-        SIDParam.put("sellerTaxNr", sellerTaxNr);
-        SIDParam.put("kpdh", kpdh);
-        SIDParam.put("kpfwqh", kpfwqh);
-        SIDParam.put("documentNr", documentNr);
-        SIDParam.put("CheckEWM", CheckEWM);
-        SIDParam.put("infoKind", infoKind);
-        SIDParam.put("Jdckind", Jdckind);
-        SIDParam.put("infoClientName", infoClientName);
-        SIDParam.put("infoClientTaxCode", infoClientTaxCode);
-        SIDParam.put("idCard", idCard);
-        SIDParam.put("vehicleKind", vehicleKind);
-        SIDParam.put("brandModel", brandModel);
-        SIDParam.put("originPlace", originPlace);
-        SIDParam.put("qualityCertificate", qualityCertificate);
-        SIDParam.put("impCertificateNo", impCertificateNo);
-        SIDParam.put("commInspectionNo", commInspectionNo);
-        SIDParam.put("enginNo", enginNo);
-        SIDParam.put("vehicleNo", vehicleNo);
-        SIDParam.put("manufacturerName", manufacturerName);
-        SIDParam.put("infoInvoicer", infoInvoicer);
-        SIDParam.put("amountTaxTotal", amountTaxTotal);
-        SIDParam.put("sellerPhone", sellerPhone);
-        SIDParam.put("sellerAccount", sellerAccount);
-        SIDParam.put("sellerAddress", sellerAddress);
-        SIDParam.put("sellerBank", sellerBank);
-        SIDParam.put("infoTaxRate", infoTaxRate);
-        SIDParam.put("tonnage", tonnage);
-        SIDParam.put("peopleNo", peopleNo);
-        SIDParam.put("infoNotes", infoNotes);
-        SIDParam.put("GoodsNoVer", GoodsNoVer);
-        SIDParam.put("GoodsTaxNo", GoodsTaxNo);
-        SIDParam.put("TaxPre", TaxPre);
-        SIDParam.put("TaxPreCon", TaxPreCon);
-        SIDParam.put("ZeroTax", ZeroTax);
-        SIDParam.put("CropGoodsNo", CropGoodsNo);
-
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-        SoapMotorInvoiceIssued smii = JSON.toJavaObject(resultJo, SoapMotorInvoiceIssued.class);
-        return smii;
-    }
-
-
-    //机动车发票查询
-    @Override
-    public SoapMotorInvoiceQuery motorInvoiceQuery(String json) {
-        String xsdh = "";//销售单号 //TODO 是否必填
-        String gfmc = "";//购方名称
-        String xfmc = "";//销方名称
-        String xfsh = "";//销方税号
-        String fpdm = "";//发票代码
-        String fphm = "";//发票号码
-        Integer kpjh = 0;//开票机号
-        Integer zfbz = 0;//作废标志
-        Integer qdbz = 0;//清单标志
-        Integer dybz = 0;//打印标志
-
-        //以下为非必填项
-        String gfsh = "";//购方税号
-        Integer bsbz = 0;//报税标志
-        String BeginDate = "";//开始日期yyyy-MM-dd
-        String EndDate = "";//截至日期yyyy-MM-dd
-        //下面分页可根据需要传
-        Integer PageSize = 0;//分页大小:一次查询返回的最大记录数
-        Integer PageIndex = 1;//当前页序号,第一页为1
-
-        JSONObject jo = JSON.parseObject(json);
-        //TODO 获取属性值
-
-        int SID = SoapSIDType.MOTORINVOICEQUERY.getValue();
-        JSONObject SIDParam = new JSONObject();
-        SIDParam.put("xsdh", xsdh);
-        SIDParam.put("gfmc", gfmc);
-        SIDParam.put("gfsh", gfsh);
-        SIDParam.put("xfmc", xfmc);
-        SIDParam.put("xfsh", xfsh);
-        SIDParam.put("fpdm", fpdm);
-        SIDParam.put("fphm", fphm);
-        SIDParam.put("kpjh", kpjh);
-        SIDParam.put("zfbz", zfbz);
-        SIDParam.put("qdbz", qdbz);
-        SIDParam.put("dybz", dybz);
-        SIDParam.put("bsbz", bsbz);
-        SIDParam.put("BeginDate", BeginDate);
-        SIDParam.put("EndDate", EndDate);
-        SIDParam.put("PageSize", PageSize);
-        SIDParam.put("PageIndex", PageIndex);
-
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-        SoapMotorInvoiceQuery smiq = JSON.toJavaObject(resultJo, SoapMotorInvoiceQuery.class);
-        return smiq;
-    }
-
-    //金税设备查询 SID=25
-    @Override
-    public ModelMap taxEquipmentQuery() {
-        ModelMap map = new ModelMap();
-
-        int SID = SoapSIDType.TAXEQUIPMENTQUERY.getValue();
-        JSONObject SIDParam = new JSONObject();
-        String str = "<?xml version=\"1.0\" encoding=\"GBK\"?><FPXT_COM_INPUT><ID>0400</ID><DATA></DATA></FPXT_COM_INPUT>";
-        SIDParam.put("SIDParam", str);
-
-        JSONObject resultJo = getSOAPJson(SID, SIDParam);
-
-        if ("0".equals(resultJo.getString("retcode"))) {
-            map.put("resultJo",resultJo);
-
-            //单纯想查看responseMsg解析后的内容
-            String responseMsg = resultJo.getString("responseMsg");
-            responseMsg = responseMsg.split("<DATA>")[1].split("</DATA>")[0];
-            responseMsg = getFromBase64(responseMsg);
-            map.put("responseMsg",responseMsg);
-
-        } else if (resultJo.getString("error") != null) {
-            map.put("error",resultJo.getString("error"));
-        } else {
-            //map.put("error","查询金税设备失败");
-            map.put("error",resultJo.getString("retmsg"));
-        }
-
-        return map;
-    }
-
-    private JSONObject getSOAPJson(int SID, JSONObject SIDParam) {
-
-        //获取当前企业
-        Long enUu = SystemSession.getUser().getEnterprise().getUu();
-        String ipAndPort = purchaseApBillOutInfoDao.findByUu(enUu).getIp();
-        String[] ipAndPortArr = ipAndPort.split(":");
-        String ip = ipAndPortArr[0].trim();
-        String port = "8888";//默认端口号
-        if (ipAndPortArr.length == 2 && !"".equals(ipAndPortArr[1].trim()))
-        {
-            port = ipAndPortArr[1].trim();
-        }
-
-        JSONObject resultJo = new JSONObject();
-        String param = null;
-        if (SIDParam != null) {
-            String SIDParamString = SIDParam.toJSONString(); //JSON.toJSONString(SIDParam, new PascalNameFilter())
-            if (SID == 1) {
-                SIDParamString = SIDParamString.replaceAll("cropGoodsNo", "CropGoodsNo").replaceAll("goodsTaxNo", "GoodsTaxNo").replaceAll("taxDeduction", "TaxDeduction").replaceAll("taxPre", "TaxPre").replaceAll("taxPreCon", "TaxPreCon").replaceAll("zeroTax", "ZeroTax");
-            }
-            param = getBase64(SIDParamString);
-        }
-
-        try {
-            String url = "http://" +ip + ":" + port + "/InvSvr?SID=" + SID + "&SIDParam=" + param;
-            String response = HttpUtil.sendPost(url, null);
-            JSONObject responseJo = JSON.parseObject(response);
-            String result = responseJo.getString("ENCMSG");
-            result = getFromBase64(result);
-            resultJo = JSON.parseObject(result);
-        } catch (NullPointerException e) { // 加一个connectException
-            resultJo.put("error", "从开票接口获取数据失败");
-            e.printStackTrace();
-        } catch (Exception e) {
-            resultJo.put("error", "链接航天开票接口失败");
-            e.printStackTrace();
-        } finally {
-            return resultJo;
-        }
-    }
-
-    private JSONObject getSOAPJson1(int SID, JSONObject SIDParam) {
-        StringBuilder sb = new StringBuilder();
-        sb.append("http://127.0.0.1:8888/InvSvr?");//192.168.253.112
-        sb.append("SID=").append(SID);
-        String str = SIDParam.toJSONString();
-
-        str = getBase64(str);
-
-        sb.append("&SIDParam=").append(str);
-        URLConnection conn = null;
-        BufferedReader rd = null;
-        JSONObject resultJo = new JSONObject();
-        String result = "";
-        String res = "";
-        try {
-            URL url = new URL(str);
-            conn = url.openConnection();
-            conn.setRequestProperty("accept", "*/*");
-            //conn.setRequestProperty("Accept-Charset", "GBK");
-            conn.setRequestProperty("connection", "Keep-Alive");
-            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
-            conn.connect();
-            rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
-            while ((result = rd.readLine()) != null) {
-                res = res + result;
-            }
-            resultJo = JSON.parseObject(res);
-
-        } catch (MalformedURLException e) {
-            e.printStackTrace();
-        } catch (ConnectException e) {
-            resultJo.put("error", "链接航天开票接口失败");
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                if (rd != null) {
-                    rd.close();
-                }
-
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-            return resultJo;
-        }
-
-        //return resultJo;
-    }
-
-     // 加密  
-    public static String getBase64(String str) {
-        byte[] b = null;  
-        String s = null;  
-        try {  
-            b = str.getBytes("GB2312");
-//          s = URLEncoder.encode(str,"GB2312");
-//          str = new String(str.getBytes("UTF-8"), "GB2312");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }  
-        if (b != null) {
-//          s = new BASE64Encoder().encode(b);
-            s = Base64.toBase64String(b);
-            s= s.replaceAll("\\+","_");
-        }  
-        return s;  
-    }
-
-    // 解密
-    public static String getFromBase64(String s) {
-        s = s.replaceAll("_", "+");
-
-        byte[] b = null;
-        String result = null;
-        if (s != null) {
-            //BASE64Decoder decoder = new BASE64Decoder();
-            try {
-                //b = decoder.decodeBuffer(s);
-                b = Base64.decode(s);
-                result = new String(b, "GB2312");
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-        return result;
-    }
-
-    private static class JsonUtil2 {
-
-        /**
-         * 将对象转化为JSON字符串
-         *
-         * @param object 要转化成json的对象
-         * @return 返回Json字符串
-         */
-        public static String parse(Object object) {
-            // TODO 请完成
-            if (object == null)
-                return "{}";
-            Class clazz = object.getClass();
-
-            try {
-                if (clazz.getName().startsWith("java.lang.String")) { // String字符串
-                    return parseString(object);
-                } else if (clazz.isPrimitive() || clazz.getName().startsWith("java.lang")) { // 基本属性类型及其封装类型
-                    return parsePrimitive(object);
-                } else if (Collection.class.isAssignableFrom(clazz)) { //集合
-                    return parseCollection(object);
-                } else if (Object.class.isAssignableFrom(clazz)) { //其他对象
-                    return parseObject(object);
-                }
-            } catch (IllegalAccessException e) {
-                e.printStackTrace();
-            }
-            return "{}";
-        }
-
-        private static String parseObject(Object object) throws IllegalAccessException {
-            StringBuffer tempSb = new StringBuffer(); //用于临时拼接集合的解析
-            tempSb.append("{");
-
-            Class c = object.getClass();
-            Field[] fs = c.getDeclaredFields();
-            for (int i = 0; i < fs.length; i++) {//遍历对象的所有属性
-                Field field = fs[i];
-                field.setAccessible(true);
-                String key = field.getName(); // Json字符串的key值
-                Object value = field.get(object);   // 解析前的值,为Object对象
-                if (Collection.class.isAssignableFrom(field.getType())) {
-                    tempSb.append("\"" + key + "\":" + parseCollection(value));
-                    continue;
-                }
-                tempSb.append("\"" + key + "\":" + parse(value));
-                if (i != fs.length - 1) { // 当不是最后一个属性时,添加逗号
-                    tempSb.append(",");
-                }
-            }
-
-            tempSb.append("}");
-            return String.valueOf(tempSb);
-        }
-
-        private static String parseCollection(Object object) {
-            if (object == null) {
-                return "[]";
-            }
-
-            StringBuffer tempSb = new StringBuffer(); //用于临时拼接集合的解析
-            tempSb.append("[");
-
-            //使用迭代器遍历集合中的对象
-            Iterator iterator = ((Collection<?>) object).iterator();
-            while (iterator.hasNext()) {
-                Object obj = iterator.next();
-                tempSb.append(parse(obj));
-                if (iterator.hasNext()) {
-                    tempSb.append(",");
-                }
-            }
-            tempSb.append("]");
-            return String.valueOf(tempSb);
-        }
-
-        private static String parsePrimitive(Object object) {
-            return String.valueOf(object);
-        }
-
-        private static String parseString(Object object) {
-            return "\"" + object + "\"";
-        }
-    }
-
-}
-
-