|
|
@@ -59,17 +59,22 @@ public class DemandCollectionServiceImpl extends BaseMybatisDao<DemandCollection
|
|
|
public int addDemandCollection(DemandCollection d) {
|
|
|
String aid=UUID.randomUUID().toString();
|
|
|
SkjtUser su=new SkjtUser();
|
|
|
- su.setId(aid);
|
|
|
- su.setAccount(d.getDwmc());
|
|
|
- su.setPassword("123456");
|
|
|
- Calendar c=Calendar.getInstance();
|
|
|
- c.set(Calendar.MILLISECOND, 0);
|
|
|
- su.setCreateTime(c.getTime());
|
|
|
- su.setNickname(d.getDwmc());
|
|
|
- su.setPassword(passwordUtil.getEncryptPwd(su));
|
|
|
- skjtUserMapper.insertSelective(su);
|
|
|
- skjtUserMapper.setUserRole(su.getId());
|
|
|
- d.setAid(aid);
|
|
|
+ SkjtUser user = skjtUserMapper.selectByAccount(d.getDwmc());
|
|
|
+ if (user==null) {
|
|
|
+ su.setId(aid);
|
|
|
+ su.setAccount(d.getDwmc());
|
|
|
+ su.setPassword("123456");
|
|
|
+ Calendar c=Calendar.getInstance();
|
|
|
+ c.set(Calendar.MILLISECOND, 0);
|
|
|
+ su.setCreateTime(c.getTime());
|
|
|
+ su.setNickname(d.getDwmc());
|
|
|
+ su.setPassword(passwordUtil.getEncryptPwd(su));
|
|
|
+ skjtUserMapper.insertSelective(su);
|
|
|
+ skjtUserMapper.setUserRole(su.getId());
|
|
|
+ d.setAid(aid);
|
|
|
+ }else {
|
|
|
+ d.setAid(user.getId());
|
|
|
+ }
|
|
|
return demandCollectionMapper.insertSelective(d);
|
|
|
}
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@@ -84,6 +89,9 @@ public class DemandCollectionServiceImpl extends BaseMybatisDao<DemandCollection
|
|
|
map.put("startTime", i.getStartTime());
|
|
|
map.put("endTime", i.getEndTime()+" 23:59:59");
|
|
|
}
|
|
|
+ if(StringUtils.isNotBlank(i.getHtly()))map.put("htly", i.getHtly());
|
|
|
+ if(StringUtils.isNotBlank(i.getRygm()))map.put("rygm", i.getRygm());
|
|
|
+ if(StringUtils.isNotBlank(i.getJjgm()))map.put("jjgm", i.getJjgm());
|
|
|
if(StringUtils.isNotBlank(i.getSsszp()))map.put("ssszp", i.getSsszp());
|
|
|
if(StringUtils.isNotBlank(i.getSsszc()))map.put("ssszc", i.getSsszc());
|
|
|
if(StringUtils.isNotBlank(i.getSssza()))map.put("sssza", i.getSssza());
|
|
|
@@ -116,7 +124,6 @@ public class DemandCollectionServiceImpl extends BaseMybatisDao<DemandCollection
|
|
|
XSSFWorkbook wb =ExportExcelUtil.exportTemplateInfoS(comment,"需求征集表");
|
|
|
//根据列表编写文档
|
|
|
XSSFSheet sheet =wb.getSheetAt(0);
|
|
|
-
|
|
|
XSSFCellStyle styleTitle = wb.createCellStyle();
|
|
|
styleTitle.setAlignment(HorizontalAlignment.CENTER);
|
|
|
styleTitle.setWrapText(true);
|
|
|
@@ -219,10 +226,10 @@ public class DemandCollectionServiceImpl extends BaseMybatisDao<DemandCollection
|
|
|
if (x==0)sheet.setColumnWidth(i, 10000);
|
|
|
break;
|
|
|
case "现有研发条件情况(人员情况、仪器设备投入等)" : o = ob.getXyyftjqk();
|
|
|
- if (x==0)sheet.setColumnWidth(i, 10000);
|
|
|
+ if (x==0)sheet.setColumnWidth(i, 20000);
|
|
|
break;
|
|
|
case "目前合作对象情况(合作对象、方式、已投入研发资金情况等)" : o = ob.getMqhzdxqk();
|
|
|
- if (x==0)sheet.setColumnWidth(i, 10000);
|
|
|
+ if (x==0)sheet.setColumnWidth(i, 20000);
|
|
|
break;
|
|
|
case "是否有下一步合作需求" : o = ob.getSfyxybhzxq(); break;
|
|
|
case "意向合作对象" : o = ob.getYxhzdx(); break;
|
|
|
@@ -244,6 +251,8 @@ public class DemandCollectionServiceImpl extends BaseMybatisDao<DemandCollection
|
|
|
}
|
|
|
x++;
|
|
|
}
|
|
|
+ //冻结
|
|
|
+ sheet.createFreezePane(2, 2, 2, 2);
|
|
|
//返回名称及参数
|
|
|
response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(),"iso-8859-1"));
|
|
|
response.setContentType("application/octet-stream;charset=utf-8");
|