Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -177,4 +177,7 @@ public class RegionDao {
|
|||||||
return regionMapper.listByThirdRegionType(parentId, thirdRegionType);
|
return regionMapper.listByThirdRegionType(parentId, thirdRegionType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<RegionDO> getFightRegionByRegionIds(List<String> regionIds) {
|
||||||
|
return regionMapper.getFightRegionByRegionIds(regionIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.cool.store.mapper;
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
import com.cool.store.entity.LicenseTransactDO;
|
import com.cool.store.entity.LicenseTransactDO;
|
||||||
|
import com.cool.store.entity.RegionDO;
|
||||||
import com.cool.store.request.LicenseListRequest;
|
import com.cool.store.request.LicenseListRequest;
|
||||||
import com.cool.store.response.LicenseListResponse;
|
import com.cool.store.response.LicenseListResponse;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -10,7 +11,9 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface ApplyLicenseMapper extends Mapper<LicenseTransactDO> {
|
public interface ApplyLicenseMapper extends Mapper<LicenseTransactDO> {
|
||||||
|
|
||||||
List<LicenseListResponse> licenseList(@Param("request") LicenseListRequest request);
|
List<LicenseListResponse> licenseList(@Param("request") LicenseListRequest request,
|
||||||
|
@Param("userId") String userId,
|
||||||
|
@Param("fightRegions") List<RegionDO> fightRegions);
|
||||||
|
|
||||||
void updateByShopId(@Param("entity") LicenseTransactDO licenseTransactDO);
|
void updateByShopId(@Param("entity") LicenseTransactDO licenseTransactDO);
|
||||||
|
|
||||||
|
|||||||
@@ -102,4 +102,6 @@ public interface RegionMapper {
|
|||||||
RegionDO getRegionByStoreId(@Param("storeId") String storeId);
|
RegionDO getRegionByStoreId(@Param("storeId") String storeId);
|
||||||
|
|
||||||
RegionDO getBigRegionByRegionId(@Param("regionId") long regionId);
|
RegionDO getBigRegionByRegionId(@Param("regionId") long regionId);
|
||||||
|
|
||||||
|
List<RegionDO> getFightRegionByRegionIds(@Param("regionIds") List<String> regionIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,15 @@
|
|||||||
LEFT JOIN xfsg_shop_info s ON o.shop_id = s.id
|
LEFT JOIN xfsg_shop_info s ON o.shop_id = s.id
|
||||||
LEFT JOIN xfsg_line_info l ON l.id = s.line_id
|
LEFT JOIN xfsg_line_info l ON l.id = s.line_id
|
||||||
<where>
|
<where>
|
||||||
|
<if test="userId != null and userId != ''">
|
||||||
|
and s.supervisor_user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="fightRegions != null">
|
||||||
|
and l.region_id in
|
||||||
|
<foreach item="regionId" collection="fightRegions" open="(" separator="," close=")">
|
||||||
|
#{regionId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="request.storeName != null and request.storeName != ''">
|
<if test="request.storeName != null and request.storeName != ''">
|
||||||
AND s.shop_name like concat('%',#{request.storeName},'%')
|
AND s.shop_name like concat('%',#{request.storeName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -374,6 +374,20 @@
|
|||||||
WHERE id = #{regionId}
|
WHERE id = #{regionId}
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getFightRegionByRegionIds" resultType="com.cool.store.entity.RegionDO">
|
||||||
|
select <include refid="fields"/>
|
||||||
|
from region_${enterpriseId}
|
||||||
|
where deleted = 0
|
||||||
|
and third_region_type = '2'
|
||||||
|
<if test="regionIds != null">
|
||||||
|
AND id in (
|
||||||
|
<foreach collection="regionIds" separator="," item="id">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -27,7 +27,7 @@ public interface ApplyLicenseService {
|
|||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PageInfo<LicenseListResponse> licenseList(LicenseListRequest request);
|
PageInfo<LicenseListResponse> licenseList(LicenseListRequest request,LoginUserInfo user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 证照审核审批
|
* 证照审核审批
|
||||||
|
|||||||
@@ -6,18 +6,13 @@ import com.cool.store.context.LoginUserInfo;
|
|||||||
import com.cool.store.dao.EnterpriseUserDAO;
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
import com.cool.store.dao.RegionDao;
|
import com.cool.store.dao.RegionDao;
|
||||||
import com.cool.store.dao.ShopStageInfoDAO;
|
import com.cool.store.dao.ShopStageInfoDAO;
|
||||||
import com.cool.store.entity.EnterpriseUserDO;
|
import com.cool.store.entity.*;
|
||||||
import com.cool.store.entity.LicenseTransactDO;
|
|
||||||
import com.cool.store.entity.ShopAuditInfoDO;
|
|
||||||
import com.cool.store.entity.ShopInfoDO;
|
|
||||||
import com.cool.store.enums.AuditTypeEnum;
|
import com.cool.store.enums.AuditTypeEnum;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.UserRoleEnum;
|
||||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.mapper.ApplyLicenseMapper;
|
import com.cool.store.mapper.*;
|
||||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
|
||||||
import com.cool.store.mapper.ShopAuditInfoMapper;
|
|
||||||
import com.cool.store.mapper.ShopInfoMapper;
|
|
||||||
import com.cool.store.request.LicenseListRequest;
|
import com.cool.store.request.LicenseListRequest;
|
||||||
import com.cool.store.request.SubmitLicenseRequest;
|
import com.cool.store.request.SubmitLicenseRequest;
|
||||||
import com.cool.store.response.GetStoreInfoByCodeResponse;
|
import com.cool.store.response.GetStoreInfoByCodeResponse;
|
||||||
@@ -76,6 +71,12 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
|||||||
@Resource
|
@Resource
|
||||||
PreparationService preparationService;
|
PreparationService preparationService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
EnterpriseUserRoleMapper enterpriseUserRoleMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
UserRegionMappingMapper userRegionMappingMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean submitLicense(SubmitLicenseRequest request,LoginUserInfo user) {
|
public Boolean submitLicense(SubmitLicenseRequest request,LoginUserInfo user) {
|
||||||
@@ -145,9 +146,28 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<LicenseListResponse> licenseList(LicenseListRequest request) {
|
public PageInfo<LicenseListResponse> licenseList(LicenseListRequest request,LoginUserInfo user) {
|
||||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
//当前用户角色
|
||||||
List<LicenseListResponse> licenseListResponses = applyLicenseMapper.licenseList(request);
|
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
||||||
|
List<LicenseListResponse> licenseListResponses = new ArrayList<>();
|
||||||
|
//查证照列表数据
|
||||||
|
if (userRoleIds.contains(UserRoleEnum.THEATER_MANAGER.getCode())){
|
||||||
|
//当前用户所属区域
|
||||||
|
List<UserRegionMappingDO> regionIdsByUserIds = userRegionMappingMapper.getRegionIdsByUserIds(Arrays.asList(user.getUserId()));
|
||||||
|
List<String> regionIds = regionIdsByUserIds.stream().map(UserRegionMappingDO::getRegionId).collect(Collectors.toList());
|
||||||
|
if (CollectionUtils.isEmpty(regionIds)){
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
|
List<RegionDO> fightRegion = regionDao.getFightRegionByRegionIds(regionIds);
|
||||||
|
if (CollectionUtils.isEmpty(fightRegion)){
|
||||||
|
return new PageInfo<>();
|
||||||
|
}
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
licenseListResponses = applyLicenseMapper.licenseList(request,null,fightRegion);
|
||||||
|
}else {
|
||||||
|
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||||
|
licenseListResponses = applyLicenseMapper.licenseList(request,user.getUserId(),null);
|
||||||
|
}
|
||||||
List<String> userIdList = new ArrayList<>();
|
List<String> userIdList = new ArrayList<>();
|
||||||
for (LicenseListResponse vo : licenseListResponses) {
|
for (LicenseListResponse vo : licenseListResponses) {
|
||||||
userIdList.add(vo.getSupervisorUserId());
|
userIdList.add(vo.getSupervisorUserId());
|
||||||
|
|||||||
@@ -418,10 +418,10 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
|
|||||||
shopAuditInfoDO.setRejectReason(request.getCause());
|
shopAuditInfoDO.setRejectReason(request.getCause());
|
||||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_32;
|
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_32;
|
||||||
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
|
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
|
||||||
//更新门店编码
|
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
|
||||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
EnterpriseUserDO supervisor = userAuthMappingService.getUserByRoleEnumAndRegionId(UserRoleEnum.SUPERVISION, shopInfoDO.getRegionId());
|
||||||
shopInfoDO.setId(shopId);
|
shopInfoDO.setStoreNum(request.getStoreNum()); //更新门店编码
|
||||||
shopInfoDO.setStoreNum(request.getStoreNum());
|
shopInfoDO.setSupervisorUserId(supervisor.getUserId());//更新督导
|
||||||
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
|
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
|
||||||
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
|
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
|
||||||
shopAuditInfoDO.setPassReason(request.getCause());
|
shopAuditInfoDO.setPassReason(request.getCause());
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ public class PCApplyLicenseController {
|
|||||||
@RequestParam(value = "submitEndTime", required = false) Long submitEndTime,
|
@RequestParam(value = "submitEndTime", required = false) Long submitEndTime,
|
||||||
@RequestParam(value = "regionId", required = false) String regionId,
|
@RequestParam(value = "regionId", required = false) String regionId,
|
||||||
@RequestParam(value = "status", required = false) Integer status) {
|
@RequestParam(value = "status", required = false) Integer status) {
|
||||||
LicenseListRequest request =
|
LicenseListRequest request = new LicenseListRequest(pageNumber, pageSize, storeName, submitStartTime, submitEndTime, regionId, status);
|
||||||
new LicenseListRequest(pageNumber, pageSize, storeName, submitStartTime, submitEndTime, regionId, status);
|
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||||
return ResponseResult.success(applyLicenseService.licenseList(request));
|
return ResponseResult.success(applyLicenseService.licenseList(request,user));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("证照办理数据回显")
|
@ApiOperation("证照办理数据回显")
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.cool.store.context.CurrentUserHolder;
|
|||||||
import com.cool.store.context.LoginUserInfo;
|
import com.cool.store.context.LoginUserInfo;
|
||||||
import com.cool.store.request.SubmitLicenseRequest;
|
import com.cool.store.request.SubmitLicenseRequest;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
|
import com.cool.store.response.SubmitLicenseResponse;
|
||||||
import com.cool.store.service.ApplyLicenseService;
|
import com.cool.store.service.ApplyLicenseService;
|
||||||
import com.cool.store.service.CoolStoreStartFlowService;
|
import com.cool.store.service.CoolStoreStartFlowService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -36,7 +37,7 @@ public class ApplyLicenseController {
|
|||||||
|
|
||||||
@ApiOperation("证照办理数据回显")
|
@ApiOperation("证照办理数据回显")
|
||||||
@GetMapping("/default/get")
|
@GetMapping("/default/get")
|
||||||
public ResponseResult getDefault(@RequestParam("shopId") Long shopId) {
|
public ResponseResult<SubmitLicenseResponse> getDefault(@RequestParam("shopId") Long shopId) {
|
||||||
return ResponseResult.success(applyLicenseService.getDefault(shopId));
|
return ResponseResult.success(applyLicenseService.getDefault(shopId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user