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);
|
||||
}
|
||||
|
||||
public List<RegionDO> getFightRegionByRegionIds(List<String> regionIds) {
|
||||
return regionMapper.getFightRegionByRegionIds(regionIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.entity.LicenseTransactDO;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.request.LicenseListRequest;
|
||||
import com.cool.store.response.LicenseListResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -10,7 +11,9 @@ import java.util.List;
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -102,4 +102,6 @@ public interface RegionMapper {
|
||||
RegionDO getRegionByStoreId(@Param("storeId") String storeId);
|
||||
|
||||
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_line_info l ON l.id = s.line_id
|
||||
<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 != ''">
|
||||
AND s.shop_name like concat('%',#{request.storeName},'%')
|
||||
</if>
|
||||
|
||||
@@ -374,6 +374,20 @@
|
||||
WHERE id = #{regionId}
|
||||
)
|
||||
</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>
|
||||
@@ -27,7 +27,7 @@ public interface ApplyLicenseService {
|
||||
* @param request
|
||||
* @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.RegionDao;
|
||||
import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.LicenseTransactDO;
|
||||
import com.cool.store.entity.ShopAuditInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.AuditTypeEnum;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.UserRoleEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.ApplyLicenseMapper;
|
||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||
import com.cool.store.mapper.ShopAuditInfoMapper;
|
||||
import com.cool.store.mapper.ShopInfoMapper;
|
||||
import com.cool.store.mapper.*;
|
||||
import com.cool.store.request.LicenseListRequest;
|
||||
import com.cool.store.request.SubmitLicenseRequest;
|
||||
import com.cool.store.response.GetStoreInfoByCodeResponse;
|
||||
@@ -76,6 +71,12 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
@Resource
|
||||
PreparationService preparationService;
|
||||
|
||||
@Resource
|
||||
EnterpriseUserRoleMapper enterpriseUserRoleMapper;
|
||||
|
||||
@Resource
|
||||
UserRegionMappingMapper userRegionMappingMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean submitLicense(SubmitLicenseRequest request,LoginUserInfo user) {
|
||||
@@ -145,9 +146,28 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<LicenseListResponse> licenseList(LicenseListRequest request) {
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
List<LicenseListResponse> licenseListResponses = applyLicenseMapper.licenseList(request);
|
||||
public PageInfo<LicenseListResponse> licenseList(LicenseListRequest request,LoginUserInfo user) {
|
||||
//当前用户角色
|
||||
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<>();
|
||||
for (LicenseListResponse vo : licenseListResponses) {
|
||||
userIdList.add(vo.getSupervisorUserId());
|
||||
|
||||
@@ -418,10 +418,10 @@ public class SysStoreAppServiceImpl implements SysStoreAppService,AuditResultSer
|
||||
shopAuditInfoDO.setRejectReason(request.getCause());
|
||||
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_32;
|
||||
}else if (request.getAuditResult() == Constants.ONE_INTEGER){
|
||||
//更新门店编码
|
||||
ShopInfoDO shopInfoDO = new ShopInfoDO();
|
||||
shopInfoDO.setId(shopId);
|
||||
shopInfoDO.setStoreNum(request.getStoreNum());
|
||||
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
|
||||
EnterpriseUserDO supervisor = userAuthMappingService.getUserByRoleEnumAndRegionId(UserRoleEnum.SUPERVISION, shopInfoDO.getRegionId());
|
||||
shopInfoDO.setStoreNum(request.getStoreNum()); //更新门店编码
|
||||
shopInfoDO.setSupervisorUserId(supervisor.getUserId());//更新督导
|
||||
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
|
||||
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
|
||||
shopAuditInfoDO.setPassReason(request.getCause());
|
||||
|
||||
@@ -36,9 +36,9 @@ public class PCApplyLicenseController {
|
||||
@RequestParam(value = "submitEndTime", required = false) Long submitEndTime,
|
||||
@RequestParam(value = "regionId", required = false) String regionId,
|
||||
@RequestParam(value = "status", required = false) Integer status) {
|
||||
LicenseListRequest request =
|
||||
new LicenseListRequest(pageNumber, pageSize, storeName, submitStartTime, submitEndTime, regionId, status);
|
||||
return ResponseResult.success(applyLicenseService.licenseList(request));
|
||||
LicenseListRequest request = new LicenseListRequest(pageNumber, pageSize, storeName, submitStartTime, submitEndTime, regionId, status);
|
||||
LoginUserInfo user = CurrentUserHolder.getUser();
|
||||
return ResponseResult.success(applyLicenseService.licenseList(request,user));
|
||||
}
|
||||
|
||||
@ApiOperation("证照办理数据回显")
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.request.SubmitLicenseRequest;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.response.SubmitLicenseResponse;
|
||||
import com.cool.store.service.ApplyLicenseService;
|
||||
import com.cool.store.service.CoolStoreStartFlowService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -36,7 +37,7 @@ public class ApplyLicenseController {
|
||||
|
||||
@ApiOperation("证照办理数据回显")
|
||||
@GetMapping("/default/get")
|
||||
public ResponseResult getDefault(@RequestParam("shopId") Long shopId) {
|
||||
public ResponseResult<SubmitLicenseResponse> getDefault(@RequestParam("shopId") Long shopId) {
|
||||
return ResponseResult.success(applyLicenseService.getDefault(shopId));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user