From 99893846b1990d19933387e3ba6e1d6d6f5bf1de Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 7 Mar 2019 18:13:11 +0800 Subject: [PATCH 01/38] tmp commit --- .../web/RetailValidationController.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java index 5194f557a..b7bda0c8c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java @@ -7,6 +7,8 @@ import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.device.DeviceSupport; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.http.HttpUtils; +import au.com.royalpay.payment.tools.locale.LocaleSupport; +import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.google.code.kaptcha.Producer; @@ -42,6 +44,11 @@ public class RetailValidationController { return deviceSupport.register(devType, registeration); } + @RequestMapping(value = "/devices/{devType}/manage/register", method = RequestMethod.POST) + public JSONObject manageRegister(@RequestBody String registeration, @PathVariable String devType) { + return deviceSupport.register(devType, registeration); + } + @RequestMapping(value = "/sign_in_check", method = RequestMethod.POST) public JSONObject signIn(@RequestBody @Valid RetailLoginInfo loginInfo, Errors errors) { HttpUtils.handleValidErrors(errors); @@ -64,6 +71,31 @@ public class RetailValidationController { return client; } + @RequestMapping(value = "/manage/sign_in_check", method = RequestMethod.POST) + public JSONObject manageSignIn(@RequestBody @Valid RetailLoginInfo loginInfo, Errors errors) { + HttpUtils.handleValidErrors(errors); + String codeValue = signInStatusManager.getVerifyCode(loginInfo.getCaptchaKey()); + if (codeValue == null) { + throw new BadRequestException("Verification code has expired"); + } + if (!codeValue.equals(loginInfo.getVerifyCode())) { + throw new BadRequestException("Verification code is not correct"); + } else { + signInStatusManager.deleteVerifyCodeKey(loginInfo.getCaptchaKey()); + } + String signKey = signInStatusManager.managerSignIn(loginInfo.toLoginInfo()); + JSONObject manager = signInStatusManager.getCurrentManager(signKey); + manager = JSON.parseObject(manager.toJSONString()); + if (!ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { + throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); + } +// if (loginInfo.getDevId() != null) { +// deviceSupport.validDeviceWithClient(manager, loginInfo.getDevId()); +// } + manager.put("sign_key", signKey); + return manager; + } + @RequestMapping(value = "/wechat_app_signin", method = RequestMethod.POST) public JSONObject partnerWechatAppSignIn(@RequestBody JSONObject data) { JSONObject res = signInStatusManager.partnerWechatAppSignIn(data.getString("code")); From 4b2416c8ef44da23908aef63926cc850b6a5fe3f Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 8 Mar 2019 11:49:36 +0800 Subject: [PATCH 02/38] =?UTF-8?q?commit=20=E7=99=BB=E5=BD=95=E3=80=81?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appclient/core/ManageAppService.java | 9 +++++++ .../core/impls/ManageAppServiceImp.java | 21 +++++++++++++++ .../appclient/web/ManageAppController.java | 26 +++++++++++++++++++ .../web/RetailValidationController.java | 5 +++- 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java create mode 100644 src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java create mode 100644 src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java new file mode 100644 index 000000000..05e8b1477 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java @@ -0,0 +1,9 @@ +package au.com.royalpay.payment.manage.appclient.core; + +import com.alibaba.fastjson.JSONObject; + +public interface ManageAppService { + + void updateDevToken(JSONObject device, String devToken); + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java new file mode 100644 index 000000000..b3d1372c1 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -0,0 +1,21 @@ +package au.com.royalpay.payment.manage.appclient.core.impls; + +import au.com.royalpay.payment.manage.appclient.core.ManageAppService; +import au.com.royalpay.payment.tools.device.DeviceSupport; +import au.com.royalpay.payment.tools.device.ManageDeviceSupport; +import com.alibaba.fastjson.JSONObject; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +@Service +public class ManageAppServiceImp implements ManageAppService { + + @Resource + private ManageDeviceSupport manageDeviceSupport; + + @Override + public void updateDevToken(JSONObject device, String devToken) { + manageDeviceSupport.updateDeviceMessageToken(device, devToken); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java new file mode 100644 index 000000000..bd895de5b --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java @@ -0,0 +1,26 @@ +package au.com.royalpay.payment.manage.appclient.web; + +import au.com.royalpay.payment.manage.appclient.core.ManageAppService; +import au.com.royalpay.payment.tools.CommonConsts; +import au.com.royalpay.payment.tools.device.ManageDeviceSupport; +import com.alibaba.fastjson.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +@RestController +@RequestMapping("/api/v1.0/manage/app") +public class ManageAppController { + Logger logger = LoggerFactory.getLogger(getClass()); + + @Resource + private ManageAppService manageAppService; + + @RequestMapping(value = "/token", method = RequestMethod.PUT) + public void updateDevToken(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) { + manageAppService.updateDevToken(device, token.getString("devToken")); + + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java index b7bda0c8c..b4f4bf3e5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java @@ -5,6 +5,7 @@ import au.com.royalpay.payment.manage.appclient.core.RetailAppService; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.device.DeviceSupport; +import au.com.royalpay.payment.tools.device.ManageDeviceSupport; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.locale.LocaleSupport; @@ -37,6 +38,8 @@ public class RetailValidationController { @Resource private DeviceSupport deviceSupport; @Resource + private ManageDeviceSupport manageDeviceSupport; + @Resource private RetailAppService retailAppService; @RequestMapping(value = "/devices/{devType}/register", method = RequestMethod.POST) @@ -46,7 +49,7 @@ public class RetailValidationController { @RequestMapping(value = "/devices/{devType}/manage/register", method = RequestMethod.POST) public JSONObject manageRegister(@RequestBody String registeration, @PathVariable String devType) { - return deviceSupport.register(devType, registeration); + return manageDeviceSupport.register(devType, registeration); } @RequestMapping(value = "/sign_in_check", method = RequestMethod.POST) From cff2f0d16d80d039a2a987c1d9e2dbcb5a2a1996 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 8 Mar 2019 18:02:21 +0800 Subject: [PATCH 03/38] add getReferrerList --- .../manage/appclient/core/ManageAppService.java | 4 ++++ .../appclient/core/impls/ManageAppServiceImp.java | 12 ++++++++++++ .../manage/appclient/web/ManageAppController.java | 7 ++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java index 05e8b1477..c8b001d75 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java @@ -2,8 +2,12 @@ package au.com.royalpay.payment.manage.appclient.core; import com.alibaba.fastjson.JSONObject; +import java.util.List; + public interface ManageAppService { void updateDevToken(JSONObject device, String devToken); + List getReferrerList(JSONObject device); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java index b3d1372c1..7a1cd2098 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -1,21 +1,33 @@ package au.com.royalpay.payment.manage.appclient.core.impls; import au.com.royalpay.payment.manage.appclient.core.ManageAppService; +import au.com.royalpay.payment.manage.mappers.system.OrgMapper; import au.com.royalpay.payment.tools.device.DeviceSupport; import au.com.royalpay.payment.tools.device.ManageDeviceSupport; import com.alibaba.fastjson.JSONObject; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.List; @Service public class ManageAppServiceImp implements ManageAppService { @Resource private ManageDeviceSupport manageDeviceSupport; + @Resource + private OrgMapper orgMapper; @Override public void updateDevToken(JSONObject device, String devToken) { manageDeviceSupport.updateDeviceMessageToken(device, devToken); } + + @Override + public List getReferrerList(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + return orgMapper.listOrgs(1,new PageBounds()); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java index bd895de5b..f4606143d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java @@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.List; @RestController @RequestMapping("/api/v1.0/manage/app") @@ -18,9 +19,13 @@ public class ManageAppController { @Resource private ManageAppService manageAppService; - @RequestMapping(value = "/token", method = RequestMethod.PUT) + @RequestMapping(value = "/token", method = RequestMethod.PUT) public void updateDevToken(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) { manageAppService.updateDevToken(device, token.getString("devToken")); + } + @RequestMapping(value = "/referrer", method = RequestMethod.GET) + public List getReferrerList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) { + return manageAppService.getReferrerList(device); } } From f9b40885618932786646184a45a70874ff7860dd Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 11 Mar 2019 15:19:51 +0800 Subject: [PATCH 04/38] =?UTF-8?q?add=20=E7=99=BB=E5=87=BA=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E3=80=81=E5=95=86=E6=88=B7?= =?UTF-8?q?=E8=BF=9B=E4=BB=B6=E3=80=81=E5=95=86=E6=88=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E5=95=86=E6=88=B7=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appclient/core/ManageAppService.java | 17 ++++ .../core/impls/ManageAppServiceImp.java | 80 +++++++++++++++++++ .../appclient/web/ManageAppController.java | 53 +++++++++++- .../system/ManageDeviceTokenMapper.java | 25 ++++++ .../system/ManageDeviceTokenMapper.xml | 9 +++ 5 files changed, 182 insertions(+), 2 deletions(-) create mode 100644 src/main/java/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.java create mode 100644 src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.xml diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java index c8b001d75..8a32cb867 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java @@ -1,5 +1,8 @@ package au.com.royalpay.payment.manage.appclient.core; +import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; +import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; +import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; import com.alibaba.fastjson.JSONObject; import java.util.List; @@ -8,6 +11,20 @@ public interface ManageAppService { void updateDevToken(JSONObject device, String devToken); + void updateDevTokenStatus(String devId, int status); + + JSONObject getDevTokenByDevId(String dev_id); + + void sign_out(JSONObject device); + + void changeAccountPassword(JSONObject device, ChangePwdBean change, String manager_id); + List getReferrerList(JSONObject device); + JSONObject registerClient(JSONObject device, ClientRegisterInfo registery); + + List listPartners(JSONObject device, PartnerQuery query); + + JSONObject clientDetail(JSONObject device, String clientMoniker); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java index 7a1cd2098..db2c72541 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -1,11 +1,22 @@ package au.com.royalpay.payment.manage.appclient.core.impls; import au.com.royalpay.payment.manage.appclient.core.ManageAppService; +import au.com.royalpay.payment.manage.mappers.system.ManageDeviceTokenMapper; +import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; import au.com.royalpay.payment.manage.mappers.system.OrgMapper; +import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; +import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; +import au.com.royalpay.payment.manage.merchants.core.ClientManager; +import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; +import au.com.royalpay.payment.manage.signin.core.ManagerAccountsService; +import au.com.royalpay.payment.manage.signin.core.SignInAccountService; import au.com.royalpay.payment.tools.device.DeviceSupport; import au.com.royalpay.payment.tools.device.ManageDeviceSupport; +import au.com.royalpay.payment.tools.device.support.DeviceRegister; +import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -18,16 +29,85 @@ public class ManageAppServiceImp implements ManageAppService { private ManageDeviceSupport manageDeviceSupport; @Resource private OrgMapper orgMapper; + @Resource + private ManagerMapper managerMapper; + @Resource + private ClientManager clientManager; + @Resource + private SignInAccountService signInAccountService; + @Resource + private ManageDeviceTokenMapper manageDeviceTokenMapper; + @Override public void updateDevToken(JSONObject device, String devToken) { manageDeviceSupport.updateDeviceMessageToken(device, devToken); } + @Override + public void sign_out(JSONObject device) { + String clientType = device.getString("client_type"); + DeviceRegister register = manageDeviceSupport.findRegister(clientType); + register.manageSignout(device); + } + + @Override + public void changeAccountPassword(JSONObject device, ChangePwdBean change, String manager_id) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + // JSONObject client = signInAccountService.getClient(account_id); + if (!manager_id.equals(device.getString("manager_id"))) { + throw new ForbiddenException("You have no permission"); + } + signInAccountService.changeManagerPassword(device, change); + updateDevTokenStatus(device.getString("dev_id"), 0); + } + @Override public List getReferrerList(JSONObject device) { String clientType = device.getString("client_type"); manageDeviceSupport.findRegister(clientType); return orgMapper.listOrgs(1,new PageBounds()); } + + @Override + public JSONObject registerClient(JSONObject device, ClientRegisterInfo registery) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + return clientManager.registerClient(null, registery, manager); + } + + @Override + public List listPartners(JSONObject device, PartnerQuery query) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + return clientManager.listPartners( manager, query); + } + + @Override + public JSONObject clientDetail(JSONObject device, String clientMoniker) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + return clientManager.clientDetail(manager, clientMoniker); + } + + @Override + public void updateDevTokenStatus(String devId, int status) { + JSONObject devTokenObj = getDevTokenByDevId(devId); + if (devTokenObj != null) { + devTokenObj.put("is_valid", status); + manageDeviceTokenMapper.update(devTokenObj); + } + } + + @Override + @Cacheable(value = ":dev_message_token:", key = "#dev_id") + public JSONObject getDevTokenByDevId(String dev_id) { + return manageDeviceTokenMapper.findByDevId(dev_id); + } + + } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java index f4606143d..350644e4a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java @@ -1,16 +1,26 @@ package au.com.royalpay.payment.manage.appclient.web; import au.com.royalpay.payment.manage.appclient.core.ManageAppService; +import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; +import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; +import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; +import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; import au.com.royalpay.payment.tools.CommonConsts; -import au.com.royalpay.payment.tools.device.ManageDeviceSupport; +import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; +import au.com.royalpay.payment.tools.http.HttpUtils; +import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import com.alibaba.fastjson.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.validation.Errors; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.validation.Valid; import java.util.List; + @RestController @RequestMapping("/api/v1.0/manage/app") public class ManageAppController { @@ -18,14 +28,53 @@ public class ManageAppController { @Resource private ManageAppService manageAppService; + @Resource + private AttachmentClient attachmentClient; @RequestMapping(value = "/token", method = RequestMethod.PUT) public void updateDevToken(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) { manageAppService.updateDevToken(device, token.getString("devToken")); } + @RequestMapping(value = "/sign_out", method = RequestMethod.PUT) + public void signOut(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + manageAppService.sign_out(device); + } + + @RequestMapping(value = "/manager_password/{manager_id}", method = RequestMethod.PUT) + public void changePassword(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @PathVariable String manager_id, + @RequestBody @Valid ChangePwdBean change, Errors errors) { + HttpUtils.handleValidErrors(errors); + manageAppService.changeAccountPassword(device, change, manager_id); + } + @RequestMapping(value = "/referrer", method = RequestMethod.GET) public List getReferrerList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) { - return manageAppService.getReferrerList(device); + return manageAppService.getReferrerList(device); + } + + @RequestMapping(value = "/attachment/files", method = RequestMethod.POST) + public JSONObject uploadImage(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestParam MultipartFile file) throws Exception { + return attachmentClient.uploadFile(file, false); } + + @RequestMapping(value = "/merchant/register", method = RequestMethod.POST) + public JSONObject registerPartner(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody @Valid ClientRegisterInfo registery, + Errors errors){ + HttpUtils.handleValidErrors(errors); + return manageAppService.registerClient(device, registery); + } + + @RequestMapping(value = "/merchants", method = RequestMethod.GET) + public List listPartners(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, PartnerQuery query) { + return manageAppService.listPartners(device, query); + } + + @RequestMapping(value = "/merchant/{clientMoniker}/detail", method = RequestMethod.GET) + public JSONObject getClientByMoniker(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.clientDetail(device, clientMoniker); + } + + + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.java new file mode 100644 index 000000000..7a758ad85 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.java @@ -0,0 +1,25 @@ +package au.com.royalpay.payment.manage.mappers.system; + +import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; +import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; +import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import com.alibaba.fastjson.JSONObject; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * Created by yixian on 2016-09-12. + */ +@AutoMapper(tablename = "sys_manage_devices_token", pkName = "dev_token_id") +public interface ManageDeviceTokenMapper { + + JSONObject findByDevId(@Param("dev_id") String devDevId); + + @AutoSql(type = SqlType.UPDATE) + void update(JSONObject devInfo); + + @AutoSql(type = SqlType.INSERT) + void save(JSONObject devTokenInfo); + +} diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.xml new file mode 100644 index 000000000..df785f3e7 --- /dev/null +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ManageDeviceTokenMapper.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file From b84e75478f97c31c7d28e2507f3f5f3dc7d68f3a Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 11 Mar 2019 16:08:19 +0800 Subject: [PATCH 05/38] fix redis key --- .../manage/appclient/core/impls/ManageAppServiceImp.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java index db2c72541..a7e236816 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -83,7 +83,7 @@ public class ManageAppServiceImp implements ManageAppService { String clientType = device.getString("client_type"); manageDeviceSupport.findRegister(clientType); JSONObject manager = managerMapper.findById(device.getString("manager_id")); - return clientManager.listPartners( manager, query); + return clientManager.listPartners(manager, query); } @Override @@ -104,7 +104,7 @@ public class ManageAppServiceImp implements ManageAppService { } @Override - @Cacheable(value = ":dev_message_token:", key = "#dev_id") + @Cacheable(value = ":manage_dev_message_token:", key = "#dev_id") public JSONObject getDevTokenByDevId(String dev_id) { return manageDeviceTokenMapper.findByDevId(dev_id); } From 7733d8b59d786e78d35079db58586518e5053332 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 11 Mar 2019 17:02:52 +0800 Subject: [PATCH 06/38] commit get version --- .../appclient/core/ManageAppService.java | 2 ++ .../core/impls/ManageAppServiceImp.java | 31 +++++++++++++++++++ .../appclient/web/ManageAppController.java | 5 +++ .../templates/org_commission_info.html | 1 - 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java index 8a32cb867..b3da8834b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java @@ -27,4 +27,6 @@ public interface ManageAppService { JSONObject clientDetail(JSONObject device, String clientMoniker); + JSONObject getNewVersion(JSONObject device); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java index a7e236816..9eefe8d1c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -13,6 +13,7 @@ import au.com.royalpay.payment.manage.signin.core.SignInAccountService; import au.com.royalpay.payment.tools.device.DeviceSupport; import au.com.royalpay.payment.tools.device.ManageDeviceSupport; import au.com.royalpay.payment.tools.device.support.DeviceRegister; +import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; @@ -109,5 +110,35 @@ public class ManageAppServiceImp implements ManageAppService { return manageDeviceTokenMapper.findByDevId(dev_id); } + @Override + public JSONObject getNewVersion(JSONObject device) { + String version = device.getString("version"); + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + String newAppVersion = PlatformEnvironment.getEnv().getNewVersion(clientType); + Boolean isUpdate = PlatformEnvironment.getEnv().isAppUpdate(clientType); + String updateContent = PlatformEnvironment.getEnv().getAppUpdateContent(clientType); + int update_type = 0;// 0:不更新 1:更新 2:强制更新 + String[] oldVersion = version.split("\\."); + String[] newVersion = newAppVersion.split("\\."); + JSONObject res = new JSONObject(); + res.put("update_content", updateContent); + for (int i = 0; i < newVersion.length; i++) { + if (Integer.valueOf(newVersion[i]) > Integer.valueOf(oldVersion[i])) { + update_type = 1; + if (isUpdate) { + update_type = 2; + } + res.put("update_type", update_type); + return res; + } else if (Integer.valueOf(newVersion[i]) < Integer.valueOf(oldVersion[i])) { + res.put("update_type", update_type); + return res; + } + } + res.put("update_type", update_type); + return res; + } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java index 350644e4a..b3166184d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java @@ -75,6 +75,11 @@ public class ManageAppController { return manageAppService.clientDetail(device, clientMoniker); } + @RequestMapping(value = "/version", method = RequestMethod.GET) + public JSONObject getAppVersion(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getNewVersion(device); + } + } diff --git a/src/main/ui/static/config/orgcommission/templates/org_commission_info.html b/src/main/ui/static/config/orgcommission/templates/org_commission_info.html index 166c0790b..2370ed76b 100644 --- a/src/main/ui/static/config/orgcommission/templates/org_commission_info.html +++ b/src/main/ui/static/config/orgcommission/templates/org_commission_info.html @@ -24,7 +24,6 @@

补充说明

    -
  • 退款成功的订单不计入合伙人提成内
  • 当本月有合伙人手续费存在欠款时,无法下载汇款文件
From 4b7dbaaaab90e56a6fda722175c6f6883b7ead1a Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 12 Mar 2019 15:44:56 +0800 Subject: [PATCH 07/38] commit commons --- .../appclient/core/ManageAppService.java | 4 + .../core/impls/ManageAppServiceImp.java | 84 +++++++++++++++++++ .../appclient/web/ManageAppController.java | 11 +++ .../FinancialPartnerCommissionMapper.java | 2 + .../manage/mappers/system/ClientMapper.java | 3 + .../manage/merchants/core/ClientManager.java | 1 + .../FinancialPartnerCommissionMapper.xml | 8 ++ .../manage/mappers/system/ClientMapper.xml | 11 +++ 8 files changed, 124 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java index b3da8834b..acdbe48d8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java @@ -23,10 +23,14 @@ public interface ManageAppService { JSONObject registerClient(JSONObject device, ClientRegisterInfo registery); + void updateClientRegisterInfo(JSONObject device, String clientMoniker, ClientRegisterInfo info); + List listPartners(JSONObject device, PartnerQuery query); JSONObject clientDetail(JSONObject device, String clientMoniker); JSONObject getNewVersion(JSONObject device); + JSONObject getCommons(JSONObject device); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java index 9eefe8d1c..f4f21a3cd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -1,6 +1,10 @@ package au.com.royalpay.payment.manage.appclient.core.impls; import au.com.royalpay.payment.manage.appclient.core.ManageAppService; +import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeLogMapper; +import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeRecordMapper; +import au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ManageDeviceTokenMapper; import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; import au.com.royalpay.payment.manage.mappers.system.OrgMapper; @@ -17,10 +21,14 @@ import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import org.apache.commons.lang3.time.DateFormatUtils; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; import java.util.List; @Service @@ -35,9 +43,17 @@ public class ManageAppServiceImp implements ManageAppService { @Resource private ClientManager clientManager; @Resource + private ClientMapper clientMapper; + @Resource private SignInAccountService signInAccountService; @Resource private ManageDeviceTokenMapper manageDeviceTokenMapper; + @Resource + private FinancialBDPrizeRecordMapper financialBDPrizeRecordMapper; + @Resource + private FinancialBDPrizeLogMapper financialBDPrizeLogMapper; + @Resource + private FinancialPartnerCommissionMapper financialPartnerCommissionMapper; @Override @@ -79,6 +95,14 @@ public class ManageAppServiceImp implements ManageAppService { return clientManager.registerClient(null, registery, manager); } + @Override + public void updateClientRegisterInfo(JSONObject device, String clientMoniker, ClientRegisterInfo info) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + clientManager.updateClientRegisterInfo(manager, clientMoniker, info); + } + @Override public List listPartners(JSONObject device, PartnerQuery query) { String clientType = device.getString("client_type"); @@ -140,5 +164,65 @@ public class ManageAppServiceImp implements ManageAppService { return res; } + @Override + public JSONObject getCommons(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + JSONObject countBdClients = clientMapper.countBdApproveClients(manager.getString("manager_id")); + + if (countBdClients == null) { + countBdClients = new JSONObject(); + countBdClients.put("approving", 0); + countBdClients.put("pass", 0); + countBdClients.put("this_months_pass", 0); + } + JSONObject result; + + switch (manager.getIntValue("org_id")) { + case 1: + result = bdCommons(manager); + break; + default: + result = orgCommons(manager); + break; + } + result.putAll(countBdClients); + return result; + } + private JSONObject bdCommons(JSONObject manager) { + Calendar monthCal = Calendar.getInstance(); + monthCal.setTime(new Date()); + monthCal.set(Calendar.MONTH, (monthCal.get(Calendar.MONTH) - 1)); + Date date = monthCal.getTime(); + JSONObject totalDetail = new JSONObject(); + totalDetail.put("date", DateFormatUtils.format(date, "yyyy-MM")); + totalDetail.put("total_amount", BigDecimal.ZERO); + totalDetail.put("total_prize", BigDecimal.ZERO); + totalDetail.put("total_donation", BigDecimal.ZERO); + totalDetail.put("send_prize", BigDecimal.ZERO); + totalDetail.put("hold_prize", BigDecimal.ZERO); + totalDetail.put("last_punish", BigDecimal.ZERO); + + JSONObject report = financialBDPrizeRecordMapper.getReport(DateFormatUtils.format(date, "yyyy-MM")); + if (report != null) { + totalDetail.putAll(financialBDPrizeLogMapper.findByReportAndBDTotal(report.getString("record_id"), manager.getString("manager_id"))); + } + return totalDetail; + } + + private JSONObject orgCommons(JSONObject manager) { + Calendar monthCal = Calendar.getInstance(); + monthCal.setTime(new Date()); + monthCal.set(Calendar.MONTH, (monthCal.get(Calendar.MONTH) - 1)); + JSONObject total = financialPartnerCommissionMapper.findTotalByOrg(monthCal.get(Calendar.YEAR), monthCal.get(Calendar.MONTH)+1, manager.getString("org_id")); + if (total == null) { + total = new JSONObject(); + total.put("total_amount", BigDecimal.ZERO); + total.put("org_prize", BigDecimal.ZERO); + } + total.put("date", DateFormatUtils.format(monthCal.getTime(), "yyyy-MM")); + return total; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java index b3166184d..28daa8408 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java @@ -65,6 +65,12 @@ public class ManageAppController { return manageAppService.registerClient(device, registery); } + @RequestMapping(value = "/merchant/{clientMoniker}/update", method = RequestMethod.PUT) + public void updatePartnerInfo(@PathVariable String clientMoniker, @RequestBody ClientRegisterInfo info, + @ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + manageAppService.updateClientRegisterInfo(device, clientMoniker, info); + } + @RequestMapping(value = "/merchants", method = RequestMethod.GET) public List listPartners(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, PartnerQuery query) { return manageAppService.listPartners(device, query); @@ -80,6 +86,11 @@ public class ManageAppController { return manageAppService.getNewVersion(device); } + @RequestMapping(value = "/commons", method = RequestMethod.GET) + public JSONObject getCommons(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getCommons(device); + } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java index 2004bb911..350e37486 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java @@ -44,4 +44,6 @@ public interface FinancialPartnerCommissionMapper { PageList getClientExtractRecord(@Param("org_id") int orgId, PageBounds pageBounds); + JSONObject findTotalByOrg(@Param("year") int year, @Param("month") int month, @Param("org_id") String orgId); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index 4e48045ce..63e40acb3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -110,4 +110,7 @@ public interface ClientMapper { List findByrpayNotNull(); + JSONObject countBdApproveClients(@Param("manager_id") String manager_id); + + } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 76e4bf096..259370b90 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -16,6 +16,7 @@ import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import org.apache.ibatis.annotations.Param; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.xml index fbb3c3829..fcbe3278b 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.xml @@ -81,4 +81,12 @@ ORDER BY c.year DESC,c.month DESC + + \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index f4e4a3aa8..520101f71 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -444,4 +444,15 @@ + + \ No newline at end of file From cc46f27ee01dd48a7e1c9baac5f792acfa168a1e Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 13 Mar 2019 18:25:59 +0800 Subject: [PATCH 08/38] =?UTF-8?q?add=20org=20prize=20&&=20bd=20kpi?= =?UTF-8?q?=E3=80=81rates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appclient/core/ManageAppService.java | 6 ++++ .../core/impls/ManageAppServiceImp.java | 31 +++++++++++++++++++ .../appclient/web/ManageAppController.java | 19 ++++++++++-- .../financial/FinancialBDConfigMapper.java | 2 ++ .../FinancialPartnerCommissionMapper.java | 2 ++ .../financial/FinancialBDConfigMapper.xml | 18 +++++++++++ .../FinancialPartnerCommissionMapper.xml | 6 ++++ 7 files changed, 81 insertions(+), 3 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java index acdbe48d8..bcb07f1d4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/ManageAppService.java @@ -33,4 +33,10 @@ public interface ManageAppService { JSONObject getCommons(JSONObject device); + List getOrgPrizeList(JSONObject device); + + List getBdConfigRates(JSONObject device); + + JSONObject getBdConfigKpi(JSONObject device); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java index f4f21a3cd..4fc8f2730 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -1,6 +1,8 @@ package au.com.royalpay.payment.manage.appclient.core.impls; import au.com.royalpay.payment.manage.appclient.core.ManageAppService; +import au.com.royalpay.payment.manage.bdprize.core.BDPrizeService; +import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeLogMapper; import au.com.royalpay.payment.manage.mappers.financial.FinancialBDPrizeRecordMapper; import au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionMapper; @@ -22,6 +24,7 @@ import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import org.apache.commons.lang3.time.DateFormatUtils; +import org.apache.ibatis.annotations.Param; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; @@ -54,6 +57,10 @@ public class ManageAppServiceImp implements ManageAppService { private FinancialBDPrizeLogMapper financialBDPrizeLogMapper; @Resource private FinancialPartnerCommissionMapper financialPartnerCommissionMapper; + @Resource + private BDPrizeService bdPrizeService; + @Resource + private FinancialBDConfigMapper financialBDConfigMapper; @Override @@ -225,4 +232,28 @@ public class ManageAppServiceImp implements ManageAppService { total.put("date", DateFormatUtils.format(monthCal.getTime(), "yyyy-MM")); return total; } + + @Override + public List getOrgPrizeList(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + List getOrgPrizeList = financialPartnerCommissionMapper.getOrgPrizeList(manager.getString("org_id")); + return getOrgPrizeList; + } + + @Override + public List getBdConfigRates(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + return bdPrizeService.getRateConfig(); + } + + @Override + public JSONObject getBdConfigKpi(JSONObject device) { + String clientType = device.getString("client_type"); + manageDeviceSupport.findRegister(clientType); + JSONObject manager = managerMapper.findById(device.getString("manager_id")); + return financialBDConfigMapper.getBDConfigById(manager.getString("manager_id")); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java index 28daa8408..433d4098b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/ManageAppController.java @@ -7,6 +7,7 @@ import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; +import au.com.royalpay.payment.tools.device.manageadvise.AppClientController; import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import com.alibaba.fastjson.JSONObject; @@ -21,7 +22,7 @@ import javax.validation.Valid; import java.util.List; -@RestController +@AppClientController @RequestMapping("/api/v1.0/manage/app") public class ManageAppController { Logger logger = LoggerFactory.getLogger(getClass()); @@ -49,7 +50,7 @@ public class ManageAppController { } @RequestMapping(value = "/referrer", method = RequestMethod.GET) - public List getReferrerList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody JSONObject token) { + public List getReferrerList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { return manageAppService.getReferrerList(device); } @@ -60,7 +61,7 @@ public class ManageAppController { @RequestMapping(value = "/merchant/register", method = RequestMethod.POST) public JSONObject registerPartner(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device, @RequestBody @Valid ClientRegisterInfo registery, - Errors errors){ + Errors errors) { HttpUtils.handleValidErrors(errors); return manageAppService.registerClient(device, registery); } @@ -91,6 +92,18 @@ public class ManageAppController { return manageAppService.getCommons(device); } + @RequestMapping(value = "/org_prize/list", method = RequestMethod.GET) + public List getOrgPrizeList(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getOrgPrizeList(device); + } + @RequestMapping(value = "/bd/rates", method = RequestMethod.GET) + public List getBdConfigRates(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getBdConfigRates(device); + } + @RequestMapping(value = "/bd/kpi", method = RequestMethod.GET) + public JSONObject getBdConfigKpi(@ModelAttribute(CommonConsts.MANAGER_DEVICE) JSONObject device) { + return manageAppService.getBdConfigKpi(device); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java index ff541b62a..8b4c76832 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.java @@ -26,6 +26,8 @@ public interface FinancialBDConfigMapper { List listBDConfig(); + JSONObject getBDConfigById(@Param("manager_id") String manager_id); + List listGroupBds(@Param("bd_group") String bd_group); BigDecimal getGroupAmount(@Param("bd_group") String bd_group, @Param("record_id") String record_id, @Param("channel") String channel); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java index 350e37486..a912023a3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/financial/FinancialPartnerCommissionMapper.java @@ -24,6 +24,8 @@ public interface FinancialPartnerCommissionMapper { @AutoSql(type = SqlType.UPDATE) void update(JSONObject commission); + List getOrgPrizeList(@Param("org_id") String orgId); + List listAvailableMonths(@Param("year") int year); List listWithOrgInfo(@Param("year") int year, @Param("month") int month); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml index 563654312..f403c4064 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/financial/FinancialBDConfigMapper.xml @@ -18,6 +18,24 @@ ]]> + + + SELECT * + FROM financial_partner_commission + WHERE org_id = #{org_id} + ORDER BY `year` DESC,`month` DESC + + + + + -

- eg:Monday-Friday 09:00-20:00,Saturday-Sunday 10:00-22:00

- - -
- -
- -
-
-
- -
- -
-
-
- +
+
- -

eg:https://www.baidu.com

+ +
+

Required + Field

+
-
- - - -
-
Contact Information
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- + ng-class="{'has-error':partnerForm.client_pay_desc.$invalid && partnerForm.client_pay_desc.$dirty}"> +
- -
+ +

+ 例如:线下场景:门店(立牌、POS)、收银系统(选择品牌名称【ipos、银豹、aupos、其他】)、无门店

+

Required Field

Less - Than 50 + Than 200 Characters(including symbols and spaces)

-
- - +
+
-
-
-
+
- +
+
Alipay Information  (Optional) +
+
+
+
+ +
+ +

+ eg:Monday-Friday 09:00-20:00,Saturday-Sunday 10:00-22:00

- -
-

Required - Field

-

Less - Than 20 Characters

+
+
+ +
+
-
- -
-

Less - Than 2 Characters

+
+ +
+
-
- -
-

Required - Field

-

Less - Than 11 Characters

+
+ +
+ +

eg:https://www.baidu.com

-
- -
- +
+
+ +
+
Contact Information
+
+
+
+ +
+ +
+

Required + Field

+

Less + Than 50 + Characters(including symbols and spaces)

+
+
+
+
+ + + +
+
+
+
+ +
+ +
+

Required + Field

+

Less + Than 20 Characters

+
+
+
+ +
+

Less + Than 2 Characters

+
+
+
+ +
+

Required + Field

+

Less + Than 11 Characters

+
+
-
-

Required - Field

-

Less Than 50 - Characters(including symbols and spaces)

+
+ +
+ +
+
+

Required + Field

+

Less Than 50 + Characters(including symbols and spaces)

+
-
- -
-
Address Information
-
-
-
- -
+ +
+
Address Information
+
+
+
+ +
-
-

Less - Than 200 - Characters(including symbols and spaces)

-

Required - Field

+
+

Less + Than 200 + Characters(including symbols and spaces)

+

Required + Field

+
-
-
- -
- -
-

Less - Than 50 - Characters(including symbols and spaces)

-

Required - Field

+
+ +
+ +
+

Less + Than 50 + Characters(including symbols and spaces)

+

Required + Field

+
+ + + + + + + + +
- - - - - - - - -
-
-
- -
- -
-

Less - Than 10 - Characters(including symbols and spaces)

-

Required - Field

+
+ +
+ +
+

Less + Than 10 + Characters(including symbols and spaces)

+

Required + Field

+
-
-
- -
- - - - - - - -
-

Required - Field

-
+
+ +
+ + + + + + + +
+

Required + Field

+
+
-
-
- -
- -
-

Less - Than 20 - Characters(including symbols and spaces)

-

Required - Field

+
+ +
+ +
+

Less + Than 20 + Characters(including symbols and spaces)

+

Required + Field

+
+ + + + + + + + +
- - - - - - - - -
-
-
- -
- +
+ +
+ +
-
-
-
Location - - -
-
-
- +
+
Location + + +
+
+
+ +
-
- +
--> -
-
Industry
-
-
- -
- -
-

Required - Field

+
+
+ Industry +
+
+
+ +
+ +
+

Required + Field

+
-
-
- -
- -
-

Required - Field

+
+ +
+ +
+

Required + Field

+
-
-
- -
- -
-

Required - Field

+
+ +
+ +
+

Required + Field

+
-
-
- -
- -
-

Required - Field

+
+ +
+ +
+

Required + Field

+
-
-
+
-
- -
- +
+ +
+ +
-
-
+
+
@@ -130,16 +134,22 @@
- - + +
-
- 制作临时合同 +
- - + +
@@ -235,7 +251,8 @@
  • Partner Accounts
  • -
  • +
  • Subpartners
  • @@ -257,7 +274,8 @@ Settlement
  • -
  • +
  • Surcharge Account
  • @@ -298,7 +316,8 @@ ) - (已禁用) + (已禁用)

    @@ -307,7 +326,8 @@

    -

    注意:(微信渠道可能不合规)

    @@ -318,7 +338,8 @@

    -

    注意:(微信渠道可能不合规)

    @@ -333,13 +354,14 @@
    -
    -

    -

    - 注意:(微信渠道可能不合规) -

    -
    +
    +

    +

    + 注意:(微信渠道可能不合规) +

    +
    @@ -348,7 +370,8 @@

    -

    注意:(微信渠道可能不合规)

    @@ -399,7 +422,7 @@
    2:  @@ -470,7 +493,8 @@ End Date BD Name Proportion - Operation + + Operation @@ -501,9 +525,568 @@
    +
    +
    Merchant Payment Scenario
    +
    +
    +
    + +
    +

    +

    +
    +
    + +
    +

    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    Alipay Information  (Optional) +
    +
    +
    +
    + +
    + +

    + eg:Monday-Friday 09:00-20:00,Saturday-Sunday 10:00-22:00

    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +

    eg:https://www.baidu.com

    +
    +
    +
    +
    +
    + +
    +
    Contact Information
    +
    +
    +
    + +
    + +
    +

    Required + Field

    +

    Less + Than 50 + Characters(including symbols and spaces)

    +
    +
    +
    +
    + + + +
    +
    +
    +
    + +
    + +
    +

    Required + Field

    +

    Less + Than 20 Characters

    +
    +
    +
    + +
    +

    Less + Than 2 Characters

    +
    +
    +
    + +
    +

    Required + Field

    +

    Less + Than 11 Characters

    +
    +
    +
    +
    + +
    + +
    +
    +

    Required + Field

    +

    Less Than 50 + Characters(including symbols and spaces)

    +
    +
    +
    +
    +
    + +
    +
    Address Information
    +
    +
    +
    + +
    + +
    +

    Less + Than 200 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    +
    +
    +
    + +
    + +
    +

    Less + Than 50 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    + + + + + + + + + +
    +
    +
    + +
    + +
    +

    Less + Than 10 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    +
    +
    +
    + +
    + + + + + + + +
    +

    Required + Field

    +
    + +
    +
    +
    + +
    + +
    +

    Less + Than 20 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    + + + + + + + + + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    Location + + +
    +
    +
    + +
    +
    +
    + + + +
    +
    + Industry +
    +
    +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + + +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + +
    + +
    + +
    +

    Required + Field

    +
    +
    + +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    -
    Alipay Information  (Optional)
    +
    Alipay Information  (Optional) +
    @@ -561,13 +1144,16 @@

    - Resend Email - - + +

    @@ -751,7 +1337,7 @@
    -

    +

    {{partner.alipayindustry|partner_alipay_industry}}    ({{partner.alipayindustry}})

    @@ -763,7 +1349,7 @@
    -

    +

    {{partner.hfindustry| partner_hf_industry}}    ({{partner.hfindustry}})

    diff --git a/src/main/ui/static/payment/partner/templates/partner_edit.html b/src/main/ui/static/payment/partner/templates/partner_edit.html index c9dd152d5..f5525f892 100644 --- a/src/main/ui/static/payment/partner/templates/partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/partner_edit.html @@ -362,6 +362,596 @@
    +
    +
    Merchant Payment Scenario
    +
    +
    +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    +
    + +
    + +

    + 例如:线下场景:门店(立牌、POS)、收银系统(选择品牌名称【ipos、银豹、aupos、其他】)、无门店

    +
    +

    Required + Field

    +

    Less + Than 200 + Characters(including symbols and spaces)

    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    Alipay Information  (Optional)
    +
    +
    +
    + +
    + +

    + eg:Monday-Friday 09:00-20:00,Saturday-Sunday 10:00-22:00

    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +

    eg:https://www.baidu.com

    +
    +
    +
    +
    +
    + +
    +
    Contact Information
    +
    +
    +
    + +
    + +
    +

    Required + Field

    +

    Less + Than 50 + Characters(including symbols and spaces)

    +
    +
    +
    +
    + + + +
    +
    +
    +
    + +
    + +
    +

    Required + Field

    +

    Less + Than 20 Characters

    +
    +
    +
    + +
    +

    Less + Than 2 Characters

    +
    +
    +
    + +
    +

    Required + Field

    +

    Less + Than 11 Characters

    +
    +
    +
    +
    + +
    + +
    +
    +

    Required + Field

    +

    Less Than 50 + Characters(including symbols and spaces)

    +
    +
    +
    +
    +
    + +
    +
    Address Information
    +
    +
    +
    + +
    + +
    +

    Less + Than 200 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    +
    +
    +
    + +
    + +
    +

    Less + Than 50 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    + + + + + + + + + +
    +
    +
    + +
    + +
    +

    Less + Than 10 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    +
    +
    +
    + +
    + + + + + + + +
    +

    Required + Field

    +
    + +
    +
    +
    + +
    + +
    +

    Less + Than 20 + Characters(including symbols and spaces)

    +

    Required + Field

    +
    + + + + + + + + + +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    Location + + +
    +
    +
    + +
    +
    +
    + + + +
    +
    + Industry +
    +
    +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + + +
    + +
    + +
    +

    Required + Field

    +
    +
    +
    + +
    + +
    + +
    +

    Required + Field

    +
    +
    + +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    Alipay Information   (Optional)
    From f80f532c018cb74af83c353a476142621dc70c11 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 26 Mar 2019 15:29:53 +0800 Subject: [PATCH 21/38] fix --- .../core/impls/ManageAppServiceImp.java | 2 -- .../templates/app/bd_prize_rules.html | 7 +++--- .../bdprize/templates/bd_prize_root.html | 22 +++++++++---------- .../templates/client_partner_detail.html | 21 ++++++++++++++++++ 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java index 2d9c56cf0..4ed05b032 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -363,7 +363,6 @@ public class ManageAppServiceImp implements ManageAppService { @Override public List getBdPrizeList(JSONObject device) { - //todo 获取BD提成列表 String clientType = device.getString("client_type"); manageDeviceSupport.findRegister(clientType); JSONObject manager = managerMapper.findById(device.getString("manager_id")); @@ -376,7 +375,6 @@ public class ManageAppServiceImp implements ManageAppService { @Override public String getPrizeRulesUrl(JSONObject device) { - //todo 获取BD提成列表 String clientType = device.getString("client_type"); manageDeviceSupport.findRegister(clientType); JSONObject manager = managerMapper.findById(device.getString("manager_id")); diff --git a/src/main/resources/templates/app/bd_prize_rules.html b/src/main/resources/templates/app/bd_prize_rules.html index 31e8d1270..7885015b4 100755 --- a/src/main/resources/templates/app/bd_prize_rules.html +++ b/src/main/resources/templates/app/bd_prize_rules.html @@ -41,7 +41,6 @@
    -
    提成规则

    BD分级提成费率速查表

    @@ -79,9 +78,9 @@

    补充说明

    • 按月度发放
    • -
    • 每月发放总提成额度的 80%,剩余 20%按照“年度考评分数比例”于每年年底即 12 月 25 日圣诞前发放
    • -
    • 提前离职者,20%提成不予发放
    • -
    • 年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放 20%的占比部分,扣下部分如果第二年考评超出一定评分 110%可以补发;同样,如果年度考评分数超过 100 分按照同比例发放
    • +
    • 每月发放总提成额度的60%,剩余40%按照“年度考评分数比例”于每年年底即12 月25 日圣诞前发放
    • +
    • 提前离职者,40%提成不予发放
    • +
    • 年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放40%的占比部分,扣下部分如果第二年考评超出一定评分110%可以补发;同样,如果年度考评分数超过100 分按照同比例发放
    • 商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配
    • 连续 2 个月不产生流水的商户,由销管部统一收回,重新分配
    • 分配后的商户流水客户专员只能占一半
    • diff --git a/src/main/ui/static/config/bdprize/templates/bd_prize_root.html b/src/main/ui/static/config/bdprize/templates/bd_prize_root.html index 9603ee070..dc4b7f769 100644 --- a/src/main/ui/static/config/bdprize/templates/bd_prize_root.html +++ b/src/main/ui/static/config/bdprize/templates/bd_prize_root.html @@ -12,14 +12,14 @@
      -
      - -
      - + + + + + + + + @@ -153,9 +153,9 @@

      补充说明

      • 按月度发放
      • -
      • 每月发放总提成额度的 80%,剩余 20%按照“年度考评分数比例”于每年年底即 12 月 25 日圣诞前发放
      • -
      • 提前离职者,20%提成不予发放
      • -
      • 年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放 20%的占比部分,扣下部分如果第二年考评超出一定评分 110%可以补发;同样,如果年度考评分数超过 100 分按照同比例发放
      • +
      • 每月发放总提成额度的60%,剩余40%按照“年度考评分数比例”于每年年底即12 月25 日圣诞前发放
      • +
      • 提前离职者,40%提成不予发放
      • +
      • 年度考评(根据销管中心每月考评表打分制进行统计)按照考评分数对应比例发放40%的占比部分,扣下部分如果第二年考评超出一定评分110%可以补发;同样,如果年度考评分数超过100 分按照同比例发放
      • 商户开通后连续 1 个月未产生流水的,上交主管,由主管重新分配
      • 连续 2 个月不产生流水的商户,由销管部统一收回,重新分配
      • 分配后的商户流水客户专员只能占一半
      • diff --git a/src/main/ui/static/payment/partner/templates/client_partner_detail.html b/src/main/ui/static/payment/partner/templates/client_partner_detail.html index 315dd19b2..0e1ccad1a 100644 --- a/src/main/ui/static/payment/partner/templates/client_partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/client_partner_detail.html @@ -176,6 +176,27 @@
      +
      +
      Merchant Payment Scenario
      +
      +
      +
      + +
      +

      +

      +
      +
      + +
      +

      +
      +
      +
      +
      +
      Alipay Information   (Optional)
      From a9b363fddfc9e975474722a8a914a2faee579f40 Mon Sep 17 00:00:00 2001 From: lujian Date: Tue, 26 Mar 2019 17:07:21 +0800 Subject: [PATCH 22/38] =?UTF-8?q?Inspiry=E8=AE=BE=E5=A4=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 ++ .../mappers/system/ClientDeviceMapper.java | 5 +- .../manage/merchants/core/ClientManager.java | 1 + .../core/impls/ClientManagerImpl.java | 29 +++++++++- .../web/PartnerManageController.java | 8 +++ .../static/payment/partner/partner-manage.js | 53 ++++++++++++++++- src/main/ui/static/payment/partner/partner.js | 16 +++++- .../payment/partner/templates/add_device.html | 57 +++++++++++++++++++ .../partner/templates/partner_devices.html | 5 +- 9 files changed, 168 insertions(+), 10 deletions(-) create mode 100644 src/main/ui/static/payment/partner/templates/add_device.html diff --git a/pom.xml b/pom.xml index b775c503d..5b0475543 100644 --- a/pom.xml +++ b/pom.xml @@ -53,6 +53,10 @@ jpinyin 1.1.7 + + com.globalfreepay.payment + payment-core + au.com.royalpay.payment diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java index 401a3a36c..80f9f8225 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceMapper.java @@ -28,7 +28,10 @@ public interface ClientDeviceMapper { @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findByClientDevId(@Param("client_dev_id") String clientDevId, @Param("client_type") String clientType); + JSONObject findByClientDevIdAndClientType(@Param("client_dev_id") String clientDevId, @Param("client_type") String clientType); + + @AutoSql(type = SqlType.SELECT) + JSONObject findByClientDevId(@Param("client_dev_id") String clientDevId); PageList listClientDevices(JSONObject params, PageBounds pagination); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 4e8151f6b..40177c321 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -407,4 +407,5 @@ public interface ClientManager { void partnerCBChannelConfig(String clientMoniker, String channelKey, String channel_id); + void addDevice(JSONObject manager, String clientMoniker, JSONObject device); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 202a7b2bc..187ff26dd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -2072,6 +2072,30 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return PageListUtils.buildPageListResult(devices); } + @Override + public void addDevice(JSONObject manager, String clientMoniker,JSONObject device) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + checkOrgPermission(manager, client); + + String clientDevId = device.getString("client_dev_id"); + JSONObject dev = clientDeviceMapper.findByClientDevId(clientDevId); + if(dev == null){ + throw new NotFoundException("设备不存在"); + } + if (dev.getIntValue("client_id") != client.getIntValue("client_id")) { + if(dev.getIntValue("is_valid") == 1){ + throw new BadRequestException("其他商户正在使用"); + } + } + device.put("dev_id",dev.getString("dev_id")); + device.put("client_id",client.getIntValue("client_id")); + device.put("remark",dev.getString("remark")); + clientDeviceMapper.update(device); + } + @Override public void updateDevie(JSONObject manager, String clientMoniker, String devId, String remark) { JSONObject client = getClientInfoByMoniker(clientMoniker); @@ -3812,8 +3836,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayRetailMerchant(); - //Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client); - Element resultElement = null; + Element resultElement = alipayClient.registerGmsPortal(mch.getPid(), client); if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { throw new BadRequestException(resultElement.elementText("error")); } @@ -4027,7 +4050,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid yeepayConfig.put("industry",merchantInfo.getString("industry")); yeepayConfig.put("business_content",merchantInfo.getString("business_content")); yeepayConfig.put("business_licence",merchantInfo.getString("business_licence")); - //yeePayClientConfigMapper.update(yeepayConfig); + yeePayClientConfigMapper.update(yeepayConfig); yeepayConfig.put("company_website",merchantInfo.getString("company_website")); yeepayConfig.put("abn",merchantInfo.getString("abn")); yeepayConfig.put("company_name",merchantInfo.getString("company_name")); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 14065bb90..97487d462 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -446,6 +446,7 @@ public class PartnerManageController { clientManager.registerClient(clientMoniker, registery, manager); } + //商户设备管理 获取商户设备信息 @ManagerMapping(value = "/{clientMoniker}/devices", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.DIRECTOR}) public JSONObject listClientDevices(@PathVariable String clientMoniker, @RequestParam(required = false) String remark, @RequestParam(required = false) String client_type, @RequestParam(required = false) String[] client_ids, @@ -454,6 +455,13 @@ public class PartnerManageController { return clientManager.listClientDevices(manager, clientMoniker, remark, page, limit,client_type,client_ids); } + //给商户新增设备 + @ManagerMapping(value = "/{clientMoniker}/addDevices", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) + public void addDevice(@PathVariable String clientMoniker, @RequestBody JSONObject device, + @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.addDevice(manager, clientMoniker,device); + } + @ManagerMapping(value = "/{clientMoniker}/devices/{devId}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) public void modifyDevice(@PathVariable String clientMoniker, @PathVariable String devId, @RequestBody JSONObject remark, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index b4fd7c576..99d039abb 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -2818,8 +2818,13 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) } }]); - app.controller('partnerDeviceCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder', function ($scope, $http, orderService, commonDialog, refunder) { - $scope.pagination = {}; + app.controller('partnerDeviceCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder','$uibModal', function ($scope,$http, orderService, commonDialog, refunder,$uibModal) { + + $scope.pagination = {}; + /** + * 查看设备 + * @param page + */ $scope.listDevices = function (page) { var params = angular.copy($scope.devsearch) || {}; params.page = page || $scope.pagination.page || 1; @@ -2829,6 +2834,24 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }; $scope.listDevices(1); + + /** + * 添加设备 + */ + $scope.addDevices = function () { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/add_device.html', + controller: 'newDeviceDialogCtrl', + resolve: { + clientMoniker: function () { + return $scope.partner.client_moniker; + } + } + }).result.then(function () { + $scope.listDevices(); + }) + }; + $scope.showDeviceOrders = function (dev) { $scope.params.dev_id = dev.dev_id; $scope.listOrders(1); @@ -2964,6 +2987,32 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } } }]); + + app.controller('newDeviceDialogCtrl', ['$scope', '$http', 'clientMoniker', function ($scope, $http,clientMoniker) { + $scope.params = {}; + $scope.manager = {}; + + $scope.save = function (form) { + $scope.errmsg = null; + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + } + + $http.post('/sys/partners/' + clientMoniker + '/addDevices', $scope.device).then(function () { + $scope.$close(); + }, function (resp) { + $scope.errmsg = resp.data.message; + }) + }; + + }]); + + app.controller('partnerChooseBDUserDialogCtrl', ['$scope', '$http', '$filter', 'partner', 'bdUsers', 'type', function ($scope, $http, $filter, partner, bdUsers, type) { $scope.bdUsers = bdUsers.data; $scope.data = {}; diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index 2ab7c022a..dfcf180fb 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -2,9 +2,9 @@ * partner info in partner client * Created by yixian on 2016-07-03. */ -define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], function (angular, Decimal) { +define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBootstrap'], function (angular, Decimal) { 'use strict'; - var app = angular.module('partnerInfoApp', ['ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload']); + var app = angular.module('partnerInfoApp', ['ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload','ui.bootstrap']); app.config(['$stateProvider', function ($stateProvider) { $stateProvider.state('basic', { url: '/basic', @@ -969,9 +969,13 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct }; $scope.loadSubPartners(); }]); - app.controller('clientDeviceCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder','$filter', function ($scope, $http, orderService, commonDialog, refunder,$filter) { + app.controller('clientDeviceCtrl','newDive','newDeviceDialogCtrl', ['$scope', '$http', 'orderService', 'commonDialog', 'refunder','$filter', '$uibModal', function ($scope, $http, orderService, commonDialog, refunder,$filter,$uibModal) { $scope.pagination = {}; $scope.params = {}; + /** + * 查询设备 + * @param page + */ $scope.listDevices = function (page) { var params = angular.copy($scope.devsearch) || {}; params.page = page || $scope.pagination.page || 1; @@ -981,6 +985,8 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct }) }; $scope.listDevices(1); + + $scope.showDeviceOrders = function (dev) { $scope.params.dev_id = dev.dev_id; $scope.listOrders(1); @@ -1067,6 +1073,10 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct $scope.refundOrder = function (order) { refunder.refunded(order.order_id) }; + + + + }]); return app; }); diff --git a/src/main/ui/static/payment/partner/templates/add_device.html b/src/main/ui/static/payment/partner/templates/add_device.html new file mode 100644 index 000000000..a86ab0240 --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/add_device.html @@ -0,0 +1,57 @@ + + + \ No newline at end of file diff --git a/src/main/ui/static/payment/partner/templates/partner_devices.html b/src/main/ui/static/payment/partner/templates/partner_devices.html index 5f9a774a9..fc28c9ce9 100644 --- a/src/main/ui/static/payment/partner/templates/partner_devices.html +++ b/src/main/ui/static/payment/partner/templates/partner_devices.html @@ -3,11 +3,14 @@
      - +
      +
      From dc87e9b82e5182b7bce9d0ef685f08ef613475c3 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 27 Mar 2019 14:42:57 +0800 Subject: [PATCH 23/38] =?UTF-8?q?add=20=E9=A3=8E=E6=8E=A7=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E4=BA=8B=E4=BB=B6=E5=A2=9E=E5=8A=A0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/impl/RiskBusinessServiceImpl.java | 54 +++++ .../templates/mail/risk_upload_mail.html | 11 +- src/main/ui/static/analysis/risk_business.js | 189 ++++++++++++------ .../analysis/templates/new_riskEvent.html | 26 +++ .../analysis/templates/riskEvent_detail.html | 36 ++++ 5 files changed, 248 insertions(+), 68 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java index c1f94f227..49aae675f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java @@ -787,6 +787,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo ctx.setVariable("warning_order_type", event.getIntValue("warning_order_type")); ctx.setVariable("description", event.getString("description")); ctx.setVariable("is_send_client",event.getIntValue("is_send_client")); + ctx.setVariable("mail_template",event.get("mail_template")==null?0:event.getIntValue("mail_template")); String realOrderIdsStr = event.getString("real_order_ids"); String[] realOrderIds = {}; if (StringUtils.isNotBlank(realOrderIdsStr)) { @@ -1202,6 +1203,21 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo "Other pictures" ); } + if (riskEvent.get("mail_template") != null) { + switch (riskEvent.getIntValue("mail_template")) { + case 1: + materialsRemark = getShopTemplate(); + break; + case 2: + materialsRemark = getTicketTemplate(); + break; + case 3: + materialsRemark = getStudyTemplate(); + break; + default: + break; + } + } JSONObject material = getRiskMaterial(riskEvent); for (int i = 0; i < materialsRemark.size(); i++) { @@ -1279,4 +1295,42 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo } } } + + private List getShopTemplate() { + return Arrays.asList("1.与调查交易金额对应的购物小票/发票存根照片 要求:照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称、购物金额等;\n" + + "Photos of shopping receipts/ invoice stubs Requirement corresponding with the investigated orders Requirement: The photos should be clear and must show Merchant name, Business address, Transaction time, Product information, Quantity purchased, etc;", + "2.购买物品如邮寄至国内,需提供物流公司发货单据,并提供对应物流公司的查询网址;澳洲本地销售则不需要提供物流单据 要求:每笔交易对应的物流单必须提供,且单据必须清晰可见;\n" + + "Photos of logistics companies’goods-delivery documents if trading across borders with Logistics company inquiry website for verifying; no need for local sales Requirement: The logistics order record corresponding to each transaction must be provided, and details of records should be clearly visible;", + "3.线上用户购买虚拟物品需要提供聊天记录、订单信息、发货凭证截图、 虚拟物品最终消费场景(例如何种游戏、软件)、提供消费场景网址/下载链接(公司官网、公众号等) 要求:每笔交易对应的截图必须清晰可见;\n" + + "Users need to provide chat records, order information, screenshots of delivery documents, final consumption scenarios of virtual goods (such as games, software); provide consumer scene URL / download link(official website/official accounts/other official platforms). Requirement: The screenshot corresponding to each transaction must be clearly visible;", + "4.商户线下门店提供显示商户门牌号码和店头名称的照片;显示商户营业场景所场内部情况(如店内商品陈列、收银台等)的照片 要求:照片清晰,外景至少一张,内景能清楚显示商户实际售卖物品或服务,至少三张Photos of Merchant Street number & Merchant name;\n" + + "Photos of internal environment of merchant business (such as in-store merchandise display, checkout counter, etc.) Requirements: At least one visible photo of store location; The photos (at least three) showing merchant activities including actual selling-goods or services obviously;", + "5.其它补充材料包含调单任务描述中要求提供的商户后台入驻材料等;商户的经营业务模式说明:介绍售卖的主要物品种类或是提供的服务内容、客单价均值、营业时间等);\n" + + "Other materials including onboarding materials as task description required;Explanation of business model for your merchant including actual selling-goods or services, per customer transaction, business hours, etc;" + ); + } + + private List getTicketTemplate() { + return Arrays.asList("1.与调查交易金额对应的购物小票/发票存根照片 要求:照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称、购物金额等;\n" + + "Photos of shopping receipts/ invoice stubs Requirement corresponding with the investigated orders Requirement: The photos should be clear and must show Merchant name, Business address, Transaction time, Product information, Quantity purchased, etc;", + "2.与调查交易相对应的客户旅游行程明细(包含行程单、机票、酒店预订信息等),线上用户购买行程/机票等的聊天记录、订单信息、购买凭证截图、提供消费场景网址/下载链接(公司官网、公众号等) 要求:每笔交易对应的截图必须清晰可见;\n" + + "Users need to provide travel itinerary, hotel reservation Information and journey times of customers about the orders, provide records of investigated orders, provide consumer scene URL / download link(official website/official accounts/other official platforms). Requirement: The screenshot corresponding to each transaction must be clearly visible;", + "3.商户线下门店提供显示商户门牌号码和店头名称的照片(清晰可见,至少一张);显示商户营业场景所场内部情况(如店内商品陈列、收银台等)的照片(照片清晰,且能清楚显示商户实际售卖物品或服务,至少三张 );\n" + + "Photos of Merchant Street number & Merchant name; Photos of internal environment of merchant business (such as in-store merchandise display, checkout counter, etc.) Requirements: At least one visible photo of store location; The photos (at least three) showing merchant activities including actual selling-goods or services obviously;", + "4.其它补充材料包含调单任务描述中要求提供的商户后台入驻材料等;商户的经营业务模式说明:介绍售卖的主要物品种类或是提供的服务内容、客单价均值、营业时间等);\n" + + "Other materials including onboarding materials as task description required;Explanation of business model for your merchant including actual selling-goods or services, per customer transaction, business hours, etc;" + ); + } + + private List getStudyTemplate() { + return Arrays.asList("1.与调查交易金额对应的购物小票/发票存根照片 要求:照片应清晰,必须显示商户名称、商户地址、购物时间、物品名称、购物金额等;\n" + + "Photos of shopping receipts/ invoice stubs Requirement corresponding with the investigated orders Requirement: The photos should be clear and must show Merchant name, Business address, Transaction time, Product information, Quantity purchased, etc;", + "2.与调查交易相对应的客户支付购买的课程明细、教育服务(签证、咨询等)明细,单价,数量,具体购买服务内容,线上用户购买的聊天记录、购买凭证截图、提供消费场景网址/下载链接(公司官网、公众号等) 要求:每笔交易对应的截图必须清晰可见;\n" + + "Users need to provide the details of purchased courses/education services(visa services/consulting/others) including price, quantity, service details, chat records online, order information, screenshots of system ordered details; provide consumer scene URL / download link(official website/official accounts/other official platforms). Requirement: The screenshot corresponding to each transaction must be clearly visible;", + "3.商户线下门店提供显示商户门牌号码和店头名称的照片(清晰可见,至少一张);显示商户营业场景所场内部情况(如店内商品陈列、收银台等)的照片(照片清晰,且能清楚显示商户实际售卖物品或服务,至少三张 );\n" + + "Photos of Merchant Street number & Merchant name; Photos of internal environment of merchant business (such as in-store merchandise display, checkout counter, etc.) Requirements: At least one visible photo of store location; The photos (at least three) showing merchant activities including actual selling-goods or services obviously;", + "4.其它补充材料包含调单任务描述中要求提供的商户后台入驻材料等;商户的经营业务模式说明:介绍售卖的主要物品种类或是提供的服务内容、客单价均值、营业时间等);\n" + + "Other materials including onboarding materials as task description required;Explanation of business model for your merchant including actual selling-goods or services, per customer transaction, business hours, etc;" + ); + } } diff --git a/src/main/resources/templates/mail/risk_upload_mail.html b/src/main/resources/templates/mail/risk_upload_mail.html index 155293c49..9fb8b01fa 100644 --- a/src/main/resources/templates/mail/risk_upload_mail.html +++ b/src/main/resources/templates/mail/risk_upload_mail.html @@ -23,8 +23,15 @@ before (Sydney time).

      -

      1、请提供以下被查单号的小票, 物流单据(如有邮寄产品的情况), 以及消费者与买家的聊天记录等来佐证被查交易单号。 被查交易单号如下:

      -

      1. Please submit the materials including invoices, courier receipts (if have posted products), and chatting records or scene of consumption which can prove the facticity of the following reviewed orders. The reviewed orders as follows:

      +

      1、请提供以下被查单号的小票, 物流单据(如有邮寄产品的情况), 以及消费者与买家的聊天记录等来佐证被查交易单号。 被查交易单号如下:

      +

      1. Please submit the materials including invoices, courier receipts (if have posted products), and chatting records or scene of consumption which can prove the facticity of the following reviewed orders. The reviewed orders as follows:

      +

      1、请提供以下被查单号的交易相关发票,对应的物流单据(如有邮寄产品的情况), 以及体现消费场景的聊天截图等来佐证被查交易单号。 被查交易单号如下:

      +

      1. Please submit the materials including invoices, courier receipts (if have posted products), and chatting records or scene of consumption which can prove the facticity of the following reviewed orders. The reviewed orders as follows:

      +

      1、请提供以下被查单号的交易相关票据,对应消费项目的行程单、机票、酒店预定凭证等, 以及体现消费场景的聊天截图等来佐证被查交易单号。 被查交易单号如下:

      +

      1. Please submit the materials including invoices, courier receipts (if have posted products), and chatting records or scene of consumption which can prove the facticity of the following reviewed orders. The reviewed orders as follows:

      +

      1、请提供以下被查单号的交易相关票据,详细购买的具体课程、服务、咨询明细, 以及体现消费场景的聊天截图等来佐证被查交易单号。 被查交易单号如下:

      +

      1. Please submit the materials including invoices, courier receipts (if have posted products), and chatting records or scene of consumption which can prove the facticity of the following reviewed orders. The reviewed orders as follows:

      + diff --git a/src/main/ui/static/analysis/risk_business.js b/src/main/ui/static/analysis/risk_business.js index 1aad32af1..8e3c51f49 100644 --- a/src/main/ui/static/analysis/risk_business.js +++ b/src/main/ui/static/analysis/risk_business.js @@ -4,6 +4,14 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], function (angular, $) { 'use strict'; + + var mailTemplate = { + "1": "代购、综合商城类", + "2": "飞机票、旅行社类", + "3": "教育类、中介类" + }; + + var orderTypesMap = { "1": "微信调单", "2": "支付宝调单", @@ -129,7 +137,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }]); - app.controller('riskBusinessCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', 'commonDialog', 'industryMap','chartParser', + app.controller('riskBusinessCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', 'commonDialog', 'industryMap', 'chartParser', function ($scope, $state, $http, $uibModal, $filter, commonDialog, industryMap, chartParser) { $scope.orderTypes = orderTypesMap; $scope.orderTypesForBD = orderTypesMapForBD; @@ -165,11 +173,11 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }); $http.get('/risk/business/events/analysis/industry', {params: params}).then(function (resp) { $scope.riskEventsByIndustry = resp.data; - $scope.risk_industry_chart = chartParser.parse(industryAmount(industries),$scope.riskEventsByIndustry); + $scope.risk_industry_chart = chartParser.parse(industryAmount(industries), $scope.riskEventsByIndustry); }); $http.get('/risk/business/events/analysis/amount', {params: params}).then(function (resp) { $scope.riskEventsByAmount = resp.data; - $scope.risk_amount_chart = chartParser.parse(intervalsAmount(),$scope.riskEventsByAmount); + $scope.risk_amount_chart = chartParser.parse(intervalsAmount(), $scope.riskEventsByAmount); }); }; @@ -193,15 +201,15 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], name: '风控事件单量', type: 'pie', radius: '80%', center: ['50%', '58%'], - label:{ //饼图图形上的文本标签 - normal:{ - show:true, - position:'outer', //标签的位置 - textStyle : { - fontWeight : 300 , - fontSize : 16 //文字的字体大小 + label: { //饼图图形上的文本标签 + normal: { + show: true, + position: 'outer', //标签的位置 + textStyle: { + fontWeight: 300, + fontSize: 16 //文字的字体大小 }, - formatter:'{d}%' + formatter: '{d}%' } }, itemStyle: { @@ -228,8 +236,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], legend: { orient: 'vertical', left: 'right', - data: [ '0-500','500-1000','1000-1500','1500-2000','2000-2500','2500-3000','3000-3500','3500-4000','4000-4500','4500-5000','5000-5500','5500-6000', - '6000-6500','6500-7000','7000-7500','7500-8000','8000-8500','8500-9000','>9000'] + data: ['0-500', '500-1000', '1000-1500', '1500-2000', '2000-2500', '2500-3000', '3000-3500', '3500-4000', '4000-4500', '4500-5000', '5000-5500', '5500-6000', + '6000-6500', '6500-7000', '7000-7500', '7500-8000', '8000-8500', '8500-9000', '>9000'] } }, series: [{ @@ -237,15 +245,15 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], name: '风控事件单量', type: 'pie', radius: '80%', center: ['50%', '58%'], - label:{ //饼图图形上的文本标签 - normal:{ - show:true, - position:'outer', //标签的位置 - textStyle : { - fontWeight : 300 , - fontSize : 16 //文字的字体大小 + label: { //饼图图形上的文本标签 + normal: { + show: true, + position: 'outer', //标签的位置 + textStyle: { + fontWeight: 300, + fontSize: 16 //文字的字体大小 }, - formatter:'{d}%' + formatter: '{d}%' } }, itemStyle: { @@ -269,12 +277,32 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], function ($scope, $state, $http, $uibModal, $filter, Upload, commonDialog, riskEvent, orderService) { $scope.orderTypes = orderTypesMap; + $scope.mailTemplate = mailTemplate; $scope.resultTypes = resultTypesMap; $scope.channelResults = channelResultArray; if (riskEvent.data.is_send_client == 1) riskEvent.data.is_send_client = true; $scope.riskEvent = riskEvent.data; + $scope.checkTemplate = function () { + var url = ""; + switch ($scope.riskEvent.mail_template) { + case "1": + url = "https://file.royalpay.com.au/open/2019/03/27/1553658222567_BzfAtsEgsBdMQLl3jGOAlfcYmFUL1F.png"; + break; + case "2": + url = "https://file.royalpay.com.au/open/2019/03/27/1553658193577_ddF4FAQYBaMx2oCEUlD2f2NtW3SxYD.png"; + break; + case "3": + url = "https://file.royalpay.com.au/open/2019/03/27/1553658238130_VJPI3RNmyKtcOgsV8w8yswUsYMFvGs.png\n"; + break; + default: + break; + } + window.open(url, '_blank'); + }; + + $http.get('/risk/business/process/logs/' + $scope.riskEvent.risk_id).then(function (resp) { $scope.riskEvent.process_logs = resp.data; }); @@ -300,7 +328,11 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }).then(function () { $http.delete('/risk/business/ban/' + $scope.riskEvent.risk_id).then(function () { $state.go('analysis_monitoring.risk_business'); - commonDialog.alert({title: 'Delete', content: 'Risk Event Already Disabled', type: 'error'}); + commonDialog.alert({ + title: 'Delete', + content: 'Risk Event Already Disabled', + type: 'error' + }); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) @@ -344,7 +376,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], // 控制编辑表格的显示 $scope.editFlag = false; - $scope.changeEditFlag = function(editFlag) { + $scope.changeEditFlag = function (editFlag) { $scope.editFlag = !editFlag; // 如果是在编辑状态,需要将日期转换为date类型(前端控件需要) // 如果是在非编辑状态,需要将日期转换为yyyy-MM-dd格式 @@ -357,7 +389,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], } }; - $scope.save = function(form) { + $scope.save = function (form) { if (form.$invalid) { angular.forEach(form, function (item, key) { if (key.indexOf('$') < 0) { @@ -416,7 +448,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }; // 关停商户 - $scope.updateClient = function(isValid, temporaryFlag) { + $scope.updateClient = function (isValid, temporaryFlag) { $scope.riskEvent.temporary_close_merchant = temporaryFlag; commonDialog.confirm({ title: 'Warning', @@ -453,8 +485,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }; // 以下为BD上传材料相关 - $scope.material={}; - $scope.uploadFile = function(files, index) { + $scope.material = {}; + $scope.uploadFile = function (files, index) { if (files && files.length) { var urls = new Array(); var value = 0; @@ -470,8 +502,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], delete $scope.allMaterialInfo.material[index].fileProgressValue; alert('Upload Failed'); }, function (evt) { - value += parseInt(100 * evt.loaded / evt.total ); - $scope.allMaterialInfo.material[index].fileProgressValue = value/(files.length*2); + value += parseInt(100 * evt.loaded / evt.total); + $scope.allMaterialInfo.material[index].fileProgressValue = value / (files.length * 2); }) } $scope.allMaterialInfo.material[index].uploadFile = urls; @@ -480,7 +512,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], $scope.submit = function (form) { var codeKey = $scope.riskEvent.submit_url.substring($scope.riskEvent.submit_url.lastIndexOf('=') + 1) || $scope.riskEvent.submit_url.substring($scope.riskEvent.submit_url.lastIndexOf('/') + 1); - $scope.material.update_time=$filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss'); + $scope.material.update_time = $filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss'); $scope.material.risk_id = $scope.riskEvent.risk_id; for (var i = 0; i < $scope.allMaterialInfo.material.length; i++) { var key = 'file' + (i + 1) + "_url"; @@ -504,12 +536,12 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }; // 加载提交材料 - $scope.loadRiskMaterial = function() { + $scope.loadRiskMaterial = function () { // $http.get('/risk/business/' + $scope.riskEvent.risk_id + '/material').then(function(resp) { // $scope.material = resp.data; // }); - $http.get('/risk/business/' + $scope.riskEvent.risk_id + '/all_material_info').then(function(resp) { + $http.get('/risk/business/' + $scope.riskEvent.risk_id + '/all_material_info').then(function (resp) { $scope.allMaterialInfo = resp.data; if ($scope.uploadShowFlag) { $scope.allMaterialInfo.description = ''; @@ -534,7 +566,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], // 加载提交材料 // $scope.fileObject = {}; - $scope.loadRiskMaterial = function() { + $scope.loadRiskMaterial = function () { // $http.get('/risk/business/' + $scope.riskEvent.risk_id + '/material').then(function(resp) { // $scope.riskMaterial = resp.data; // $scope.file1 = resp.data.file1; @@ -552,7 +584,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], // // $scope.fileLength = Object.keys($scope.fileObject).length; // }) - $http.get('/risk/business/' + $scope.riskEvent.risk_id + '/all_material_info').then(function(resp) { + $http.get('/risk/business/' + $scope.riskEvent.risk_id + '/all_material_info').then(function (resp) { $scope.riskMaterial = resp.data; }); }; @@ -562,7 +594,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], $scope.uploadShowFlag = ($scope.riskEvent.result_type == 1 || $scope.riskEvent.result_type == 3 || $scope.riskEvent.result_type == 4) ? true : false; // 材料上传 - $scope.uploadFile = function(files, index) { + $scope.uploadFile = function (files, index) { if (files && files.length) { var urls = new Array(); var value = 0; @@ -579,8 +611,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], delete $scope.riskMaterial.material[index].fileProgressValue; alert('Upload Failed'); }, function (evt) { - value += parseInt(100 * evt.loaded / evt.total ); - $scope.riskMaterial.material[index].fileProgressValue = value/(files.length*2); + value += parseInt(100 * evt.loaded / evt.total); + $scope.riskMaterial.material[index].fileProgressValue = value / (files.length * 2); }) } $scope.riskMaterial.material[index].file = urls; @@ -592,7 +624,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], if (index < 0) index = $scope.riskEvent.submit_url.lastIndexOf('/'); var codeKey = $scope.riskEvent.submit_url.substring(index + 1); - $scope.material.update_time=$filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss'); + $scope.material.update_time = $filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss'); $scope.material.risk_id = $scope.riskEvent.risk_id; for (var i = 0; i < $scope.riskMaterial.material.length; i++) { var key = 'file' + (i + 1) + "_url"; @@ -616,7 +648,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }; // 材料审核 - $scope.auditMaterial = function(auditType) { + $scope.auditMaterial = function (auditType) { var url = '/risk/business/events/pass'; var warningMessageHTML = '是否确定通过该材料?'; @@ -665,31 +697,50 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], $scope.receive_email_date = new Date(); $scope.today = new Date(); $scope.orderTypes = orderTypesMap; + $scope.mailTemplate = mailTemplate; $scope.royapayOrderTypes = royalpayOrderTypesMap; $scope.warningOrderTypes = warningOrderTypesMap; $scope.materials = [{key: 0, value: ""}]; $scope.canMinus = false; $scope.riskEvent = {}; - $scope.increase = function($index) { + $scope.checkTemplate = function () { + var url = ""; + switch ($scope.riskEvent.mail_template) { + case "1": + url = "https://file.royalpay.com.au/open/2019/03/27/1553658222567_BzfAtsEgsBdMQLl3jGOAlfcYmFUL1F.png"; + break; + case "2": + url = "https://file.royalpay.com.au/open/2019/03/27/1553658193577_ddF4FAQYBaMx2oCEUlD2f2NtW3SxYD.png"; + break; + case "3": + url = "https://file.royalpay.com.au/open/2019/03/27/1553658238130_VJPI3RNmyKtcOgsV8w8yswUsYMFvGs.png\n"; + break; + default: + break; + } + window.open(url, '_blank'); + }; + + $scope.increase = function ($index) { $scope.materials.splice($index + 1, 0, - {key: new Date().getTime(), value: ""}); // 用时间戳作为每个item的key - // 增加新的input后允许删除 + {key: new Date().getTime(), value: ""}); // 用时间戳作为每个item的key + // 增加新的input后允许删除 $scope.canMinus = true; }; - $scope.decrease = function($index) { + $scope.decrease = function ($index) { // 如果input大于1,删除 - if ($scope.materials.length > 1) { - $scope.materials.splice($index, 1); - } - // 如果回复数为1,不允许删除 - if ($scope.materials.length == 1) { - $scope.canMinus = false; - } + if ($scope.materials.length > 1) { + $scope.materials.splice($index, 1); + } + // 如果回复数为1,不允许删除 + if ($scope.materials.length == 1) { + $scope.canMinus = false; + } }; - var array=new Array(); + var array = new Array(); var validIndex = 0; - $scope.combineMaterials = function() { + $scope.combineMaterials = function () { for (var i = 0; i < $scope.materials.length; i++) { var value = $scope.materials[i].value; if (value == '') @@ -705,10 +756,10 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }; $scope.is_send_client = false; - $scope.changeIsSendClient = function(flag) { + $scope.changeIsSendClient = function (flag) { $scope.is_send_client = flag }; - $scope.save = function(form) { + $scope.save = function (form) { if (form.$invalid) { angular.forEach(form, function (item, key) { if (key.indexOf('$') < 0) { @@ -746,7 +797,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], content: 'Register new riskEvent successfully', type: 'success' }); - $state.go('^',{}, {reload: true}); + $state.go('^', {}, {reload: true}); }, function (resp) { saveRiskBtn.innerHTML = saveRiskBtnInnerHtmlBak; saveRiskBtn.disabled = false; @@ -758,7 +809,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], }); }; $scope.partnerParam = {}; - $scope.loadParnters = function() { + $scope.loadParnters = function () { $scope.partnerParam.sub_merchant_id = $scope.riskEvent.sub_merchant_id; $http.get('/risk/business/partners', {params: $scope.partnerParam}).then(function (resp) { $scope.partners = resp.data; @@ -793,34 +844,40 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], ]); // 调单类型过滤器 - app.filter('orderType', function() { - return function(type) { + app.filter('orderType', function () { + return function (type) { return orderTypesMap[type]; } }); - app.filter('royalPayOrderType', function() { - return function(type) { + app.filter('templateType', function () { + return function (type) { + return mailTemplate[type]; + } + }); + + app.filter('royalPayOrderType', function () { + return function (type) { return royalpayOrderTypesMap[type]; } }); - app.filter('warningOrderType', function() { - return function(type) { + app.filter('warningOrderType', function () { + return function (type) { return warningOrderTypesMap[type]; } }); // 处理结果过滤器 - app.filter('resultType', function() { - return function(type, resultTypesMap) { + app.filter('resultType', function () { + return function (type, resultTypesMap) { return resultTypesMap[type]; } }); // 邮件发送状态过滤器 - app.filter('emailStatus', function() { - return function(status) { + app.filter('emailStatus', function () { + return function (status) { return emailStatusMap[status]; } }); diff --git a/src/main/ui/static/analysis/templates/new_riskEvent.html b/src/main/ui/static/analysis/templates/new_riskEvent.html index b678c4570..f0a64110f 100644 --- a/src/main/ui/static/analysis/templates/new_riskEvent.html +++ b/src/main/ui/static/analysis/templates/new_riskEvent.html @@ -230,6 +230,32 @@ +
      + +
      + +
      +

      required field +

      +
      +
      +
      + +
      +
      +
      diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail.html b/src/main/ui/static/analysis/templates/riskEvent_detail.html index 5c33d0ef6..ecbb960cc 100644 --- a/src/main/ui/static/analysis/templates/riskEvent_detail.html +++ b/src/main/ui/static/analysis/templates/riskEvent_detail.html @@ -156,6 +156,15 @@
      +
      + +
      +

      +

      +
      +
      +
      @@ -524,6 +533,33 @@
      +
      + +
      + +
      +

      required field +

      +
      +
      +
      + +
      +
      + +
      From e25bbbbc530e1551d2b2321cc53e5cbac48c32ee Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 27 Mar 2019 15:27:06 +0800 Subject: [PATCH 24/38] fix --- src/main/ui/static/analysis/templates/riskEvent_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail.html b/src/main/ui/static/analysis/templates/riskEvent_detail.html index ecbb960cc..b87da2879 100644 --- a/src/main/ui/static/analysis/templates/riskEvent_detail.html +++ b/src/main/ui/static/analysis/templates/riskEvent_detail.html @@ -541,7 +541,7 @@
      -
      +

      client_dev_id field is required

      + ng-class="{'has-error':deviceForm.auth_code.$invalid && deviceForm.auth_code.$dirty}"> -
      +

      设备密钥 field is required

      -
      - - -
      -

      设备类型 field is required

      -
      +
      + +
      + ng-class="{'has-error':deviceForm.version.$invalid && deviceForm.version.$dirty}"> -
      +

      version field is required

      - - +
      + + +
      +
      +