diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/controller/BackendStoreController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/controller/BackendStoreController.java index 1806091d4..0b1d48d71 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/controller/BackendStoreController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/store/controller/BackendStoreController.java @@ -289,18 +289,8 @@ public class BackendStoreController extends BaseController { @ApiOperation(value = "获取店铺详情") @RequestMapping(value = "/info/{id}", method = RequestMethod.GET) @CrossOrigin - public ResponseObject getStoreInfo(HttpServletRequest request, @PathVariable("id") Integer id) throws BusinessCheckException { - String token = request.getHeader("Access-Token"); - AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token); - if (accountInfo == null) { - return getFailureResult(1001, "请先登录"); - } - + public ResponseObject getStoreInfo( @PathVariable("id") Integer id) throws BusinessCheckException { StoreDto storeInfo = storeService.queryStoreDtoById(id); - - Map result = new HashMap<>(); - result.put("storeInfo", storeInfo); - - return getSuccessResult(result); + return getSuccessResult(storeInfo); } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/StatusEnum.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/StatusEnum.java index de815d56f..4edb18e59 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/StatusEnum.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/enums/StatusEnum.java @@ -11,7 +11,7 @@ public enum StatusEnum { ENABLED("A", "启用"), EXPIRED("C", "过期"), DISABLE("D", "删除"), - FORBIDDEN("N", "禁用"), + FORBIDDEN("jy", "禁用"), UnAudited("U", "待审核"); private String key; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/AccountService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/AccountService.java index c6ead09d5..a3cf93391 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/AccountService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/AccountService.java @@ -9,7 +9,7 @@ import com.fuint.framework.exception.BusinessCheckException; import com.fuint.framework.pagination.PaginationRequest; import com.fuint.framework.pagination.PaginationResponse; import com.fuint.repository.model.TAccount; -import com.fuint.repository.model.TDuty; +import com.fuint.system.role.entity.TDuty; import java.util.List; /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java index 3f43eddcd..d3cf5ce6b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/AccountServiceImpl.java @@ -20,6 +20,8 @@ import com.fuint.repository.mapper.*; import com.fuint.repository.model.*; import com.fuint.system.dept.entity.SysDept; import com.fuint.system.dept.service.ISysDeptService; +import com.fuint.system.role.entity.TDuty; +import com.fuint.system.role.mapper.TDutyMapper; import com.fuint.utils.Digests; import com.fuint.utils.Encodes; import com.github.pagehelper.Page; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendLoginController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendLoginController.java index 516b81f5d..a0cdf6737 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendLoginController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendLoginController.java @@ -14,8 +14,9 @@ import com.fuint.framework.web.BaseController; import com.fuint.framework.web.ResponseObject; import com.fuint.module.backendApi.response.LoginResponse; import com.fuint.repository.model.TAccount; -import com.fuint.repository.model.TDuty; +import com.fuint.system.role.entity.TDuty; import com.fuint.repository.model.TSource; +import com.fuint.system.role.service.DutyService; import com.fuint.utils.StringUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/xml/SysConfigMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/xml/SysConfigMapper.xml index 9e0ccc464..580ae03d6 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/xml/SysConfigMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/config/mapper/xml/SysConfigMapper.xml @@ -2,95 +2,8 @@ - + - - - - - - - - - - - - - - - - - - - - - update sys_dept set ancestors = - - when #{item.deptId} then #{item.ancestors} - - where dept_id in - - #{item.deptId} - - - - - update sys_dept set status = '0' where dept_id in - - #{deptId} - - \ No newline at end of file diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/entity/SysDept.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/entity/SysDept.java index 52a1fa4ca..3356dc1c4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/entity/SysDept.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/entity/SysDept.java @@ -3,6 +3,7 @@ package com.fuint.system.dept.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fuint.framework.entity.BaseEntity; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -13,6 +14,7 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -38,7 +40,7 @@ public class SysDept extends BaseEntity /** 部门名称 */ private String deptName; - //节点类型:1代理商2连锁店3基本门店 + //节点类型:1代理商2连锁店3基本门店4三方机构 private String deptType; @@ -52,6 +54,12 @@ public class SysDept extends BaseEntity private String leaderName; private String leaderPhone; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date validStartTime; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date validEndTime; + //有效次数 + private Integer validNum; /** 子部门 */ @TableField(exist = false) private List children = new ArrayList(); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/SysDeptMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/SysDeptMapper.java index d522265d3..f51b185a7 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/SysDeptMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/SysDeptMapper.java @@ -81,11 +81,10 @@ public interface SysDeptMapper extends BaseMapper /** - * 修改所在部门正常状态 - * - * @param deptIds 部门ID组 + * 修改所在部门状态 + * */ - public void updateDeptStatusNormal(Long[] deptIds); + public void updateDeptStatusNormal(String ancestor); /** * 修改子元素关系 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml index 9e0ccc464..4b92d91f4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/dept/mapper/xml/SysDeptMapper.xml @@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select * from t_duty u where u.DUTY_NAME = #{name} @@ -18,7 +18,7 @@ - select * from t_duty where duty_id in #{id} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/DutyService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/DutyService.java similarity index 96% rename from fuintBackend/fuint-application/src/main/java/com/fuint/common/service/DutyService.java rename to fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/DutyService.java index 86a8b2251..9b553d5e4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/DutyService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/DutyService.java @@ -1,11 +1,11 @@ -package com.fuint.common.service; +package com.fuint.system.role.service; import com.baomidou.mybatisplus.extension.service.IService; import com.fuint.framework.exception.BusinessCheckException; import com.fuint.framework.pagination.PaginationRequest; import com.fuint.framework.pagination.PaginationResponse; import com.fuint.module.backendApi.request.DutyStatusRequest; -import com.fuint.repository.model.TDuty; +import com.fuint.system.role.entity.TDuty; import com.fuint.repository.model.TSource; import com.fuint.common.domain.TreeNode; import java.util.List; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/DutyServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java similarity index 93% rename from fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/DutyServiceImpl.java rename to fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java index 58f5943d6..d74bbba77 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/common/service/impl/DutyServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/role/service/impl/DutyServiceImpl.java @@ -1,10 +1,10 @@ -package com.fuint.common.service.impl; +package com.fuint.system.role.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fuint.common.enums.StatusEnum; -import com.fuint.common.service.DutyService; +import com.fuint.system.role.service.DutyService; import com.fuint.framework.annoation.OperationServiceLog; import com.fuint.framework.exception.BusinessCheckException; import com.fuint.common.domain.TreeNode; @@ -12,9 +12,9 @@ import com.fuint.framework.exception.BusinessRuntimeException; import com.fuint.framework.pagination.PaginationRequest; import com.fuint.framework.pagination.PaginationResponse; import com.fuint.module.backendApi.request.DutyStatusRequest; -import com.fuint.repository.mapper.TDutyMapper; +import com.fuint.system.role.mapper.TDutyMapper; import com.fuint.repository.mapper.TDutySourceMapper; -import com.fuint.repository.model.TDuty; +import com.fuint.system.role.entity.TDuty; import com.fuint.repository.model.TDutySource; import com.fuint.repository.model.TSource; import com.fuint.utils.ArrayUtil; @@ -82,7 +82,7 @@ public class DutyServiceImpl extends ServiceImpl implements @OperationServiceLog(description = "删除后台角色") public void deleteDuty(Integer merchantId, long dutyId) { TDuty tDuty = getRoleById(dutyId); - if (!merchantId.equals(tDuty.getMerchantId()) && merchantId > 0) { + if (!merchantId.equals(tDuty.getStoreId()) && merchantId > 0) { throw new BusinessRuntimeException("抱歉,您没有删除的权限"); } try { @@ -106,7 +106,7 @@ public class DutyServiceImpl extends ServiceImpl implements public void updateStatus(Integer merchantId, DutyStatusRequest dutyStatusRequest) throws BusinessCheckException { TDuty tDuty = tDutyMapper.selectById(dutyStatusRequest.getRoleId()); - if (!merchantId.equals(tDuty.getMerchantId()) && merchantId > 0) { + if (!merchantId.equals(tDuty.getStoreId()) && merchantId > 0) { throw new BusinessRuntimeException("抱歉,您没有操作的权限"); } @@ -132,7 +132,7 @@ public class DutyServiceImpl extends ServiceImpl implements throw new BusinessCheckException("角色不存在."); } if (!StringUtil.equals(tduty.getDutyName(), existsDuty.getDutyName())) { - TDuty tDuty = findByName(existsDuty.getMerchantId(), tduty.getDutyName()); + TDuty tDuty = findByName(existsDuty.getStoreId(), tduty.getDutyName()); if (tDuty != null) { throw new BusinessCheckException("角色名已存在."); } @@ -188,7 +188,7 @@ public class DutyServiceImpl extends ServiceImpl implements @Transactional(rollbackFor = Exception.class) @OperationServiceLog(description = "新增后台角色") public void saveDuty(TDuty duty, List sources) throws BusinessCheckException { - TDuty existsDuty = tDutyMapper.findByName(duty.getMerchantId(), duty.getDutyName()); + TDuty existsDuty = tDutyMapper.findByName(duty.getStoreId(), duty.getDutyName()); if (existsDuty != null) { throw new BusinessCheckException("角色名称已经存在."); } @@ -224,9 +224,9 @@ public class DutyServiceImpl extends ServiceImpl implements String merchantId = paginationRequest.getSearchParams().get("merchantId") == null ? "" : paginationRequest.getSearchParams().get("merchantId").toString(); if (StringUtils.isNotBlank(merchantId)) { lambdaQueryWrapper.and(wq -> wq - .eq(TDuty::getMerchantId, 0) + .eq(TDuty::getStoreId, 0) .or() - .eq(TDuty::getMerchantId, merchantId)); + .eq(TDuty::getStoreId, merchantId)); } lambdaQueryWrapper.orderByDesc(TDuty::getDutyId); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/system/user/controller/BackendAccountController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/system/user/controller/BackendAccountController.java index f71a8d509..cde8e9272 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/system/user/controller/BackendAccountController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/system/user/controller/BackendAccountController.java @@ -7,7 +7,7 @@ import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.RoleDto; import com.fuint.common.enums.StatusEnum; import com.fuint.common.service.AccountService; -import com.fuint.common.service.DutyService; +import com.fuint.system.role.service.DutyService; import com.fuint.common.service.MerchantService; import com.fuint.business.store.service.StoreService; import com.fuint.common.util.CommonUtil; @@ -18,7 +18,7 @@ import com.fuint.framework.web.ResponseObject; import com.fuint.repository.model.MtMerchant; import com.fuint.business.store.entity.MtStore; import com.fuint.repository.model.TAccount; -import com.fuint.repository.model.TDuty; +import com.fuint.system.role.entity.TDuty; import com.fuint.utils.StringUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation;