Commit ee12f20c by zhiwj

修改商户id取值

parent 8d3fcaca
......@@ -2,25 +2,18 @@ package com.gic.store.web.controller;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GlobalInfo;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.store.dto.ClerkDTO;
import com.gic.store.dto.ClerkSearchDTO;
import com.gic.store.service.ClerkApiService;
import com.gic.store.web.qo.PageQO;
import com.gic.store.web.qo.clerk.ClerkQO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @author zhiwj
* @date 2019/7/16
......@@ -33,7 +26,7 @@ public class ClerkController {
@RequestMapping("/save-clerk")
public RestResponse save(@Validated(ClerkQO.SaveValidView.class) ClerkQO clerkQO) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ClerkDTO clerkDTO = EntityUtil.changeEntityByOrika(ClerkDTO.class, clerkQO);
clerkDTO.setEnterpriseId(enterpriseId);
ServiceResponse serviceResponse = clerkApiService.saveOrUpdate(clerkDTO);
......@@ -46,7 +39,7 @@ public class ClerkController {
@RequestMapping("/list-clerk")
public RestResponse listClerk(@RequestBody ClerkSearchDTO clerkSearchDTO) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
clerkSearchDTO.setEnterpriseId(enterpriseId);
ServiceResponse serviceResponse = clerkApiService.listClerk(enterpriseId, clerkSearchDTO, clerkSearchDTO.getCurrentPage(), clerkSearchDTO.getPageSize());
if (serviceResponse.isSuccess()) {
......@@ -58,7 +51,7 @@ public class ClerkController {
@RequestMapping("/update-clerk-status")
public RestResponse updateClerkStatus(String clerkIds, Integer status) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse serviceResponse = clerkApiService.updateClerkStatus(enterpriseId, clerkIds, status);
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......
......@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.store.constant.GenderEnum;
import com.gic.store.constant.StoreImportEnum;
import com.gic.store.constant.StoreOwnTypeEnum;
......@@ -89,7 +90,7 @@ public class ClerkImportController {
*/
@RequestMapping("/clerk-tmp-file-upload")
public RestResponse fileUpload(HttpServletRequest request, MultipartFile file, PageQO pageQO) throws IOException {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
if (file == null || file.isEmpty()) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "文件不存在");
}
......@@ -159,7 +160,7 @@ public class ClerkImportController {
*/
@RequestMapping("/get_clerk_batch_process")
public Object getStoreBatchProcess(HttpServletRequest request, PageQO page) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
String uuId = request.getParameter("uuId");
Map<String, Object> data = clerkImportApiService.getClerkBatchProcess(enterpriseId, uuId, page.getCurrentPage(), page.getPageSize()).getResult();
return RestResponse.success(data);
......@@ -172,7 +173,7 @@ public class ClerkImportController {
*/
@RequestMapping("/clerk-import-load-error-data")
public Object loadErrorData(PageQO page) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
Map<String, Object> result = new HashMap<String, Object>();
List<ClerkTmpDTO> successList = clerkImportApiService.listClerkTmp(enterpriseId, true).getResult();
ServiceResponse<Page> serviceResponse = clerkImportApiService.pageError(enterpriseId, page.getCurrentPage(), page.getPageSize());
......@@ -194,7 +195,7 @@ public class ClerkImportController {
*/
@RequestMapping("/export-clerk-error-data")
public RestResponse exportErrorData(HttpServletRequest request, HttpServletResponse response) throws IOException {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
String fileName = "导购导入错误记录.xlsx";
List<ClerkTmpDTO> listErrorData = clerkImportApiService.listClerkTmp(enterpriseId, false).getResult();
if (!listErrorData.isEmpty()) {
......
......@@ -6,6 +6,7 @@ import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.PlatformBrandDTO;
import com.gic.enterprise.service.PlatformBrandApiService;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.store.dto.StoreBrandDTO;
import com.gic.store.service.StoreBrandApiService;
import com.gic.store.web.qo.PageQO;
......@@ -42,7 +43,7 @@ public class StoreBrandController {
@RequestMapping("/save-store-brand")
public RestResponse saveStoreBrand(@Validated(StoreBrandQO.SaveValidView.class) StoreBrandQO storeBrandQO) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
StoreBrandDTO storeBrandDTO = EntityUtil.changeEntity(StoreBrandDTO.class, storeBrandQO);
storeBrandDTO.setEnterpriseId(enterpriseId);
ServiceResponse<Integer> serviceResponse = storeBrandApiService.saveOrUpdateStoreBrand(storeBrandDTO);
......@@ -55,7 +56,7 @@ public class StoreBrandController {
@RequestMapping("/page-store-brand")
public RestResponse pageStoreBrand(String search, PageQO pageQO) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<Page<StoreBrandDTO>> serviceResponse = storeBrandApiService.listStoreBrand(enterpriseId, search, pageQO.getCurrentPage(), pageQO.getPageSize());
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......@@ -66,7 +67,7 @@ public class StoreBrandController {
@RequestMapping("/list-store-brand")
public RestResponse listStoreBrand(String search, Integer storeSupport, Integer goodsSupport) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<List<StoreBrandDTO>> serviceResponse = storeBrandApiService.listAllStoreBrand(enterpriseId, search, storeSupport, goodsSupport);
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......@@ -77,7 +78,7 @@ public class StoreBrandController {
@RequestMapping("/delete-store-brand-batch")
public RestResponse deleteByIds(String ids) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse serviceResponse = storeBrandApiService.deleteByIds(enterpriseId, ids);
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......@@ -87,7 +88,7 @@ public class StoreBrandController {
}
@RequestMapping("/delete-all-store-brand-batch")
public RestResponse delete() {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse serviceResponse = storeBrandApiService.deleteAll(enterpriseId);
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......@@ -99,7 +100,7 @@ public class StoreBrandController {
@RequestMapping("/move-store-brand")
public RestResponse moveStoreBrand(@Validated(StoreBrandQO.MoveValidView.class) StoreBrandQO storeBrandQO) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse serviceResponse = storeBrandApiService.moveStoreBrand(enterpriseId, storeBrandQO.getStoreBrandId(), storeBrandQO.getMoveType());
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......@@ -110,7 +111,7 @@ public class StoreBrandController {
@RequestMapping("/set-store-brand-sort")
public RestResponse setStoreBrandSort(@Validated({StoreBrandQO.SetSortValidView.class}) StoreBrandQO storeBrandQO) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse serviceResponse = storeBrandApiService.setStoreBrandSort(enterpriseId, storeBrandQO.getStoreBrandId(), storeBrandQO.getSeq());
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......
......@@ -54,7 +54,7 @@ public class StoreController {
@RequestMapping("/save-store")
public RestResponse saveOrUpdate(@Validated({StoreQO.SaveValidView.class}) StoreQO storeQO) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
StoreDTO storeDTO = EntityUtil.changeEntityByOrika(StoreDTO.class, storeQO);
storeDTO.setEnterpriseId(enterpriseId);
String photos = storeQO.getPhotos();
......@@ -85,7 +85,7 @@ public class StoreController {
@RequestMapping("/store-detail")
public RestResponse getStoreDetail(Integer storeId) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<StoreDTO> serviceResponse = storeApiService.getStoreById(enterpriseId, storeId);
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......@@ -190,7 +190,7 @@ public class StoreController {
@RequestMapping("bulk-update-store")
public RestResponse bulkUpdateStatus(String storeIds, String value, int type) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
if (StringUtils.isBlank(storeIds) || StringUtils.isBlank(value)) {
return EnterpriseRestResponse.failure(ErrorCode.MISS_PARAMETER);
}
......
......@@ -5,6 +5,7 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.store.constant.StoreImportEnum;
import com.gic.store.dto.*;
import com.gic.store.service.*;
......@@ -73,7 +74,7 @@ public class StoreImportController {
if (StringUtils.isBlank(regionIdStr)) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "请选择门店域");
}
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
List<List<String>> list = new ArrayList<>();
ServiceResponse<List<List<String>>> titleServiceResponse = storeImportApiService.listImportTitle(enterpriseId, Integer.parseInt(regionIdStr));
......@@ -109,7 +110,7 @@ public class StoreImportController {
*/
@RequestMapping("/store-tmp-file-upload")
public RestResponse fileUpload(HttpServletRequest request, MultipartFile file, PageQO pageQO) throws IOException {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
if (file == null || file.isEmpty()) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "文件不存在");
}
......@@ -187,7 +188,7 @@ public class StoreImportController {
*/
@RequestMapping("/store-import-load-error-data")
public Object loadErrorData(PageQO page) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
Map<String, Object> result = new HashMap<String, Object>();
List<StoreTmpDTO> successList = storeImportApiService.listStoreTmp(enterpriseId, true).getResult();
ServiceResponse<Page> serviceResponse = storeImportApiService.pageError(enterpriseId, page.getCurrentPage(), page.getPageSize());
......@@ -208,7 +209,7 @@ public class StoreImportController {
@RequestMapping("/get_store_batch_process")
public Object getStoreBatchProcess(HttpServletRequest request, PageQO page) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
String uuId = request.getParameter("uuId");
// String url = GlobalVar.ctxPropertiesMap.get("batch.task.url").replace("\\", "") + "/task-allocation/queryTask.json";
// HashMap<String, String> param = new HashMap<>(4);
......@@ -261,7 +262,7 @@ public class StoreImportController {
*/
@RequestMapping("/export-error-data")
public RestResponse exportErrorData(HttpServletRequest request, HttpServletResponse response) throws IOException {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
String fileName = "门店导入错误记录.xlsx";
List<StoreTmpDTO> listErrorData = storeImportApiService.listStoreTmp(enterpriseId, false).getResult();
if (!listErrorData.isEmpty()) {
......
......@@ -3,6 +3,7 @@ package com.gic.store.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.store.dto.StoreRegionDTO;
import com.gic.store.service.StoreRegionApiService;
import com.gic.store.web.qo.PageQO;
......@@ -26,7 +27,7 @@ public class StoreRegionController {
@RequestMapping("/save-store-region")
public RestResponse saveStoreRegion(@Validated({StoreRegionQO.SaveValidView.class}) StoreRegionQO storeRegionQO) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<Integer> serviceResponse = storeRegionApiService.saveOrUpdateStoreRegion(enterpriseId, storeRegionQO.getRegionCode(), storeRegionQO.getRegionName(), storeRegionQO.getRegionId());
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......@@ -37,7 +38,7 @@ public class StoreRegionController {
@RequestMapping("/page-store-region")
public RestResponse pageStoreRegion(String search, PageQO pageQO) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<Page<StoreRegionDTO>> serviceResponse = storeRegionApiService.listStoreRegion(enterpriseId, search, pageQO.getCurrentPage(), pageQO.getPageSize());
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......@@ -48,7 +49,7 @@ public class StoreRegionController {
@RequestMapping("/list-store-region")
public RestResponse listStoreRegion(String search) {
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<List<StoreRegionDTO>> serviceResponse = storeRegionApiService.listStoreRegion(enterpriseId, search);
if (serviceResponse.isSuccess()) {
return RestResponse.success(serviceResponse.getResult());
......
......@@ -4,6 +4,7 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseRestResponse;
import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.store.constant.StoreOwnTypeEnum;
import com.gic.store.dto.StoreRegionDTO;
import com.gic.store.dto.StoreStatusSettingDTO;
......@@ -29,7 +30,7 @@ public class StoreStatusSettingController {
@RequestMapping("storestatus-setting")
public RestResponse saveStoreStatusSetting(Integer regionId, Integer days, Integer value){
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
if(regionId == null || days == null || value == null){
return EnterpriseRestResponse.failure(ErrorCode.MISS_PARAMETER);
}
......@@ -47,7 +48,7 @@ public class StoreStatusSettingController {
@RequestMapping("list-storestatus-setting")
public RestResponse listStoreStatusSetting(){
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<List<StoreStatusSettingDTO>> serviceResponse = this.storeStatusSettingApiService.listSetting(enterpriseId);
if(serviceResponse.isSuccess()){
List<StoreStatusSettingVO> list = new ArrayList<>();
......@@ -99,7 +100,7 @@ public class StoreStatusSettingController {
if(id == null){
return EnterpriseRestResponse.failure(ErrorCode.MISS_PARAMETER);
}
Integer enterpriseId = 1111;
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse serviceResponse = this.storeStatusSettingApiService.delete(enterpriseId, id);
if(serviceResponse.isSuccess()){
return RestResponse.success();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment