diff --git a/src/main/java/cn/com/tenlion/systemcard/controller/api/shopcertification/ShopCertificationController.java b/src/main/java/cn/com/tenlion/systemcard/controller/api/shopcertification/ShopCertificationController.java index e134d28..f11726c 100644 --- a/src/main/java/cn/com/tenlion/systemcard/controller/api/shopcertification/ShopCertificationController.java +++ b/src/main/java/cn/com/tenlion/systemcard/controller/api/shopcertification/ShopCertificationController.java @@ -21,12 +21,12 @@ import java.util.Map; /** * @ClassName: ShopCertificationController - * @Description: 店铺认证 + * @Description: 企业认证 * @Author: CodeFactory * @Date: 2021-04-07 17:47:38 * @Version: 3.0 **/ -@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "店铺认证接口") +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "企业认证接口") @RestController @RequestMapping(ISystemConstant.API_PREFIX + "/shopcertification") public class ShopCertificationController extends DefaultBaseController { @@ -34,9 +34,9 @@ public class ShopCertificationController extends DefaultBaseController { @Autowired private IShopCertificationService shopCertificationService; - @ApiOperation(value = "修改店铺认证状态", notes = "修改店铺认证接口") + @ApiOperation(value = "修改企业认证状态", notes = "修改企业认证接口") @ApiImplicitParams({ - @ApiImplicitParam(name = "shopCertificationId", value = "店铺认证ID", paramType = "path") + @ApiImplicitParam(name = "shopCertificationId", value = "企业认证ID", paramType = "path") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PutMapping("updateAuditStatus/{shopCertificationId}/{auditStatus}") @@ -45,7 +45,7 @@ public class ShopCertificationController extends DefaultBaseController { return new SuccessResult(); } - @ApiOperation(value = "新增店铺认证", notes = "新增店铺认证接口") + @ApiOperation(value = "新增企业认证", notes = "新增企业认证接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("save") @CheckRequestBodyAnnotation @@ -54,7 +54,7 @@ public class ShopCertificationController extends DefaultBaseController { return new SuccessResult(); } - @ApiOperation(value = "删除店铺认证", notes = "删除店铺认证接口") + @ApiOperation(value = "删除企业认证", notes = "删除企业认证接口") @ApiImplicitParams({ @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") }) @@ -65,9 +65,9 @@ public class ShopCertificationController extends DefaultBaseController { return new SuccessResult(); } - @ApiOperation(value = "修改店铺认证", notes = "修改店铺认证接口") + @ApiOperation(value = "修改企业认证", notes = "修改企业认证接口") @ApiImplicitParams({ - @ApiImplicitParam(name = "shopCertificationId", value = "店铺认证ID", paramType = "path") + @ApiImplicitParam(name = "shopCertificationId", value = "企业认证ID", paramType = "path") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PutMapping("update/{shopCertificationId}") @@ -77,9 +77,9 @@ public class ShopCertificationController extends DefaultBaseController { return new SuccessResult(); } - @ApiOperation(value = "店铺认证详情", notes = "店铺认证详情接口") + @ApiOperation(value = "企业认证详情", notes = "企业认证详情接口") @ApiImplicitParams({ - @ApiImplicitParam(name = "shopCertificationId", value = "店铺认证ID", paramType = "path") + @ApiImplicitParam(name = "shopCertificationId", value = "企业认证ID", paramType = "path") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("get/{shopCertificationId}") @@ -87,7 +87,7 @@ public class ShopCertificationController extends DefaultBaseController { return shopCertificationService.get(shopCertificationId); } - @ApiOperation(value = "店铺认证列表", notes = "店铺认证列表接口") + @ApiOperation(value = "企业认证列表", notes = "企业认证列表接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("list") public List list() { @@ -95,7 +95,7 @@ public class ShopCertificationController extends DefaultBaseController { return shopCertificationService.list(params); } - @ApiOperation(value = "店铺认证分页列表", notes = "店铺认证分页列表接口") + @ApiOperation(value = "企业认证分页列表", notes = "企业认证分页列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), @@ -111,7 +111,7 @@ public class ShopCertificationController extends DefaultBaseController { return shopCertificationService.listPage(page); } - @ApiOperation(value = "店铺认证统计", notes = "店铺认证统计接口") + @ApiOperation(value = "企业认证统计", notes = "企业认证统计接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("count") SuccessResultData count() { diff --git a/src/main/java/cn/com/tenlion/systemcard/controller/app/api/accountwithdraw/AccountWithdrawAppController.java b/src/main/java/cn/com/tenlion/systemcard/controller/app/api/accountwithdraw/AccountWithdrawAppController.java index 0d3485d..5d7cc7f 100644 --- a/src/main/java/cn/com/tenlion/systemcard/controller/app/api/accountwithdraw/AccountWithdrawAppController.java +++ b/src/main/java/cn/com/tenlion/systemcard/controller/app/api/accountwithdraw/AccountWithdrawAppController.java @@ -2,8 +2,12 @@ package cn.com.tenlion.systemcard.controller.app.api.accountwithdraw; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.common.component.SecurityComponent; +import ink.wgink.exceptions.SearchException; import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.app.AppTokenUser; +import ink.wgink.pojo.bos.UserInfoBO; import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResultData; @@ -12,6 +16,7 @@ import cn.com.tenlion.systemcard.pojo.dtos.accountwithdraw.AccountWithdrawDTO; import cn.com.tenlion.systemcard.pojo.vos.accountwithdraw.AccountWithdrawVO; import cn.com.tenlion.systemcard.service.accountwithdraw.IAccountWithdrawService; import io.swagger.annotations.*; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -32,6 +37,21 @@ public class AccountWithdrawAppController extends DefaultBaseController { @Autowired private IAccountWithdrawService accountWithdrawService; + @Autowired + protected SecurityComponent securityComponent; + + private String getUserId(String token) throws Exception { + String userId = "notUserId"; + if (StringUtils.isBlank(token)) { + UserInfoBO userInfoBO = securityComponent.getCurrentUser(); + userId = userInfoBO.getUserId(); + } else { + AppTokenUser appTokenUser = securityComponent.getAppTokenUser(token); + userId = appTokenUser.getId(); + } + return userId; + } + @ApiOperation(value = "新增CBC账户提现表", notes = "新增CBC账户提现表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header") @@ -55,8 +75,10 @@ public class AccountWithdrawAppController extends DefaultBaseController { }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpage") - public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) { + public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) throws Exception { Map params = requestParams(); + String userId = getUserId(token); + params.put("accountWithdrawUserId", userId);// 申请人ID page.setParams(params); return accountWithdrawService.listPage(page); } diff --git a/src/main/java/cn/com/tenlion/systemcard/controller/app/api/cardtemplatescans/CardTemplateScansAppController.java b/src/main/java/cn/com/tenlion/systemcard/controller/app/api/cardtemplatescans/CardTemplateScansAppController.java index c510424..1c14fc8 100644 --- a/src/main/java/cn/com/tenlion/systemcard/controller/app/api/cardtemplatescans/CardTemplateScansAppController.java +++ b/src/main/java/cn/com/tenlion/systemcard/controller/app/api/cardtemplatescans/CardTemplateScansAppController.java @@ -8,6 +8,8 @@ import ink.wgink.common.component.SecurityComponent; import ink.wgink.exceptions.SearchException; import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.app.AppTokenUser; +import ink.wgink.pojo.bos.UserInfoBO; import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResultData; @@ -42,6 +44,18 @@ public class CardTemplateScansAppController extends DefaultBaseController { @Autowired protected SecurityComponent securityComponent; + private String getUserId(String token) throws Exception { + String userId = "notUserId"; + if (StringUtils.isBlank(token)) { + UserInfoBO userInfoBO = securityComponent.getCurrentUser(); + userId = userInfoBO.getUserId(); + } else { + AppTokenUser appTokenUser = securityComponent.getAppTokenUser(token); + userId = appTokenUser.getId(); + } + return userId; + } + @ApiOperation(value = "保存查看记录", notes = "保存查看记录接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header") @@ -95,14 +109,9 @@ public class CardTemplateScansAppController extends DefaultBaseController { }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpage/{type}") - public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page, @PathVariable("type") String type) { + public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page, @PathVariable("type") String type) throws Exception { Map params = requestParams(); - String userId = ""; - try { - userId = securityComponent.getAppTokenUser(token).getId(); - }catch(Exception e) { - throw new SearchException("没有登陆信息"); - } + String userId = getUserId(token); if("1".equals(type)) { // 我看过谁 params.put("creator", userId); diff --git a/src/main/java/cn/com/tenlion/systemcard/controller/app/api/shopcertification/ShopCertificationAppController.java b/src/main/java/cn/com/tenlion/systemcard/controller/app/api/shopcertification/ShopCertificationAppController.java index f5239a2..14dd58c 100644 --- a/src/main/java/cn/com/tenlion/systemcard/controller/app/api/shopcertification/ShopCertificationAppController.java +++ b/src/main/java/cn/com/tenlion/systemcard/controller/app/api/shopcertification/ShopCertificationAppController.java @@ -28,12 +28,12 @@ import java.util.Map; /** * @ClassName: ShopCertificationAppController - * @Description: 店铺认证 + * @Description: 企业认证 * @Author: CodeFactory * @Date: 2021-04-07 17:47:38 * @Version: 3.0 **/ -@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "店铺认证接口") +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "企业认证接口") @RestController @RequestMapping(ISystemConstant.APP_PREFIX + "/shopcertification") public class ShopCertificationAppController extends DefaultBaseController { @@ -63,19 +63,19 @@ public class ShopCertificationAppController extends DefaultBaseController { return OCRBusinessLicenseUtil.businessLicenseFile(filePO.getFilePath()); } - @ApiOperation(value = "新增店铺认证", notes = "新增店铺认证接口") + @ApiOperation(value = "新增企业认证", notes = "新增企业认证接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("save") @CheckRequestBodyAnnotation - public SuccessResult save(@RequestHeader("token") String token, @RequestBody ShopCertificationVO shopCertificationVO) { + public synchronized SuccessResult save(@RequestHeader("token") String token, @RequestBody ShopCertificationVO shopCertificationVO) { shopCertificationService.save(token, shopCertificationVO); return new SuccessResult(); } - @ApiOperation(value = "删除店铺认证(id列表)", notes = "删除店铺认证(id列表)接口") + @ApiOperation(value = "删除企业认证(id列表)", notes = "删除企业认证(id列表)接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") @@ -87,23 +87,23 @@ public class ShopCertificationAppController extends DefaultBaseController { return new SuccessResult(); } - @ApiOperation(value = "修改店铺认证", notes = "修改店铺认证接口") + @ApiOperation(value = "修改企业认证", notes = "修改企业认证接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header"), - @ApiImplicitParam(name = "shopCertificationId", value = "店铺认证ID", paramType = "path") + @ApiImplicitParam(name = "shopCertificationId", value = "企业认证ID", paramType = "path") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @PutMapping("updateshopcertification/{shopCertificationId}") + @PutMapping("update/{shopCertificationId}") @CheckRequestBodyAnnotation public SuccessResult updateShopCertification(@RequestHeader("token") String token, @PathVariable("shopCertificationId") String shopCertificationId, @RequestBody ShopCertificationVO shopCertificationVO) { shopCertificationService.update(token, shopCertificationId, shopCertificationVO); return new SuccessResult(); } - @ApiOperation(value = "店铺认证详情(通过ID)", notes = "店铺认证详情(通过ID)接口") + @ApiOperation(value = "企业认证详情(通过ID)", notes = "企业认证详情(通过ID)接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header"), - @ApiImplicitParam(name = "shopCertificationId", value = "店铺认证ID", paramType = "path") + @ApiImplicitParam(name = "shopCertificationId", value = "企业认证ID", paramType = "path") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("get/{shopCertificationId}") @@ -111,7 +111,7 @@ public class ShopCertificationAppController extends DefaultBaseController { return shopCertificationService.get(shopCertificationId); } - @ApiOperation(value = "店铺认证列表", notes = "店铺认证列表接口") + @ApiOperation(value = "企业认证列表", notes = "企业认证列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header") }) @@ -122,7 +122,7 @@ public class ShopCertificationAppController extends DefaultBaseController { return shopCertificationService.list(params); } - @ApiOperation(value = "店铺认证分页列表", notes = "店铺认证分页列表接口") + @ApiOperation(value = "企业认证分页列表", notes = "企业认证分页列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header"), @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), @@ -132,14 +132,14 @@ public class ShopCertificationAppController extends DefaultBaseController { @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @GetMapping("listpageshopcertification") + @GetMapping("listpage") public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) { Map params = requestParams(); page.setParams(params); return shopCertificationService.listPage(page); } - @ApiOperation(value = "店铺认证统计", notes = "店铺认证统计接口") + @ApiOperation(value = "企业认证统计", notes = "企业认证统计接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("count") SuccessResultData count() { diff --git a/src/main/java/cn/com/tenlion/systemcard/controller/route/cardconsole/CardConsoleRouteController.java b/src/main/java/cn/com/tenlion/systemcard/controller/route/cardconsole/CardConsoleRouteController.java index e959a4c..9067aca 100644 --- a/src/main/java/cn/com/tenlion/systemcard/controller/route/cardconsole/CardConsoleRouteController.java +++ b/src/main/java/cn/com/tenlion/systemcard/controller/route/cardconsole/CardConsoleRouteController.java @@ -1,6 +1,7 @@ package cn.com.tenlion.systemcard.controller.route.cardconsole; import cn.com.tenlion.projectconfig.util.ProjectConfigUtil; +import cn.com.tenlion.systemcard.socket.CardLogSocket; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.properties.ServerProperties; @@ -30,6 +31,7 @@ public class CardConsoleRouteController extends DefaultBaseController { public ModelAndView save() { ModelAndView mv = new ModelAndView("cardconsole/console"); mv.addObject("webSocketConsole", ProjectConfigUtil.getText("webSocketConsole")); + mv.addObject("listenerPath", CardLogSocket.listenerPath); return mv; } diff --git a/src/main/java/cn/com/tenlion/systemcard/dao/shopcertification/IShopCertificationDao.java b/src/main/java/cn/com/tenlion/systemcard/dao/shopcertification/IShopCertificationDao.java index 25ca8a5..a5d1ac0 100644 --- a/src/main/java/cn/com/tenlion/systemcard/dao/shopcertification/IShopCertificationDao.java +++ b/src/main/java/cn/com/tenlion/systemcard/dao/shopcertification/IShopCertificationDao.java @@ -14,7 +14,7 @@ import java.util.Map; /** * @ClassName: IShopCertificationDao - * @Description: 店铺认证 + * @Description: 企业认证 * @Author: CodeFactory * @Date: 2021-04-07 17:47:38 * @Version: 3.0 @@ -33,7 +33,7 @@ public interface IShopCertificationDao { /** - * 新增店铺认证 + * 新增企业认证 * * @param params * @throws SaveException @@ -41,7 +41,7 @@ public interface IShopCertificationDao { void save(Map params) throws SaveException; /** - * 删除店铺认证 + * 删除企业认证 * * @param params * @throws RemoveException @@ -49,7 +49,7 @@ public interface IShopCertificationDao { void remove(Map params) throws RemoveException; /** - * 删除店铺认证(物理) + * 删除企业认证(物理) * * @param params * @throws RemoveException @@ -57,7 +57,7 @@ public interface IShopCertificationDao { void delete(Map params) throws RemoveException; /** - * 修改店铺认证 + * 修改企业认证 * * @param params * @throws UpdateException @@ -65,7 +65,7 @@ public interface IShopCertificationDao { void update(Map params) throws UpdateException; /** - * 店铺认证详情 + * 企业认证详情 * * @param params * @return @@ -74,7 +74,7 @@ public interface IShopCertificationDao { ShopCertificationDTO get(Map params) throws SearchException; /** - * 店铺认证详情 + * 企业认证详情 * * @param params * @return @@ -83,7 +83,7 @@ public interface IShopCertificationDao { ShopCertificationBO getBO(Map params) throws SearchException; /** - * 店铺认证详情 + * 企业认证详情 * * @param params * @return @@ -92,7 +92,7 @@ public interface IShopCertificationDao { ShopCertificationPO getPO(Map params) throws SearchException; /** - * 店铺认证列表 + * 企业认证列表 * * @param params * @return @@ -101,7 +101,7 @@ public interface IShopCertificationDao { List list(Map params) throws SearchException; /** - * 店铺认证列表 + * 企业认证列表 * * @param params * @return @@ -110,7 +110,7 @@ public interface IShopCertificationDao { List listBO(Map params) throws SearchException; /** - * 店铺认证列表 + * 企业认证列表 * * @param params * @return @@ -119,7 +119,7 @@ public interface IShopCertificationDao { List listPO(Map params) throws SearchException; /** - * 店铺认证统计 + * 企业认证统计 * * @param params * @return @@ -127,4 +127,11 @@ public interface IShopCertificationDao { */ Integer count(Map params) throws SearchException; + /** + * 查询统一信用代码证 + * @param certificationId + * @return + */ + ShopCertificationDTO getByCertificationId(String certificationId) throws SearchException; + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemcard/filter/CardAppException.java b/src/main/java/cn/com/tenlion/systemcard/filter/CardAppException.java index 1d896dc..bbac024 100644 --- a/src/main/java/cn/com/tenlion/systemcard/filter/CardAppException.java +++ b/src/main/java/cn/com/tenlion/systemcard/filter/CardAppException.java @@ -2,15 +2,29 @@ package cn.com.tenlion.systemcard.filter; import cn.com.tenlion.projectconfig.util.ProjectConfigUtil; import cn.com.tenlion.systemcard.socket.CardLogSocket; +import com.alibaba.fastjson.JSON; +import ink.wgink.common.advice.ResponseAdvice; import ink.wgink.common.component.SecurityComponent; +import ink.wgink.exceptions.*; +import ink.wgink.exceptions.base.SystemException; import ink.wgink.pojo.app.AppTokenUser; +import ink.wgink.pojo.result.ErrorResult; +import ink.wgink.util.AesUtil; import ink.wgink.util.ReflectUtil; import ink.wgink.util.date.DateUtil; +import ink.wgink.util.map.HashMapUtil; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.http.HttpStatus; +import org.springframework.security.authentication.InsufficientAuthenticationException; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.HandlerExceptionResolver; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; @@ -18,13 +32,17 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.sql.SQLSyntaxErrorException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @ControllerAdvice +// @Order(Ordered.LOWEST_PRECEDENCE) public class CardAppException { + private static final Logger LOG = LoggerFactory.getLogger(CardAppException.class); @Autowired CardLogSocket cardLogSocket; @@ -32,48 +50,146 @@ public class CardAppException { @Autowired protected SecurityComponent securityComponent; - @ExceptionHandler(Exception.class) - public ModelAndView customException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Exception e) { + @ResponseBody + @ExceptionHandler({SystemException.class, SQLSyntaxErrorException.class, Exception.class, HashMapUtil.TypeConversionException.class, ReflectUtil.ReflectException.class}) + public void customException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Exception e) throws IOException { if (!ProjectConfigUtil.getSwitch("consoleDebugSwitch")) { - return null; + return; } - e.printStackTrace(); HttpServletRequest httpRequest = (HttpServletRequest) httpServletRequest; String token = httpRequest.getHeader("token"); - String url = httpRequest.getRequestURI(); - if(!url.contains("/app/")) { - return null; - } - if(!StringUtils.isEmpty(token) && !StringUtils.isEmpty(cardLogSocket.selectUser)) { - AppTokenUser appTokenUser = null; - try { - appTokenUser = securityComponent.getAppTokenUser(token); - } catch (ReflectUtil.ReflectException e1) { - } - if(appTokenUser == null || !cardLogSocket.selectUser.equals(appTokenUser.getId())) { - return null; + String url = httpRequest.getServletPath(); + if(url.matches(".*/(" + cardLogSocket.listenerPath + ").*")){ + if(!StringUtils.isEmpty(token) && !StringUtils.isEmpty(cardLogSocket.selectUser)) { + AppTokenUser appTokenUser = null; + try { + appTokenUser = securityComponent.getAppTokenUser(token); + } catch (ReflectUtil.ReflectException e1) { + } + if(!StringUtils.isEmpty(cardLogSocket.selectUser)) { + if(appTokenUser != null && cardLogSocket.selectUser.equals(appTokenUser.getId())) { + // 此方式支持form-data传参方式参数获取,其他传参方式请自行研究 + Map parameterMap = httpRequest.getParameterMap(); + List parameterList = new ArrayList<>(); + parameterMap.forEach((key, value) -> { + parameterList.add(key + ":" + Arrays.toString(value)); + }); + String clientIp = httpRequest.getHeader("x-forwarded-for"); + if (clientIp == null) { + clientIp = httpRequest.getRemoteAddr(); + } + if(cardLogSocket.exceptionDescription) { + StringWriter trace = new StringWriter(); + e.printStackTrace(new PrintWriter(trace)); + String log = "Exception:" + e.getMessage() + "\r\n" + trace.toString(); + cardLogSocket.sendAll(log); + }else{ + String log = "Exception:" + e.getMessage(); + cardLogSocket.sendAll(log); + } + } + }else{ + // 此方式支持form-data传参方式参数获取,其他传参方式请自行研究 + Map parameterMap = httpRequest.getParameterMap(); + List parameterList = new ArrayList<>(); + parameterMap.forEach((key, value) -> { + parameterList.add(key + ":" + Arrays.toString(value)); + }); + String clientIp = httpRequest.getHeader("x-forwarded-for"); + if (clientIp == null) { + clientIp = httpRequest.getRemoteAddr(); + } + if(cardLogSocket.exceptionDescription) { + StringWriter trace = new StringWriter(); + e.printStackTrace(new PrintWriter(trace)); + String log = "Exception:" + e.getMessage() + "\r\n" + trace.toString(); + cardLogSocket.sendAll(log); + }else{ + String log = "Exception:" + e.getMessage(); + cardLogSocket.sendAll(log); + } + } } } - // 此方式支持form-data传参方式参数获取,其他传参方式请自行研究 - Map parameterMap = httpRequest.getParameterMap(); - List parameterList = new ArrayList<>(); - parameterMap.forEach((key, value) -> { - parameterList.add(key + ":" + Arrays.toString(value)); - }); - String clientIp = httpRequest.getHeader("x-forwarded-for"); - if (clientIp == null) { - clientIp = httpRequest.getRemoteAddr(); - } - if(cardLogSocket.exceptionDescription) { - StringWriter trace = new StringWriter(); - e.printStackTrace(new PrintWriter(trace)); - String log = "Exception:" + e.getMessage() + "\r\n" + trace.toString(); - cardLogSocket.sendAll(log); - }else{ - String log = "Exception:" + e.getMessage(); - cardLogSocket.sendAll(log); - } - return null; + responseException(httpServletRequest, httpServletResponse, e); } + + public void responseException(HttpServletRequest request, HttpServletResponse response, Exception e) throws IOException { + if (e instanceof InsufficientAuthenticationException) { + throw new InsufficientAuthenticationException(e.getMessage()); + } else { + if (e instanceof FileException) { + LOG.error(e.getMessage()); + } else if (e instanceof ParamsException) { + LOG.error(e.getMessage()); + } else { + LOG.error(e.getMessage(), e); + } + + ErrorResult result = new ErrorResult(ErrorResult.ErrorResultCodeEnum.SYSTEM_ERROR.getValue(), "系统错误"); + if (e instanceof SaveException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.SAVE_ERROR.getValue()); + } else if (e instanceof RemoveException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.REMOVE_ERROR.getValue()); + } else if (e instanceof UpdateException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.UPDATE_ERROR.getValue()); + } else if (e instanceof SearchException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.QUERY_ERROR.getValue()); + } else if (e instanceof ParamsException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.PARAMS_ERROR.getValue()); + } else if (e instanceof FileException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.FILE_ERROR.getValue()); + } else if (e instanceof AppTokenException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.APP_DEPENDENCY_ERROR.getValue()); + } else if (e instanceof AppDeviceException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.DEVICE_ERROR.getValue()); + } else if (e instanceof AppVersionException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.DEVICE_VERSION_ERROR.getValue()); + } else if (e instanceof PropertiesException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.PROPERTIES_ERROR.getValue()); + } else if (e instanceof AccessTokenException) { + response.setStatus(HttpStatus.UNAUTHORIZED.value()); + } + + if (e instanceof SystemException) { + result.setMsg(e.getMessage()); + } else if (e instanceof UnsupportedEncodingException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.ENCODE_ERROR.getValue()); + result.setMsg(e.getMessage()); + } else if (e instanceof AesUtil.AesEncodeException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.ENCODE_ERROR.getValue()); + result.setMsg(e.getMessage()); + } else if (e instanceof AesUtil.AesDecodeException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.DECODE_ERROR.getValue()); + result.setMsg(e.getMessage()); + } else if (e instanceof ReflectUtil.ReflectException) { + result.setCode(ErrorResult.ErrorResultCodeEnum.SYSTEM_ERROR.getValue()); + } else { + StringBuilder errorMessageSB = new StringBuilder(); + StackTraceElement[] var6 = e.getStackTrace(); + int var7 = var6.length; + + for(int var8 = 0; var8 < var7; ++var8) { + StackTraceElement stackTraceElement = var6[var8]; + errorMessageSB.append(stackTraceElement.toString()).append("\n"); + } + + result.setDetail(errorMessageSB.toString()); + result.setDetail(e.getMessage()); + } + + String contentType = request.getContentType(); + if (contentType != null && contentType.contains("application/json")) { + response.setCharacterEncoding("UTF-8"); + response.setContentType("application/json"); + response.setStatus(HttpStatus.BAD_REQUEST.value()); + response.getWriter().write(JSON.toJSONString(result)); + } else { + request.getSession().setAttribute("errorMessage", JSON.toJSONString(result)); + } + + } + } + } diff --git a/src/main/java/cn/com/tenlion/systemcard/filter/CardAppFilter.java b/src/main/java/cn/com/tenlion/systemcard/filter/CardAppFilter.java index f801820..226786f 100644 --- a/src/main/java/cn/com/tenlion/systemcard/filter/CardAppFilter.java +++ b/src/main/java/cn/com/tenlion/systemcard/filter/CardAppFilter.java @@ -45,8 +45,8 @@ public class CardAppFilter extends DefaultBaseController implements Filter { } HttpServletRequest httpRequest = (HttpServletRequest) servletRequest; String token = httpRequest.getHeader("token"); - String url = httpRequest.getRequestURI(); - if(!url.contains("/app/")) { + String url = httpRequest.getServletPath(); + if(!url.matches(".*/(" + cardLogSocket.listenerPath + ").*")){ filterChain.doFilter(servletRequest, servletResponse); return; } diff --git a/src/main/java/cn/com/tenlion/systemcard/pojo/bos/shopcertification/ShopCertificationBO.java b/src/main/java/cn/com/tenlion/systemcard/pojo/bos/shopcertification/ShopCertificationBO.java index c4e2b62..ccf7fda 100644 --- a/src/main/java/cn/com/tenlion/systemcard/pojo/bos/shopcertification/ShopCertificationBO.java +++ b/src/main/java/cn/com/tenlion/systemcard/pojo/bos/shopcertification/ShopCertificationBO.java @@ -3,7 +3,7 @@ package cn.com.tenlion.systemcard.pojo.bos.shopcertification; /** * * @ClassName: ShopCertificationBO - * @Description: 店铺认证 + * @Description: 企业认证 * @Author: CodeFactory * @Date: 2021-04-07 17:47:38 * @Version: 3.0 diff --git a/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/shop/ShopDTO.java b/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/shop/ShopDTO.java index 6d619f9..61097cc 100644 --- a/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/shop/ShopDTO.java +++ b/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/shop/ShopDTO.java @@ -38,7 +38,7 @@ public class ShopDTO { private String industryName; @ApiModelProperty(name = "industryId", value = "店铺行业ID") private String industryId; - @ApiModelProperty(name = "shopCertificationId", value = "店铺认证ID") + @ApiModelProperty(name = "shopCertificationId", value = "企业认证ID") private String shopCertificationId; @ApiModelProperty(name = "auditStatus", value = "店铺审核状态") private Integer auditStatus; diff --git a/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/shopcertification/ShopCertificationDTO.java b/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/shopcertification/ShopCertificationDTO.java index 936dbe1..d4fbcca 100644 --- a/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/shopcertification/ShopCertificationDTO.java +++ b/src/main/java/cn/com/tenlion/systemcard/pojo/dtos/shopcertification/ShopCertificationDTO.java @@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModelProperty; /** * * @ClassName: ShopCertificationDTO - * @Description: 店铺认证 + * @Description: 企业认证 * @Author: CodeFactory * @Date: 2021-04-07 17:47:38 * @Version: 3.0 @@ -14,18 +14,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel public class ShopCertificationDTO { - @ApiModelProperty(name = "shopCertificationId", value = "店铺认证ID") + @ApiModelProperty(name = "shopCertificationId", value = "企业认证ID") private String shopCertificationId; - @ApiModelProperty(name = "shopId", value = "店铺ID") - private String shopId; - @ApiModelProperty(name = "certificationCertificate", value = "企业认证授权书") - private String certificationCertificate; - @ApiModelProperty(name = "shopName", value = "店铺名称") - private String shopName; + @ApiModelProperty(name = "certificationImage", value = "营业执照照片") + private String certificationImage; @ApiModelProperty(name = "certificationId", value = "统一信用代码") private String certificationId; - @ApiModelProperty(name = "certificationNumber", value = "证书编号") - private String certificationNumber; @ApiModelProperty(name = "certificationName", value = "企业名称") private String certificationName; @ApiModelProperty(name = "certificationType", value = "企业类型") @@ -42,13 +36,19 @@ public class ShopCertificationDTO { private String certificationLicenseTerm; @ApiModelProperty(name = "certificationBusiness", value = "企业经营范围") private String certificationBusiness; - @ApiModelProperty(name = "certificationAuthority", value = "登记机关") + @ApiModelProperty(name = "certificationCertificate", value = "企业授权书(新增字段)") + private String certificationCertificate; + @ApiModelProperty(name = "certificationNumber", value = "证书编号(该字段已取消)") + private String certificationNumber; + @ApiModelProperty(name = "certificationAuthority", value = "登记机关(该字段已取消)") private String certificationAuthority; - @ApiModelProperty(name = "certificationComposition", value = "企业组成形式") + @ApiModelProperty(name = "certificationComposition", value = "企业组成形式(该字段已取消)") private String certificationComposition; - @ApiModelProperty(name = "营业执照图片", value = "营业执照图片") - private String certificationImage; - @ApiModelProperty(name = "审核状态", value = "0 未审核 1审核通过 -1审核不通过") + @ApiModelProperty(name = "shopId", value = "店铺ID") + private String shopId; + @ApiModelProperty(name = "shopName", value = "店铺名称") + private String shopName; + @ApiModelProperty(name = "auditStatus", value = "审核状态 0 未审核 1审核通过 -1审核不通过") private Integer auditStatus; @ApiModelProperty(name = "gmtCreate", value = "申请时间") private String gmtCreate; @@ -59,6 +59,14 @@ public class ShopCertificationDTO { @ApiModelProperty(name = "auditResult", value = "审核说明") private String auditResult; + public String getShopName() { + return shopName == null ? "" : shopName; + } + + public void setShopName(String shopName) { + this.shopName = shopName; + } + public String getCertificationCertificate() { return certificationCertificate == null ? "" : certificationCertificate; } @@ -171,7 +179,6 @@ public class ShopCertificationDTO { this.certificationComposition = certificationComposition; } - public String getShopId() { return shopId; } @@ -180,14 +187,6 @@ public class ShopCertificationDTO { this.shopId = shopId; } - public String getShopName() { - return shopName; - } - - public void setShopName(String shopName) { - this.shopName = shopName; - } - public String getCertificationImage() { return certificationImage; } diff --git a/src/main/java/cn/com/tenlion/systemcard/pojo/pos/shopcertification/ShopCertificationPO.java b/src/main/java/cn/com/tenlion/systemcard/pojo/pos/shopcertification/ShopCertificationPO.java index 51c3a4a..83536d5 100644 --- a/src/main/java/cn/com/tenlion/systemcard/pojo/pos/shopcertification/ShopCertificationPO.java +++ b/src/main/java/cn/com/tenlion/systemcard/pojo/pos/shopcertification/ShopCertificationPO.java @@ -3,7 +3,7 @@ package cn.com.tenlion.systemcard.pojo.pos.shopcertification; /** * * @ClassName: ShopCertificationPO - * @Description: 店铺认证 + * @Description: 企业认证 * @Author: CodeFactory * @Date: 2021-04-07 17:47:38 * @Version: 3.0 diff --git a/src/main/java/cn/com/tenlion/systemcard/pojo/vos/shopcertification/ShopCertificationVO.java b/src/main/java/cn/com/tenlion/systemcard/pojo/vos/shopcertification/ShopCertificationVO.java index a23a777..ec44c30 100644 --- a/src/main/java/cn/com/tenlion/systemcard/pojo/vos/shopcertification/ShopCertificationVO.java +++ b/src/main/java/cn/com/tenlion/systemcard/pojo/vos/shopcertification/ShopCertificationVO.java @@ -1,12 +1,13 @@ package cn.com.tenlion.systemcard.pojo.vos.shopcertification; +import ink.wgink.annotation.CheckEmptyAnnotation; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** * * @ClassName: ShopCertificationVO - * @Description: 店铺认证 + * @Description: 企业认证 * @Author: CodeFactory * @Date: 2021-04-07 17:47:38 * @Version: 3.0 @@ -14,34 +15,55 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel public class ShopCertificationVO { + @ApiModelProperty(name = "certificationImage", value = "营业执照照片") + @CheckEmptyAnnotation(name = "营业执照照片") + private String certificationImage; @ApiModelProperty(name = "certificationId", value = "统一信用代码") + @CheckEmptyAnnotation(name = "统一信用代码") private String certificationId; - @ApiModelProperty(name = "shopId", value = "店铺ID") - private String shopId; - @ApiModelProperty(name = "certificationNumber", value = "证书编号") - private String certificationNumber; @ApiModelProperty(name = "certificationName", value = "企业名称") + @CheckEmptyAnnotation(name = "企业名称") private String certificationName; @ApiModelProperty(name = "certificationType", value = "企业类型") + @CheckEmptyAnnotation(name = "企业类型") private String certificationType; @ApiModelProperty(name = "certificationAddress", value = "企业地址") + @CheckEmptyAnnotation(name = "企业地址") private String certificationAddress; @ApiModelProperty(name = "certificationLegalPerson", value = "企业法定代表人") + @CheckEmptyAnnotation(name = "企业法定代表人") private String certificationLegalPerson; @ApiModelProperty(name = "certificationCapital", value = "企业注册资本") + @CheckEmptyAnnotation(name = "企业注册资本") private String certificationCapital; @ApiModelProperty(name = "certificationFoundTime", value = "企业注册时间") + @CheckEmptyAnnotation(name = "企业注册时间") private String certificationFoundTime; @ApiModelProperty(name = "certificationLicenseTerm", value = "营业期限") + @CheckEmptyAnnotation(name = "营业期限") private String certificationLicenseTerm; @ApiModelProperty(name = "certificationBusiness", value = "企业经营范围") + @CheckEmptyAnnotation(name = "企业经营范围") private String certificationBusiness; - @ApiModelProperty(name = "certificationAuthority", value = "登记机关") + @ApiModelProperty(name = "certificationCertificate", value = "企业授权书(新增字段)") + @CheckEmptyAnnotation(name = "企业授权书") + private String certificationCertificate; + @ApiModelProperty(name = "certificationNumber", value = "证书编号(该字段已取消)") + private String certificationNumber; + @ApiModelProperty(name = "certificationAuthority", value = "登记机关(该字段已取消)") private String certificationAuthority; - @ApiModelProperty(name = "certificationComposition", value = "企业组成形式") + @ApiModelProperty(name = "certificationComposition", value = "企业组成形式(该字段已取消)") private String certificationComposition; - @ApiModelProperty(name = "certificationImage", value = "营业执照照片") - private String certificationImage; + @ApiModelProperty(name = "shopId", value = "店铺ID") + private String shopId; + + public String getCertificationCertificate() { + return certificationCertificate == null ? "" : certificationCertificate; + } + + public void setCertificationCertificate(String certificationCertificate) { + this.certificationCertificate = certificationCertificate; + } public String getCertificationId() { return certificationId == null ? "" : certificationId.trim(); diff --git a/src/main/java/cn/com/tenlion/systemcard/service/cardtemplatescans/impl/CardTemplateScansServiceImpl.java b/src/main/java/cn/com/tenlion/systemcard/service/cardtemplatescans/impl/CardTemplateScansServiceImpl.java index a73337c..af0eb85 100644 --- a/src/main/java/cn/com/tenlion/systemcard/service/cardtemplatescans/impl/CardTemplateScansServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemcard/service/cardtemplatescans/impl/CardTemplateScansServiceImpl.java @@ -203,19 +203,22 @@ public class CardTemplateScansServiceImpl extends DefaultBaseService implements }else{ scansDTO.setCardTemplateUseDTO(cardTemplateUseDTO); // 封装人员ID, 用于批量查询人员的昵称和头像 - userSet.add(scansDTO.getCreator()); + userSet.add(cardTemplateUseDTO.getCreator()); } } // 查询出人员的信息 List userList = new ArrayList(); userList.addAll(userSet); - List miniappUserPOS = iMiniappUserService.listPO(userList); + List miniappUserPOS = new ArrayList(); + if(userList.size() > 0) { + miniappUserPOS = iMiniappUserService.listPO(userList); + } Map userPOMap = new HashMap(); for(MiniappUserPO userPO : miniappUserPOS) { userPOMap.put(userPO.getUserId(), userPO); } for(CardTemplateScansDTO scansDTO : list) { - MiniappUserPO userPO = userPOMap.get(scansDTO.getCreator()); + MiniappUserPO userPO = userPOMap.get(scansDTO.getCardTemplateUseDTO().getCreator()); if (userPO != null) { /** * 封装人员头像信息, 昵称信息 @@ -243,23 +246,37 @@ public class CardTemplateScansServiceImpl extends DefaultBaseService implements public SuccessResultList> listPage(ListPage page) { PageHelper.startPage(page.getPage(), page.getRows()); List cardTemplateScansDTOs = list(page.getParams()); - // 为了让系统默认名片在最上面 , 把本页的系统默认名片先删除掉 - Iterator scansDTOIterator = cardTemplateScansDTOs.iterator(); - while(scansDTOIterator.hasNext()) { - CardTemplateScansDTO cardTemplateScansDTO = scansDTOIterator.next(); - CardTemplateUseDTO useDTO = iCardTemplateUseService.get(cardTemplateScansDTO.getCardTemplateUseId()); - if("1".equals(useDTO.getCardTemplateUseSystem())) { - scansDTOIterator.remove(); + // 首页我看过谁 列表 + if(1 == page.getPage() && page.getParams().get("homePage") != null && 1 == Integer.valueOf(page.getParams().get("homePage").toString())) { + // 为了让系统默认名片在最上面 , 把本页的系统默认名片先删除掉 + Iterator scansDTOIterator = cardTemplateScansDTOs.iterator(); + while(scansDTOIterator.hasNext()) { + CardTemplateScansDTO cardTemplateScansDTO = scansDTOIterator.next(); + CardTemplateUseDTO useDTO = iCardTemplateUseService.get(cardTemplateScansDTO.getCardTemplateUseId()); + if("1".equals(useDTO.getCardTemplateUseSystem())) { + scansDTOIterator.remove(); + } } - } - // 把系统默认名片放到第一页 - if(1 == page.getPage()) { - CardTemplateUseDTO cardTemplateUseDTO = iCardTemplateUseService.getSystemCard(); - if(cardTemplateUseDTO != null) { - CardTemplateScansDTO scansDTO = new CardTemplateScansDTO(); - scansDTO.setCardTemplateUseId(cardTemplateUseDTO.getCardTemplateUseId()); - scansDTO.setCardTemplateUseDTO(cardTemplateUseDTO); - cardTemplateScansDTOs.add(0, scansDTO); + // 把系统默认名片放到第一页 + if(1 == page.getPage()) { + CardTemplateUseDTO cardTemplateUseDTO = iCardTemplateUseService.getSystemCard(); + if(cardTemplateUseDTO != null) { + CardTemplateScansDTO scansDTO = new CardTemplateScansDTO(); + scansDTO.setCardTemplateUseId(cardTemplateUseDTO.getCardTemplateUseId()); + scansDTO.setCardTemplateUseDTO(cardTemplateUseDTO); + cardTemplateScansDTOs.add(0, scansDTO); + } + } + }else{ + // 卡包浏览记录 我看过谁 列表 + Iterator scansDTOIterator = cardTemplateScansDTOs.iterator(); + while(scansDTOIterator.hasNext()) { + CardTemplateScansDTO cardTemplateScansDTO = scansDTOIterator.next(); + CardTemplateUseDTO useDTO = iCardTemplateUseService.get(cardTemplateScansDTO.getCardTemplateUseId()); + // 海报的浏览记录不加载到浏览历史列表中 + if("2".equals(useDTO.getTemplateMode())) { + scansDTOIterator.remove(); + } } } PageInfo pageInfo = new PageInfo<>(cardTemplateScansDTOs); @@ -306,7 +323,10 @@ public class CardTemplateScansServiceImpl extends DefaultBaseService implements // 查询出人员的信息 List userList = new ArrayList(); userList.addAll(userSet); - List miniappUserPOS = iMiniappUserService.listPO(userList); + List miniappUserPOS = new ArrayList(); + if(userList.size() > 0) { + miniappUserPOS = iMiniappUserService.listPO(userList); + } Map userPOMap = new HashMap(); for(MiniappUserPO userPO : miniappUserPOS) { userPOMap.put(userPO.getUserId(), userPO); diff --git a/src/main/java/cn/com/tenlion/systemcard/service/shop/impl/ShopServiceImpl.java b/src/main/java/cn/com/tenlion/systemcard/service/shop/impl/ShopServiceImpl.java index 375c17d..35395b1 100644 --- a/src/main/java/cn/com/tenlion/systemcard/service/shop/impl/ShopServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemcard/service/shop/impl/ShopServiceImpl.java @@ -181,7 +181,7 @@ public class ShopServiceImpl extends DefaultBaseService implements IShopService shopDTO.setIndustryName(industryName.deleteCharAt(industryName.length() - 1).toString()); shopDTO.setIndustryId(industryId.deleteCharAt(industryId.length() - 1).toString()); } - // 通过店铺ID获取店铺认证ID + // 通过店铺ID获取企业认证ID ShopCertificationDTO shopCertificationDTO = shopCertificationDao.getByShopIdAndAuditStatus(params); if(null != shopCertificationDTO) { shopDTO.setShopCertificationId(shopCertificationDTO.getShopCertificationId()); diff --git a/src/main/java/cn/com/tenlion/systemcard/service/shopauditlog/IShopAuditLogUpdateService.java b/src/main/java/cn/com/tenlion/systemcard/service/shopauditlog/IShopAuditLogUpdateService.java new file mode 100644 index 0000000..de25b97 --- /dev/null +++ b/src/main/java/cn/com/tenlion/systemcard/service/shopauditlog/IShopAuditLogUpdateService.java @@ -0,0 +1,22 @@ +package cn.com.tenlion.systemcard.service.shopauditlog; + +import cn.com.tenlion.systemcard.pojo.vos.shopauditlog.ShopAuditLogVO; + +/** + * @ClassName: IShopAuditLogService + * @Description: + * @Author: CodeFactory + * @Date: 2021-03-18 15:09:25 + * @Version: 3.0 + * 审核回调接口 , 所有需要审核的业务类 , 需要实现该接口来获取审核结果内容 + **/ +public interface IShopAuditLogUpdateService { + + /** + * 更新审核状态 + * @param shopAuditLogVO + * @return + */ + void updateStatus(ShopAuditLogVO shopAuditLogVO); + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemcard/service/shopauditlog/impl/ShopAuditLogServiceImpl.java b/src/main/java/cn/com/tenlion/systemcard/service/shopauditlog/impl/ShopAuditLogServiceImpl.java index c331598..8e01b69 100644 --- a/src/main/java/cn/com/tenlion/systemcard/service/shopauditlog/impl/ShopAuditLogServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemcard/service/shopauditlog/impl/ShopAuditLogServiceImpl.java @@ -1,16 +1,19 @@ package cn.com.tenlion.systemcard.service.shopauditlog.impl; import cn.com.tenlion.systemcard.dao.shopauditlog.IShopAuditLogDao; +import cn.com.tenlion.systemcard.filter.AuditServiceLocator; import cn.com.tenlion.systemcard.pojo.bos.shopauditlog.ShopAuditLogBO; import cn.com.tenlion.systemcard.pojo.dtos.shopauditlog.ShopAuditLogDTO; import cn.com.tenlion.systemcard.pojo.pos.shopauditlog.ShopAuditLogPO; import cn.com.tenlion.systemcard.pojo.vos.shopauditlog.ShopAuditLogVO; import cn.com.tenlion.systemcard.service.shop.IShopService; import cn.com.tenlion.systemcard.service.shopauditlog.IShopAuditLogService; +import cn.com.tenlion.systemcard.service.shopauditlog.IShopAuditLogUpdateService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.common.component.SecurityComponent; +import ink.wgink.exceptions.SaveException; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.util.UUIDUtil; @@ -19,7 +22,6 @@ import ink.wgink.util.map.HashMapUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - import java.util.List; import java.util.Map; @@ -39,7 +41,8 @@ public class ShopAuditLogServiceImpl extends DefaultBaseService implements IShop private SecurityComponent securityComponent; @Autowired private IShopService shopService; - + @Autowired + private AuditServiceLocator auditServiceLocator; @Override public void save(ShopAuditLogVO shopAuditLogVO) { @@ -70,6 +73,14 @@ public class ShopAuditLogServiceImpl extends DefaultBaseService implements IShop setAppSaveInfo(token, params); } shopAuditLogDao.save(params); + IShopAuditLogUpdateService service = auditServiceLocator.getService(shopAuditLogVO.getAuditType()); + if(service == null) { + throw new SaveException("该审核类型实现类不存在"); + } + service.updateStatus(shopAuditLogVO); + /** + * 更新对应表的审核状态 + */ return shopAuditId; } diff --git a/src/main/java/cn/com/tenlion/systemcard/service/shopcertification/IShopCertificationService.java b/src/main/java/cn/com/tenlion/systemcard/service/shopcertification/IShopCertificationService.java index a314f67..c9ea33c 100644 --- a/src/main/java/cn/com/tenlion/systemcard/service/shopcertification/IShopCertificationService.java +++ b/src/main/java/cn/com/tenlion/systemcard/service/shopcertification/IShopCertificationService.java @@ -12,13 +12,18 @@ import java.util.Map; /** * @ClassName: IShopCertificationService - * @Description: 店铺认证 + * @Description: 企业认证 * @Author: CodeFactory * @Date: 2021-04-07 17:47:38 * @Version: 3.0 **/ public interface IShopCertificationService { + /** + * 查询信用代码 + * @param certificationId + */ + ShopCertificationDTO getByCertificationId(String certificationId); /** * 更新认证审核状态 @@ -28,7 +33,7 @@ public interface IShopCertificationService { void updateAuditStatus(String shopCertificationId,String auditStatus); /** - * 新增店铺认证 + * 新增企业认证 * * @param shopCertificationVO * @return @@ -36,7 +41,7 @@ public interface IShopCertificationService { void save(ShopCertificationVO shopCertificationVO); /** - * 新增店铺认证 + * 新增企业认证 * * @param token * @param shopCertificationVO @@ -45,7 +50,7 @@ public interface IShopCertificationService { void save(String token, ShopCertificationVO shopCertificationVO); /** - * 新增店铺认证 + * 新增企业认证 * * @param shopCertificationVO * @return shopCertificationId @@ -53,7 +58,7 @@ public interface IShopCertificationService { String saveReturnId(ShopCertificationVO shopCertificationVO); /** - * 新增店铺认证 + * 新增企业认证 * * @param token * @param shopCertificationVO @@ -62,7 +67,7 @@ public interface IShopCertificationService { String saveReturnId(String token, ShopCertificationVO shopCertificationVO); /** - * 删除店铺认证 + * 删除企业认证 * * @param ids id列表 * @return @@ -71,7 +76,7 @@ public interface IShopCertificationService { /** - * 删除店铺认证 + * 删除企业认证 * * @param token * @param ids id列表 @@ -80,14 +85,14 @@ public interface IShopCertificationService { void remove(String token, List ids); /** - * 删除店铺认证(物理删除) + * 删除企业认证(物理删除) * * @param ids id列表 */ void delete(List ids); /** - * 修改店铺认证 + * 修改企业认证 * * @param shopCertificationId * @param shopCertificationVO @@ -96,7 +101,7 @@ public interface IShopCertificationService { void update(String shopCertificationId, ShopCertificationVO shopCertificationVO); /** - * 修改店铺认证 + * 修改企业认证 * * @param token * @param shopCertificationId @@ -106,7 +111,7 @@ public interface IShopCertificationService { void update(String token, String shopCertificationId, ShopCertificationVO shopCertificationVO); /** - * 店铺认证详情 + * 企业认证详情 * * @param params 参数Map * @return @@ -114,7 +119,7 @@ public interface IShopCertificationService { ShopCertificationDTO get(Map params); /** - * 店铺认证详情 + * 企业认证详情 * * @param shopCertificationId * @return @@ -122,7 +127,7 @@ public interface IShopCertificationService { ShopCertificationDTO get(String shopCertificationId); /** - * 店铺认证详情 + * 企业认证详情 * * @param params 参数Map * @return @@ -130,7 +135,7 @@ public interface IShopCertificationService { ShopCertificationBO getBO(Map params); /** - * 店铺认证详情 + * 企业认证详情 * * @param shopCertificationId * @return @@ -138,7 +143,7 @@ public interface IShopCertificationService { ShopCertificationBO getBO(String shopCertificationId); /** - * 店铺认证详情 + * 企业认证详情 * * @param params 参数Map * @return @@ -146,7 +151,7 @@ public interface IShopCertificationService { ShopCertificationPO getPO(Map params); /** - * 店铺认证详情 + * 企业认证详情 * * @param shopCertificationId * @return @@ -154,7 +159,7 @@ public interface IShopCertificationService { ShopCertificationPO getPO(String shopCertificationId); /** - * 店铺认证列表 + * 企业认证列表 * * @param params * @return @@ -162,7 +167,7 @@ public interface IShopCertificationService { List list(Map params); /** - * 店铺认证列表 + * 企业认证列表 * * @param params * @return @@ -170,7 +175,7 @@ public interface IShopCertificationService { List listBO(Map params); /** - * 店铺认证列表 + * 企业认证列表 * * @param params * @return @@ -178,7 +183,7 @@ public interface IShopCertificationService { List listPO(Map params); /** - * 店铺认证分页列表 + * 企业认证分页列表 * * @param page * @return @@ -186,7 +191,7 @@ public interface IShopCertificationService { SuccessResultList> listPage(ListPage page); /** - * 店铺认证统计 + * 企业认证统计 * * @param params * @return diff --git a/src/main/java/cn/com/tenlion/systemcard/service/shopcertification/impl/ShopCertificationServiceImpl.java b/src/main/java/cn/com/tenlion/systemcard/service/shopcertification/impl/ShopCertificationServiceImpl.java index 2fc08cb..46b4c4a 100644 --- a/src/main/java/cn/com/tenlion/systemcard/service/shopcertification/impl/ShopCertificationServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemcard/service/shopcertification/impl/ShopCertificationServiceImpl.java @@ -6,14 +6,21 @@ import cn.com.tenlion.systemcard.pojo.bos.shopcertification.ShopCertificationBO; import cn.com.tenlion.systemcard.pojo.dtos.shopauditlog.ShopAuditLogDTO; import cn.com.tenlion.systemcard.pojo.dtos.shopcertification.ShopCertificationDTO; import cn.com.tenlion.systemcard.pojo.pos.shopcertification.ShopCertificationPO; +import cn.com.tenlion.systemcard.pojo.vos.shopauditlog.ShopAuditLogVO; import cn.com.tenlion.systemcard.pojo.vos.shopcertification.ShopCertificationVO; import cn.com.tenlion.systemcard.service.shop.IShopService; +import cn.com.tenlion.systemcard.service.shopauditlog.IShopAuditLogUpdateService; import cn.com.tenlion.systemcard.service.shopcertification.IShopCertificationService; +import cn.com.tenlion.systemcard.util.BusinessLicenseCheckUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.exceptions.ParamsException; +import ink.wgink.exceptions.SaveException; +import ink.wgink.module.file.service.IFileService; import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.app.AppTokenUser; +import ink.wgink.pojo.bos.UserInfoBO; import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.util.UUIDUtil; import ink.wgink.util.map.HashMapUtil; @@ -27,44 +34,47 @@ import java.util.Map; /** * @ClassName: ShopCertificationServiceImpl - * @Description: 店铺认证 + * @Description: 企业认证 * @Author: CodeFactory * @Date: 2021-04-07 17:47:38 * @Version: 3.0 **/ @Service -public class ShopCertificationServiceImpl extends DefaultBaseService implements IShopCertificationService { +public class ShopCertificationServiceImpl extends DefaultBaseService implements IShopCertificationService , IShopAuditLogUpdateService { @Autowired private IShopCertificationDao shopCertificationDao; - @Autowired - private IShopService shopService; + @Autowired private IShopAuditLogDao shopAuditLogDao; + @Override + public void updateStatus(ShopAuditLogVO shopAuditLogVO) { + updateAuditStatus(shopAuditLogVO.getAuditBId(), shopAuditLogVO.getAuditStatus() + ""); + } + @Override + public ShopCertificationDTO getByCertificationId(String certificationId) { + return shopCertificationDao.getByCertificationId(certificationId); + } - + @Override public void updateAuditStatus(String shopCertificationId,String auditStatus) { + ShopCertificationDTO shopCertificationDTO = this.get(shopCertificationId); + if(shopCertificationDTO == null){ + throw new ParamsException("该内容不存在"); + } Map params = new HashMap(); params.put("shopCertificationId", shopCertificationId); params.put("auditStatus", auditStatus); setUpdateInfo(params); shopCertificationDao.update(params); - ShopCertificationDTO shopCertificationDTO = this.get(shopCertificationId); - if(shopCertificationDTO == null){ - throw new ParamsException("系统异常"); - } - //审核通过更新店铺认证状态 - if(shopCertificationDTO.getAuditStatus() == 1){ - shopService.updateIsCertification(shopCertificationDTO.getShopId()); - } + // 审核通过更新企业认证状态 2021年9月22日17:05:45 逻辑改为了先有企业认证, 再有店铺. +// if(shopCertificationDTO.getAuditStatus() == 1){ +// shopService.updateIsCertification(shopCertificationDTO.getShopId()); +// } } - - - - @Override public void save(ShopCertificationVO shopCertificationVO) { saveReturnId(shopCertificationVO); @@ -80,18 +90,52 @@ public class ShopCertificationServiceImpl extends DefaultBaseService implements return saveReturnId(null, shopCertificationVO); } + private String getUserId(String token) { + String userId = "notUserId"; + if (StringUtils.isBlank(token)) { + UserInfoBO userInfoBO = this.securityComponent.getCurrentUser(); + userId = userInfoBO.getUserId(); + } else { + AppTokenUser appTokenUser = this.getAppTokenUser(token); + userId = appTokenUser.getId(); + } + return userId; + } + @Override public String saveReturnId(String token, ShopCertificationVO shopCertificationVO) { - Map params1 = new HashMap(); - params1.put("shopId",shopCertificationVO.getShopId()); - ShopCertificationDTO sdtot = shopCertificationDao.getByShopIdAndAuditStatus(params1); - if(sdtot != null){ - throw new ParamsException("该店铺已经提交过认证,请勿重复提交"); + String userId = getUserId(token); + /** + * 通过统一信用代码查询是否已经存在, 如果存在则不允许再新增 + */ + shopCertificationVO.setCertificationId(shopCertificationVO.getCertificationId().trim()); + boolean checkResult = false; + try { + checkResult = BusinessLicenseCheckUtil.validateUnifiedCreditCode(shopCertificationVO.getCertificationId()); + }catch(Exception e) { + throw new SaveException("统一信用代码错误"); } + if(!checkResult) { + throw new SaveException("统一信用代码错误"); + } + ShopCertificationDTO shopCertificationDTO = getByCertificationId(shopCertificationVO.getCertificationId()); + if (shopCertificationDTO != null) { + throw new SaveException("该企业认证已存在"); + } + // 是将该userId作为企业认证ID来存储的, 这样可以避免一个人认证多个的情况出现 + ShopCertificationDTO shopCertificationUserDTO = get(getUserId(token)); + if (shopCertificationUserDTO != null) { + throw new SaveException("您已认证过企业"); + } +// params1.put("shopId",shopCertificationVO.getShopId()); +// ShopCertificationDTO sdtot = shopCertificationDao.getByShopIdAndAuditStatus(params1); +// if(sdtot != null){ +// throw new ParamsException("该店铺已经提交过认证,请勿重复提交"); +// } String shopCertificationId = UUIDUtil.getUUID(); Map params = HashMapUtil.beanToMap(shopCertificationVO); - params.put("shopCertificationId", shopCertificationId); - params.put("auditStatus", 0); + params.put("shopCertificationId", userId); + params.put("auditStatus", 0);// 待审核 if (StringUtils.isBlank(token)) { setSaveInfo(params); } else { diff --git a/src/main/java/cn/com/tenlion/systemcard/socket/CardLogSocket.java b/src/main/java/cn/com/tenlion/systemcard/socket/CardLogSocket.java index 438c266..5a3d213 100644 --- a/src/main/java/cn/com/tenlion/systemcard/socket/CardLogSocket.java +++ b/src/main/java/cn/com/tenlion/systemcard/socket/CardLogSocket.java @@ -1,6 +1,7 @@ package cn.com.tenlion.systemcard.socket; import ink.wgink.util.UUIDUtil; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import org.springframework.web.socket.TextMessage; import org.springframework.web.socket.WebSocketSession; @@ -26,6 +27,8 @@ public class CardLogSocket { public static Boolean exceptionDescription = false; + public static String listenerPath = "(app/)"; + @OnOpen public void onOpen(Session session) { System.out.println("链接成功......"); @@ -65,6 +68,15 @@ public class CardLogSocket { if(message.contains("exceptionDescription")) { exceptionDescription = Boolean.parseBoolean(message.split("=")[1]); } + if(message.contains("listenerPath")) { + String listener = message.split("=")[1]; + if(StringUtils.isEmpty(listener)) { + listenerPath = "(app/)"; + }else { + listenerPath = listener; + } + } + } /** diff --git a/src/main/java/cn/com/tenlion/systemcard/util/HttpUtil.java b/src/main/java/cn/com/tenlion/systemcard/util/HttpUtil.java index 306376e..561067d 100644 --- a/src/main/java/cn/com/tenlion/systemcard/util/HttpUtil.java +++ b/src/main/java/cn/com/tenlion/systemcard/util/HttpUtil.java @@ -27,6 +27,12 @@ public class HttpUtil { private static Integer TIMEOUT = 3000; private static Logger logger = Logger.getLogger(HttpUtil.class); + + public static void main(String[] args) { + if("/api/configcolumn/listpage".matches(".*((/api/)|(path)).*")){ + System.out.println("true"); + } + } /** * Post请求 diff --git a/src/main/resources/mybatis/mapper/account/account-mapper.xml b/src/main/resources/mybatis/mapper/account/account-mapper.xml index 18d61a8..444d7ab 100644 --- a/src/main/resources/mybatis/mapper/account/account-mapper.xml +++ b/src/main/resources/mybatis/mapper/account/account-mapper.xml @@ -258,7 +258,7 @@ - SELECT t1.account_id, t1.account_money, diff --git a/src/main/resources/mybatis/mapper/cardcharge/card-charge-mapper.xml b/src/main/resources/mybatis/mapper/cardcharge/card-charge-mapper.xml index 7b3d630..1e501e9 100644 --- a/src/main/resources/mybatis/mapper/cardcharge/card-charge-mapper.xml +++ b/src/main/resources/mybatis/mapper/cardcharge/card-charge-mapper.xml @@ -437,7 +437,7 @@ - SELECT t1.card_charge_id, t1.card_charge_price, diff --git a/src/main/resources/mybatis/mapper/cardtemplateuse/card-template-use-mapper.xml b/src/main/resources/mybatis/mapper/cardtemplateuse/card-template-use-mapper.xml index 00cebfb..3654b1e 100644 --- a/src/main/resources/mybatis/mapper/cardtemplateuse/card-template-use-mapper.xml +++ b/src/main/resources/mybatis/mapper/cardtemplateuse/card-template-use-mapper.xml @@ -459,7 +459,7 @@ - SELECT t1.card_template_use_id, t1.picture_template_id, diff --git a/src/main/resources/mybatis/mapper/shopauditlog/shopauditlog-mapper.xml b/src/main/resources/mybatis/mapper/shopauditlog/shopauditlog-mapper.xml index 9ae7fba..632a7fb 100644 --- a/src/main/resources/mybatis/mapper/shopauditlog/shopauditlog-mapper.xml +++ b/src/main/resources/mybatis/mapper/shopauditlog/shopauditlog-mapper.xml @@ -150,24 +150,26 @@ diff --git a/src/main/resources/mybatis/mapper/shopcertification/shop-certification-mapper.xml b/src/main/resources/mybatis/mapper/shopcertification/shop-certification-mapper.xml index 0d5647a..7f2fd02 100644 --- a/src/main/resources/mybatis/mapper/shopcertification/shop-certification-mapper.xml +++ b/src/main/resources/mybatis/mapper/shopcertification/shop-certification-mapper.xml @@ -72,7 +72,7 @@ - + INSERT INTO svc_shop_certification( shop_certification_id, @@ -123,7 +123,7 @@ ) - + UPDATE svc_shop_certification @@ -138,7 +138,7 @@ - + DELETE FROM svc_shop_certification @@ -149,7 +149,7 @@ - + UPDATE svc_shop_certification @@ -208,7 +208,33 @@ shop_certification_id = #{shopCertificationId} - + + + + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/src/main/resources/static/route/cardtemplate/save-cardtemplatearea.html b/src/main/resources/static/route/cardtemplate/save-cardtemplatearea.html index a992807..f64b357 100644 --- a/src/main/resources/static/route/cardtemplate/save-cardtemplatearea.html +++ b/src/main/resources/static/route/cardtemplate/save-cardtemplatearea.html @@ -491,6 +491,10 @@ function lineChange(id, height, width, left, top) { $('.line').show(); + var newHeight = Math.round(height); + var newWidth = Math.round(width); + var newLeft = Math.round(left); + var newTop = Math.round(top); $('.line-t').css({'borderColor': '#FFF'}); $('.line-l').css({'borderColor': '#FFF'}); $('.line-r').css({'borderColor': '#FFF'}); @@ -499,24 +503,24 @@ $('.line-l').css({'left': left}) $('.line-r').css({'left': (left + width) + 'px'}) $('.line-b').css({'top': (top + height) + 'px'}) - var bottom = top + height; - var right = left + width; + var bottom = newTop + newHeight; + var right = newLeft + newWidth; // 判断哪个div的边线, 与当前的8条边线相交汇 var boxArray = $(".box"); for(var i = 0; i < boxArray.length; i++) { var box = boxArray[i] did = $(box).attr("id"); - w = $(box).width(); - h = $(box).height(); - x = $(box).css("left"); - y = $(box).css("top"); - x = Number(x.replace('px','')); - y = Number(y.replace('px','')); + w = Math.round($(box).width()); + h = Math.round($(box).height()); + x = Math.round($(box).css("left")); + y = Math.round($(box).css("top")); + x = Math.round(Number(x.replace('px',''))); + y = Math.round(Number(y.replace('px',''))); r = x + w; b = y + h; if(id != did) { // 谁与当前上边重合 - if(top == y || top == b) { + if(newTop == y || newTop == b) { $('.line-t').css({'borderColor': 'red'}); } // 谁与当前下边重合 @@ -524,7 +528,7 @@ $('.line-b').css({'borderColor': 'red'}); } // 谁与当前左线重合 - if(left == x || left == r) { + if(newLeft == x || newLeft == r) { $('.line-l').css({'borderColor': 'red'}); } // 谁与当前右线重合 diff --git a/src/main/resources/static/route/shopauditlog/audit.html b/src/main/resources/static/route/shopauditlog/audit.html index 2e34f18..64fed25 100644 --- a/src/main/resources/static/route/shopauditlog/audit.html +++ b/src/main/resources/static/route/shopauditlog/audit.html @@ -81,12 +81,8 @@ top.dialog.close(index); var loadLayerIndex; top.restAjax.post(top.restAjax.path('api/shopauditlog/save', []), formData.field, null, function(code, data) { - var auditType = formData.field['auditType']; - var auditBId = formData.field['auditBId']; - var auditStatus = formData.field['auditStatus']; - if(auditType == 1){ - auditType1(auditBId,auditStatus) - } + top.dialog.close(index); + closeBox(); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -98,29 +94,6 @@ return false; }); - function auditType1(shopCertificationId,auditStatus){ - var loadLayerIndex; - top.restAjax.put(top.restAjax.path('api/shopcertification/updateAuditStatus/{shopCertificationId}/{auditStatus}', [shopCertificationId,auditStatus]), null, null, function(code, data) { - var layerIndex = top.dialog.msg("提交成功!", { - time: 0, - btn: [top.dataMessage.button.yes], - shade: 0.3, - yes: function(index) { - top.dialog.close(index); - closeBox(); - } - }); - }, function(code, data) { - top.dialog.msg(data.msg); - }, function() { - loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3}); - }, function() { - top.dialog.close(loadLayerIndex); - }); - } - - - $('.close').on('click', function() { closeBox(); }); diff --git a/src/main/resources/static/route/shopcertification/list.html b/src/main/resources/static/route/shopcertification/list.html index 4cc9ec9..b5a714b 100644 --- a/src/main/resources/static/route/shopcertification/list.html +++ b/src/main/resources/static/route/shopcertification/list.html @@ -82,7 +82,7 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'certificationImage', width: 180, title: '营业执照', align:'center', + {field: 'certificationImage', width: 120, title: '营业执照', align:'center', templet: function(row) { var rowData = row[this.field]; var value='
'; @@ -92,7 +92,16 @@ return value; } }, - {field: 'shopName', width: 180, title: '关联店铺', align:'center', + // {field: 'shopName', width: 180, title: '关联店铺', align:'center', + // templet: function(row) { + // var rowData = row[this.field]; + // if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + // return '-'; + // } + // return rowData; + // } + // }, + {field: 'certificationName', width: 200, title: '企业名称', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -101,7 +110,7 @@ return rowData; } }, - {field: 'certificationName', width: 180, title: '企业名称', align:'center', + {field: 'certificationLegalPerson', width: 150, title: '企业法定代表人', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -110,7 +119,7 @@ return rowData; } }, - {field: 'certificationId', width: 180, title: '统一信用代码', align:'center', + {field: 'certificationId', width: 200, title: '统一信用代码', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -120,16 +129,7 @@ } }, - {field: 'certificationType', width: 180, title: '企业类型', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - return rowData; - } - }, - {field: 'certificationLegalPerson', width: 180, title: '企业法定代表人', align:'center', + {field: 'certificationType', width: 250, title: '企业类型', align:'center', templet: function(row) { var rowData = row[this.field]; if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { @@ -156,17 +156,15 @@ return rowData; } }, - {field: 'auditStatus', width: 180, title: '审核状态', align:'center',fixed: 'right', + {field: 'auditStatus', width: 100, title: '审核状态', align:'center',fixed: 'right', templet: function(row) { var rowData = row[this.field]; - if (rowData === 0){ - return "未审核" - } - if (rowData === 1){ - return "审核通过"; - } - if (rowData === -1){ - return "不通过"; + if(rowData == 0) { + return ''; + }else if(rowData == 1) { + return ''; + }else{ + return ''; } return rowData; } @@ -174,11 +172,13 @@ {field:'cz', width:220, title: '操作', align:'center', fixed: 'right', templet: function(row) { var rowData = '
' - +'' - +'' - if(row['auditStatus'] === 0){ - rowData += '' + +''; + if(row['shopId']){ + rowData += ''; } + // if(row['auditStatus'] === 0){ + // rowData += '' + // } rowData += '' rowData += '
'; return rowData; diff --git a/src/main/resources/static/route/shopcertification/show.html b/src/main/resources/static/route/shopcertification/show.html index 050db82..7e5b0fc 100644 --- a/src/main/resources/static/route/shopcertification/show.html +++ b/src/main/resources/static/route/shopcertification/show.html @@ -21,7 +21,7 @@
@@ -37,25 +37,25 @@
-
+
-
+
-
- -
- -
-
+ + + + + +
@@ -105,18 +105,18 @@
-
- -
- -
-
-
- -
- -
-
+ + + + + + + + + + + +
@@ -126,6 +126,7 @@
@@ -154,9 +155,6 @@ var wangEditorObj = {}; var viewerObj = {}; - var view = new Viewer(document.getElementById("imageview"),{}); - - function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } @@ -170,10 +168,24 @@ }); } + $('.auditlogSave').on('click', function() { + auditlogSave(); + }); - - - + function auditlogSave() { + layer.open({ + type: 2, + title: false, + closeBtn: 0, + area: ['70%', '50%'], + shadeClose: true, + anim: 2, + content: top.restAjax.path('route/shopauditlog/audit.html?auditType=shopCertificationServiceImpl&bId={shopCertificationId}', [shopCertificationId]), + end: function() { + window.location.reload(); + } + }); + } // 初始化内容 function initData() { @@ -183,7 +195,16 @@ for(var i in data) { dataFormData[i] = data[i] +''; } - $("#showImg").attr("src","route/file/download/true/"+data.certificationImage); + if(data.auditStatus == 0) { + $(".auditlogSave").show(); + } + if(data.certificationImage) { + $("#showImg").attr("src","route/file/download/true/"+data.certificationImage); + var view = new Viewer(document.getElementById("imageview"),{}); + } + if(data.shopId) { + $("#showShop").show(); + } form.val('dataForm', dataFormData); form.render(null, 'dataForm'); }, function(code, data) { diff --git a/src/main/resources/templates/cardconsole/console.html b/src/main/resources/templates/cardconsole/console.html index 1bb3826..63cfb00 100644 --- a/src/main/resources/templates/cardconsole/console.html +++ b/src/main/resources/templates/cardconsole/console.html @@ -59,8 +59,10 @@ 内容查询 内容替换 指定行跳转 - + + + 选中文字内容 CTRL + K【下一个】 | ALT + SHIF + K【上一个】 @@ -127,6 +129,7 @@ } }); + $("#listenerPath").val("[[${listenerPath}]]"); var socket; if(typeof(WebSocket) == "undefined") { console.log("您的浏览器不支持WebSocket"); @@ -163,6 +166,11 @@ } } + $('#listenerPath').on('input', function(){ + var listenerPath = $(this).val(); + socket.send("listenerPath=" + listenerPath); + }); + $(document).on('click','#selectUser',function(){ // route/cardconsole/appuser route/department/user/select-user var index = top.dialog.open({