use of com.itrus.portal.db.OnlinePay in project portal by ixinportal.
the class PayController method list.
// 列表所有信息
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "sn", required = false) String sn, @RequestParam(value = "queryDate1", required = false) Date queryDate1, @RequestParam(value = "queryDate2", required = false) Date queryDate2, @RequestParam(value = "projectname", required = false) String projectname, @RequestParam(value = "entname", required = false) String entname, @RequestParam(value = "issms", required = false) Integer issms, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "sn1", required = false) String sn1, @RequestParam(value = "queryDate11", required = false) Date queryDate11, @RequestParam(value = "queryDate21", required = false) Date queryDate21, @RequestParam(value = "projectname1", required = false) String projectname1, @RequestParam(value = "entname1", required = false) String entname1, @RequestParam(value = "page2", required = false) Integer page1, @RequestParam(value = "size2", required = false) Integer size1, @RequestParam(value = "sn2", required = false) String sn2, @RequestParam(value = "queryDate12", required = false) Date queryDate12, @RequestParam(value = "queryDate22", required = false) Date queryDate22, @RequestParam(value = "queryDate32", required = false) Date queryDate32, @RequestParam(value = "queryDate42", required = false) Date queryDate42, @RequestParam(value = "projectname2", required = false) String projectname2, @RequestParam(value = "entname2", required = false) String entname2, @RequestParam(value = "way2", required = false) Integer way2, @RequestParam(value = "page3", required = false) Integer page2, @RequestParam(value = "size3", required = false) Integer size2, @RequestParam(value = "page4", required = false) Integer page4, @RequestParam(value = "size4", required = false) Integer size4, @RequestParam(value = "sn4", required = false) String sn4, @RequestParam(value = "queryDate14", required = false) Date queryDate14, @RequestParam(value = "queryDate24", required = false) Date queryDate24, @RequestParam(value = "projectname4", required = false) String projectname4, @RequestParam(value = "entname4", required = false) String entname4, @RequestParam(value = "way4", required = false) Integer way4, Model uiModel) throws Exception {
if (queryDate12 == null && queryDate22 == null) {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
calendar.add(Calendar.MILLISECOND, -1);
queryDate22 = calendar.getTime();
calendar.add(Calendar.MILLISECOND, 1);
calendar.add(Calendar.MONTH, -1);
queryDate12 = calendar.getTime();
}
Map param = new HashMap();
// 管理员项目权限
Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
param.put("hasProjects", Arrays.asList(projectsOfAdmin));
// page,size
if (page == null || page < 1)
page = 1;
if (size == null || size < 1)
size = 10;
Integer offset = size * (page - 1);
param.put("offset", offset);
param.put("limit", size);
if (StringUtils.isNotEmpty(sn)) {
param.put("sn", "%" + sn + "%");
}
param.put("queryDate1", queryDate1);
param.put("queryDate2", queryDate2);
if (StringUtils.isNotEmpty(projectname)) {
param.put("projectname", "%" + projectname + "%");
}
if (StringUtils.isNotEmpty(entname)) {
param.put("entname", "%" + entname + "%");
}
param.put("issms", issms);
param.put("status", status == null ? 1 : status);
if (status == null || status == 1) {
param.put("asc", 1);
} else {
param.put("desc", 1);
}
List billexall = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectByCondition", param);
uiModel.addAttribute("bills", billexall);
Integer count = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectCountByCondition", param);
uiModel.addAttribute("count", count);
uiModel.addAttribute("pages", (count + size - 1) / size);
// page, size
if (page > 1 && size * (page - 1) >= count) {
page = (count + size - 1) / size;
}
uiModel.addAttribute("page", page);
uiModel.addAttribute("size", size);
// itemcount
uiModel.addAttribute("sn", sn);
uiModel.addAttribute("queryDate1", queryDate1);
uiModel.addAttribute("queryDate2", queryDate2);
uiModel.addAttribute("projectname", projectname);
uiModel.addAttribute("entname", entname);
uiModel.addAttribute("issms", issms);
Map param1 = new HashMap();
// 管理员项目权限
param1.put("hasProjects", Arrays.asList(projectsOfAdmin));
// page,size
if (page1 == null || page1 < 1)
page1 = 1;
if (size1 == null || size1 < 1)
size1 = 10;
Integer offset1 = size1 * (page1 - 1);
param1.put("offset", offset1);
param1.put("limit", size1);
if (StringUtils.isNotEmpty(sn1)) {
param1.put("sn", "%" + sn1 + "%");
}
param1.put("queryDate1", queryDate11);
param1.put("queryDate2", queryDate21);
if (StringUtils.isNotEmpty(projectname1)) {
param1.put("projectname", "%" + projectname1 + "%");
}
if (StringUtils.isNotEmpty(entname1)) {
param1.put("entname", "%" + entname1 + "%");
}
param1.put("status", 2);
param1.put("pay_asc", 1);
List billexall1 = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectByCondition", param1);
uiModel.addAttribute("bills1", billexall1);
Integer count1 = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectCountByCondition", param1);
uiModel.addAttribute("count2", count1);
uiModel.addAttribute("pages2", (count1 + size1 - 1) / size1);
// page, size
if (page1 > 1 && size1 * (page1 - 1) >= count1) {
page1 = (count1 + size1 - 1) / size1;
}
uiModel.addAttribute("page2", page1);
uiModel.addAttribute("size2", size1);
// itemcount
uiModel.addAttribute("sn1", sn1);
uiModel.addAttribute("queryDate11", queryDate11);
uiModel.addAttribute("queryDate21", queryDate21);
uiModel.addAttribute("projectname1", projectname1);
uiModel.addAttribute("entname1", entname1);
Map param2 = new HashMap();
// 管理员项目权限
param2.put("hasProjects", Arrays.asList(projectsOfAdmin));
// page,size
if (page2 == null || page2 < 1)
page2 = 1;
if (size2 == null || size2 < 1)
size2 = 10;
Integer offset2 = size2 * (page2 - 1);
param2.put("offset", offset2);
param2.put("limit", size2);
if (StringUtils.isNotEmpty(sn2)) {
param2.put("sn", "%" + sn2 + "%");
}
if (way2 != null) {
if ((int) way2 > 0) {
param2.put("way", way2);
param2.put("payStatus", 1);
} else {
param2.put("way", way2);
}
} else {
param2.put("way", way2);
}
param2.put("queryDate1", queryDate12);
param2.put("queryDate2", queryDate22);
param2.put("queryDate3", queryDate32);
param2.put("queryDate4", queryDate42);
if (StringUtils.isNotEmpty(projectname2)) {
param2.put("projectname", "%" + projectname2 + "%");
}
if (StringUtils.isNotEmpty(entname2)) {
param2.put("entname", "%" + entname2 + "%");
}
param2.put("pay_true", 1);
param2.put("status1", 1);
param2.put("dqr", 1);
List billexall2 = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectByCondition", param2);
uiModel.addAttribute("bills2", billexall2);
Integer count2 = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectCountByCondition", param2);
uiModel.addAttribute("count3", count2);
uiModel.addAttribute("pages3", (count2 + size2 - 1) / size2);
// page, size
if (page2 > 1 && size2 * (page2 - 1) >= count2) {
page2 = (count2 + size2 - 1) / size2;
}
uiModel.addAttribute("page3", page2);
uiModel.addAttribute("size3", size2);
// itemcount
uiModel.addAttribute("sn2", sn2);
uiModel.addAttribute("queryDate12", queryDate12);
uiModel.addAttribute("queryDate22", queryDate22);
uiModel.addAttribute("queryDate32", queryDate32);
uiModel.addAttribute("queryDate42", queryDate42);
uiModel.addAttribute("projectname2", projectname2);
uiModel.addAttribute("entname2", entname2);
uiModel.addAttribute("way2", way2);
// 第三方支付中
Map param4 = new HashMap();
// 管理员项目权限
param4.put("hasProjects", Arrays.asList(projectsOfAdmin));
// page,size
if (page4 == null || page4 < 1)
page4 = 1;
if (size4 == null || size4 < 1)
size4 = 10;
Integer offset4 = size4 * (page4 - 1);
param4.put("offset", offset4);
param4.put("limit", size4);
if (StringUtils.isNotEmpty(sn4)) {
param4.put("sn", "%" + sn4 + "%");
}
param4.put("queryDate1", queryDate14);
param4.put("queryDate2", queryDate24);
if (StringUtils.isNotEmpty(projectname4)) {
param4.put("projectname", "%" + projectname4 + "%");
}
if (StringUtils.isNotEmpty(entname4)) {
param4.put("entname", "%" + entname4 + "%");
}
param4.put("way", way4);
param4.put("ycdigndan", 1);
param4.put("payStatus", 0);
param4.put("asc", 1);
List billexall4 = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectByCondition", param4);
uiModel.addAttribute("bills4", billexall4);
Integer count4 = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectCountByCondition", param4);
uiModel.addAttribute("count4", count4);
uiModel.addAttribute("pages4", (count4 + size4 - 1) / size4);
// page, size
if (page4 > 1 && size4 * (page4 - 1) >= count4) {
page4 = (count4 + size4 - 1) / size4;
}
uiModel.addAttribute("page4", page4);
uiModel.addAttribute("size4", size4);
// itemcount
uiModel.addAttribute("sn4", sn4);
uiModel.addAttribute("queryDate14", queryDate14);
uiModel.addAttribute("queryDate24", queryDate24);
uiModel.addAttribute("projectname4", projectname4);
uiModel.addAttribute("entname4", entname4);
uiModel.addAttribute("way4", way4);
uiModel.addAttribute("status", status);
Map<Long, OnlinePay> onlinepays = sqlSession.selectMap("com.itrus.portal.db.OnlinePayMapper.selectByExample", null, "id");
uiModel.addAttribute("onlinepays", onlinepays);
return "pay/list";
}
use of com.itrus.portal.db.OnlinePay in project portal by ixinportal.
the class PayController method confirm.
// 显示详情
@RequestMapping(value = "/confirm/{id}", produces = "text/html")
public String confirm(@PathVariable("id") Long id, Model uiModel) {
Map param = new HashMap();
param.put("id", id);
// 管理员项目权限
Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
param.put("hasProjects", Arrays.asList(projectsOfAdmin));
Map bill = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByCondition", param);
if (null == bill || bill.isEmpty()) {
uiModel.addAttribute("errorMsg", "未找到该订单");
return "status403";
}
uiModel.addAttribute("bill", bill);
// 得到纳税人识别号
if (bill.get("id") != null) {
String taxesCode = getTaxesCode(Long.valueOf(bill.get("id").toString()));
uiModel.addAttribute("taxesCode", taxesCode);
}
if (bill.get("on_pay_info") != null) {
OnPayInfo onpayinfo = sqlSession.selectOne("com.itrus.portal.db.OnPayInfoMapper.selectByPrimaryKey", bill.get("on_pay_info"));
uiModel.addAttribute("onpayinfo", onpayinfo);
OnlinePay onlinepay = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.selectByPrimaryKey", bill.get("online_pay"));
uiModel.addAttribute("onlinepay", onlinepay);
}
if (bill.get("price") != null && bill.get("product_num") != null) {
uiModel.addAttribute("sum", Double.parseDouble(bill.get("price").toString()) * Integer.parseInt(bill.get("product_num").toString()));
} else {
uiModel.addAttribute("sum", 0);
}
ProductSpec productSpec = null;
Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", bill.get("product"));
DigitalCert cert = sqlSession.selectOne("com.itrus.portal.db.DigitalCertMapper.selectByPrimaryKey", product.getCert());
uiModel.addAttribute("cert", cert);
// 判断是否属于组合产品
if (product.getIsCombined() != null && product.getIsCombined().equals(1)) {
Product productSub = null;
PreferentialRecord pr = null;
// 得到三条组合产品的产品信息
for (int i = 1; i < 4; i++) {
if (bill.get("product" + i) == null) {
continue;
}
productSub = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", bill.get("product" + i));
uiModel.addAttribute("product" + i, productSub);
cert = sqlSession.selectOne("com.itrus.portal.db.DigitalCertMapper.selectByPrimaryKey", productSub.getCert());
uiModel.addAttribute("cert" + i, cert);
// 获取产品规格
if (bill.containsKey("product_spec" + i) && !"0".equals(bill.get("product_spec" + i))) {
productSpec = productSpecService.getProductSpec((Long) bill.get("product_spec" + i));
}
uiModel.addAttribute("productSpec" + i, productSpec);
// 该订单是否有价格优惠记录
pr = preferentialRecordService.selectPreferentialRecordSByBillIdAndProductId(id, (Long) (bill.get("product" + i)));
if (null != pr) {
uiModel.addAttribute("preferentialrecord" + i, pr);
}
}
PayInfo pi = sqlSession.selectOne("com.itrus.portal.db.PayInfoMapper.selectByPrimaryKey", bill.get("pay_info"));
uiModel.addAttribute("pi", pi);
return "pay/update";
}
// 获取产品规格
if (bill.containsKey("product_spec") && !"0".equals(bill.get("product_spec"))) {
productSpec = productSpecService.getProductSpec((Long) bill.get("product_spec"));
}
uiModel.addAttribute("productSpec", productSpec);
PayInfo pi = sqlSession.selectOne("com.itrus.portal.db.PayInfoMapper.selectByPrimaryKey", bill.get("pay_info"));
uiModel.addAttribute("pi", pi);
// 该订单是否有价格优惠记录
PreferentialRecord pr = preferentialRecordService.selectPreferentialRecordSByBillId(id);
if (null != pr) {
uiModel.addAttribute("preferentialrecord", pr);
}
return "pay/update";
}
use of com.itrus.portal.db.OnlinePay in project portal by ixinportal.
the class ExtraProductController method show.
// 显示详情页面
@RequestMapping(value = "/show/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) throws Exception {
ExtraProduct extraProduct = extraProductService.selectByPrimaryKey(id);
uiModel.addAttribute("extraProduct", extraProduct);
List<ExtraProductSpec> extraProductSpecs = extraProductSpecService.getSpecByProductId(id);
uiModel.addAttribute("extraProductSpecs", extraProductSpecs);
// 服务提供商组成的map
Map<Long, ServiceProvider> serviceProviderMap = serviceProviderService.selectMapByExample(null);
uiModel.addAttribute("serviceProviderMap", serviceProviderMap);
// 在线支付的map:微信和支付宝
List<OnlinePay> onlinepays = sqlSession.selectList("com.itrus.portal.db.OnlinePayMapper.selectByExample", null);
uiModel.addAttribute("onlinepays", onlinepays);
// 银行付款的List
List<Transfer> bankPays = sqlSession.selectList("com.itrus.portal.db.TransferMapper.selectByExample", null);
uiModel.addAttribute("bankPays", bankPays);
// 电子发票的list
List<Ereceipt> einvoices = sqlSession.selectList("com.itrus.portal.db.EreceiptMapper.selectByExample", null);
uiModel.addAttribute("einvoices", einvoices);
// 附加项的list
List<ExtraMessage> extraMessages = extraMessageService.selectByExample(null);
uiModel.addAttribute("extraMessages", extraMessages);
return "extraproduct/show";
}
use of com.itrus.portal.db.OnlinePay in project portal by ixinportal.
the class ExtraProductController method updatePage.
// 修改基础信息和产品规格信息页面
@RequestMapping(value = "/update/{id}", produces = "text/html")
public String updatePage(@PathVariable("id") Long id, Model uiModel) throws Exception {
ExtraProduct extraProduct = extraProductService.selectByPrimaryKey(id);
uiModel.addAttribute("extraProduct", extraProduct);
List<ExtraProductSpec> extraProductSpecs = extraProductSpecService.getSpecByProductId(id);
uiModel.addAttribute("extraProductSpecs", extraProductSpecs);
// 服务提供商组成的map
Map<Long, ServiceProvider> serviceProviderMap = serviceProviderService.selectMapByExample(null);
uiModel.addAttribute("serviceProviderMap", serviceProviderMap);
// 在线支付的map:微信和支付宝
List<OnlinePay> onlinepays = sqlSession.selectList("com.itrus.portal.db.OnlinePayMapper.selectByExample", null);
uiModel.addAttribute("onlinepays", onlinepays);
// 银行付款的List
List<Transfer> bankPays = sqlSession.selectList("com.itrus.portal.db.TransferMapper.selectByExample", null);
uiModel.addAttribute("bankPays", bankPays);
// 电子发票的list
List<Ereceipt> einvoices = sqlSession.selectList("com.itrus.portal.db.EreceiptMapper.selectByExample", null);
uiModel.addAttribute("einvoices", einvoices);
return "extraproduct/update";
}
use of com.itrus.portal.db.OnlinePay in project portal by ixinportal.
the class ExtraQueryBillController method show.
// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
// 管理员项目权限
Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
List<Long> projectsOfAdminList = Arrays.asList(projectsOfAdmin);
ExtraBillExample billExample = new ExtraBillExample();
ExtraBillExample.Criteria criteria = billExample.or();
criteria.andIdEqualTo(id);
criteria.andProjectIn(projectsOfAdminList);
ExtraBill bill = sqlSession.selectOne("com.itrus.portal.db.ExtraBillMapper.selectByExample", billExample);
if (null == bill) {
uiModel.addAttribute("errorMsg", "未找到该订单");
return "status403";
}
uiModel.addAttribute("bill", bill);
// 项目
Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", bill.getProject());
uiModel.addAttribute("project", project);
// 企业
Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bill.getEnterprise());
if (StringUtils.isNotBlank(enterprise.getProvince())) {
String province = sysRegionService.getProvince(enterprise.getProvince());
enterprise.setProvince(province);
}
if (StringUtils.isNotBlank(enterprise.getCity())) {
String city = sysRegionService.getCity(enterprise.getCity());
enterprise.setCity(city);
}
uiModel.addAttribute("enterprise", enterprise);
// 产品
ExtraProduct product = sqlSession.selectOne("com.itrus.portal.db.ExtraProductMapper.selectByPrimaryKey", bill.getExtraProduct());
uiModel.addAttribute("product", product);
// 规格
ExtraProductSpec productSpec = sqlSession.selectOne("com.itrus.portal.db.ExtraProductSpecMapper.selectByPrimaryKey", bill.getExtraProductSpec());
uiModel.addAttribute("productSpec", productSpec);
// 服务商
ServiceProvider serviceProvider = serviceProviderService.selectByPrimaryKey(product.getServiceProvider());
uiModel.addAttribute("serviceProvider", serviceProvider);
// 用户
UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bill.getUniqueId());
uiModel.addAttribute("userInfo", userInfo);
// 第三方支付信息
OnPayInfo onPayInfo = sqlSession.selectOne("com.itrus.portal.db.OnPayInfoMapper.selectByPrimaryKey", bill.getOnPayInfo());
uiModel.addAttribute("onPayInfo", onPayInfo);
if (onPayInfo != null) {
// 在线支付信息
OnlinePay onlinePay = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.selectByPrimaryKey", onPayInfo.getOnlinePay());
uiModel.addAttribute("onlinePay", onlinePay);
}
// 电子发票
Einvoice einvoice = sqlSession.selectOne("com.itrus.portal.db.EinvoiceMapper.selectByPrimaryKey", bill.geteInvoice());
uiModel.addAttribute("einvoice", einvoice);
// 电子发票类型
if (einvoice != null && einvoice.geteReiceipt() != null) {
Ereceipt ereceipt = sqlSession.selectOne("com.itrus.portal.db.EreceiptMapper.selectByPrimaryKey", einvoice.geteReiceipt());
uiModel.addAttribute("ereceipt", ereceipt);
}
// 其他附加信息
// 营业执照
BusinessLicense businessLicense = businessService.getBusinessByExtraBillId(id, null);
uiModel.addAttribute("bl", businessLicense);
// 税务登记
TaxRegisterCert taxRegisterCert = taxCertService.getTaxRegisterCertByExtraBillId(id, null);
uiModel.addAttribute("trc", taxRegisterCert);
// 组织机构代码
OrgCode orgCode = orgCodeService.getOrgCodeByExtraBillId(id, null);
uiModel.addAttribute("oc", orgCode);
// 代理人
Agent agent = agentService.getAgentByExtraBillId(id, null);
uiModel.addAttribute("agent", agent);
// 开户行信息
OpenBankInfo openBankInfo = openBankInfoService.getOpenBankInfoByExtraBillId(id, null);
uiModel.addAttribute("obi", openBankInfo);
// 法人信息
IdentityCard identityCard = identityCardService.getIdentityCardByExtraBillId(id, null);
uiModel.addAttribute("ic", identityCard);
// TODO 还需要补充订单对应的附加信息和第三方回调信息
return "extrabill/show";
}
Aggregations