Commit 69b4e16b by zhiwj

修改门店标签bug

parent 27ba25f8
package com.gic.store.service;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.dto.StoreTagTmpDTO;
......@@ -15,4 +16,6 @@ public interface StoreTagTmpApiService {
ServiceResponse<Void> saveStoreTagTmp(StoreTagTmpDTO bean);
ServiceResponse<Page<StoreTagTmpDTO>> listImportError(Integer enterpriseId, Integer currentPage, Integer pageSize);
ServiceResponse<JSONObject> queryCount(Integer enterpriseId);
}
......@@ -56,4 +56,6 @@ public interface TabStoreTagTmpMapper {
void delStoreTagTmp(@Param("enterpriseId") Integer enterpriseId);
Page<TabStoreTagTmp> listImportError(@Param("enterpriseId") Integer enterpriseId);
Integer querySuccessCount(@Param("enterpriseId") Integer enterpriseId);
}
\ No newline at end of file
......@@ -15,4 +15,6 @@ public interface StoreTagTmpService {
void saveStoreTagTmp(StoreTagTmpDTO bean);
Page<TabStoreTagTmp> listImportError(Integer enterpriseId, Integer currentPage, Integer pageSize);
Integer querySuccessCount(Integer enterpriseId);
}
......@@ -37,4 +37,9 @@ public class StoreTagTmpServiceImpl implements StoreTagTmpService {
PageHelper.startPage(currentPage, pageSize);
return tabStoreTagTmpMapper.listImportError(enterpriseId);
}
@Override
public Integer querySuccessCount(Integer enterpriseId) {
return tabStoreTagTmpMapper.querySuccessCount(enterpriseId);
}
}
package com.gic.store.service.outer.impl;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.PageHelperUtils;
......@@ -39,4 +40,12 @@ public class StoreTagTmpApiServiceImpl implements StoreTagTmpApiService {
com.github.pagehelper.Page<TabStoreTagTmp> page = this.storeTagTmpService.listImportError(enterpriseId, currentPage, pageSize);
return EnterpriseServiceResponse.success(PageHelperUtils.changePageHelperToCurrentPage(page, StoreTagTmpDTO.class));
}
@Override
public ServiceResponse<JSONObject> queryCount(Integer enterpriseId) {
Integer successCount = this.storeTagTmpService.querySuccessCount(enterpriseId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("successCount", successCount);
return EnterpriseServiceResponse.success(jsonObject);
}
}
......@@ -136,4 +136,9 @@
where enterprise_id = #{enterpriseId}
and error_message is not null
</select>
<select id="querySuccessCount" resultType="int">
select
count(*)
from tab_store_tag_tmp where enterprise_id = #{enterpriseId} and error_message is null
</select>
</mapper>
\ No newline at end of file
package com.gic.store.web.controller;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.download.utils.OperationResultUtils;
import com.gic.enterprise.error.ErrorCode;
......@@ -12,6 +14,7 @@ import com.gic.store.dto.*;
import com.gic.store.service.*;
import com.gic.store.web.qo.PageQO;
import com.gic.store.web.utils.ExcelUtils;
import com.gic.store.web.vo.StoreTagErrorListVO;
import com.gic.store.web.vo.StoreTagVO;
import com.gic.store.web.vo.storeWidget.StoreWidgetSearch;
import com.gic.store.web.vo.storeWidget.StoreWidgetWriteBack;
......@@ -162,7 +165,16 @@ public class StoreTagController {
@RequestMapping("/list-import-error")
public RestResponse listImportError(PageQO pageQO) {
ServiceResponse<Page<StoreTagTmpDTO>> serviceResponse = this.storeTagTmpApiService.listImportError(UserDetailUtils.getUserDetail().getEnterpriseId(), pageQO.getCurrentPage(), pageQO.getPageSize());
return ResultControllerUtils.commonResult(serviceResponse);
if (serviceResponse.isSuccess()) {
StoreTagErrorListVO vo = EntityUtil.changeEntityByJSON(StoreTagErrorListVO.class, serviceResponse.getResult());
ServiceResponse<JSONObject> countResponse = storeTagTmpApiService.queryCount(UserDetailUtils.getUserDetail().getEnterpriseId());
JSONObject result = countResponse.getResult();
vo.setSuccessCount(result.getInteger("successCount"));
return RestResponse.success(vo);
} else {
return RestResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
}
private Map<String, Object> parseFile(MultipartFile file, Integer storeWidgetId) {
......
......@@ -297,9 +297,9 @@ public class ExcelUtils {
// XSSFWorkbook xssfWorkbook = new XSSFWorkbook(in);
for (int numSheet = 0; numSheet < 1; numSheet++) {
Sheet xssfSheet = xssfWorkbook.getSheetAt(numSheet);
if (xssfSheet == null || xssfSheet.getLastRowNum() == 1) {
continue;
}
// if (xssfSheet == null || xssfSheet.getLastRowNum() == 1) {
// continue;
// }
for (int rowNum = row - 1; rowNum <= xssfSheet.getLastRowNum(); rowNum++) {
Row xssfRow = xssfSheet.getRow(rowNum);
if (xssfRow == null) {
......
package com.gic.store.web.vo;
import com.gic.api.base.commons.Page;
/**
* @author zhiwj
* @Description:
* @date 2020-02-28 16:34
*/
public class StoreTagErrorListVO extends Page {
private static final long serialVersionUID = -7808725362785909785L;
private Integer successCount;
public Integer getSuccessCount() {
return successCount;
}
public void setSuccessCount(Integer successCount) {
this.successCount = successCount;
}
}
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