From af88814fd0ccef50ae0dc4cda176fd1246286093 Mon Sep 17 00:00:00 2001 From: Xia Kaixiang Date: Sat, 12 Oct 2019 11:43:52 +0800 Subject: [PATCH] =?utf8?q?=E5=95=86=E6=88=B7=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../dlpay/framework/dao/OperChkdtlDao.java | 30 + .../dlpay/framework/dao/ShopDao.java | 11 +- .../dlpay/framework/dao/ShopaccDao.java | 3 +- .../dlpay/framework/domain/TOperChkdtl.java | 179 ++++++ .../dlpay/framework/domain/TShop.java | 106 ++++ .../dlpay/framework/util/SysparaUtil.java | 3 +- .../dlpay/framework/util/TradeDict.java | 2 + .../dlpay/system/bean/ShopCheckBean.java | 125 ++++ .../system/controller/ShopController.java | 415 +++++++++++-- .../dlpay/system/service/ShopDataService.java | 36 +- .../service/impl/ShopDataServiceImpl.java | 570 +++++++++++++++++- .../supwisdom/dlpay/util/ConstantUtil.java | 8 + payapi/src/main/resources/data.sql | 49 +- .../resources/static/custom/module/admin.js | 2 +- .../src/main/resources/static/libs/custom.js | 6 + .../templates/system/shop/addshop.html | 329 ++++++++++ .../templates/system/shop/index.html | 557 ++++++----------- .../templates/system/shop/opercheck.html | 239 ++++++++ .../templates/system/shop/shopcheck.html | 134 ++++ .../templates/system/shop/shopchk.html | 144 +++++ .../templates/system/shop/shopdetail.html | 209 +++++++ .../templates/system/shop/updateshop.html | 333 ++++++++++ .../templates/system/thirdchk/chkdtl.html | 2 +- 23 files changed, 3029 insertions(+), 463 deletions(-) create mode 100644 payapi/src/main/java/com/supwisdom/dlpay/framework/dao/OperChkdtlDao.java create mode 100644 payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperChkdtl.java create mode 100644 payapi/src/main/java/com/supwisdom/dlpay/system/bean/ShopCheckBean.java create mode 100644 payapi/src/main/resources/templates/system/shop/addshop.html create mode 100644 payapi/src/main/resources/templates/system/shop/opercheck.html create mode 100644 payapi/src/main/resources/templates/system/shop/shopcheck.html create mode 100644 payapi/src/main/resources/templates/system/shop/shopchk.html create mode 100644 payapi/src/main/resources/templates/system/shop/shopdetail.html create mode 100644 payapi/src/main/resources/templates/system/shop/updateshop.html diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/OperChkdtlDao.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/OperChkdtlDao.java new file mode 100644 index 00000000..4a08c332 --- /dev/null +++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/OperChkdtlDao.java @@ -0,0 +1,30 @@ +package com.supwisdom.dlpay.framework.dao; + +import com.supwisdom.dlpay.framework.data.ExistBean; +import com.supwisdom.dlpay.framework.domain.TOperChkdtl; +import org.springframework.data.jpa.repository.*; +import org.springframework.stereotype.Repository; + +import javax.persistence.LockModeType; + +@Repository +public interface OperChkdtlDao extends JpaRepository, JpaSpecificationExecutor { + + @Modifying + @Query("update TOperChkdtl set invalidflag=true where chkType=?1 and contentId=?2 and chkResult='uncheck' ") + void doClearChkdtl(String chktype, String contentId); + + @Modifying + @Query("update TOperChkdtl set invalidflag=true where chkType=?1 and chkMode=?2 and contentId=?3 and chkResult='uncheck' ") + void doClearChkdtl(String chktype, String chkmode, String contentId); + + @Query("select count(t.chkNo) as existed from TOperChkdtl t where t.chkType=?1 and t.chkMode=?2 and t.contentId=?3 and t.chkResult=?4 and t.invalidflag=false ") + ExistBean getChkdtlCount(String chktype, String chkmode, String contentId, String chkresult); + + @Query("from TOperChkdtl where chkNo=?1 ") + TOperChkdtl getByChkno(Long chkNo); + + @Lock(LockModeType.PESSIMISTIC_WRITE) + @Query("from TOperChkdtl where chkNo=?1 ") + TOperChkdtl getByChknoForUpdate(Long chkNo); +} diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/ShopDao.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/ShopDao.java index efa53d38..e6ea3c13 100644 --- a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/ShopDao.java +++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/ShopDao.java @@ -2,6 +2,7 @@ package com.supwisdom.dlpay.framework.dao; import com.supwisdom.dlpay.framework.domain.TShop; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Lock; import org.springframework.data.jpa.repository.Query; @@ -11,7 +12,7 @@ import java.util.List; /** * Created by shuwei on 2019/4/15. */ -public interface ShopDao extends JpaRepository { +public interface ShopDao extends JpaRepository, JpaSpecificationExecutor { TShop getByThirdUniqueIdenty(String thirdUniqueIdenty); @Lock(LockModeType.PESSIMISTIC_WRITE) @@ -25,7 +26,7 @@ public interface ShopDao extends JpaRepository { @Query("from TShop where status='normal' and fshopid=?1 ") List getChildShopsByShopid(Integer shopid); - @Query(value = "select count(t.shopid) from TB_SHOP t where t.status='normal' and t.shopname=?1 and t.fshopid=?2 and t.shopid!=?3", nativeQuery = true) + @Query(value = "select count(t.shopid) from TB_SHOP t where (t.status='normal' or t.status='uncheck') and t.shopname=?1 and t.fshopid=?2 and t.shopid!=?3", nativeQuery = true) long checkShopnameExist(String shopname, int fshopid, int oldShopid); @Query("from TShop where status='normal' order by shopid asc ") @@ -33,4 +34,10 @@ public interface ShopDao extends JpaRepository { @Query("from TShop where shoptype='root' and status='normal' order by shopid asc ") List getRootNormalShops(); + + @Query("from TShop where shoptype='root' order by shopid asc ") + List getRootShops(); + + @Query("from TShop order by shopid asc ") + List findAllShops(); } diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/ShopaccDao.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/ShopaccDao.java index db210cd1..77b52040 100644 --- a/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/ShopaccDao.java +++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/dao/ShopaccDao.java @@ -39,8 +39,7 @@ public interface ShopaccDao extends JpaRepository { TShopacc getByShopaccnoAndTenantId(String shopaccno, String tenantid); - @Transactional - @Modifying(clearAutomatically = true) + @Modifying @Query("update TShopacc set shopname=?1 where shopaccno=?2") void updateShopnameByShopaccno(String shopname, String shopaccno); diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperChkdtl.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperChkdtl.java new file mode 100644 index 00000000..ba1afa1b --- /dev/null +++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TOperChkdtl.java @@ -0,0 +1,179 @@ +package com.supwisdom.dlpay.framework.domain; + +import javax.persistence.*; + +/** + * 操作员审批表 + * */ +@Entity +@Table(name = "TB_OPER_CHKDTL", + indexes = {@Index(name = "tb_oper_chkdtl_index", columnList = "CHKTYPE,CHKMODE")}) +public class TOperChkdtl { + @Id + @SequenceGenerator(name = "operchkno", sequenceName = "SEQ_OPERCHKNO", allocationSize = 1, initialValue = 10000) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "operchkno") + @Column(name = "CHKNO", nullable = false, precision = 10) + private Long chkNo; //审批编号 + + @Column(name = "CHKTYPE", nullable = false, length = 32) + private String chkType; //审批类型 + + @Column(name = "CHKMODE", nullable = false, length = 32) + private String chkMode; //新增/修改/删除 + + @Column(name = "CONTENT_ID", length = 32) + private String contentId; //对应Id + + @Column(name = "CONTENT", length = 4000) + private String content; //内容 + + @Column(name = "CHKRESULT", nullable = false, length = 600) + private String chkResult; //审核结果 + + @Column(name = "CHKMSG", length = 600) + private String chkMsg; //审核意见 + + @Column(name = "CREATE_OPERID", length = 32) + private String createOperid; //创建者 + + @Column(name = "CREATE_OPERNAME", length = 100) + private String createOpername; //创建者名称 + + @Column(name = "CREATETIME", length = 14) + private String createtime; //创建时间 + + @Column(name = "CHECK_OPERID", length = 32) + private String checkOperid; //审核者 + + @Column(name = "CHECK_OPERNAME", length = 100) + private String checkOpername; //审核者名称 + + @Column(name = "CHECKTIME", length = 14) + private String checktime; //审核时间 + + @Column(name = "INVALIDFLAG", length = 10) + private Boolean invalidflag=false; //无效标志: true-无效;false-有效 + + @Column(name = "tenantid", nullable = false, length = 20) + private String tenantId; + + public Long getChkNo() { + return chkNo; + } + + public void setChkNo(Long chkNo) { + this.chkNo = chkNo; + } + + public String getChkType() { + return chkType; + } + + public void setChkType(String chkType) { + this.chkType = chkType; + } + + public String getChkMode() { + return chkMode; + } + + public void setChkMode(String chkMode) { + this.chkMode = chkMode; + } + + public String getContentId() { + return contentId; + } + + public void setContentId(String contentId) { + this.contentId = contentId; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getChkResult() { + return chkResult; + } + + public void setChkResult(String chkResult) { + this.chkResult = chkResult; + } + + public String getChkMsg() { + return chkMsg; + } + + public void setChkMsg(String chkMsg) { + this.chkMsg = chkMsg; + } + + public String getCreateOperid() { + return createOperid; + } + + public void setCreateOperid(String createOperid) { + this.createOperid = createOperid; + } + + public String getCreateOpername() { + return createOpername; + } + + public void setCreateOpername(String createOpername) { + this.createOpername = createOpername; + } + + public String getCreatetime() { + return createtime; + } + + public void setCreatetime(String createtime) { + this.createtime = createtime; + } + + public String getCheckOperid() { + return checkOperid; + } + + public void setCheckOperid(String checkOperid) { + this.checkOperid = checkOperid; + } + + public String getCheckOpername() { + return checkOpername; + } + + public void setCheckOpername(String checkOpername) { + this.checkOpername = checkOpername; + } + + public String getChecktime() { + return checktime; + } + + public void setChecktime(String checktime) { + this.checktime = checktime; + } + + public Boolean getInvalidflag() { + return invalidflag; + } + + public void setInvalidflag(Boolean invalidflag) { + this.invalidflag = invalidflag; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } +} diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TShop.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TShop.java index 5c81f456..76ee122c 100644 --- a/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TShop.java +++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/domain/TShop.java @@ -3,6 +3,7 @@ package com.supwisdom.dlpay.framework.domain; import javax.persistence.*; import javax.validation.constraints.NotNull; +import java.sql.Timestamp; @Entity @Table(name = "TB_SHOP", @@ -73,6 +74,28 @@ public class TShop { @Column(name = "THIRD_UNIQUE_IDENTY", length = 200) private String thirdUniqueIdenty; + //扩展信息 + @Column(name = "BUSINESS_LICENSE_NO", length = 60) + private String businessLicenseNo; //营业执照编号 + + @Column(name = "TAX_REGISTRATION_NO", length = 60) + private String taxRegistrationNo; //税务登记号 + + @Column(name = "LEGAL_PERSON_NAME", length = 60) + private String legalPersonName; //法人姓名 + + @Column(name = "LEGAL_PERSON_IDTYPE", length = 32) + private String legalPersonIdtype; //法人证件类型 + + @Column(name = "LEGAL_PERSON_IDNO", length = 32) + private String legalPersonIdno; //法人证件号码 + + @Column(name = "ADD_OPERID", length = 32) + private String addOperid; //新增操作员 + + @Column(name = "DEL_OPERID", length = 32) + private String delOperid; //删除操作员 + public TShop() { } @@ -95,6 +118,33 @@ public class TShop { this.thirdUniqueIdenty = thirdUniqueIdenty; } + public TShop(@NotNull Integer fshopid, @NotNull String shopname, @NotNull String shoptype, @NotNull String status, String shopaccno, String contactman, String idtype, String idno, String tel, String mobile, String email, String addr, String zipcode, String opendate, String closedate, @NotNull String tenantId, String thirdUniqueIdenty, String businessLicenseNo, String taxRegistrationNo, String legalPersonName, String legalPersonIdtype, String legalPersonIdno, String addOperid, String delOperid) { + this.fshopid = fshopid; + this.shopname = shopname; + this.shoptype = shoptype; + this.status = status; + this.shopaccno = shopaccno; + this.contactman = contactman; + this.idtype = idtype; + this.idno = idno; + this.tel = tel; + this.mobile = mobile; + this.email = email; + this.addr = addr; + this.zipcode = zipcode; + this.opendate = opendate; + this.closedate = closedate; + this.tenantId = tenantId; + this.thirdUniqueIdenty = thirdUniqueIdenty; + this.businessLicenseNo = businessLicenseNo; + this.taxRegistrationNo = taxRegistrationNo; + this.legalPersonName = legalPersonName; + this.legalPersonIdtype = legalPersonIdtype; + this.legalPersonIdno = legalPersonIdno; + this.addOperid = addOperid; + this.delOperid = delOperid; + } + public String getThirdUniqueIdenty() { return thirdUniqueIdenty; } @@ -238,4 +288,60 @@ public class TShop { public void setTenantId(String tenantId) { this.tenantId = tenantId; } + + public String getBusinessLicenseNo() { + return businessLicenseNo; + } + + public void setBusinessLicenseNo(String businessLicenseNo) { + this.businessLicenseNo = businessLicenseNo; + } + + public String getTaxRegistrationNo() { + return taxRegistrationNo; + } + + public void setTaxRegistrationNo(String taxRegistrationNo) { + this.taxRegistrationNo = taxRegistrationNo; + } + + public String getLegalPersonName() { + return legalPersonName; + } + + public void setLegalPersonName(String legalPersonName) { + this.legalPersonName = legalPersonName; + } + + public String getLegalPersonIdtype() { + return legalPersonIdtype; + } + + public void setLegalPersonIdtype(String legalPersonIdtype) { + this.legalPersonIdtype = legalPersonIdtype; + } + + public String getLegalPersonIdno() { + return legalPersonIdno; + } + + public void setLegalPersonIdno(String legalPersonIdno) { + this.legalPersonIdno = legalPersonIdno; + } + + public String getAddOperid() { + return addOperid; + } + + public void setAddOperid(String addOperid) { + this.addOperid = addOperid; + } + + public String getDelOperid() { + return delOperid; + } + + public void setDelOperid(String delOperid) { + this.delOperid = delOperid; + } } diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/util/SysparaUtil.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/util/SysparaUtil.java index a67d6ff9..f87b96bb 100644 --- a/payapi/src/main/java/com/supwisdom/dlpay/framework/util/SysparaUtil.java +++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/util/SysparaUtil.java @@ -11,9 +11,10 @@ public class SysparaUtil { public static final int BALANCE_LIMIT = 1; //系统默认最大余额限制的ID - public static final int MOBILE_LOGIN_EXPIRE_IN_SECONDS = 4; //手机端用户过期时间(秒) public static final int NOPASS_LIMIT = 2; //默认免密额度 public static final int DAY_PAY_LIMIT = 3; //默认日累计额度 + public static final int MOBILE_LOGIN_EXPIRE_IN_SECONDS = 4; //手机端用户过期时间(秒) + public static final int SHOP_NEEDCHECK_SWITCH = 5; //商户是否需要审核:1-需要;0-不需要 public static final int DLCARDMANAGER_APPID = 2019; //与卡管系统对接的应用ID public static final int DLCARDMANAGER_SECRET = 2020; //与卡管系统对接的应用appkey diff --git a/payapi/src/main/java/com/supwisdom/dlpay/framework/util/TradeDict.java b/payapi/src/main/java/com/supwisdom/dlpay/framework/util/TradeDict.java index c59dfd11..9c2162ff 100644 --- a/payapi/src/main/java/com/supwisdom/dlpay/framework/util/TradeDict.java +++ b/payapi/src/main/java/com/supwisdom/dlpay/framework/util/TradeDict.java @@ -18,6 +18,8 @@ public class TradeDict { public static final String STATUS_FROZEN = "frozen"; public static final String STATUS_UNUSE = "unuse"; public static final String STATUS_ABNORMAL = "abnormal"; + public static final String STATUS_UNCHECK = "uncheck"; + public static final String STATUS_REJECT = "reject"; public static final String STATUS_YES = "yes"; public static final String STATUS_NO = "no"; diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/bean/ShopCheckBean.java b/payapi/src/main/java/com/supwisdom/dlpay/system/bean/ShopCheckBean.java new file mode 100644 index 00000000..9ed4304d --- /dev/null +++ b/payapi/src/main/java/com/supwisdom/dlpay/system/bean/ShopCheckBean.java @@ -0,0 +1,125 @@ +package com.supwisdom.dlpay.system.bean; + +import com.supwisdom.dlpay.framework.domain.TShop; + +public class ShopCheckBean extends TShop { + private String fshopname; + private Integer oldFshopid; + private String oldFshopname; + private String oldShopname; + + private String oldBusinessLicenseNo; //营业执照编号 + private String oldTaxRegistrationNo; //税务登记号 + private String oldLegalPersonName; //法人姓名 + private String oldLegalPersonIdtype; //法人证件类型 + private String oldLegalPersonIdno; //法人证件号码 + + private String oldContactman; + private String oldMobile; + private String oldEmail; + private String oldTel; + + public String getFshopname() { + return fshopname; + } + + public void setFshopname(String fshopname) { + this.fshopname = fshopname; + } + + public String getOldFshopname() { + return oldFshopname; + } + + public void setOldFshopname(String oldFshopname) { + this.oldFshopname = oldFshopname; + } + + public String getOldShopname() { + return oldShopname; + } + + public void setOldShopname(String oldShopname) { + this.oldShopname = oldShopname; + } + + public String getOldBusinessLicenseNo() { + return oldBusinessLicenseNo; + } + + public void setOldBusinessLicenseNo(String oldBusinessLicenseNo) { + this.oldBusinessLicenseNo = oldBusinessLicenseNo; + } + + public String getOldTaxRegistrationNo() { + return oldTaxRegistrationNo; + } + + public void setOldTaxRegistrationNo(String oldTaxRegistrationNo) { + this.oldTaxRegistrationNo = oldTaxRegistrationNo; + } + + public String getOldLegalPersonName() { + return oldLegalPersonName; + } + + public void setOldLegalPersonName(String oldLegalPersonName) { + this.oldLegalPersonName = oldLegalPersonName; + } + + public String getOldLegalPersonIdtype() { + return oldLegalPersonIdtype; + } + + public void setOldLegalPersonIdtype(String oldLegalPersonIdtype) { + this.oldLegalPersonIdtype = oldLegalPersonIdtype; + } + + public String getOldLegalPersonIdno() { + return oldLegalPersonIdno; + } + + public void setOldLegalPersonIdno(String oldLegalPersonIdno) { + this.oldLegalPersonIdno = oldLegalPersonIdno; + } + + public String getOldContactman() { + return oldContactman; + } + + public void setOldContactman(String oldContactman) { + this.oldContactman = oldContactman; + } + + public String getOldMobile() { + return oldMobile; + } + + public void setOldMobile(String oldMobile) { + this.oldMobile = oldMobile; + } + + public String getOldEmail() { + return oldEmail; + } + + public void setOldEmail(String oldEmail) { + this.oldEmail = oldEmail; + } + + public String getOldTel() { + return oldTel; + } + + public void setOldTel(String oldTel) { + this.oldTel = oldTel; + } + + public Integer getOldFshopid() { + return oldFshopid; + } + + public void setOldFshopid(Integer oldFshopid) { + this.oldFshopid = oldFshopid; + } +} diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java b/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java index af225dd7..3d1a9639 100644 --- a/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java +++ b/payapi/src/main/java/com/supwisdom/dlpay/system/controller/ShopController.java @@ -1,25 +1,30 @@ package com.supwisdom.dlpay.system.controller; +import com.supwisdom.dlpay.api.annotation.ShopType; import com.supwisdom.dlpay.api.bean.JsonResult; import com.supwisdom.dlpay.api.domain.TSourceType; import com.supwisdom.dlpay.api.domain.TShopSourceType; import com.supwisdom.dlpay.api.domain.TShopSourceTypeConfig; import com.supwisdom.dlpay.api.types.IDTypes; import com.supwisdom.dlpay.api.types.ShopTypes; -import com.supwisdom.dlpay.framework.domain.TDictionary; -import com.supwisdom.dlpay.framework.domain.TShop; -import com.supwisdom.dlpay.framework.domain.TShopacc; +import com.supwisdom.dlpay.framework.domain.*; import com.supwisdom.dlpay.framework.service.SystemUtilService; import com.supwisdom.dlpay.framework.util.*; +import com.supwisdom.dlpay.system.bean.ShopCheckBean; import com.supwisdom.dlpay.system.bean.ShopConfigBean; +import com.supwisdom.dlpay.system.bean.TreeSelectNode; import com.supwisdom.dlpay.system.service.DictionaryProxy; import com.supwisdom.dlpay.system.service.ParamService; import com.supwisdom.dlpay.system.service.ShopDataService; import com.supwisdom.dlpay.util.ConstantUtil; import com.supwisdom.dlpay.util.EnumCheck; import com.supwisdom.dlpay.util.WebCheckException; +import org.apache.commons.lang.math.NumberUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.security.core.userdetails.UserDetails; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; @@ -43,33 +48,60 @@ public class ShopController { @GetMapping("/shop/index") public String shopView(Model model) { - model.addAttribute(Dictionary.IDTYPE, - dictionaryProxy.getDictionaryAsList(Dictionary.IDTYPE)); + model.addAttribute("shopNeedCheck", systemUtilService.getSysparaValueAsBoolean(SysparaUtil.SHOP_NEEDCHECK_SWITCH)); return "system/shop/index"; } @GetMapping("/shop/shoptree") @PreAuthorize("hasPermission('/shop/index','')") @ResponseBody - public JsonResult shopTreeData() { - return JsonResult.ok("OK").put("data", shopDataService.getAllShopNodes()); + public JsonResult shopTreeData(@AuthenticationPrincipal UserDetails operUser) { + try { + TOperator oper = (TOperator) operUser; + return JsonResult.ok("OK").put("data", shopDataService.getShopManageLayerShopTree(oper.getOperid())); + } catch (Exception e) { + return JsonResult.error("查询商户树失败!").put("exception", e); + } + } + + @GetMapping("/shop/shoplist") + @PreAuthorize("hasPermission('/shop/index','')") + @ResponseBody + public PageResult getShopBySearch(@RequestParam("page") Integer pageNo, + @RequestParam("limit") Integer pageSize, + @RequestParam(value = "status", required = false) String status, + @RequestParam(value = "shopname", required = false) String shopname, + @RequestParam(value = "shopid", required = false) Integer shopid) { + try { + if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT; + if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT; + return shopDataService.getShopListBySearch(status, shopname, shopid, pageNo, pageSize); + } catch (Exception e) { + e.printStackTrace(); + return new PageResult<>(99, "系统查询错误"); + } } @PostMapping("/shop/deleteshop") @PreAuthorize("hasPermission('/shop/deleteshop','')") @ResponseBody - public JsonResult deleteShop(@RequestParam("shopid") Integer shopid) { + public JsonResult deleteShop(@RequestParam("shopid") Integer shopid, + @AuthenticationPrincipal UserDetails operUser) { TShop shop = shopDataService.getShopByShopid(shopid); if (null == shop) { return JsonResult.error("商户不存在,请重新查询"); //商户不存在,请重新查询 } try { - if (shopDataService.deleteShop(shop)) { + TOperator oper = (TOperator) operUser; + boolean needCheck = systemUtilService.getSysparaValueAsBoolean(SysparaUtil.SHOP_NEEDCHECK_SWITCH); + int ret = shopDataService.deleteShop(shop, needCheck, oper); + if (0 == ret) { return JsonResult.ok("删除成功"); - } else { - return JsonResult.error("删除失败"); + } else if (ret > 0) { + return JsonResult.ok("删除申请成功"); } + return JsonResult.error(needCheck ? "删除申请失败" : "删除失败"); } catch (WebCheckException ex) { return JsonResult.error(ex.getMessage()); } catch (Exception e) { @@ -77,79 +109,264 @@ public class ShopController { } } - @GetMapping("/shop/getshopinfo") - @PreAuthorize("hasPermission('/shop/getshopinfo','')") + @GetMapping("/shop/load4addshop") + @PreAuthorize("hasPermission('/shop/load4addshop','')") + public String load4AddShop(Model model) { + model.addAttribute(Dictionary.IDTYPE, dictionaryProxy.getDictionaryAsList(Dictionary.IDTYPE)); + return "system/shop/addshop"; + } + + @GetMapping("/shop/selectshopgroup") + @PreAuthorize("hasPermission('/shop/index','')") @ResponseBody - public JsonResult getShopInfo(@RequestParam("shopid") Integer shopid) { - TShop shop = shopDataService.getShopByShopid(shopid); - if (null == shop) { - return JsonResult.error("商户不存在,请重新查询"); //商户不存在,请重新查询 - } - return JsonResult.ok("查询成功").put("shop", shop); + public List searchShopTree() { + return shopDataService.getChooseShopGroup(); } - @PostMapping("/shop/saveorupdate") - @PreAuthorize("hasPermission('/shop/saveorupdate','')") + + @PostMapping("/shop/addshop") + @PreAuthorize("hasPermission('/shop/addshop','')") @ResponseBody - public JsonResult saveOrUpdateShop(@RequestParam("shopid") Integer shopid, @RequestParam("shopname") String shopname, - @RequestParam("fshopid") Integer fshopid, @RequestParam("shoptype") String shoptype, - @RequestParam(value = "contactman", required = false) String contactman, - @RequestParam(value = "idtype", required = false) String idtype, - @RequestParam(value = "idno", required = false) String idno, - @RequestParam(value = "mobile", required = false) String mobile, - @RequestParam(value = "tel", required = false) String tel, - @RequestParam(value = "email", required = false) String email, - @RequestParam(value = "addr", required = false) String addr, - @RequestParam(value = "zipcode", required = false) String zipcode) { - if (null == shopid || StringUtil.isEmpty(shopname) || null == fshopid - || !shopTypeCheck.isInEnums(shoptype, ShopTypes.NORMAL, ShopTypes.GROUP, ShopTypes.ROOT)) { + public JsonResult addShop(@RequestParam("shoptype") String shoptype, + @RequestParam("fshopid") Integer fshopid, + @RequestParam("shopname") String shopname, + @RequestParam("businessLicenseNo") String businessLicenseNo, + @RequestParam("taxRegistrationNo") String taxRegistrationNo, + @RequestParam("addr") String addr, + @RequestParam("legalPersonName") String legalPersonName, + @RequestParam("legalPersonIdtype") String legalPersonIdtype, + @RequestParam("legalPersonIdno") String legalPersonIdno, + @RequestParam("contactman") String contactman, + @RequestParam("mobile") String mobile, + @RequestParam("email") String email, + @RequestParam("tel") String tel, + @AuthenticationPrincipal UserDetails operUser) { + if (StringUtil.isEmpty(shopname) || null == fshopid || !shopTypeCheck.isInEnums(shoptype, ShopTypes.NORMAL, ShopTypes.GROUP, ShopTypes.ROOT)) { return JsonResult.error("参数传递错误"); + } else if (ShopTypes.NORMAL.toString().equals(shoptype) && (StringUtil.isEmpty(businessLicenseNo) || StringUtil.isEmpty(taxRegistrationNo) + || StringUtil.isEmpty(addr) || StringUtil.isEmpty(legalPersonName) || StringUtil.isEmpty(legalPersonIdtype) || StringUtil.isEmpty(legalPersonIdno))) { + return JsonResult.error("参数传递错误,结算商户必须填写商户营业信息!"); + } + TShop shop = new TShop(); + shop.setFshopid(fshopid); + shop.setShopname(shopname); + shop.setShoptype(shoptype); + shop.setBusinessLicenseNo(null == businessLicenseNo ? null : businessLicenseNo.trim()); + shop.setTaxRegistrationNo(null == taxRegistrationNo ? null : taxRegistrationNo.trim()); + shop.setAddr(null == addr ? null : addr.trim()); + shop.setLegalPersonName(null == legalPersonName ? null : legalPersonName.trim()); + shop.setLegalPersonIdtype(null == legalPersonIdtype ? null : legalPersonIdtype.trim()); + shop.setLegalPersonIdno(null == legalPersonIdno ? null : legalPersonIdno); + if (!StringUtil.isEmpty(shop.getLegalPersonIdno()) && StringUtil.isEmpty(shop.getLegalPersonIdtype())) { + return JsonResult.error("填写法人证件号时必须指定证件类型!"); + } else if (!StringUtil.isEmpty(shop.getLegalPersonIdno()) && IDTypes.IDCARD.value().equals(shop.getLegalPersonIdtype()) && !StringUtil.isIdentity(shop.getLegalPersonIdno())) { + return JsonResult.error("身份证格式错误!"); + } + shop.setContactman(contactman == null ? null : contactman.trim()); + shop.setMobile(mobile); + if (!StringUtil.isEmpty(shop.getMobile()) && !StringUtil.isMobile(shop.getMobile())) { + return JsonResult.error("请正确填写联系人手机号!"); + } + shop.setTel(tel == null ? null : tel.trim()); + shop.setEmail(email == null ? null : email.trim()); + if (!StringUtil.isEmpty(shop.getEmail()) && !StringUtil.isEmail(shop.getEmail())) { + return JsonResult.error("请正确填写联系人邮箱!"); } - TShop shop; - boolean addflag = false; - if (shopid == 0) { - //新增 - addflag = true; - shop = new TShop(); - shop.setFshopid(fshopid); - shop.setShopname(shopname); - shop.setShoptype(shoptype); - shop.setStatus(TradeDict.STATUS_NORMAL); - } else { - //修改 - shop = shopDataService.getShopByShopid(shopid); - if (null == shop) { - return JsonResult.error("商户不存在,修改失败!请重新查询"); + try { + TOperator oper = (TOperator) operUser; + boolean needCheck = systemUtilService.getSysparaValueAsBoolean(SysparaUtil.SHOP_NEEDCHECK_SWITCH); + int ret = shopDataService.saveNewShop(shop, needCheck, oper); + if (ret == 0) { + return JsonResult.ok("新增成功!"); + } else if (ret > 0) { + return JsonResult.ok("新增申请成功!"); } - shop.setFshopid(fshopid); - shop.setShopname(shopname); + return JsonResult.error(needCheck ? "新增申请失败" : "新增失败"); + } catch (WebCheckException ex) { + return JsonResult.error(ex.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + return JsonResult.error("系统处理异常").put("exception", e); } - shop.setContactman(contactman == null ? null : contactman.trim()); - shop.setIdno(idno == null ? null : idno.trim()); - shop.setIdtype(idtype == null ? null : idtype.trim()); - if (!StringUtil.isEmpty(shop.getIdno()) && StringUtil.isEmpty(shop.getIdtype())) { - return JsonResult.error("填写证件号时必须制定证件类型!"); - } else if (!StringUtil.isEmpty(shop.getIdno()) && IDTypes.IDCARD.value().equals(shop.getIdtype()) && !StringUtil.isIdentity(shop.getIdno())) { + } + + @GetMapping("/shop/load4updateshop") + @PreAuthorize("hasPermission('/shop/load4updateshop','')") + public String load4UpdateShop(@RequestParam("shopid") Integer shopid, Model model) { + TShop shop = shopDataService.getShopByShopid(shopid); + model.addAttribute("shop", shop != null ? shop : new TShop()); + model.addAttribute(Dictionary.IDTYPE, dictionaryProxy.getDictionaryAsList(Dictionary.IDTYPE)); + return "system/shop/updateshop"; + } + + @PostMapping("/shop/updateshop") + @PreAuthorize("hasPermission('/shop/updateshop','')") + @ResponseBody + public JsonResult updateShop(@RequestParam("shopid") Integer shopid, + @RequestParam("fshopid") Integer fshopid, + @RequestParam("shopname") String shopname, + @RequestParam("businessLicenseNo") String businessLicenseNo, + @RequestParam("taxRegistrationNo") String taxRegistrationNo, + @RequestParam("addr") String addr, + @RequestParam("legalPersonName") String legalPersonName, + @RequestParam("legalPersonIdtype") String legalPersonIdtype, + @RequestParam("legalPersonIdno") String legalPersonIdno, + @RequestParam("contactman") String contactman, + @RequestParam("mobile") String mobile, + @RequestParam("email") String email, + @RequestParam("tel") String tel, + @AuthenticationPrincipal UserDetails operUser) { + if (null == shopid || StringUtil.isEmpty(shopname) || null == fshopid) { + return JsonResult.error("参数传递错误"); + } + TShop oldShop = shopDataService.getShopByShopid(shopid); + if (null == oldShop) { + return JsonResult.error("商户不存在,修改失败!请重新查询"); + } + if (ShopTypes.NORMAL.toString().equals(oldShop.getShoptype()) && (StringUtil.isEmpty(businessLicenseNo) || StringUtil.isEmpty(taxRegistrationNo) + || StringUtil.isEmpty(addr) || StringUtil.isEmpty(legalPersonName) || StringUtil.isEmpty(legalPersonIdtype) || StringUtil.isEmpty(legalPersonIdno))) { + return JsonResult.error("参数传递错误,结算商户必须填写商户营业信息!"); + } + + TShop shop=new TShop(); + BeanUtils.copyProperties(oldShop, shop); //TODO:避免JPA的set方法会提交数据库 + shop.setFshopid(fshopid); + shop.setShopname(shopname); + shop.setBusinessLicenseNo(null == businessLicenseNo ? null : businessLicenseNo.trim()); + shop.setTaxRegistrationNo(null == taxRegistrationNo ? null : taxRegistrationNo.trim()); + shop.setAddr(null == addr ? null : addr.trim()); + shop.setLegalPersonName(null == legalPersonName ? null : legalPersonName.trim()); + shop.setLegalPersonIdtype(null == legalPersonIdtype ? null : legalPersonIdtype.trim()); + shop.setLegalPersonIdno(null == legalPersonIdno ? null : legalPersonIdno); + if (!StringUtil.isEmpty(shop.getLegalPersonIdno()) && StringUtil.isEmpty(shop.getLegalPersonIdtype())) { + return JsonResult.error("填写法人证件号时必须指定证件类型!"); + } else if (!StringUtil.isEmpty(shop.getLegalPersonIdno()) && IDTypes.IDCARD.value().equals(shop.getLegalPersonIdtype()) && !StringUtil.isIdentity(shop.getLegalPersonIdno())) { return JsonResult.error("身份证格式错误!"); } + shop.setContactman(contactman == null ? null : contactman.trim()); shop.setMobile(mobile); if (!StringUtil.isEmpty(shop.getMobile()) && !StringUtil.isMobile(shop.getMobile())) { - return JsonResult.error("请正确填写手机号!"); + return JsonResult.error("请正确填写联系人手机号!"); } shop.setTel(tel == null ? null : tel.trim()); shop.setEmail(email == null ? null : email.trim()); if (!StringUtil.isEmpty(shop.getEmail()) && !StringUtil.isEmail(shop.getEmail())) { - return JsonResult.error("请正确填写邮箱地址!"); + return JsonResult.error("请正确填写联系人邮箱!"); + } + + try { + TOperator oper = (TOperator) operUser; + boolean needCheck = systemUtilService.getSysparaValueAsBoolean(SysparaUtil.SHOP_NEEDCHECK_SWITCH); + int ret = shopDataService.updateShop(shop, needCheck, oper); + if (ret == 0) { + return JsonResult.ok("修改成功!"); + } else if (ret > 0) { + return JsonResult.ok("修改申请成功!"); + } + return JsonResult.error(needCheck ? "修改申请失败" : "修改失败"); + } catch (WebCheckException ex) { + return JsonResult.error(ex.getMessage()); + } catch (Exception e) { + e.printStackTrace(); + return JsonResult.error("系统处理异常").put("exception", e); + } + } + + @GetMapping("/shop/getshopinfo") + @PreAuthorize("hasPermission('/shop/getshopinfo','')") + public String getShopInfo(@RequestParam("shopid") Integer shopid,Model model) { + TShop shop = shopDataService.getShopByShopid(shopid); + model.addAttribute("shop", shop != null ? shop : new TShop()); + model.addAttribute(Dictionary.IDTYPE, dictionaryProxy.getDictionaryAsList(Dictionary.IDTYPE)); + return "system/shop/shopdetail"; + } + + @GetMapping("/shop/getshopchk") + @PreAuthorize("hasPermission('/shop/getshopchk','')") + public String getShopChkdtl(@RequestParam("shopid") Integer shopid,Model model) { + model.addAttribute("selectShopid", shopid); + return "system/shop/shopchk"; + } + + @GetMapping("/shop/getshopchklist") + @PreAuthorize("hasPermission('/shop/getshopchk','')") + @ResponseBody + public PageResult getShopBySearch(@RequestParam("page") Integer pageNo, + @RequestParam("limit") Integer pageSize, + @RequestParam(value = "shopid", required = false) String shopid, + @RequestParam(value = "status", required = false) String status, + @RequestParam(value = "searchkey", required = false) String searchkey) { + try { + if (StringUtil.isEmpty(shopid)) return new PageResult<>(99, "无数据"); + if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT; + if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT; + return shopDataService.getShopChkdtlDetails(shopid, status, searchkey, pageNo, pageSize); + } catch (Exception e) { + e.printStackTrace(); + return new PageResult<>(99, "系统查询错误"); + } + } + + /** + * ==================================================== + * 商户审批 + * ==================================================== + */ + @GetMapping("/shop/shopcheck") + @PreAuthorize("hasPermission('/shop/shopcheck','')") + public String shopCheckIndex(){ + return "system/shop/shopcheck"; + } + + @GetMapping("/shop/shopchecklist") + @PreAuthorize("hasPermission('/shop/shopcheck','')") + @ResponseBody + public PageResult shopCheckIndex(@RequestParam("page") Integer pageNo, + @RequestParam("limit") Integer pageSize, + @RequestParam(value = "shopid", required = false) String shopid, + @RequestParam(value = "status", required = false) String status, + @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 shopDataService.getShopChkdtlDetails(shopid, status, searchkey, pageNo, pageSize); + } catch (Exception e) { + e.printStackTrace(); + return new PageResult<>(99, "系统查询错误"); + } + } + + @GetMapping("/shop/opercheck") + @PreAuthorize("hasPermission('/shop/opercheck','')") + public String shopOperCheck(@RequestParam("chkno") Long chkno, Model map) { + TOperChkdtl chkdtl = shopDataService.getOperChkdtlByChkno(chkno); + ShopCheckBean shop = shopDataService.getOperChkShopInfo(chkdtl); + map.addAttribute("operChkdtl", chkdtl); + map.addAttribute("shop", shop); + return "system/shop/opercheck"; + } + + @PostMapping("/shop/docheckshop") + @PreAuthorize("hasPermission('/shop/docheckshop','')") + @ResponseBody + public JsonResult doCheckShop(@RequestParam("chkno") String chkno, + @RequestParam("chkresult") String chkresult, + @RequestParam("chkmsg") String chkmsg, + @AuthenticationPrincipal UserDetails operUser) { + if(!NumberUtils.isDigits(chkno) || (!TradeDict.STATUS_NORMAL.equals(chkresult) && !TradeDict.STATUS_REJECT.equals(chkresult))){ + return JsonResult.error("参数传递错误"); + }else if(!TradeDict.STATUS_NORMAL.equals(chkresult) && StringUtil.isEmpty(chkmsg)){ + return JsonResult.error("驳回必须填写审核意见!"); } - shop.setAddr(addr == null ? null : addr.trim()); - shop.setZipcode(zipcode == null ? null : zipcode.trim()); try { - if (shopDataService.saveOrUpdateShop(shop)) { - return JsonResult.ok(addflag ? "新增成功" : "修改成功").put("shop", shop); + TOperator oper = (TOperator) operUser; + TOperChkdtl chkdtl = shopDataService.doCheckShopChkdtl(Long.valueOf(chkno), TradeDict.STATUS_NORMAL.equals(chkresult), chkmsg, oper); + if (chkresult.equals(chkdtl.getChkResult())) { + return JsonResult.ok(TradeDict.STATUS_NORMAL.equals(chkresult) ? "审核成功!" : "驳回成功!"); } else { - return JsonResult.error(addflag ? "新增失败" : "修改失败"); + return JsonResult.ok(299, chkdtl.getChkMsg()); } } catch (WebCheckException ex) { return JsonResult.error(ex.getMessage()); @@ -159,6 +376,77 @@ public class ShopController { } } +// @PostMapping("/shop/saveorupdate") +// @PreAuthorize("hasPermission('/shop/saveorupdate','')") +// @ResponseBody +// public JsonResult saveOrUpdateShop(@RequestParam("shopid") Integer shopid, @RequestParam("shopname") String shopname, +// @RequestParam("fshopid") Integer fshopid, @RequestParam("shoptype") String shoptype, +// @RequestParam(value = "contactman", required = false) String contactman, +// @RequestParam(value = "idtype", required = false) String idtype, +// @RequestParam(value = "idno", required = false) String idno, +// @RequestParam(value = "mobile", required = false) String mobile, +// @RequestParam(value = "tel", required = false) String tel, +// @RequestParam(value = "email", required = false) String email, +// @RequestParam(value = "addr", required = false) String addr, +// @RequestParam(value = "zipcode", required = false) String zipcode) { +// if (null == shopid || StringUtil.isEmpty(shopname) || null == fshopid +// || !shopTypeCheck.isInEnums(shoptype, ShopTypes.NORMAL, ShopTypes.GROUP, ShopTypes.ROOT)) { +// return JsonResult.error("参数传递错误"); +// } +// +// TShop shop; +// boolean addflag = false; +// if (shopid == 0) { +// //新增 +// addflag = true; +// shop = new TShop(); +// shop.setFshopid(fshopid); +// shop.setShopname(shopname); +// shop.setShoptype(shoptype); +// shop.setStatus(TradeDict.STATUS_NORMAL); +// } else { +// //修改 +// shop = shopDataService.getShopByShopid(shopid); +// if (null == shop) { +// return JsonResult.error("商户不存在,修改失败!请重新查询"); +// } +// shop.setFshopid(fshopid); +// shop.setShopname(shopname); +// } +// shop.setContactman(contactman == null ? null : contactman.trim()); +// shop.setIdno(idno == null ? null : idno.trim()); +// shop.setIdtype(idtype == null ? null : idtype.trim()); +// if (!StringUtil.isEmpty(shop.getIdno()) && StringUtil.isEmpty(shop.getIdtype())) { +// return JsonResult.error("填写证件号时必须制定证件类型!"); +// } else if (!StringUtil.isEmpty(shop.getIdno()) && IDTypes.IDCARD.value().equals(shop.getIdtype()) && !StringUtil.isIdentity(shop.getIdno())) { +// return JsonResult.error("身份证格式错误!"); +// } +// shop.setMobile(mobile); +// if (!StringUtil.isEmpty(shop.getMobile()) && !StringUtil.isMobile(shop.getMobile())) { +// return JsonResult.error("请正确填写手机号!"); +// } +// shop.setTel(tel == null ? null : tel.trim()); +// shop.setEmail(email == null ? null : email.trim()); +// if (!StringUtil.isEmpty(shop.getEmail()) && !StringUtil.isEmail(shop.getEmail())) { +// return JsonResult.error("请正确填写邮箱地址!"); +// } +// shop.setAddr(addr == null ? null : addr.trim()); +// shop.setZipcode(zipcode == null ? null : zipcode.trim()); +// +// try { +// if (shopDataService.saveOrUpdateShop(shop)) { +// return JsonResult.ok(addflag ? "新增成功" : "修改成功").put("shop", shop); +// } else { +// return JsonResult.error(addflag ? "新增失败" : "修改失败"); +// } +// } catch (WebCheckException ex) { +// return JsonResult.error(ex.getMessage()); +// } catch (Exception e) { +// e.printStackTrace(); +// return JsonResult.error("系统处理异常").put("exception", e); +// } +// } + /** * ==================================================== * 商户支付能力配置 @@ -166,7 +454,6 @@ public class ShopController { */ @GetMapping("/shop/config") public String shopConfigView(Model model) { -// model.addAttribute("paytypelist", shopDataService.getConsumePaytypes()); model.addAttribute(Dictionary.PAY_TYPE, dictionaryProxy.getDictionaryAsList(Dictionary.SOURCE_TYPE)); return "system/shop/config"; diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java b/payapi/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java index 40e58d3e..31531d1b 100644 --- a/payapi/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java +++ b/payapi/src/main/java/com/supwisdom/dlpay/system/service/ShopDataService.java @@ -2,12 +2,12 @@ package com.supwisdom.dlpay.system.service; import com.supwisdom.dlpay.api.domain.TShopSourceType; import com.supwisdom.dlpay.api.domain.TShopSourceTypeConfig; +import com.supwisdom.dlpay.framework.domain.TOperChkdtl; +import com.supwisdom.dlpay.framework.domain.TOperator; import com.supwisdom.dlpay.framework.domain.TShop; import com.supwisdom.dlpay.framework.domain.TShopacc; import com.supwisdom.dlpay.framework.util.PageResult; -import com.supwisdom.dlpay.system.bean.LayerTreeNode; -import com.supwisdom.dlpay.system.bean.ShopConfigBean; -import com.supwisdom.dlpay.system.bean.ZTreeNode; +import com.supwisdom.dlpay.system.bean.*; import com.supwisdom.dlpay.util.WebCheckException; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -23,7 +23,13 @@ public interface ShopDataService { TShop getShopByShopid(Integer shopid); @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) - boolean deleteShop(TShop shop) throws WebCheckException; + int deleteShop(TShop shop, boolean needCheck, TOperator oper) throws WebCheckException; + + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) + int saveNewShop(TShop shop, boolean needCheck, TOperator oper) throws WebCheckException; + + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) + int updateShop(TShop shop, boolean needCheck, TOperator oper) throws WebCheckException; @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) boolean saveOrUpdateShop(TShop shop) throws WebCheckException; @@ -48,4 +54,26 @@ public interface ShopDataService { @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true) List getLayerShopTree(); + + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true) + List getShopManageLayerShopTree(String operid); + + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true) + PageResult getShopListBySearch(String status, String shopname, Integer shopid, int pageNo, int pageSize); + + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true) + List getChooseShopGroup(); + + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true) + PageResult getShopChkdtlDetails(String shopid, String status, String searchkey, int pageNo, int pageSize); + + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true) + TOperChkdtl getOperChkdtlByChkno(Long chkno); + + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, readOnly = true) + ShopCheckBean getOperChkShopInfo(TOperChkdtl chkdtl); + + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) + TOperChkdtl doCheckShopChkdtl(Long chkno,boolean passflag, String chkmsg, TOperator oper) throws Exception; + } diff --git a/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java b/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java index 427e64fc..1cccf992 100644 --- a/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java +++ b/payapi/src/main/java/com/supwisdom/dlpay/system/service/impl/ShopDataServiceImpl.java @@ -1,5 +1,6 @@ package com.supwisdom.dlpay.system.service.impl; +import com.google.gson.Gson; import com.supwisdom.dlpay.api.dao.SourceTypeConfigDao; import com.supwisdom.dlpay.api.dao.SourceTypeDao; import com.supwisdom.dlpay.api.dao.ShopSourceTypeConfigDao; @@ -9,20 +10,21 @@ import com.supwisdom.dlpay.api.domain.TSourceTypeConfig; import com.supwisdom.dlpay.api.domain.TShopSourceType; import com.supwisdom.dlpay.api.domain.TShopSourceTypeConfig; import com.supwisdom.dlpay.api.types.ShopTypes; +import com.supwisdom.dlpay.framework.dao.DictionaryDao; +import com.supwisdom.dlpay.framework.dao.OperChkdtlDao; import com.supwisdom.dlpay.framework.dao.ShopDao; import com.supwisdom.dlpay.framework.dao.ShopaccDao; import com.supwisdom.dlpay.framework.data.SystemDateTime; -import com.supwisdom.dlpay.framework.domain.TShop; -import com.supwisdom.dlpay.framework.domain.TShopacc; +import com.supwisdom.dlpay.framework.domain.*; import com.supwisdom.dlpay.framework.service.SystemUtilService; import com.supwisdom.dlpay.framework.tenant.TenantContext; import com.supwisdom.dlpay.framework.util.*; -import com.supwisdom.dlpay.system.bean.LayerTreeNode; -import com.supwisdom.dlpay.system.bean.ShopConfigBean; -import com.supwisdom.dlpay.system.bean.ZTreeNode; +import com.supwisdom.dlpay.system.bean.*; import com.supwisdom.dlpay.system.service.ShopDataService; +import com.supwisdom.dlpay.util.ConstantUtil; import com.supwisdom.dlpay.util.EnumCheck; import com.supwisdom.dlpay.util.WebCheckException; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; @@ -31,6 +33,8 @@ import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.data.jpa.domain.Specification; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; import javax.persistence.criteria.*; import java.util.ArrayList; import java.util.List; @@ -52,6 +56,12 @@ public class ShopDataServiceImpl implements ShopDataService { private SourceTypeConfigDao sourceTypeConfigDao; @Autowired private ShopSourceTypeConfigDao shopPaytypeConfigDao; + @Autowired + private OperChkdtlDao operChkdtlDao; + @Autowired + private DictionaryDao dictionaryDao; + @PersistenceContext + private EntityManager entityManager; private EnumCheck enumUtil = new EnumCheck<>(); @@ -87,27 +97,210 @@ public class ShopDataServiceImpl implements ShopDataService { } @Override - public boolean deleteShop(TShop shop) throws WebCheckException { + public int deleteShop(TShop shop, boolean needCheck, TOperator oper) throws WebCheckException { if (null != shop) { if (ShopTypes.ROOT.value().equals(shop.getShoptype())) { throw new WebCheckException("不能删除根商户节点"); } + if (TradeDict.STATUS_CLOSED.equals(shop.getStatus())) { + throw new WebCheckException("商户已经被删除,请重新查询再操作"); + } List childShops = shopDao.getChildShopsByShopid(shop.getShopid()); if (!StringUtil.isEmpty(childShops)) throw new WebCheckException("请先删除下级商户"); - shop.setStatus(TradeDict.STATUS_CLOSED); - shop.setClosedate(systemUtilService.getSysdatetime().getHostdate()); - shopDao.save(shop); + TShopacc shopacc = null; if (!StringUtil.isEmpty(shop.getShopaccno())) { - TShopacc shopacc = shopaccDao.getByShopaccno(shop.getShopaccno()); + shopacc = shopaccDao.getByShopaccno(shop.getShopaccno()); if (null == shopacc) throw new WebCheckException("数据异常!对应的商户账户不存在!"); - shopacc.setStatus(TradeDict.STATUS_CLOSED); - shopacc.setClosedate(shop.getClosedate()); + } + + if (!needCheck) { + //无需审批,直接注销 + shop.setStatus(TradeDict.STATUS_CLOSED); + shop.setClosedate(systemUtilService.getSysdatetime().getHostdate()); + shopDao.save(shop); + if (null != shopacc) { + shopacc.setStatus(TradeDict.STATUS_CLOSED); + shopacc.setClosedate(shop.getClosedate()); + shopaccDao.save(shopacc); + } + return 0; + } else { + //创建审批记录 + if (TradeDict.STATUS_NORMAL.equals(shop.getStatus())) { + if (operChkdtlDao.getChkdtlCount(ConstantUtil.OPERCHK_CHKTYPE_SHOP, ConstantUtil.OPERCHK_CHKMODE_DELETE, shop.getShopid().toString(), TradeDict.STATUS_UNCHECK).getExisted() > 0) { + throw new WebCheckException("该商户已经提交了删除申请,无需再次提交!"); + } + TOperChkdtl chkdtl = new TOperChkdtl(); + chkdtl.setChkType(ConstantUtil.OPERCHK_CHKTYPE_SHOP); + chkdtl.setChkMode(ConstantUtil.OPERCHK_CHKMODE_DELETE); + chkdtl.setContentId(shop.getShopid().toString()); + chkdtl.setChkResult(TradeDict.STATUS_UNCHECK); + chkdtl.setCreateOperid(oper.getOperid()); + chkdtl.setCreateOpername(oper.getOpername()); + chkdtl.setCreatetime(systemUtilService.getSysdatetime().getHostdatetime()); + chkdtl.setTenantId(shop.getTenantId()); + operChkdtlDao.save(chkdtl); + return 1; + } else { + //未审批或被驳回的商户直接删除,未审核的审批直接作废 + operChkdtlDao.doClearChkdtl(ConstantUtil.OPERCHK_CHKTYPE_SHOP, shop.getShopid().toString()); + shopDao.delete(shop); + if (null != shopacc) { + shopaccDao.delete(shopacc); + } + return 0; + } + } + } + return -1; + } + + @Override + public int saveNewShop(TShop shop, boolean needCheck, TOperator oper) throws WebCheckException { + if (null == shop) return -1; + if (shop.getFshopid() != 0) { + TShop fshop = shopDao.getTShopByShopid(shop.getFshopid()); + if (null == fshop) { + throw new WebCheckException("上级商户不存在!"); + } else if (!enumUtil.isInEnums(fshop.getShoptype(), + ShopTypes.ROOT, ShopTypes.GROUP)) { + throw new WebCheckException("上级商户不是商户组!"); + } + } + if (shopDao.checkShopnameExist(shop.getShopname(), shop.getFshopid(), shop.getShopid() == null ? 0 : shop.getShopid()) > 0) { + throw new WebCheckException("商户名称在同级下已经存在!"); + } + + SystemDateTime dt = systemUtilService.getSysdatetime(); + shop.setOpendate(dt.getHostdate()); + shop.setTenantId(TenantContext.getTenantSchema()); + shop.setAddOperid(oper == null ? null : oper.getOperid()); + if (!needCheck) { + //不需要审核 + shop.setStatus(TradeDict.STATUS_NORMAL); + shopDao.save(shop); + if (enumUtil.isInEnums(shop.getShoptype(), ShopTypes.NORMAL)) { + TShopacc shopacc = new TShopacc(); + shopacc.setShopaccno(String.format("2%09d", shop.getShopid())); + shopacc.setShopid(shop.getShopid()); + shopacc.setShopname(shop.getShopname()); + shopacc.setSubjno(Subject.SUBJNO_MACHANT_INCOME); + shopacc.setStatus(TradeDict.STATUS_NORMAL); + shopacc.setOpendate(dt.getHostdate()); + shopacc.setBalance(0D); + shopacc.setTenantId(shop.getTenantId()); + shopacc = shopaccDao.save(shopacc); + shopacc.setMac(shopacc.genMAC()); shopaccDao.save(shopacc); + shop.setShopaccno(shopacc.getShopaccno()); + shopDao.save(shop); + +// TShopPaytype shopPaytype = new TShopPaytype(); +// shopPaytype.setShopaccno(shopacc.getShopaccno()); +// shopPaytype.setSourceType(TradeDict.PAYTYPE_BALANCE); +// shopPaytype.setConsumeEnable(true); +// shopPaytype.setAnonymousEnable(false); +// shopPaytype.setReverseEnable(false); +// shopPaytype.setCreatetime(dt.getHostdatetime()); +// shopSourceTypeDao.save(shopPaytype); //默认增加余额支付方式 } - return true; + return 0; + + } else { + //需要审核 + shop.setStatus(TradeDict.STATUS_UNCHECK); + shop = shopDao.save(shop); + + TOperChkdtl chkdtl = new TOperChkdtl(); + chkdtl.setChkType(ConstantUtil.OPERCHK_CHKTYPE_SHOP); + chkdtl.setChkMode(ConstantUtil.OPERCHK_CHKMODE_ADD); + chkdtl.setContentId(shop.getShopid().toString()); + chkdtl.setChkResult(TradeDict.STATUS_UNCHECK); + chkdtl.setCreateOperid(oper.getOperid()); + chkdtl.setCreateOpername(oper.getOpername()); + chkdtl.setCreatetime(systemUtilService.getSysdatetime().getHostdatetime()); + chkdtl.setTenantId(shop.getTenantId()); + operChkdtlDao.save(chkdtl); //审批记录 + return 1; } - return false; + } + + @Override + public int updateShop(TShop shop, boolean needCheck, TOperator oper) throws WebCheckException { + if (null != shop) { + if (TradeDict.STATUS_CLOSED.equals(shop.getStatus())) { + throw new WebCheckException("商户已经被删除,请重新查询再操作"); + } + if (shop.getFshopid() != 0) { + TShop fshop = shopDao.getTShopByShopid(shop.getFshopid()); + if (null == fshop) { + throw new WebCheckException("上级商户不存在!"); + } else if (!enumUtil.isInEnums(fshop.getShoptype(), + ShopTypes.ROOT, ShopTypes.GROUP)) { + throw new WebCheckException("上级商户不是商户组!"); + } + } + if (shopDao.checkShopnameExist(shop.getShopname(), shop.getFshopid(), shop.getShopid() == null ? 0 : shop.getShopid()) > 0) { + throw new WebCheckException("商户名称在同级下已经存在!"); + } + + if (!needCheck) { + //无需审核 + shopDao.save(shop); + if (!StringUtil.isEmpty(shop.getShopaccno())) { + shopaccDao.updateShopnameByShopaccno(shop.getShopname(), shop.getShopaccno()); //更新商户名 + } + return 0; + } else { + //需要审核 + if (TradeDict.STATUS_UNCHECK.equals(shop.getStatus())) { + //待审核的商户直接更新原记录 + shopDao.save(shop); + if (!StringUtil.isEmpty(shop.getShopaccno())) { + shopaccDao.updateShopnameByShopaccno(shop.getShopname(), shop.getShopaccno()); //更新商户名 + } + return 0; + } else if (TradeDict.STATUS_REJECT.equals(shop.getStatus())) { + //被驳回的商户 + shop.setStatus(TradeDict.STATUS_UNCHECK); //重新变为待审核 + shopDao.save(shop); + if (!StringUtil.isEmpty(shop.getShopaccno())) { + shopaccDao.updateShopnameByShopaccno(shop.getShopname(), shop.getShopaccno()); //更新商户名 + } + + TOperChkdtl chkdtl = new TOperChkdtl(); + chkdtl.setChkType(ConstantUtil.OPERCHK_CHKTYPE_SHOP); + chkdtl.setChkMode(ConstantUtil.OPERCHK_CHKMODE_ADD); + chkdtl.setContentId(shop.getShopid().toString()); + chkdtl.setChkResult(TradeDict.STATUS_UNCHECK); + chkdtl.setCreateOperid(oper.getOperid()); + chkdtl.setCreateOpername(oper.getOpername()); + chkdtl.setCreatetime(systemUtilService.getSysdatetime().getHostdatetime()); + chkdtl.setTenantId(shop.getTenantId()); + operChkdtlDao.save(chkdtl); //审批记录 + return 1; + } else { + //正常的商户,新增审核记录 + operChkdtlDao.doClearChkdtl(ConstantUtil.OPERCHK_CHKTYPE_SHOP, ConstantUtil.OPERCHK_CHKMODE_MODIFY, shop.getShopid().toString()); //未审核的修改记录作废 + TOperChkdtl chkdtl = new TOperChkdtl(); + chkdtl.setChkType(ConstantUtil.OPERCHK_CHKTYPE_SHOP); + chkdtl.setChkMode(ConstantUtil.OPERCHK_CHKMODE_MODIFY); + chkdtl.setContentId(shop.getShopid().toString()); + chkdtl.setContent(new Gson().toJson(shop)); //修改后的商户信息json暂存 + chkdtl.setChkResult(TradeDict.STATUS_UNCHECK); + chkdtl.setCreateOperid(oper.getOperid()); + chkdtl.setCreateOpername(oper.getOpername()); + chkdtl.setCreatetime(systemUtilService.getSysdatetime().getHostdatetime()); + chkdtl.setTenantId(shop.getTenantId()); + operChkdtlDao.save(chkdtl); //审批记录 + return 1; + } + } + } + return -1; + + } @Override @@ -234,7 +427,7 @@ public class ShopDataServiceImpl implements ShopDataService { List list = sourceTypeConfigDao.getBySourceTypeOrderByConfigid(paytype.trim()); if (!StringUtil.isEmpty(list)) { for (TSourceTypeConfig pt : list) { - if(pt.getGlobalflag()){ + if (pt.getGlobalflag()) { continue; //通用参数跳过 } TShopSourceTypeConfig spc = shopPaytypeConfigDao.getShopSourceTypeConfigById(shopaccno, pt.getSourceType(), pt.getConfigid()); @@ -296,7 +489,7 @@ public class ShopDataServiceImpl implements ShopDataService { node.setField(StringUtil.isEmpty(shop.getShopaccno()) ? "" : shop.getShopaccno().trim()); node.setSpread(true); List children = getShopLayerChildres(shoplist, shop.getShopid()); - node.setChildren(StringUtil.isEmpty(children)? null : children); + node.setChildren(StringUtil.isEmpty(children) ? null : children); result.add(node); //跟节点 } return result; @@ -309,8 +502,6 @@ public class ShopDataServiceImpl implements ShopDataService { LayerTreeNode node = new LayerTreeNode(); node.setTitle(shop.getShopname()); node.setId(shop.getShopid().toString()); - node.setTitle(shop.getShopname()); - node.setId(shop.getShopid().toString()); node.setField(StringUtil.isEmpty(shop.getShopaccno()) ? "" : shop.getShopaccno().trim()); node.setSpread(StringUtil.isEmpty(shop.getShopaccno())); List children = getShopLayerChildres(shoplist, shop.getShopid()); @@ -321,4 +512,347 @@ public class ShopDataServiceImpl implements ShopDataService { return result; } + @Override + public List getShopManageLayerShopTree(String operid) { + if (StringUtil.isEmpty(operid)) return getLayerShopTree(); + + List shoplist = shopDao.findAllShops(); + List rootlist = shopDao.getRootShops(); + List result = new ArrayList<>(0); + if (StringUtil.isEmpty(rootlist)) { + return result; + } + for (TShop shop : rootlist) { + if (TradeDict.STATUS_CLOSED.equals(shop.getStatus())) continue; //注销商户跳过 + if (!TradeDict.STATUS_NORMAL.equals(shop.getStatus()) && !operid.equals(shop.getAddOperid())) + continue; //非正常商户,非用户权限跳过 + LayerTreeNode node = new LayerTreeNode(); + node.setTitle(shop.getShopname()); + if (TradeDict.STATUS_UNCHECK.equals(shop.getStatus())) { + node.setTitle(shop.getShopname() + " (待审核)"); + } else if (TradeDict.STATUS_REJECT.equals(shop.getStatus())) { + node.setTitle(shop.getShopname() + " (被驳回)"); + } + node.setId(shop.getShopid().toString()); + node.setField(StringUtil.isEmpty(shop.getShopaccno()) ? "" : shop.getShopaccno().trim()); + node.setSpread(true); + List children = getShopManageLayerChildres(shoplist, shop.getShopid(), operid); + node.setChildren(StringUtil.isEmpty(children) ? null : children); + result.add(node); //跟节点 + } + return result; + } + + private List getShopManageLayerChildres(List shoplist, Integer fshopid, String operid) { + List result = new ArrayList<>(0); + for (TShop shop : shoplist) { + if (TradeDict.STATUS_CLOSED.equals(shop.getStatus())) continue; //注销商户跳过 + if (!TradeDict.STATUS_NORMAL.equals(shop.getStatus()) && !operid.equals(shop.getAddOperid())) + continue; //非正常商户,非用户权限跳过 + if (fshopid.equals(shop.getFshopid())) { + LayerTreeNode node = new LayerTreeNode(); + node.setTitle(shop.getShopname()); + if (TradeDict.STATUS_UNCHECK.equals(shop.getStatus())) { + node.setTitle(shop.getShopname() + " (待审核)"); + } else if (TradeDict.STATUS_REJECT.equals(shop.getStatus())) { + node.setTitle(shop.getShopname() + " (被驳回)"); + } + node.setId(shop.getShopid().toString()); + node.setField(StringUtil.isEmpty(shop.getShopaccno()) ? "" : shop.getShopaccno().trim()); + node.setSpread(!ShopTypes.NORMAL.toString().equals(shop.getShoptype())); + List children = getShopManageLayerChildres(shoplist, shop.getShopid(), operid); + node.setChildren(StringUtil.isEmpty(children) ? null : children); + result.add(node); + } + } + return result; + } + + @Override + public PageResult getShopListBySearch(String status, String shopname, Integer shopid, int pageNo, int pageSize) { + Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by("shopid")); + Page page = shopDao.findAll(new Specification() { + @Override + public Predicate toPredicate(Root root, CriteriaQuery query, CriteriaBuilder criteriaBuilder) { + List predicates = new ArrayList<>(); + if (!StringUtil.isEmpty(status)) { + predicates.add(criteriaBuilder.equal(root.get("status").as(String.class), status.trim())); + } + if (!StringUtil.isEmpty(shopname)) { + predicates.add(criteriaBuilder.like(root.get("shopname").as(String.class), "%" + shopname.trim() + "%")); + } + if (null != shopid) { + predicates.add(criteriaBuilder.equal(root.get("shopid").as(Integer.class), shopid)); + } + predicates.add(criteriaBuilder.notEqual(root.get("status").as(String.class), TradeDict.STATUS_CLOSED)); //排除注销商户 + return criteriaBuilder.and(predicates.toArray(new Predicate[0])); + } + }, pageable); + + return new PageResult<>(page); + } + + @Override + public List getChooseShopGroup() { + List rootList = shopDao.getRootNormalShops(); + List shoplist = shopDao.findAllShops(); + List result = new ArrayList<>(0); + if (StringUtil.isEmpty(rootList)) { + return result; + } + for (TShop rt : rootList) { + TreeSelectNode node = new TreeSelectNode(); + node.setId(rt.getShopid().toString()); + node.setName(rt.getShopname()); + node.setOpen(true); + node.setChecked(false); + node.setAccno(rt.getShopaccno() == null ? "" : rt.getShopaccno()); + node.setpId(String.valueOf(rt.getFshopid())); + List children = getChooseShopGroupTree(shoplist, rt.getShopid()); + node.setChildren(StringUtil.isEmpty(children) ? null : children); + result.add(node); + } + return result; + } + + private List getChooseShopGroupTree(List shopList, int fshopid) { + List result = new ArrayList<>(0); + if (!StringUtil.isEmpty(shopList)) { + for (TShop shop : shopList) { + if (fshopid == shop.getFshopid() && !ShopTypes.NORMAL.toString().equals(shop.getShoptype()) && TradeDict.STATUS_NORMAL.equals(shop.getStatus())) { + //状态正常的商户组 + TreeSelectNode node = new TreeSelectNode(); + node.setId(shop.getShopid().toString()); + node.setName(shop.getShopname()); + node.setOpen(true); + node.setChecked(false); + node.setAccno(shop.getShopaccno() == null ? "" : shop.getShopaccno()); + node.setpId(String.valueOf(fshopid)); + List children = getChooseShopGroupTree(shopList, shop.getShopid()); + node.setChildren(StringUtil.isEmpty(children) ? null : children); + result.add(node); + } + } + } + return result; + } + + @Override + public PageResult getShopChkdtlDetails(String shopid, String status, String searchkey, int pageNo, int pageSize) { + Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by(Sort.Direction.DESC,"chkNo")); + + Page page = operChkdtlDao.findAll(new Specification() { + @Override + public Predicate toPredicate(Root root, CriteriaQuery query, CriteriaBuilder criteriaBuilder) { + List predicates = new ArrayList<>(); + if (!StringUtil.isEmpty(shopid)) { + predicates.add(criteriaBuilder.equal(root.get("contentId").as(String.class), shopid.trim())); + } + if (!StringUtil.isEmpty(status)) { + predicates.add(criteriaBuilder.equal(root.get("chkResult").as(String.class), status.trim())); + } + if (!StringUtil.isEmpty(searchkey)) { + predicates.add(criteriaBuilder.or(criteriaBuilder.like(root.get("chkNo").as(String.class), "%" + searchkey.trim() + "%"), + criteriaBuilder.like(root.get("createOpername").as(String.class), "%" + searchkey.trim() + "%"), + criteriaBuilder.like(root.get("checkOpername").as(String.class), "%" + searchkey.trim() + "%"))); + } + predicates.add(criteriaBuilder.equal(root.get("chkType").as(String.class), ConstantUtil.OPERCHK_CHKTYPE_SHOP)); + predicates.add(criteriaBuilder.equal(root.get("invalidflag").as(Boolean.class), false)); + return criteriaBuilder.and(predicates.toArray(new Predicate[0])); + } + }, pageable); + return new PageResult<>(page); + } + + @Override + public TOperChkdtl getOperChkdtlByChkno(Long chkno) { + TOperChkdtl chkdtl = operChkdtlDao.getByChkno(chkno != null ? chkno : -99L); + if (null != chkdtl) { + return chkdtl; + } + return new TOperChkdtl(); + } + + private boolean checkSameString(String str1, String str2) { + if (StringUtil.isEmpty(str1) && StringUtil.isEmpty(str2)) return true; + if (null != str1 && str1.equals(str2)) return true; + return false; + } + + @Override + public ShopCheckBean getOperChkShopInfo(TOperChkdtl chkdtl) { + if (null == chkdtl || null == chkdtl.getChkNo() || !ConstantUtil.OPERCHK_CHKTYPE_SHOP.equals(chkdtl.getChkType())) + return new ShopCheckBean(); + TShop tShop = shopDao.getTShopByShopid(Integer.valueOf(chkdtl.getContentId())); + if (null == tShop) return new ShopCheckBean(); //未找到商户 + ShopCheckBean result = new ShopCheckBean(); + if (ConstantUtil.OPERCHK_CHKMODE_MODIFY.equals(chkdtl.getChkMode())) { + TShop shop = new Gson().fromJson(chkdtl.getContent(), TShop.class); //修改后的商户记录 + BeanUtils.copyProperties(shop, result); + //判断哪些字段有修改 + if (result.getFshopid() != tShop.getFshopid().intValue()) result.setOldFshopid(tShop.getFshopid()); + if (!result.getShopname().equals(tShop.getShopname())) result.setOldShopname(tShop.getShopname()); + if (!checkSameString(result.getBusinessLicenseNo(), tShop.getBusinessLicenseNo())) + result.setOldBusinessLicenseNo(tShop.getBusinessLicenseNo()); + if (!checkSameString(result.getTaxRegistrationNo(), tShop.getTaxRegistrationNo())) + result.setOldTaxRegistrationNo(tShop.getTaxRegistrationNo()); + if (!checkSameString(result.getLegalPersonName(), tShop.getLegalPersonName())) + result.setOldLegalPersonName(tShop.getLegalPersonName()); + if (!checkSameString(result.getLegalPersonIdtype(), tShop.getLegalPersonIdtype())) + result.setOldLegalPersonIdtype(tShop.getLegalPersonIdtype()); + if (!checkSameString(result.getLegalPersonIdno(), tShop.getLegalPersonIdno())) + result.setOldLegalPersonIdno(tShop.getLegalPersonIdno()); + if (!checkSameString(result.getContactman(), tShop.getContactman())) + result.setOldContactman(tShop.getContactman()); + if (!checkSameString(result.getMobile(), tShop.getMobile())) result.setOldMobile(tShop.getMobile()); + if (!checkSameString(result.getEmail(), tShop.getEmail())) result.setOldEmail(tShop.getEmail()); + if (!checkSameString(result.getTel(), tShop.getTel())) result.setOldTel(tShop.getTel()); + } else { + BeanUtils.copyProperties(tShop, result); + } + + if (null != result.getFshopid() && result.getFshopid() > 0) { + TShop fshop = shopDao.getTShopByShopid(result.getFshopid()); + result.setFshopname(fshop == null ? "" : fshop.getShopname()); + } + if (null != result.getOldFshopid() && result.getOldFshopid() > 0) { + TShop fshop = shopDao.getTShopByShopid(result.getOldFshopid()); + result.setFshopname(fshop == null ? "" : fshop.getShopname()); + } + if (null != result.getLegalPersonIdtype()) { + TDictionary dict = dictionaryDao.getByDicttypeAndDictval(Dictionary.IDTYPE, result.getLegalPersonIdtype()); + result.setLegalPersonIdtype(dict == null ? "其他" : dict.getDictcaption()); + } + if (null != result.getOldLegalPersonIdtype()) { + TDictionary dict = dictionaryDao.getByDicttypeAndDictval(Dictionary.IDTYPE, result.getOldLegalPersonIdtype()); + result.setOldLegalPersonIdtype(dict == null ? "其他" : dict.getDictcaption()); + } + return result; + } + + @Override + public TOperChkdtl doCheckShopChkdtl(Long chkno, boolean passflag, String chkmsg, TOperator oper) throws Exception { + TOperChkdtl chkdtl = operChkdtlDao.getByChknoForUpdate(chkno); + if (null == chkdtl) { + throw new WebCheckException("审批记录不存在!"); + } else if (!TradeDict.STATUS_UNCHECK.equals(chkdtl.getChkResult())) { + throw new WebCheckException("审批记录已被审核,请重新查询再操作!"); + } else if (!ConstantUtil.OPERCHK_CHKTYPE_SHOP.equals(chkdtl.getChkType())) { + throw new WebCheckException("该记录非商户审批记录,请重新查询再操作!"); + } else if (chkdtl.getInvalidflag()) { + throw new WebCheckException("该审批记录已作废,请重新查询再操作!"); + } + + TShop shop = shopDao.getTShopByShopid(Integer.valueOf(chkdtl.getContentId())); + if (null == shop) { + throw new WebCheckException("业务异常!审批记录指定的商户已被删除!"); + } + if (null != oper) { + chkdtl.setCheckOperid(oper.getOperid()); + chkdtl.setCheckOpername(oper.getOpername()); + } + chkdtl.setChkMsg(StringUtil.isEmpty(chkmsg) ? null : chkmsg.trim()); + chkdtl.setChecktime(systemUtilService.getSysdatetime().getHostdatetime()); + + if (passflag) { + //审核通过 + if (ConstantUtil.OPERCHK_CHKMODE_DELETE.equals(chkdtl.getChkMode())) { + //同意删除申请 + if (ShopTypes.ROOT.value().equals(shop.getShoptype())) { + chkdtl.setChkResult(TradeDict.STATUS_REJECT); //拒绝 + chkdtl.setChkMsg("不能删除根商户节点"); + } else { + if (!TradeDict.STATUS_CLOSED.equals(shop.getStatus())) { + List childShops = shopDao.getChildShopsByShopid(shop.getShopid()); + if (!StringUtil.isEmpty(childShops)) { + chkdtl.setChkResult(TradeDict.STATUS_REJECT); //拒绝 + chkdtl.setChkMsg("该商户下存在正常的下级商户,不满足删除条件!"); + } else { + //可以删除 + chkdtl.setChkResult(TradeDict.STATUS_NORMAL); //通过 + + shop.setStatus(TradeDict.STATUS_CLOSED); + shop.setClosedate(systemUtilService.getSysdatetime().getHostdate()); + shop.setDelOperid(chkdtl.getCreateOperid()); + shopDao.save(shop); + if (!StringUtil.isEmpty(shop.getShopaccno())) { + TShopacc shopacc = shopaccDao.getByShopaccno(shop.getShopaccno()); + if (null == shopacc) throw new WebCheckException("数据异常!对应的商户账户不存在!"); + shopacc.setStatus(TradeDict.STATUS_CLOSED); + shopacc.setClosedate(shop.getClosedate()); + shopaccDao.save(shopacc); + } + } + } + } + + } else if (ConstantUtil.OPERCHK_CHKMODE_ADD.equals(chkdtl.getChkMode())) { + //同意新增 + chkdtl.setChkResult(TradeDict.STATUS_NORMAL); //通过 + + shop.setStatus(TradeDict.STATUS_NORMAL); //状态置为正常 + shop.setAddOperid(chkdtl.getCreateOperid()); + shop.setShopaccno(null); + if (ShopTypes.NORMAL.toString().equals(shop.getShoptype())) { + String shopaccno = String.format("2%09d", shop.getShopid()); + TShopacc shopacc = shopaccDao.getByShopaccno(shopaccno); + if (null != shopacc) { + shopacc.setStatus(shop.getStatus()); + shopacc.setShopname(shop.getShopname()); + shopaccDao.save(shopacc); + } else { + shopacc = new TShopacc(); + shopacc.setShopaccno(shopaccno); + shopacc.setShopid(shop.getShopid()); + shopacc.setShopname(shop.getShopname()); + shopacc.setSubjno(Subject.SUBJNO_MACHANT_INCOME); + shopacc.setStatus(shop.getStatus()); + shopacc.setOpendate(systemUtilService.getSysdatetime().getHostdate()); + shopacc.setBalance(0D); + shopacc.setTenantId(shop.getTenantId()); + shopacc = shopaccDao.save(shopacc); + shopacc.setMac(shopacc.genMAC()); + shopaccDao.save(shopacc); + } + shop.setShopaccno(shopacc.getShopaccno()); + } + shopDao.save(shop); + + } else if (ConstantUtil.OPERCHK_CHKMODE_MODIFY.equals(chkdtl.getChkMode())) { + //同意修改 + chkdtl.setChkResult(TradeDict.STATUS_NORMAL); //通过 + + TShop newShop = new Gson().fromJson(chkdtl.getContent(), TShop.class); + shop.setFshopid(newShop.getFshopid()); + shop.setShopname(newShop.getShopname()); + shop.setBusinessLicenseNo(newShop.getBusinessLicenseNo()); + shop.setTaxRegistrationNo(newShop.getTaxRegistrationNo()); + shop.setAddr(newShop.getAddr()); + shop.setLegalPersonName(newShop.getLegalPersonName()); + shop.setLegalPersonIdtype(newShop.getLegalPersonIdtype()); + shop.setLegalPersonIdno(newShop.getLegalPersonIdno()); + shop.setContactman(newShop.getContactman()); + shop.setMobile(newShop.getMobile()); + shop.setEmail(newShop.getEmail()); + shop.setTel(newShop.getTel()); + shopDao.save(shop); + if (!StringUtil.isEmpty(shop.getShopaccno())) { + shopaccDao.updateShopnameByShopaccno(shop.getShopname(), shop.getShopaccno()); //更新商户名 + } + } else { + //非增删改 + throw new WebCheckException("该审批记录数据错误,非新增、修改、删除操作!"); + } + } else { + //审核驳回 + chkdtl.setChkResult(TradeDict.STATUS_REJECT); + if (TradeDict.STATUS_UNCHECK.equals(shop.getStatus())) { + //新增时改变状态,其他的不变 + shop.setStatus(TradeDict.STATUS_REJECT); + shopDao.save(shop); + } + } + return operChkdtlDao.save(chkdtl); + } + } diff --git a/payapi/src/main/java/com/supwisdom/dlpay/util/ConstantUtil.java b/payapi/src/main/java/com/supwisdom/dlpay/util/ConstantUtil.java index 6862e9d6..873e619d 100644 --- a/payapi/src/main/java/com/supwisdom/dlpay/util/ConstantUtil.java +++ b/payapi/src/main/java/com/supwisdom/dlpay/util/ConstantUtil.java @@ -81,4 +81,12 @@ public class ConstantUtil { public static final String CITIZENCARD_SYSTEM_URL = "dlsmk.cardsystem.url"; //大理市民卡管系统url + /** + * 商户审批 + * */ + public static final String OPERCHK_CHKTYPE_SHOP = "SHOP"; + + public static final String OPERCHK_CHKMODE_ADD = "新增"; + public static final String OPERCHK_CHKMODE_MODIFY = "修改"; + public static final String OPERCHK_CHKMODE_DELETE = "删除"; } diff --git a/payapi/src/main/resources/data.sql b/payapi/src/main/resources/data.sql index d218c43a..32cfd2f0 100644 --- a/payapi/src/main/resources/data.sql +++ b/payapi/src/main/resources/data.sql @@ -50,7 +50,7 @@ VALUES (24, NULL, 1, NULL, '', '/user/point', '积分管理', 3, 19, '{tenantid} INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid) VALUES (22, NULL, 1, NULL, '', '/user/acc', '账户管理', 2, 19, '{tenantid}'); INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid) -VALUES (25, NULL, 1, NULL, '', '/shop/config', '商户支付能力配置', 2, 7, '{tenantid}'); +VALUES (25, NULL, 1, NULL, '', '/shop/config', '商户支付能力配置', 3, 7, '{tenantid}'); INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid) VALUES (26, NULL, 0, NULL, 'layui-icon-tabs', '#', '流水管理', 3, -1, '{tenantid}'); INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid) @@ -71,8 +71,8 @@ INSERT INTO "tb_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon" 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_function" ("id", "createtime", "isleaf", "lastsaved", "menuicon", "menuurl", "name", "ordernum", "parentid", tenantid) +VALUES (36, NULL, 1, NULL, '', '/shop/shopcheck', '商户审批', 2, 7, '{tenantid}'); INSERT INTO "tb_role_function" ("id", "functionid", "roleid", tenantid) VALUES ('ff8080816b7947ed016b7955772c0032', 1, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); @@ -134,6 +134,9 @@ INSERT INTO "tb_role_function" ("id", "functionid", "roleid", tenantid) VALUES ('ff8082816c8468e8016c846d7a570017', 34, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); INSERT INTO "tb_role_function" ("id", "functionid", "roleid", tenantid) VALUES ('ff8083816c8468e8016c846d7a570017', 35, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); +INSERT INTO "tb_role_function" ("id", "functionid", "roleid", tenantid) +VALUES ('ff8080816db87e27016db88be41a0014', 36, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); + INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) VALUES (4, '1', 4, '添加功能', '/function/add', '{tenantid}'); @@ -224,11 +227,11 @@ VALUES (53, '', 23, '删除', '/shop/deleteshop', '{tenantid}'); INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) VALUES (54, '', 21, '添加', '/user/add', '{tenantid}'); INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) -VALUES (56, '', 23, '查询', '/shop/getshopinfo', '{tenantid}'); +VALUES (56, '', 23, '商户详情', '/shop/getshopinfo', '{tenantid}'); INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) -VALUES (57, '', 23, '商户树', '/shop/index', '{tenantid}'); +VALUES (57, '', 23, '查询', '/shop/index', '{tenantid}'); INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) -VALUES (58, '', 23, '新增修改', '/shop/saveorupdate', '{tenantid}'); +VALUES (58, '', 23, '新增跳转', '/shop/load4addshop', '{tenantid}'); INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) VALUES (59, '', 21, '删除', '/user/del', '{tenantid}'); INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) @@ -273,6 +276,20 @@ 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_resource" ("id", "code", "function_id", "name", "uri", tenantid) +VALUES (83, '', 23, '新增商户', '/shop/addshop', '{tenantid}'); +INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) +VALUES (84, '', 23, '修改跳转', '/shop/load4updateshop', '{tenantid}'); +INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) +VALUES (85, '', 23, '修改', '/shop/updateshop', '{tenantid}'); +INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) +VALUES (86, '', 23, '审批意见', '/shop/getshopchk', '{tenantid}'); +INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) +VALUES (87, '', 36, '查询', '/shop/shopcheck', '{tenantid}'); +INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) +VALUES (88, '', 36, '审核跳转', '/shop/opercheck', '{tenantid}'); +INSERT INTO "tb_resource" ("id", "code", "function_id", "name", "uri", tenantid) +VALUES (89, '', 36, '审核', '/shop/docheckshop', '{tenantid}'); INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", tenantid) @@ -413,6 +430,20 @@ 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_permission" ("id", "resid", "role_func_id", "roleid", "tenantid") +VALUES ('402868516daf75de016dafb36670002a', 83, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); +INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid") +VALUES ('ff8080816db54261016db543aad40009', 84, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); +INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid") +VALUES ('402868516daf15d2016daf1fcb290017', 85, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); +INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid") +VALUES ('ff8080816db36bbd016db36ff8580010', 86, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); +INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid") +VALUES ('ff8080816db36bbd016db36ff8580011', 87, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); +INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid") +VALUES ('ff8080816db87e27016db94468da0089', 88, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); +INSERT INTO "tb_permission" ("id", "resid", "role_func_id", "roleid", "tenantid") +VALUES ('ff8080816db87e27016db94468da008a', 89, NULL, 'd1yctWs5+ks0iQN3m9bUvRHus6HbKbrs', '{tenantid}'); INSERT INTO "tb_subject" ("subjid","subjno", "balflag", "displayflag", "endflag", "fsubjno", "opendate", "subjlevel", "subjname", "subjtype", "tenantid") @@ -547,6 +578,8 @@ INSERT INTO "tb_syspara" ("paraid", "displayflag", "editflag", "lastsaved", "par VALUES (3, 'yes', 1, '20190514165658', '默认日累计额度', '元', '200.0', '账户余额支付时默认的日累计额度', 'amount', '{tenantid}'); INSERT INTO "tb_syspara" ("paraid", "displayflag", "editflag", "lastsaved", "paraname", "paraunit", "paraval", "remark", "valuetype", "tenantid") VALUES (4, 'yes', 1, '20190514165658', '手机端用户过期时间', '秒', null, '手机端用户过期时间(秒)', 'decimal', '{tenantid}'); +INSERT INTO "tb_syspara" ("paraid", "displayflag", "editflag", "lastsaved", "paraname", "paraunit", "paraval", "remark", "valuetype", "tenantid") +VALUES (5, 'yes', 1, '20190514165658', '商户信息维护是否需要审核', '', '0', '商户的新增、修改、删除是否需要审核:1-需要;0-不需要', 'switch', '{tenantid}'); INSERT INTO "tb_syspara" ("paraid", "displayflag", "editflag", "lastsaved", "paraname", "paraunit", "paraval", "remark", "valuetype", "tenantid") VALUES (2019, 'yes', 1, '20190514165658', '与卡管系统对接的应用ID', null, null, '与卡管系统对接的app_id', 'string', '{tenantid}'); @@ -559,8 +592,8 @@ VALUES (2021, 'yes', 1, '20190514165658', '与卡管系统对接的业务参数 INSERT INTO "tb_task_lock" ("taskcode", "remark", "taskstatus", "tasktime", "tenantid") VALUES ('DAYENDSETTLETASK', '日终结算', '0', '20190619100600', '{tenantid}'); -INSERT INTO "tb_shop" ("shopid", "shopname", "shoptype", "fshopid", "status", "opendate", "tenantid") -VALUES (1, '支付中心', 'root', 0, 'normal', '20190517', '{tenantid}'); +INSERT INTO "tb_shop" ("shopid", "shopname", "shoptype", "fshopid", "status", "check_status", "opendate", "tenantid") +VALUES (1, '支付中心', 'root', 0, 'normal', 'normal', '20190517', '{tenantid}'); INSERT INTO "tb_transcode" ("transcode_id", "transcode", "transname", "tenantid") VALUES (1, 3010, '市民卡代扣', '{tenantid}'); diff --git a/payapi/src/main/resources/static/custom/module/admin.js b/payapi/src/main/resources/static/custom/module/admin.js index 16942866..e557e6c6 100755 --- a/payapi/src/main/resources/static/custom/module/admin.js +++ b/payapi/src/main/resources/static/custom/module/admin.js @@ -224,7 +224,7 @@ layui.define(['layer'], function (exports) { }, formatDate:function (str) { if (str == null || str == "") { - return; + return ''; } switch (str.length) { case 8: diff --git a/payapi/src/main/resources/static/libs/custom.js b/payapi/src/main/resources/static/libs/custom.js index c2b560aa..d034401d 100644 --- a/payapi/src/main/resources/static/libs/custom.js +++ b/payapi/src/main/resources/static/libs/custom.js @@ -102,4 +102,10 @@ root.dateFormat = function (str) { return str.replace(/^(\d{4})(\d{2})(\d{2})$/, '$1-$2-$3'); //yyyyMMdd --> yyyy-MM-dd } + + root.isempty = function (s) { + if (s == null || s.length == 0) + return true; + return /\s/.test(s); + } }(window)); \ No newline at end of file diff --git a/payapi/src/main/resources/templates/system/shop/addshop.html b/payapi/src/main/resources/templates/system/shop/addshop.html new file mode 100644 index 00000000..1a1bd629 --- /dev/null +++ b/payapi/src/main/resources/templates/system/shop/addshop.html @@ -0,0 +1,329 @@ +
+
+

新增商户

+ + 商户管理 + 新增商户 + +
+
+
+
商户基本信息
+
+ +
+ +
+
+ 注意:商户组无商户账号,且能创建下级商户。结算商户是叶子商户,会创建商户账号。保存后无法修改!!! +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
商户营业信息
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
商户联系人信息
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ + +
+ +
+
+
+
+
+ + \ No newline at end of file diff --git a/payapi/src/main/resources/templates/system/shop/index.html b/payapi/src/main/resources/templates/system/shop/index.html index 78ef8af2..61e7cc7b 100644 --- a/payapi/src/main/resources/templates/system/shop/index.html +++ b/payapi/src/main/resources/templates/system/shop/index.html @@ -13,153 +13,38 @@
商户树(双击商户进行修改)
-
-
    +
    -
    @@ -167,255 +52,203 @@ + + + \ No newline at end of file diff --git a/payapi/src/main/resources/templates/system/shop/opercheck.html b/payapi/src/main/resources/templates/system/shop/opercheck.html new file mode 100644 index 00000000..c9450e75 --- /dev/null +++ b/payapi/src/main/resources/templates/system/shop/opercheck.html @@ -0,0 +1,239 @@ +
    +
    +

    审核商户

    + + 商户审批 + 审核商户 + +
    +
    +
    +
    商户基本信息
    +
    + +
    +
    根节点
    +
    商户组
    +
    结算商户
    +
    +
    + 注意:商户组无商户账号,且能创建下级商户。结算商户是叶子商户,会创建商户账号。保存后无法修改!!! +
    +
    +
    +
    +
    + +
    +
    [[${shop.shopid}]]
    +
    +
    +
    + +
    +
    [[${shop.shopaccno}]]
    +
    +
    +
    +
    +
    + +
    +
    [[${shop.fshopname}]]
    +
    +
    +
    + +
    +
    [[${shop.shopname}]]
    +
    +
    +
    +
    +
    商户营业信息
    +
    +
    + +
    +
    [[${shop.businessLicenseNo}]]
    +
    +
    + +
    + +
    +
    [[${shop.taxRegistrationNo}]]
    +
    +
    + +
    + +
    +
    [[${shop.addr}]]
    +
    +
    + +
    + +
    +
    [[${shop.legalPersonName}]]
    +
    +
    + +
    +
    + +
    +
    [[${shop.legalPersonIdtype}]]
    +
    +
    +
    + +
    +
    [[${shop.legalPersonIdno}]]
    +
    +
    +
    +
    +
    商户联系人信息
    +
    +
    +
    + +
    +
    [[${shop.contactman}]]
    +
    +
    +
    + +
    +
    [[${shop.mobile}]]
    +
    +
    +
    +
    +
    + +
    +
    [[${shop.email}]]
    +
    +
    +
    + +
    +
    [[${shop.tel}]]
    +
    +
    +
    +
    + +
    商户审核
    +
    +
    +
    + +
    +
    [[${operChkdtl.chkNo}]]
    + +
    +
    +
    + +
    +
    [[${operChkdtl.chkMode}]]商户 +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    + + + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/payapi/src/main/resources/templates/system/shop/shopcheck.html b/payapi/src/main/resources/templates/system/shop/shopcheck.html new file mode 100644 index 00000000..270c86a3 --- /dev/null +++ b/payapi/src/main/resources/templates/system/shop/shopcheck.html @@ -0,0 +1,134 @@ +
    +
    +

    商户审批

    + + 商户中心 + 商户审批 + +
    +
    +
    + 搜索: + + + + +
    +
    +
    +
    + + + + + \ No newline at end of file diff --git a/payapi/src/main/resources/templates/system/shop/shopchk.html b/payapi/src/main/resources/templates/system/shop/shopchk.html new file mode 100644 index 00000000..ed8e62dc --- /dev/null +++ b/payapi/src/main/resources/templates/system/shop/shopchk.html @@ -0,0 +1,144 @@ +
    +
    +

    审批意见

    + + 商户管理 + 审批意见 + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/payapi/src/main/resources/templates/system/shop/shopdetail.html b/payapi/src/main/resources/templates/system/shop/shopdetail.html new file mode 100644 index 00000000..148225a7 --- /dev/null +++ b/payapi/src/main/resources/templates/system/shop/shopdetail.html @@ -0,0 +1,209 @@ +
    +
    +

    商户详情

    + + 商户管理 + 商户详情 + +
    +
    +
    +
    商户基本信息
    +
    + +
    + +
    +
    + 注意:商户组无商户账号,且能创建下级商户。结算商户是叶子商户,会创建商户账号。保存后无法修改!!! +
    +
    +
    +
    +
    + +
    +
    [[${shop.shopid}]]
    + +
    +
    +
    + +
    +
    [[${shop.shopaccno}]]
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    [[${shop.shopname}]]
    +
    +
    +
    +
    +
    + +
    +
    待审核
    +
    正 常
    +
    注 销
    +
    驳 回
    +
    +
    +
    +
    +
    商户营业信息
    +
    +
    + +
    +
    [[${shop.businessLicenseNo}]]
    +
    +
    + +
    + +
    +
    [[${shop.taxRegistrationNo}]]
    +
    +
    + +
    + +
    +
    [[${shop.addr}]]
    +
    +
    + +
    + +
    +
    [[${shop.legalPersonName}]]
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    [[${shop.legalPersonIdno}]]
    +
    +
    +
    +
    +
    商户联系人信息
    +
    +
    +
    + +
    +
    [[${shop.contactman}]]
    +
    +
    +
    + +
    +
    [[${shop.mobile}]]
    +
    +
    +
    +
    +
    + +
    +
    [[${shop.email}]]
    +
    +
    +
    + +
    +
    [[${shop.tel}]]
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/payapi/src/main/resources/templates/system/shop/updateshop.html b/payapi/src/main/resources/templates/system/shop/updateshop.html new file mode 100644 index 00000000..da90dc39 --- /dev/null +++ b/payapi/src/main/resources/templates/system/shop/updateshop.html @@ -0,0 +1,333 @@ +
    +
    +

    修改商户

    + + 商户管理 + 修改商户 + +
    +
    +
    +
    商户基本信息
    +
    + +
    + +
    +
    + 注意:商户组无商户账号,且能创建下级商户。结算商户是叶子商户,会创建商户账号。保存后无法修改!!! +
    +
    +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    商户营业信息
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    商户联系人信息
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    + + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/payapi/src/main/resources/templates/system/thirdchk/chkdtl.html b/payapi/src/main/resources/templates/system/thirdchk/chkdtl.html index fbc2b4e1..dba78cb5 100644 --- a/payapi/src/main/resources/templates/system/thirdchk/chkdtl.html +++ b/payapi/src/main/resources/templates/system/thirdchk/chkdtl.html @@ -65,7 +65,7 @@ layui.use(['form', 'table', 'admin'], function () { var form = layui.form; var table = layui.table; - var admin = layui.admin + var admin = layui.admin; form.render("select"); form.render("checkbox"); -- 2.17.1