Commit 19d81797 by zhiwj

门店批量插入任务

parent 81b640af
......@@ -69,10 +69,7 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
public void dealSingle(Object o) throws TaskAllocationException {
StoreTmpDTO t = (StoreTmpDTO) o;
try {
ServiceResponse<Integer> serviceResponse = this.importDataToStore(t);
if (!serviceResponse.isSuccess()) {
t.setErrorMessage(serviceResponse.getMessage());
}
this.importDataToStore(t);
} catch (Exception e) {
logger.warn("写入门店表和成员表异常", e);
t.setErrorMessage("导入异常");
......@@ -80,7 +77,7 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
}
}
public ServiceResponse<Integer> importDataToStore(StoreTmpDTO t) {
public void importDataToStore(StoreTmpDTO t) {
StoreDTO storeDTO = new StoreDTO();
storeDTO.setEnterpriseId(t.getEnterpriseId());
storeDTO.setStoreName(t.getStoreName());
......@@ -162,7 +159,15 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
List<StoreExtendDTO> extendList = JSON.parseArray(customField, StoreExtendDTO.class);
storeDTO.setStoreExtendList(extendList);
return storeApiService.saveOrUpdate(storeDTO);
ServiceResponse<Integer> serviceResponse = storeApiService.saveOrUpdate(storeDTO);
String msg;
if (serviceResponse.isSuccess()) {
msg = "success";
} else {
msg = serviceResponse.getMessage();
}
t.setErrorMessage(msg);
storeImportService.updateData(t);
}
@Override
......
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