对账中心
diff --git a/config/application-devel-pg-xkx.properties b/config/application-devel-pg-xkx.properties
index 3c10fe9..a3f5f41 100644
--- a/config/application-devel-pg-xkx.properties
+++ b/config/application-devel-pg-xkx.properties
@@ -38,3 +38,25 @@
resttemplate.proxy.type=direct
resttemplate.proxy.host=127.0.0.1
resttemplate.proxy.port=8087
+
+#============== kafka ===================
+# 指定kafka 代理地址,可以多个
+#spring.kafka.bootstrap-servers=172.28.201.101:9192
+#=============== provider =======================
+spring.kafka.producer.retries=3
+# 每次批量发送消息的数量
+spring.kafka.producer.batch-size=16384
+spring.kafka.producer.buffer-memory=33554432
+# 指定消息key和消息体的编解码方式
+spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
+spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
+
+#===============kafka consumer =======================
+# 指定默认消费者group id
+spring.kafka.consumer.group-id=epaymessager1
+spring.kafka.consumer.auto-offset-reset=earliest
+spring.kafka.consumer.enable-auto-commit=true
+spring.kafka.consumer.auto-commit-interval=100
+# 指定消息key和消息体的编解码方式
+spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
+spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeCheckDao.java b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeCheckDao.java
index 361cb42..9f1a81d 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeCheckDao.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeCheckDao.java
@@ -8,4 +8,6 @@
public interface SourceTypeCheckDao extends CrudRepository<TSourceTypeCheckStatus, Integer> {
TSourceTypeCheckStatus getBySourceTypeAndTenantId(String sourceType, String tenantid);
+ TSourceTypeCheckStatus getById(int id);
+
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeDao.java b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeDao.java
index 38e1b38..718841a 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeDao.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/SourceTypeDao.java
@@ -22,4 +22,7 @@
List<TSourceType> getConsumeSourceTypes();
List<TSourceType> findByEnableAndTenantid(Boolean enabled, String tenantid);
+
+ @Query("from TSourceType t where t.enable=true and t.checkable=true and t.tenantid=?1 order by t.sourceType ")
+ List<TSourceType> findNeedChecks(String tenantid);
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/TransactionChkdtlDao.java b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/TransactionChkdtlDao.java
index fb538c8..0b80ad7 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/TransactionChkdtlDao.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/TransactionChkdtlDao.java
@@ -4,6 +4,7 @@
import com.supwisdom.dlpay.framework.data.CountAmountBean;
import com.supwisdom.dlpay.framework.data.ExistBean;
import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
@@ -12,7 +13,7 @@
import java.util.List;
@Repository
-public interface TransactionChkdtlDao extends JpaRepository<TTransactionChkdtl, String> {
+public interface TransactionChkdtlDao extends JpaRepository<TTransactionChkdtl, String>,JpaSpecificationExecutor<TTransactionChkdtl> {
@Modifying
@Query("delete from TTransactionChkdtl t where t.chkfileId=?1 ")
@@ -51,6 +52,6 @@
@Query("from TTransactionChkdtl t where t.chkresult='nocharge' and t.resolved<>'equal' and t.chkfileId=?1 order by t.recordno ")
List<TTransactionChkdtl> getNeedRepairChkdtls(String chkfileId);
- @Query("select count(t.id) as existed from TTransactionChkdtl t where t.chkfileId=?1 and t.and t.resolved<>'equal' ")
+ @Query("select count(t.id) as existed from TTransactionChkdtl t where t.chkfileId=?1 and t.resolved<>'equal' ")
ExistBean getChkdtlNotEqualCount(String chkfileId);
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/TransactionChkfileDao.java b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/TransactionChkfileDao.java
index a42f8ad..88da7c2 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/dao/TransactionChkfileDao.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/dao/TransactionChkfileDao.java
@@ -2,10 +2,11 @@
import com.supwisdom.dlpay.api.domain.TTransactionChkfile;
import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Service;
@Service
-public interface TransactionChkfileDao extends JpaRepository<TTransactionChkfile, String> {
+public interface TransactionChkfileDao extends JpaRepository<TTransactionChkfile, String>, JpaSpecificationExecutor<TTransactionChkfile> {
TTransactionChkfile getByAccdateAndSourcetype(String accdate, String sourcetype);
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceTypeCheckStatus.java b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceTypeCheckStatus.java
index 6a13467..aae858e 100644
--- a/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceTypeCheckStatus.java
+++ b/payapi/src/main/java/com/supwisdom/dlpay/api/domain/TSourceTypeCheckStatus.java
@@ -1,21 +1,20 @@
package com.supwisdom.dlpay.api.domain;
-import com.sun.org.apache.xpath.internal.operations.Bool;
-
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.sql.Timestamp;
@Entity
@Table(name = "tb_sourcetype_check",
- indexes = {@Index(name = "sourcetype_check_idx", columnList = "source_type, tenantid", unique = true)})
+ indexes = {@Index(name = "sourcetype_check_idx", columnList = "sourcetype, tenantid", unique = true)})
public class TSourceTypeCheckStatus {
@Id
@SequenceGenerator(name = "st_checker_id", sequenceName = "SEQ_SOURCETYPE_CHECK", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "st_checker_id")
+ @Column(name = "ID", nullable = false, length = 9)
private Integer id;
- @Column(name = "source_type", length = 30)
+ @Column(name = "sourcetype", length = 30)
@NotNull
private String sourceType;
@@ -174,4 +173,5 @@
public void setRepairStatus(Boolean repairStatus) {
this.repairStatus = repairStatus;
}
+
}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/controller/SourcetypeCheckController.java b/payapi/src/main/java/com/supwisdom/dlpay/system/controller/SourcetypeCheckController.java
new file mode 100644
index 0000000..f5025bf
--- /dev/null
+++ b/payapi/src/main/java/com/supwisdom/dlpay/system/controller/SourcetypeCheckController.java
@@ -0,0 +1,137 @@
+package com.supwisdom.dlpay.system.controller;
+
+import com.supwisdom.dlpay.api.bean.JsonResult;
+import com.supwisdom.dlpay.api.domain.TSourceTypeCheckStatus;
+import com.supwisdom.dlpay.api.domain.TTransactionChkdtl;
+import com.supwisdom.dlpay.api.domain.TTransactionChkfile;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import com.supwisdom.dlpay.framework.util.WebConstant;
+import com.supwisdom.dlpay.system.service.SourcetypeCheckManagerService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+/**
+ * 对账管理
+ */
+@Controller
+public class SourcetypeCheckController {
+ @Autowired
+ private SourcetypeCheckManagerService sourcetypeCheckManagerService;
+
+ /**
+ * ====================================================
+ * 对帐状态总表 checkStatus
+ * ====================================================
+ */
+ @GetMapping("/thirdchk/chkstatus")
+ public String chkStatusIndex() {
+ return "system/thirdchk/chkstatus";
+ }
+
+ @GetMapping("/thirdchk/chkstatuslist")
+ @PreAuthorize("hasPermission('/thirdchk/chkstatus','')")
+ @ResponseBody
+ public PageResult<TSourceTypeCheckStatus> getDataList(@RequestParam("page") Integer pageNo,
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam(value = "searchkey", required = false) String searchKey) {
+ try {
+ if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
+ if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
+ return sourcetypeCheckManagerService.getSourceTypeCheckStatusPage(searchKey, pageNo, pageSize);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return new PageResult<>(99, "系统查询错误");
+ }
+ }
+
+ @PostMapping("/thirdchk/forcerecheck")
+ @PreAuthorize("hasPermission('/thirdchk/forcerecheck','')")
+ @ResponseBody
+ public JsonResult forceRecheck(@RequestParam("chkid") Integer chkid, @RequestParam("enable") Boolean enable) {
+ try {
+ TSourceTypeCheckStatus checkStatus = sourcetypeCheckManagerService.getSourceTypeCheckStatusById(chkid);
+ if (null == checkStatus) {
+ return JsonResult.error("对账状态记录不存在");
+ } else if (checkStatus.getSettleStatus()) {
+ return JsonResult.error("该对账状态记录已清算完成,不能修改此状态");
+ }
+
+ if (enable.equals(checkStatus.getForceRecheck())) {
+ return JsonResult.error(checkStatus.getForceRecheck() ? "该对账状态记录目前已启用强制重对" : "该对账状态记录目前已关闭强制重对");
+ }
+ checkStatus.setForceRecheck(enable);
+
+ if (sourcetypeCheckManagerService.saveOrUpdateSourceTypeCheckStatus(checkStatus)) {
+ return JsonResult.ok("修改成功!");
+ } else {
+ return JsonResult.error("修改失败");
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ return JsonResult.error("系统处理异常").put("exception", ex);
+ }
+ }
+
+ /**
+ * ====================================================
+ * 对帐明细表 chkfile chkdtl
+ * ====================================================
+ */
+ @GetMapping("/thirdchk/chkfile")
+ public String checkFileIndex(Model map) {
+ map.addAttribute("checkSourcetypeList", sourcetypeCheckManagerService.getNeedCheckSourcetype());
+ return "system/thirdchk/chkfile";
+ }
+
+ @GetMapping("/thirdchk/chkfilelist")
+ @PreAuthorize("hasPermission('/thirdchk/chkfile','')")
+ @ResponseBody
+ public PageResult<TTransactionChkfile> getChkfileDataList(@RequestParam("page") Integer pageNo,
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam(value = "startdate", required = false) String startdate,
+ @RequestParam(value = "enddate", required = false) String enddate,
+ @RequestParam(value = "sourcetype", required = false) String sourcetype) {
+ try {
+ if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
+ if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
+ return sourcetypeCheckManagerService.getTransactionChkfilePage(startdate, enddate, sourcetype, pageNo, pageSize);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return new PageResult<>(99, "系统查询错误");
+ }
+ }
+
+ @GetMapping("/thirdchk/chkdtl")
+ @PreAuthorize("hasPermission('/thirdchk/chkdtl','')")
+ public String load4CheckDtl(@RequestParam("chkfileid") String chkfileid, Model map) {
+ map.addAttribute("chkfileid", chkfileid);
+ return "system/thirdchk/chkdtl";
+ }
+
+ @GetMapping("/thirdchk/chkdtllist")
+ @PreAuthorize("hasPermission('/thirdchk/chkdtl','')")
+ @ResponseBody
+ public PageResult<TTransactionChkdtl> getChkdtlList(@RequestParam("page") Integer pageNo,
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam("chkfileid") String chkfileid,
+ @RequestParam(value = "searchkey", required = false) String searchKey,
+ @RequestParam(value = "chkresult", required = false) String chkresult,
+ @RequestParam(value = "errorshow", required = false) Boolean errorshow) {
+ try {
+ if (StringUtil.isEmpty(chkfileid)) return new PageResult<>(99, "请选择对账明细文件");
+ if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
+ if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
+ return sourcetypeCheckManagerService.getTransactionChkdtlPage(chkfileid, searchKey, chkresult, (errorshow != null ? errorshow : false), pageNo, pageSize);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return new PageResult<>(99, "系统查询错误");
+ }
+ }
+}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/service/SourcetypeCheckManagerService.java b/payapi/src/main/java/com/supwisdom/dlpay/system/service/SourcetypeCheckManagerService.java
new file mode 100644
index 0000000..dcd9bb5
--- /dev/null
+++ b/payapi/src/main/java/com/supwisdom/dlpay/system/service/SourcetypeCheckManagerService.java
@@ -0,0 +1,31 @@
+package com.supwisdom.dlpay.system.service;
+
+import com.supwisdom.dlpay.api.domain.TSourceType;
+import com.supwisdom.dlpay.api.domain.TSourceTypeCheckStatus;
+import com.supwisdom.dlpay.api.domain.TTransactionChkdtl;
+import com.supwisdom.dlpay.api.domain.TTransactionChkfile;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+public interface SourcetypeCheckManagerService {
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ PageResult<TSourceTypeCheckStatus> getSourceTypeCheckStatusPage(String searchkey, int pageNo, int pageSize);
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ TSourceTypeCheckStatus getSourceTypeCheckStatusById(Integer chkid);
+
+ @Transactional(rollbackFor = Exception.class)
+ boolean saveOrUpdateSourceTypeCheckStatus(TSourceTypeCheckStatus checkStatus);
+
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ List<TSourceType> getNeedCheckSourcetype();
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ PageResult<TTransactionChkfile> getTransactionChkfilePage(String startdate, String enddate, String sourcetype, int pageNo, int pageSize);
+
+ @Transactional(rollbackFor = Exception.class, readOnly = true)
+ PageResult<TTransactionChkdtl> getTransactionChkdtlPage(String chkfileId, String searchKey, String chkresult, boolean errorshow, int pageNo, int pageSize);
+}
diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/SourcetypeCheckManagerServiceImpl.java b/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/SourcetypeCheckManagerServiceImpl.java
new file mode 100644
index 0000000..b8790ae
--- /dev/null
+++ b/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/SourcetypeCheckManagerServiceImpl.java
@@ -0,0 +1,155 @@
+package com.supwisdom.dlpay.system.service.impl;
+
+import com.supwisdom.dlpay.api.dao.SourceTypeCheckDao;
+import com.supwisdom.dlpay.api.dao.SourceTypeDao;
+import com.supwisdom.dlpay.api.dao.TransactionChkdtlDao;
+import com.supwisdom.dlpay.api.dao.TransactionChkfileDao;
+import com.supwisdom.dlpay.api.domain.TSourceType;
+import com.supwisdom.dlpay.api.domain.TSourceTypeCheckStatus;
+import com.supwisdom.dlpay.api.domain.TTransactionChkdtl;
+import com.supwisdom.dlpay.api.domain.TTransactionChkfile;
+import com.supwisdom.dlpay.framework.tenant.TenantContext;
+import com.supwisdom.dlpay.framework.util.DateUtil;
+import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import com.supwisdom.dlpay.system.service.SourcetypeCheckManagerService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class SourcetypeCheckManagerServiceImpl implements SourcetypeCheckManagerService {
+ @Autowired
+ private TransactionChkfileDao transactionChkfileDao;
+ @Autowired
+ private TransactionChkdtlDao transactionChkdtlDao;
+ @Autowired
+ private SourceTypeCheckDao sourceTypeCheckDao;
+ @Autowired
+ private SourceTypeDao sourceTypeDao;
+
+ @PersistenceContext
+ private EntityManager entityManager;
+
+
+ @Override
+ public PageResult<TSourceTypeCheckStatus> getSourceTypeCheckStatusPage(String searchkey, int pageNo, int pageSize) {
+ StringBuffer querySql = new StringBuffer("select a from TSourceTypeCheckStatus a,TSourceType b where a.sourceType=b.sourceType and a.tenantId=b.tenantid ");
+
+ StringBuffer countSql = new StringBuffer("select count(a.id) as cnt from TSourceTypeCheckStatus a,TSourceType b where a.sourceType=b.sourceType and a.tenantId=b.tenantid ");
+ if (!StringUtil.isEmpty(searchkey)) {
+ querySql.append(" and (b.sourceType like :str or b.paydesc like :str) ");
+ countSql.append(" and (b.sourceType like :str or b.paydesc like :str) ");
+ }
+ querySql.append(" order by a.sourceType ");
+ Query query = entityManager.createQuery(querySql.toString());
+ Query countQuery = entityManager.createQuery(countSql.toString());
+ if (!StringUtil.isEmpty(searchkey)) {
+ query.setParameter("str", "%" + searchkey.trim() + "%");
+ countQuery.setParameter("str", "%" + searchkey.trim() + "%");
+ }
+ query.setFirstResult((pageNo - 1) * pageSize);
+ query.setMaxResults(pageSize); //分页显示
+ List<TSourceTypeCheckStatus> list = query.getResultList();
+ Long count = (Long) countQuery.getSingleResult();
+ return new PageResult<>(count.longValue(), list);
+ }
+
+ @Override
+ public TSourceTypeCheckStatus getSourceTypeCheckStatusById(Integer chkid) {
+ if (null != chkid) {
+ return sourceTypeCheckDao.getById(chkid);
+ }
+ return null;
+ }
+
+ @Override
+ public boolean saveOrUpdateSourceTypeCheckStatus(TSourceTypeCheckStatus checkStatus) {
+ if (null != checkStatus) {
+ sourceTypeCheckDao.save(checkStatus);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public List<TSourceType> getNeedCheckSourcetype() {
+ List<TSourceType> list = sourceTypeDao.findNeedChecks(TenantContext.getTenantSchema());
+ if (!StringUtil.isEmpty(list)) {
+ return list;
+ }
+ return new ArrayList<>(0);
+ }
+
+ @Override
+ public PageResult<TTransactionChkfile> getTransactionChkfilePage(String startdate, String enddate, String sourcetype, int pageNo, int pageSize) {
+ Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by(Sort.Direction.DESC, "accdate"));
+ Page<TTransactionChkfile> page = transactionChkfileDao.findAll(new Specification<TTransactionChkfile>() {
+ @Override
+ public Predicate toPredicate(Root<TTransactionChkfile> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
+ List<Predicate> predicates = new ArrayList<>();
+ if (!StringUtil.isEmpty(startdate)) {
+ predicates.add(criteriaBuilder.ge(root.get("accdate").as(Integer.class), Integer.valueOf(DateUtil.unParseToDateFormat(startdate))));
+ }
+ if (!StringUtil.isEmpty(enddate)) {
+ predicates.add(criteriaBuilder.le(root.get("accdate").as(Integer.class), Integer.valueOf(DateUtil.unParseToDateFormat(enddate))));
+ }
+ if (!StringUtil.isEmpty(sourcetype)) {
+ predicates.add(criteriaBuilder.equal(root.get("sourcetype").as(String.class), sourcetype.trim()));
+ }
+ return criteriaBuilder.and(predicates.toArray(new Predicate[0]));
+ }
+ }, pageable);
+ return new PageResult<>(page);
+ }
+
+ @Override
+ public PageResult<TTransactionChkdtl> getTransactionChkdtlPage(String chkfileId, String searchKey, String chkresult, boolean errorshow, int pageNo, int pageSize) {
+ StringBuffer querySql = new StringBuffer("select a from TTransactionChkdtl a where a.chkfileId=:chkfileid ");
+ StringBuffer countSql = new StringBuffer("select count(a.id) as cnt from TTransactionChkdtl a where a.chkfileId=:chkfileid ");
+ if (!StringUtil.isEmpty(searchKey)) {
+ querySql.append(" and (a.otherRefno like :str or a.localRefno like :str) ");
+ countSql.append(" and (a.otherRefno like :str or a.localRefno like :str) ");
+ }
+ if (!errorshow && !StringUtil.isEmpty(chkresult)) {
+ querySql.append(" and a.chkresult=:chkresult ");
+ countSql.append(" and a.chkresult=:chkresult ");
+ }
+ if (errorshow) {
+ querySql.append(" and a.chkresult<>'equal' ");
+ countSql.append(" and a.chkresult<>'equal' ");
+ }
+ querySql.append(" order by a.recordno ");
+ Query query = entityManager.createQuery(querySql.toString());
+ Query countQuery = entityManager.createQuery(countSql.toString());
+ query.setParameter("chkfileid", chkfileId.trim());
+ countQuery.setParameter("chkfileid", chkfileId.trim());
+ if (!StringUtil.isEmpty(searchKey)) {
+ query.setParameter("str", "%" + searchKey.trim() + "%");
+ countQuery.setParameter("str", "%" + searchKey.trim() + "%");
+ }
+ if (!errorshow && !StringUtil.isEmpty(chkresult)) {
+ query.setParameter("chkresult", chkresult.trim());
+ countQuery.setParameter("chkresult", chkresult.trim());
+ }
+ query.setFirstResult((pageNo - 1) * pageSize);
+ query.setMaxResults(pageSize); //分页显示
+ List<TTransactionChkdtl> list = query.getResultList();
+ Long count = (Long) countQuery.getSingleResult();
+ return new PageResult<>(count.longValue(), list);
+ }
+}
diff --git a/payapi/src/main/resources/data.sql b/payapi/src/main/resources/data.sql
index 80a95a2..362bc3c 100644
--- a/payapi/src/main/resources/data.sql
+++ b/payapi/src/main/resources/data.sql
@@ -65,6 +65,13 @@
VALUES (31, NULL, 1, NULL, '', '/report/shopbusiness', '商户营业情况表', 3, 20, '{tenantid}');
INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid)
VALUES (32, NULL, 1, NULL, '', '/settlelog/index', '结算日志', 5, 3, '{tenantid}');
+INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid)
+VALUES (33, NULL, 0, NULL, 'layui-icon-component', '#', '对账中心', 8, -1, '{tenantid}');
+INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid)
+VALUES (34, NULL, 1, NULL, '', '/thirdchk/chkstatus', '对账状态查询', 331, 33, '{tenantid}');
+INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid)
+VALUES (35, NULL, 1, NULL, '', '/thirdchk/chkfile', '对账明细查询', 332, 33, '{tenantid}');
+
INSERT INTO "tb_role_function" ("id", "functionid", "roleid", tenantid)
@@ -121,6 +128,12 @@
VALUES ('ff8080816b7947ed016b795577370081', 18, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
INSERT INTO "tb_role_function" ("id", "functionid", "roleid", tenantid)
VALUES ('ff8080816c8468e8016c846d7a570017', 32, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
+INSERT INTO "tb_role_function" ("id", "functionid", "roleid", tenantid)
+VALUES ('ff8080816c8468e8016c846d7a570017', 33, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
+INSERT INTO "tb_role_function" ("id", "functionid", "roleid", tenantid)
+VALUES ('ff8080816c8468e8016c846d7a570017', 34, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
+INSERT INTO "tb_role_function" ("id", "functionid", "roleid", tenantid)
+VALUES ('ff8080816c8468e8016c846d7a570017', 35, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
VALUES (4, '1', 4, '添加功能', '/function/add', '{tenantid}');
@@ -252,6 +265,15 @@
VALUES (77, '', 32, '查询', '/settlelog/index', '{tenantid}');
INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
VALUES (78, '', 32, '查询', '/settlelog/dosettle', '{tenantid}');
+INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
+VALUES (79, '', 34, '查询', '/thirdchk/chkstatus', '{tenantid}');
+INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
+VALUES (80, '', 34, '强制重对切换', '/thirdchk/forcerecheck', '{tenantid}');
+INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
+VALUES (81, '', 35, '查询', '/thirdchk/chkfile', '{tenantid}');
+INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid)
+VALUES (82, '', 35, '查看详情', '/thirdchk/chkdtl', '{tenantid}');
+
INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", tenantid)
VALUES ('ff8080816b7947ed016b795577300036', 16, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
@@ -383,6 +405,15 @@
VALUES ('ff8080816c8468e8016c846d7a5d0018', 77, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid")
VALUES ('ff8080816c85279d016c852aa829000d', 78, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
+INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid")
+VALUES ('ff8080816c985e76016c98659ad00015', 79, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
+INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid")
+VALUES ('ff8080816c985e76016c98659ad10016', 80, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
+INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid")
+VALUES ('ff8080816c985e76016c98659ad10017', 81, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
+INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid")
+VALUES ('ff8080816c99abee016c99b1cb1c0004', 82, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}');
+
INSERT INTO "tb_subject" ("subjid","subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid")
VALUES (1, '1001', 1, 'y', 1, NULL, 20190430, 1, '库存现金', 1, '{tenantid}');
diff --git a/payapi/src/main/resources/templates/system/thirdchk/chkdtl.html b/payapi/src/main/resources/templates/system/thirdchk/chkdtl.html
new file mode 100644
index 0000000..fbc2b4e
--- /dev/null
+++ b/payapi/src/main/resources/templates/system/thirdchk/chkdtl.html
@@ -0,0 +1,188 @@
+<div class="layui-card">
+ <div class="layui-card-header">
+ <h2 class="header-title">对账详情</h2>
+ <span class="layui-breadcrumb pull-right">
+ <a href="#!_thirdchk_chkfile">对账明细查询</a>
+ <a><cite>对账详情</cite></a>
+ </span>
+ </div>
+ <div class="layui-card-body">
+ <div class="layui-form" lay-filter="thirdchk-chkdtl-search-form">
+ <div class="layui-form-item" style="margin-bottom: 0;">
+ <div class="layui-inline">
+ <label class="layui-form-label">关键字</label>
+ <div class="layui-input-block" style="width: 260px;">
+ <input type="text" name="searchkey" id="thirdchk-chkdtl-search-searchkey" class="layui-input"
+ placeholder="输入本地流水号、第三方流水号查询"/>
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <label class="layui-form-label">对账结果</label>
+ <div class="layui-input-block" style="height: 35px;">
+ <select name="chkresult" id="thirdchk-chkdtl-search-chkresult"
+ lay-filter="thirdchk-chkdtl-search-chkresult-filter">
+ <option value="">全部</option>
+ <option value="uncheck">未检查</option>
+ <option value="equal">双方一致</option>
+ <option value="nocharge">本地流水未入账</option>
+ <option value="notexist">本地流水不存在</option>
+ <option value="surplus">本地多流水</option>
+ <option value="diff">金额不相等</option>
+ <option value="error">流水异常</option>
+ </select>
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <input type="hidden" id="thirdchk-chkdtl-search-chkfileid" th:value="${chkfileid}"/>
+ <div class="layui-input-block" style="margin-left: 0;">
+ <input type="checkbox" name="errorshow" id="thirdchk-chkdtl-search-errorshow" value="yes"
+ lay-skin="primary" title="仅显示不平"/>
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <button id="thirdchk-chkdtl-search-btn" class="layui-btn icon-btn" data-type="search"><i
+ class="layui-icon"></i>搜索
+ </button>
+ <button id="thirdchk-chkdtl-reset-btn" class="layui-btn layui-btn-primary" data-type="reset">清空
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="layui-card-body">
+ <table class="layui-table" id="thirdchkChkdtlTable" lay-filter="thirdchkChkdtlTable-filter"></table>
+ </div>
+</div>
+
+<script type="text/html" id="thirdchk-chkdtl-toolbar">
+ <div class="layui-btn-container"></div>
+</script>
+
+<script>
+ layui.use(['form', 'table', 'admin'], function () {
+ var form = layui.form;
+ var table = layui.table;
+ var admin = layui.admin
+
+ form.render("select");
+ form.render("checkbox");
+
+ // 渲染表格
+ var renderTable = function (obj) {
+ table.render({
+ id: 'thirdchkChkdtlTable',
+ title: '对账详情',
+ elem: '#thirdchkChkdtlTable',
+ url: '[[@{/thirdchk/chkdtllist}]]',
+ page: true,
+ where: obj,
+ toolbar: '#thirdchk-chkdtl-toolbar',
+ cols: [
+ [
+ {field: 'accdate', title: '账单日期', align: 'center', width: 100, fixed: 'left'},
+ {
+ field: 'sourcetype',
+ title: '支付方式',
+ width: 200,
+ align: 'center',
+ fixed: 'left',
+ templet: function (e) {
+ return getTempDictValue('sourcetypeList', e.sourcetype);
+ }
+ },
+ {field: 'recordno', title: '记录号', align: 'center', width: 80, fixed: 'left'},
+ {
+ field: 'amount', title: '交易金额', align: 'center', width: 100, templet: function (e) {
+ return parseFloat(e.amount).toFixed(2);
+ }
+ },
+ {
+ field: 'chkresult', title: '对账结果', align: 'center', width: 150, templet: function (e) {
+ if ("uncheck" == e.chkresult) {
+ return '<span class="layui-badge layui-bg-gray">未检查</span>';
+ } else if ("equal" == e.chkresult) {
+ return '<span class="layui-badge layui-bg-green">双方一致</span>';
+ } else if ("nocharge" == e.chkresult) {
+ return '<span class="layui-badge layui-bg-orange">本地流水未入账</span>';
+ } else if ("notexist" == e.chkresult) {
+ return '<span class="layui-badge layui-bg-orange">本地流水不存在</span>';
+ } else if ("surplus" == e.chkresult) {
+ return '<span class="layui-badge">本地多流水</span>';
+ } else if ("diff" == e.chkresult) {
+ return '<span class="layui-badge">金额不相等</span>';
+ } else {
+ return '<span class="layui-badge">流水异常</span>';
+ }
+ }
+ },
+ {
+ field: 'resolved', title: '处理结果', align: 'center', width: 100, templet: function (e) {
+ if ("none" == e.resolved) {
+ return '-';
+ } else if ("equal" == e.resolved) {
+ if ("equal" == e.chkresult) {
+ return '一致';
+ } else {
+ return '补账后一致';
+ }
+ } else if ("add" == e.resolved) {
+ return '需补账';
+ } else if ("fail" == e.resolved) {
+ return '补账失败';
+ } else if ("hangup" == e.resolved) {
+ return '异常挂起';
+ } else {
+ return e.resolved;
+ }
+ }
+ },
+ {field: 'remark', title: '备注', align: 'center', width: 200},
+ {field: 'localRefno', title: '本地流水号', align: 'center', width: 200},
+ {field: 'otherRefno', title: '外部流水号', align: 'center', width: 200},
+ {field: 'otherAccdate', title: '外部记账日期', align: 'center', width: 100},
+ {
+ field: 'transtype', title: '交易类型', align: 'center', width: 100, templet: function (e) {
+ if ("pay" == e.transtype) {
+ return '支付';
+ } else if ("refund" == e.transtype) {
+ return '退款';
+ } else if ("cancel" == e.transtype) {
+ return '撤销';
+ } else {
+ return e.transtype;
+ }
+ }
+ },
+ {field: 'extdata', title: '扩展字段', align: 'center', width: 200}
+ ]
+ ]
+ });
+ }
+ renderTable({
+ chkfileid: $("#thirdchk-chkdtl-search-chkfileid").val(),
+ errorshow: false
+ });
+
+ $("#thirdchk-chkdtl-search-btn").click(function () {
+ table.reload('thirdchkChkdtlTable', {
+ where: {
+ chkfileid: $("#thirdchk-chkdtl-search-chkfileid").val(),
+ searchkey: $("#thirdchk-chkdtl-search-searchkey").val(),
+ chkresult: $("#thirdchk-chkdtl-search-chkresult").val(),
+ errorshow: $("#thirdchk-chkdtl-search-errorshow").is(':checked')
+ }, page: {curr: 1}
+ });
+ });
+
+ $("#thirdchk-chkdtl-reset-btn").click(function () {
+ $("#thirdchk-chkdtl-search-searchkey").val("");
+ $("#thirdchk-chkdtl-search-chkresult").val("");
+ $("#thirdchk-chkdtl-search-errorshow").prop("checked", false);
+ form.render("select");
+ form.render("checkbox");
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/payapi/src/main/resources/templates/system/thirdchk/chkfile.html b/payapi/src/main/resources/templates/system/thirdchk/chkfile.html
new file mode 100644
index 0000000..0a5bb52
--- /dev/null
+++ b/payapi/src/main/resources/templates/system/thirdchk/chkfile.html
@@ -0,0 +1,173 @@
+<div class="layui-card">
+ <div class="layui-card-header">
+ <h2 class="header-title">对账明细查询</h2>
+ <span class="layui-breadcrumb pull-right">
+ <a href="#">对账中心</a>
+ <a><cite>对账明细查询</cite></a>
+ </span>
+ </div>
+ <div class="layui-card-body">
+ <div class="layui-form" lay-filter="thirdchk-chkfile-search-form">
+ <div class="layui-form-item" style="margin-bottom: 0;">
+ <div class="layui-inline">
+ <label class="layui-form-label">账单日期</label>
+ <div class="layui-input-inline">
+ <input type="text" name="startdate" id="thirdchk-chkfile-search-startdate" placeholder="起始日期"
+ autocomplete="off" class="layui-input"/>
+ </div>
+ <div class="layui-form-mid">-</div>
+ <div class="layui-input-inline">
+ <input type="text" name="enddate" id="thirdchk-chkfile-search-enddate" placeholder="截止日期"
+ autocomplete="off" class="layui-input"/>
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <label class="layui-form-label">支付方式</label>
+ <div class="layui-input-block" style="height: 35px;">
+ <select name="sourcetype" id="thirdchk-chkfile-search-sourcetype"
+ lay-filter="thirdchk-chkfile-search-sourcetype-filter">
+ <option value=""> 全部</option>
+ <option th:each="pt:${checkSourcetypeList}" th:value="${pt.sourceType}"
+ th:text="${pt.paydesc}"></option>
+ </select> 
+ </div>
+ </div>
+
+ <div class="layui-inline">
+ <button id="btn-search-thirdchk-chkfile" class="layui-btn icon-btn"><i class="layui-icon"></i> 搜 索</button>
+ <button id="thirdchk-chkfile-reset-btn" class="layui-btn layui-btn-primary" data-type="reset"> 清 空
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="layui-card-body">
+ <table class="layui-table" id="thirdchkChkfileTable" lay-filter="thirdchkChkfileTable-filter"></table>
+ </div>
+</div>
+
+<script type="text/html" id="thirdchk-chkfile-toolbar">
+ <div class="layui-btn-container"></div>
+</script>
+
+<!-- 表格操作列 -->
+<script type="text/html" id="thirdchk-chkfile-table-bar">
+ <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="load4chkdtl">查看详情</a>
+</script>
+
+<script>
+ layui.use(['form', 'table', 'layer', 'admin', 'laydate', 'index','element'], function () {
+ var $ = layui.jquery;
+ var form = layui.form;
+ var table = layui.table;
+ var admin = layui.admin
+ var laydate = layui.laydate;
+ var index = layui.index;
+ var element = layui.element;
+
+ form.render("select");
+ laydate.render({
+ elem: '#thirdchk-chkfile-search-startdate',
+ trigger: 'click'
+ });
+ laydate.render({
+ elem: '#thirdchk-chkfile-search-enddate',
+ trigger: 'click'
+ });
+
+ // 渲染表格
+ table.render({
+ id: 'thirdchkChkfileTable',
+ title: '对账明细表',
+ elem: '#thirdchkChkfileTable',
+ url: '[[@{/thirdchk/chkfilelist}]]',
+ toolbar: '#thirdchk-chkfile-toolbar',
+ page: true,
+ cols: [
+ [
+ {
+ align: 'center',
+ title: '操作',
+ width: 100,
+ fixed: 'left',
+ toolbar: '#thirdchk-chkfile-table-bar'
+ },
+ {
+ field: 'sourcetype',
+ title: '名称',
+ width: 200,
+ align: 'center',
+ fixed: 'left',
+ templet: function (e) {
+ return getTempDictValue('sourcetypeList', e.sourcetype);
+ }
+ },
+ {field: 'accdate', title: '账单日期', width: 120, align: 'center', fixed: 'left'},
+ {field: 'othercnt', title: '外部总笔数', width: 120, align: 'center'},
+ {
+ field: 'otheramt', title: '外部总金额', width: 120, align: 'center', templet: function (e) {
+ return parseFloat(e.otheramt).toFixed(2);
+ }
+ },
+ {field: 'localcnt', title: '本地总笔数', width: 120, align: 'center'},
+ {
+ field: 'localamt', title: '本地总金额', width: 110, align: 'center', templet: function (e) {
+ return parseFloat(e.localamt).toFixed(2);
+ }
+ },
+ {
+ field: 'status', title: '账单状态', width: 120, align: 'center', templet: function (e) {
+ if ('init' == e.status) {
+ return '<span class="layui-badge layui-bg-gray">初始化</span>';
+ } else if ('uncheck' == e.status) {
+ return '<span class="layui-badge layui-bg-orange">待对账</span>';
+ } else if ('finish' == e.status) {
+ return '<span class="layui-badge layui-bg-green">对账完成</span>';
+ } else if ('error' == e.status) {
+ return '<span class="layui-badge">异常</span>';
+ } else if ('checkout' == e.status) {
+ return '<span class="layui-badge layui-bg-blue">校对完成</span>';
+ } else {
+ return e.status;
+ }
+ }
+ },
+ {field: 'remark', title: '对账结果', align: 'left'}
+ ]
+ ]
+ });
+
+ $("#btn-search-thirdchk-chkfile").click(function () {
+ var startdate = $("#thirdchk-chkfile-search-startdate").val();
+ var enddate = $("#thirdchk-chkfile-search-enddate").val();
+ var sourcetype = $("#thirdchk-chkfile-search-sourcetype").val();
+ table.reload('thirdchkChkfileTable', {
+ where: {
+ startdate: startdate,
+ enddate: enddate,
+ sourcetype: sourcetype
+ }, page: {curr: 1}
+ });
+ });
+
+ $("#thirdchk-chkfile-reset-btn").click(function () {
+ $("#thirdchk-chkfile-search-startdate").val("");
+ $("#thirdchk-chkfile-search-enddate").val("");
+ $("#thirdchk-chkfile-search-sourcetype").val("");
+ form.render("select");
+ });
+
+ //监听单元格
+ table.on('tool(thirdchkChkfileTable-filter)', function (obj) {
+ if ('load4chkdtl' == obj.event) {
+ element.tabDelete('admin-pagetabs', '_thirdchk_chkdtl'); //关闭现有详情
+ index.openNewTab({
+ url: "[[@{/thirdchk/chkdtl}]]?chkfileid=" + obj.data.id,
+ menuId: '_thirdchk_chkdtl',
+ title: '对账详情'
+ })
+ }
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/payapi/src/main/resources/templates/system/thirdchk/chkstatus.html b/payapi/src/main/resources/templates/system/thirdchk/chkstatus.html
new file mode 100644
index 0000000..2114a4a
--- /dev/null
+++ b/payapi/src/main/resources/templates/system/thirdchk/chkstatus.html
@@ -0,0 +1,133 @@
+<div class="layui-card">
+ <div class="layui-card-header">
+ <h2 class="header-title">对账状态查询</h2>
+ <span class="layui-breadcrumb pull-right">
+ <a href="#">对账管理</a>
+ <a><cite>对账状态查询</cite></a>
+ </span>
+ </div>
+ <div class="layui-card-body">
+ <div class="layui-form toolbar">
+ 搜索:
+ <input id="search-chkstatus-searchkey" class="layui-input search-input" type="text" maxlength="20"
+ placeholder="输入支付能力、名称查询"/> 
+ <button id="btn-chkstatus-search" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ </button>
+ <button id="btn-chkstatus-reset" class="layui-btn layui-btn-primary" data-type="reset"><i
+ class="layui-icon"></i>清 空
+ </button>
+ </div>
+ <table class="layui-table" id="checkStatusTable" lay-filter="checkStatusTable-filter"></table>
+ </div>
+</div>
+
+<!-- 表格状态列 -->
+<script type="text/html" id="chkstatus-forceRechk-tpl-state">
+ <input type="checkbox" lay-filter="chkstatus-forceRechk-tpl-state" value="{{d.id}}" lay-skin="switch"
+ lay-text="启用|关闭" {{d.forceRecheck== true?'checked':''}}/>
+</script>
+
+<script>
+ layui.use(['form', 'table', 'layer', 'admin', 'element'], function () {
+ var form = layui.form;
+ var table = layui.table;
+ var admin = layui.admin;
+ // 渲染表格
+ table.render({
+ elem: '#checkStatusTable',
+ url: '[[@{/thirdchk/chkstatuslist}]]',
+ page: true,
+ cols: [
+ [
+ {field: 'sourceType', title: '支付方式', width: 130, align: 'center', fixed: 'left', sort: true},
+ {
+ field: 'sourceType',
+ title: '名称',
+ width: 200,
+ align: 'center',
+ fixed: 'left',
+ templet: function (e) {
+ return getTempDictValue('sourcetypeList', e.sourceType);
+ }
+ },
+ {field: 'startAccdate', title: '起始日期', width: 110, align: 'center'},
+ {field: 'checkFileDate', title: '对账日期', width: 110, align: 'center'},
+ {
+ field: 'checkFileOk', title: '下载账单状态', width: 120, align: 'center', templet: function (e) {
+ if (e.checkFileOk) {
+ return '<span style="color: green">已成功</span>';
+ } else {
+ return '<span style="color: red;">未成功</span>';
+ }
+ }
+ },
+ {
+ field: 'checkStatus', title: '对账状态', width: 100, align: 'center', templet: function (e) {
+ if (e.checkStatus) {
+ return '<span style="color: green">已完成</span>';
+ } else {
+ return '<span style="color: red;">未完成</span>';
+ }
+ }
+ },
+ {
+ field: 'settleStatus', title: '清算状态', width: 100, align: 'center', templet: function (e) {
+ if (e.settleStatus) {
+ return '<span style="color: green">已完成</span>';
+ } else {
+ return '<span style="color: red;">未完成</span>';
+ }
+ }
+ },
+ {
+ field: 'forceRecheck',
+ title: '强制重对',
+ width: 100,
+ align: 'center',
+ templet: '#chkstatus-forceRechk-tpl-state',
+ },
+ {field: 'remark', title: '备注', align: 'left'}
+ ]
+ ]
+ });
+
+ // 搜索按钮点击事件
+ $('#btn-chkstatus-search').click(function () {
+ var skey = $("#search-chkstatus-searchkey").val();
+ table.reload('checkStatusTable', {where: {searchkey: skey}, page: {curr: 1}});
+
+ });
+
+ $('#btn-reset-sysparam').click(function () {
+ $("#search-chkstatus-searchkey").val("");
+ });
+
+ // 修改状态
+ form.on('switch(chkstatus-forceRechk-tpl-state)', function (obj) {
+ var token = $("meta[name='_csrf_token']").attr("value");
+ admin.go('[[@{/thirdchk/forcerecheck}]]', {
+ chkid: obj.elem.value,
+ enable: obj.elem.checked,
+ _csrf: token
+ }, function (data) {
+ console.log(data);
+ if (data.code === 200) {
+ layer.msg(data.msg, {icon: 1, time: 1000});
+ table.reload('checkStatusTable');
+ } else if (data.code === 401) {
+ layer.msg(data.msg, {icon: 2, time: 1500}, function () {
+ location.replace('[[@{/login}]]');
+ }, 1000);
+ } else {
+ layer.msg(data.msg, {icon: 2});
+ $(obj.elem).prop('checked', !obj.elem.checked);
+ form.render('checkbox');
+ }
+ }, function (err) {
+ admin.errorBack(err);
+ $(obj.elem).prop('checked', !obj.elem.checked);
+ form.render('checkbox');
+ });
+ });
+ });
+</script>
\ No newline at end of file