Commit 44a72871 authored by 侯彦文's avatar 侯彦文

Merge remote-tracking branch 'origin/master'

parents 2cf5852b 7231d9e7
......@@ -149,7 +149,7 @@ public class Constants {
/**
* 已发布
*/
public static final String PBULISHED = "published";
public static final String PBULISHED = "release";
/**
* 已发布
*/
......
......@@ -22,6 +22,7 @@ import com.yonde.dex.dao.service.util.ApplicationContextUtil;
import com.yonde.dex.dao.service.util.DxPageUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
......@@ -87,6 +88,7 @@ public class ICMPlanExcelListenner extends AnalysisEventListener<ExtICMPlanExcel
}
@Transactional(rollbackFor = Exception.class)
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
// 收尾工作,处理剩下的缓存数据。。。
......@@ -107,7 +109,10 @@ public class ICMPlanExcelListenner extends AnalysisEventListener<ExtICMPlanExcel
ExtICMExternalInterfacePlanVO extICMPlanVOForDB = getICMPlanByPlanNumber(extICMPlanExcelVO.getPlanNumber());
extICMPlanVOForDB.setOperator(OperatorType.MODIFY);
transitionObject(extICMPlanVOForDB,extICMPlanExcelVO);
extICMExternalInterfacePlanService.saveRecursion(extICMPlanVOForDB);
//更新,大版本升级
extICMExternalInterfacePlanService.newVersion(extICMPlanVOForDB);
//将旧版本设置为作废
extICMExternalInterfacePlanService.changeStatus(extICMPlanVOForDB.getId(),Constants.OBSOLETE,true);
} else { //删除
ExtICMExternalInterfacePlanVO extICMPlanVOForDB = getICMPlanByPlanNumber(extICMPlanExcelVO.getPlanNumber());
extICMExternalInterfacePlanService.remove(extICMPlanVOForDB.getId());
......@@ -154,7 +159,15 @@ public class ICMPlanExcelListenner extends AnalysisEventListener<ExtICMPlanExcel
errorString.append("解析到数据第"+excelDataRow+"行,新增ICM计划编号:" + extICMPlanExcelVO.getPlanNumber() + "已存在,不能重复添加!");
errorList.add(errorString);
}
}else {
} else if (Constants.EXCEL_UPDATE.equals(extICMPlanExcelVO.getOperation())) {
ExtICMExternalInterfacePlanVO extICMPlanForDB = getICMPlanByPlanNumber(extICMPlanExcelVO.getPlanNumber());
String icmState = extICMPlanForDB.getState();
//如果计划不是已发布不能进行升版本 -->release已发布
if(!icmState.equals(Constants.RELEASE)){
errorString.append("解析到数据第"+excelDataRow+"行,更新ICM计划编号:" + extICMPlanExcelVO.getPlanNumber() + "的状态是"+ icmState +",不能进行更新操作!");
errorList.add(errorString);
}
} else {
ExtICMExternalInterfacePlanVO extICMPlanVO = getICMPlanByFileNumberAndDeleted(extICMPlanExcelVO.getPlanNumber());
if (!ObjectUtils.isEmpty(extICMPlanVO) && 1 == extICMPlanVO.getDeleted()) {
errorString.append("解析到数据第"+excelDataRow+"行,ICM计划编号:" + extICMPlanExcelVO.getPlanNumber() + "已被删除,更新或删除失败!");
......
......@@ -21,6 +21,7 @@ import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.basedata.entity.api.CustomMultipartFile;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.dao.business.events.DaoPluginBusinessEvent;
import com.yonde.dex.dfs.feign.FileManagerFeignService;
import com.yonde.dex.systemfile.feign.SystemFileFeignService;
import org.apache.commons.collections.CollectionUtils;
......@@ -38,6 +39,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import com.yonde.dcs.plan.core.service.ExtICMExternalInterfacePlanService;
import com.yonde.dcs.plan.core.repository.ExtICMExternalInterfacePlanRepository;
......@@ -53,7 +55,7 @@ import javax.servlet.http.HttpServletResponse;
**/
@Slf4j
@Service(ExtICMExternalInterfacePlanServiceImpl.BEAN_NAME)
public class ExtICMExternalInterfacePlanServiceImpl<V extends ExtICMExternalInterfacePlanVO> implements ExtICMExternalInterfacePlanService<V>{
public class ExtICMExternalInterfacePlanServiceImpl<V extends ExtICMExternalInterfacePlanVO> implements ExtICMExternalInterfacePlanService<V> {
public static final String BEAN_NAME = "extICMExternalInterfacePlanServiceImpl";
......@@ -119,7 +121,7 @@ public class ExtICMExternalInterfacePlanServiceImpl<V extends ExtICMExternalInte
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.sheet("ICM计划列表").doWrite(extICMPlanExcelVOList);
//导出数据
FileUtils.exportFile(response, new FileInputStream(filePath), "application/vnd.ms-excel;charset=utf-8", "ICM计划.xlsx");
FileUtils.exportFile(response, new FileInputStream(filePath), "application/vnd.ms-excel;charset=utf-8", "ICM计划模板(内部).xlsx");
FileUtil.del(dir);
} else {
......@@ -169,6 +171,7 @@ public class ExtICMExternalInterfacePlanServiceImpl<V extends ExtICMExternalInte
return ApiResult.SUCCESS;
}
}
......@@ -121,7 +121,7 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.sheet("IED计划列表").doWrite(extIEDPlanExcelVOList);
//导出数据
FileUtils.exportFile(response, new FileInputStream(filePath), "application/vnd.ms-excel;charset=utf-8", "采购计划.xlsx");
FileUtils.exportFile(response, new FileInputStream(filePath), "application/vnd.ms-excel;charset=utf-8", "IED计划模板(内部).xlsx");
FileUtil.del(dir);
} else {
......
......@@ -116,7 +116,7 @@ public class ExtPuchasePlanAttributeServiceImpl<V extends ExtPuchasePlanAttribut
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
.sheet("采购计划列表").doWrite(extPuchasePlanExcelVOList);
//导出数据
FileUtils.exportFile(response, new FileInputStream(filePath), "application/vnd.ms-excel;charset=utf-8", "采购计划.xlsx");
FileUtils.exportFile(response, new FileInputStream(filePath), "application/vnd.ms-excel;charset=utf-8", "采购计划模板(内部).xlsx");
FileUtil.del(dir);
} else {
......
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