配置文件
This commit is contained in:
parent
460a1a07b6
commit
d4cb55d98f
|
|
@ -3,7 +3,8 @@ server:
|
|||
|
||||
spring:
|
||||
redis:
|
||||
host: 172.27.181.247
|
||||
#host: 172.27.181.247
|
||||
host: 127.0.0.1
|
||||
# 进入哨兵项目-这个端口就不用了,除非是单体
|
||||
port: 8011
|
||||
# sentinel:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
spring:
|
||||
profiles:
|
||||
active: dev #设定打包配置文件
|
||||
active: yun #设定打包配置文件
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,7 @@ import com.rzyc.model.check.ChkBillDetailWithBLOBs;
|
|||
import com.rzyc.model.check.ChkGovBillDetail;
|
||||
import com.rzyc.model.ent.*;
|
||||
import com.rzyc.model.oth.OthRefuge;
|
||||
import com.rzyc.model.user.ListPerform;
|
||||
import com.rzyc.model.user.SysUnit;
|
||||
import com.rzyc.model.user.SysUser;
|
||||
import com.rzyc.model.user.*;
|
||||
import com.rzyc.service.PcBusinessService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
|
@ -3001,5 +2999,110 @@ public class ImportController extends com.rzyc.controller.BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入新兴行业职责
|
||||
* @version v1.0
|
||||
* @author dong
|
||||
* @date 2022/7/18 14:59
|
||||
*/
|
||||
@ApiOperation(value = "导入新兴行业职责", notes = "导入新兴行业职责")
|
||||
@RequestMapping(value = "/risingData", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public SingleResult<String> risingData(@RequestBody MultipartFile multipartFile)throws Exception{
|
||||
SingleResult<String> result = new SingleResult<>();
|
||||
Workbook wookbook = WorkbookFactory.create(multipartFile.getInputStream());
|
||||
Sheet sheet = wookbook.getSheetAt(0);
|
||||
|
||||
//获得表头
|
||||
Row rowHead = sheet.getRow(0);
|
||||
|
||||
System.out.println("getPhysicalNumberOfCells -> "+rowHead.getPhysicalNumberOfCells());
|
||||
//判断表头是否正确
|
||||
if(true){
|
||||
//获得数据的总行数
|
||||
int totalRowNum = sheet.getLastRowNum();
|
||||
|
||||
if(totalRowNum > 0){
|
||||
|
||||
Boolean isSubject = true;
|
||||
DataFormatter dataFormatter = new DataFormatter();
|
||||
|
||||
|
||||
|
||||
|
||||
ChkBillDetailWithBLOBs chkBillDetail = new ChkBillDetailWithBLOBs();
|
||||
String workUnit = "";
|
||||
|
||||
|
||||
|
||||
List<String> itemIds = new ArrayList<>();
|
||||
Map<Integer,String> map = new HashMap<>();
|
||||
|
||||
Row row = sheet.getRow(0);
|
||||
|
||||
Cell cell = row.getCell((short)1);
|
||||
|
||||
for (int j = 1;j<=13;j++){
|
||||
cell = row.getCell((short)j);
|
||||
String str = dataFormatter.formatCellValue(cell);
|
||||
str = StringUtils.replaceBlank(str);
|
||||
map.put(j,str);
|
||||
}
|
||||
|
||||
|
||||
System.out.println("map --> "+JSONArray.toJSONString(map));
|
||||
|
||||
|
||||
Integer index = 1;
|
||||
//获得所有数据
|
||||
for(int i = 1 ; i <= totalRowNum ; i++){
|
||||
//获得第i行对象
|
||||
row = sheet.getRow(i);
|
||||
if(null == row){
|
||||
break;
|
||||
}
|
||||
|
||||
cell = row.getCell((short)0);
|
||||
String unitName = dataFormatter.formatCellValue(cell);
|
||||
unitName = StringUtils.replaceBlank(unitName);
|
||||
System.out.println("unitName ----> "+unitName);
|
||||
ListPerform perform = listPerformMapper.findByName(unitName,"5bd164aa-dd43-45e3-a5a2-649bb2fd9fb9");
|
||||
if(null != perform){
|
||||
for (int k = 1;k<=13;k++){
|
||||
cell = row.getCell((short)k);
|
||||
String listStr = dataFormatter.formatCellValue(cell);
|
||||
listStr = StringUtils.replaceBlank(listStr);
|
||||
if(StringUtils.isNotBlank(listStr)){
|
||||
System.out.println(perform.getListperformid()+" -----> listStr ---------> "+listStr);
|
||||
ListSafeWithBLOBs listSafe = new ListSafeWithBLOBs();
|
||||
listSafe.setListsafeid(RandomNumber.getUUid());
|
||||
listSafe.setListperformid(perform.getListperformid());
|
||||
listSafe.setSafeduty(map.get(k)+":"+listStr);
|
||||
listSafe.setSortid(i);
|
||||
listSafe.setCreatedby("excel");
|
||||
listSafe.setModifiedby("excel");
|
||||
listSafe.setCreatedon(new Date());
|
||||
listSafe.setModifiedon(new Date());
|
||||
listSafeMapper.insert(listSafe);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
System.out.println(index);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ spring:
|
|||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://121.40.106.103:3306/inventory_copy?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false
|
||||
username: rzyc
|
||||
password: ENC(FDlRK2MAcJBMF7UBHBJPLGzRkpWQ4T6dgYP2bDnTodQ=)
|
||||
password: admin@rzyc2022.com##
|
||||
tomcat:
|
||||
max-active: 10
|
||||
min-idle: 10
|
||||
|
|
|
|||
|
|
@ -30,11 +30,14 @@ spring:
|
|||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://121.40.106.103:3306/inventory_copy?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&useSSL=false
|
||||
username: rzyc
|
||||
password: ENC(FDlRK2MAcJBMF7UBHBJPLGzRkpWQ4T6dgYP2bDnTodQ=)
|
||||
password: admin@rzyc2022.com##
|
||||
testOnBorrow: true
|
||||
validationQuery: SELECT 1
|
||||
tomcat:
|
||||
max-active: 10
|
||||
min-idle: 10
|
||||
initial-size: 2
|
||||
testOnBorrow: true
|
||||
hikari:
|
||||
minimum-idle: 3
|
||||
maximum-pool-size: 10
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
spring:
|
||||
profiles:
|
||||
active: dev #设定打包配置文件
|
||||
active: yun #设定打包配置文件
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user