xg
This commit is contained in:
parent
33703e072c
commit
6ddd39ea5a
11
pom.xml
11
pom.xml
@ -248,6 +248,16 @@
|
|||||||
<artifactId>bcutil-jdk18on</artifactId>
|
<artifactId>bcutil-jdk18on</artifactId>
|
||||||
<version>1.78.1</version>
|
<version>1.78.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi</artifactId>
|
||||||
|
<version>5.2.5</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi-ooxml</artifactId>
|
||||||
|
<version>5.2.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -468,6 +478,7 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
|||||||
@ -242,15 +242,16 @@ public class ContractInfoManageController {
|
|||||||
ContractInfoStatus bean = new ContractInfoStatus();
|
ContractInfoStatus bean = new ContractInfoStatus();
|
||||||
bean.setTs_code(contractInfo.getTs_code());
|
bean.setTs_code(contractInfo.getTs_code());
|
||||||
contractInfoStatusMapper.insertSelective(bean);
|
contractInfoStatusMapper.insertSelective(bean);
|
||||||
|
}else {
|
||||||
|
ContractInfoStatus info = opStatu.get();
|
||||||
|
info.setContract_status(0);
|
||||||
|
info.setScribe_status(null);
|
||||||
|
info.setScribe_update_time(null);
|
||||||
|
info.setScribe_number(null);
|
||||||
|
info.setTs_code(null);
|
||||||
|
contractInfoStatusMapper.updateByPrimaryKeySelective(info);
|
||||||
}
|
}
|
||||||
ContractInfoStatus info = opStatu.get();
|
|
||||||
info.setContract_status(0);
|
|
||||||
info.setScribe_status(null);
|
|
||||||
info.setScribe_status(null);
|
|
||||||
info.setScribe_update_time(null);
|
|
||||||
info.setScribe_number(null);
|
|
||||||
info.setTs_code(null);
|
|
||||||
contractInfoStatusMapper.updateByPrimaryKeySelective(info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return R.SUCCESS("ok");
|
return R.SUCCESS("ok");
|
||||||
@ -292,15 +293,16 @@ public class ContractInfoManageController {
|
|||||||
bean.setTs_code(contractInfo.getTs_code());
|
bean.setTs_code(contractInfo.getTs_code());
|
||||||
bean.setContract_status(1);
|
bean.setContract_status(1);
|
||||||
contractInfoStatusMapper.insertSelective(bean);
|
contractInfoStatusMapper.insertSelective(bean);
|
||||||
|
}else {
|
||||||
|
ContractInfoStatus info = opStatu.get();
|
||||||
|
info.setContract_status(1);
|
||||||
|
info.setScribe_status(null);
|
||||||
|
info.setScribe_update_time(null);
|
||||||
|
info.setScribe_number(null);
|
||||||
|
info.setTs_code(null);
|
||||||
|
contractInfoStatusMapper.updateByPrimaryKeySelective(info);
|
||||||
}
|
}
|
||||||
ContractInfoStatus info = opStatu.get();
|
|
||||||
info.setContract_status(1);
|
|
||||||
info.setScribe_status(null);
|
|
||||||
info.setScribe_status(null);
|
|
||||||
info.setScribe_update_time(null);
|
|
||||||
info.setScribe_number(null);
|
|
||||||
info.setTs_code(null);
|
|
||||||
contractInfoStatusMapper.updateByPrimaryKeySelective(info);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,14 @@
|
|||||||
package jj.tech.finance.biz.webadmin.controller;
|
package jj.tech.finance.biz.webadmin.controller;
|
||||||
|
|
||||||
import static org.mybatis.dynamic.sql.SqlBuilder.*;
|
import static org.mybatis.dynamic.sql.SqlBuilder.count;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.equalTo;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualToWhenPresent;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.isLikeWhenPresent;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.isNull;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.or;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.select;
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.selectDistinct;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -14,7 +22,6 @@ import org.apache.commons.lang3.ArrayUtils;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.mybatis.dynamic.sql.BasicColumn;
|
import org.mybatis.dynamic.sql.BasicColumn;
|
||||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||||
import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider;
|
|
||||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||||
import org.mybatis.dynamic.sql.select.QueryExpressionDSL;
|
import org.mybatis.dynamic.sql.select.QueryExpressionDSL;
|
||||||
import org.mybatis.dynamic.sql.select.SelectModel;
|
import org.mybatis.dynamic.sql.select.SelectModel;
|
||||||
@ -22,11 +29,9 @@ import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
|||||||
import org.mybatis.dynamic.sql.where.WhereApplier;
|
import org.mybatis.dynamic.sql.where.WhereApplier;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
@ -37,7 +42,6 @@ import jakarta.validation.Valid;
|
|||||||
import jj.tech.finance.biz.web.dao.ContractInfoSelectMapper;
|
import jj.tech.finance.biz.web.dao.ContractInfoSelectMapper;
|
||||||
import jj.tech.finance.biz.webadmin.dao.SelectMapper;
|
import jj.tech.finance.biz.webadmin.dao.SelectMapper;
|
||||||
import jj.tech.finance.biz.webadmin.vo.ContractInfoStatuScribe;
|
import jj.tech.finance.biz.webadmin.vo.ContractInfoStatuScribe;
|
||||||
import jj.tech.finance.biz.webadmin.vo.ContractInfoStatuScribeStore;
|
|
||||||
import jj.tech.finance.biz.webadmin.vo.ScribeVo;
|
import jj.tech.finance.biz.webadmin.vo.ScribeVo;
|
||||||
import jj.tech.finance.biz.webadmin.vo.parm.Contract;
|
import jj.tech.finance.biz.webadmin.vo.parm.Contract;
|
||||||
import jj.tech.finance.biz.webadmin.vo.parm.Id;
|
import jj.tech.finance.biz.webadmin.vo.parm.Id;
|
||||||
@ -412,4 +416,7 @@ public class ContractInfoScribeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,172 @@
|
|||||||
|
package jj.tech.finance.biz.webadmin.controller;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.stream.Collector;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.apache.commons.beanutils.BeanUtils;
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jj.tech.finance.biz.web.dao.ContractInfoSelectMapper;
|
||||||
|
import jj.tech.finance.biz.webadmin.dao.SelectMapper;
|
||||||
|
import jj.tech.finance.biz.webadmin.service.ScribeService;
|
||||||
|
import jj.tech.finance.biz.webadmin.vo.ScribeExcelVo;
|
||||||
|
import jj.tech.finance.biz.webadmin.vo.parm.Contract;
|
||||||
|
import jj.tech.finance.repository.mybatis.dao.ContractInfoMapper;
|
||||||
|
import jj.tech.finance.repository.mybatis.dao.ContractInfoStatusMapper;
|
||||||
|
import jj.tech.finance.repository.mybatis.dao.ContractInfoStatusScribeMapper;
|
||||||
|
import jj.tech.finance.repository.mybatis.dao.FutDailyMapper;
|
||||||
|
import jj.tech.finance.repository.mybatis.entity.ContractInfoStatusScribe;
|
||||||
|
import jj.tech.finance.utils.R;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Tag(name = "contractInfoScribeExcelController", description = "划线管理,excel,最大处理1万条")
|
||||||
|
@RequestMapping(value = "/op/scribe/excel", name = "划线管理,excel")
|
||||||
|
public class ContractInfoScribeExcelController {
|
||||||
|
|
||||||
|
@Autowired ObjectMapper objectMapper;
|
||||||
|
@Autowired ContractInfoMapper contractInfoMapper;
|
||||||
|
@Autowired ContractInfoStatusMapper contractInfoStatusMapper;
|
||||||
|
@Autowired ContractInfoStatusScribeMapper contractInfoStatusScribeMapper;
|
||||||
|
@Autowired ContractInfoSelectMapper contractInfoSelectMapper;
|
||||||
|
@Autowired FutDailyMapper futDailyMapper;
|
||||||
|
@Autowired SelectMapper selectMapper;
|
||||||
|
@Autowired ScribeService scribeService;
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "传入解析excel之后的json数据,批量给合约添加划线值", description = "")
|
||||||
|
@PostMapping(value="/do")
|
||||||
|
public Object dos(@RequestBody(required = true) List<ScribeExcelVo> parm) {
|
||||||
|
|
||||||
|
Map<String, List<ScribeExcelVo>> map = parm.stream().collect(Collectors.groupingBy(ScribeExcelVo::getTs_code));
|
||||||
|
|
||||||
|
AtomicInteger item_sum = new AtomicInteger(0);
|
||||||
|
AtomicInteger ts_code_sum = new AtomicInteger(0);
|
||||||
|
map.forEach((ts_code, v)->{
|
||||||
|
int sum = scribeService.add(ts_code, v);
|
||||||
|
item_sum.addAndGet(sum);
|
||||||
|
ts_code_sum.addAndGet(1);
|
||||||
|
});
|
||||||
|
HashMap<String,Object> h = new HashMap<String,Object>();
|
||||||
|
h.put("item_sum", item_sum.intValue());
|
||||||
|
h.put("ts_code_sum", ts_code_sum.intValue());
|
||||||
|
return R.SUCCESS("item_sum:更新划线条数, ts_code_sum:合约数", h);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "导入划线excel,返回解析完成的json数据,最大处理1万条数据", description = "")
|
||||||
|
@PostMapping(value="/import", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
|
||||||
|
public Object importExcel(@RequestPart(value = "file") MultipartFile excelFile) throws Exception {
|
||||||
|
|
||||||
|
List<ScribeExcelVo> list = new ArrayList<ScribeExcelVo>();
|
||||||
|
XSSFWorkbook workbook = new XSSFWorkbook(excelFile.getInputStream());
|
||||||
|
XSSFSheet worksheet = workbook.getSheetAt(0);
|
||||||
|
|
||||||
|
if(worksheet.getPhysicalNumberOfRows()>10000) {
|
||||||
|
return R.FALSE("批处理数据不能大于1万条");
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=5;i<=worksheet.getPhysicalNumberOfRows() ;i++) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
XSSFRow row = worksheet.getRow(i);
|
||||||
|
ScribeExcelVo vo = new ScribeExcelVo();
|
||||||
|
vo.setName(row.getCell(0).getStringCellValue());
|
||||||
|
vo.setTs_code(row.getCell(1).getStringCellValue());
|
||||||
|
vo.setIdname(row.getCell(2).getStringCellValue());
|
||||||
|
vo.setScribe_value(BigDecimal.valueOf(row.getCell(3).getNumericCellValue()));
|
||||||
|
vo.setScribe_shor_name(row.getCell(4).getStringCellValue());
|
||||||
|
vo.setScribe_id(Double.valueOf(row.getCell(5).getNumericCellValue()).intValue());
|
||||||
|
vo.setScribe_name(row.getCell(6).getStringCellValue());
|
||||||
|
list.add(vo);
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// System.out.println(row.getCell(0).getStringCellValue());
|
||||||
|
// System.out.println(row.getCell(1).getStringCellValue());
|
||||||
|
// System.out.println(row.getCell(2).getStringCellValue());
|
||||||
|
// System.out.println(row.getCell(3).getNumericCellValue());
|
||||||
|
// System.out.println(row.getCell(4).getStringCellValue());
|
||||||
|
// System.out.println(row.getCell(5).getNumericCellValue());
|
||||||
|
// System.out.println(row.getCell(6).getStringCellValue());
|
||||||
|
// System.out.println("=============");
|
||||||
|
}
|
||||||
|
IOUtils.close(workbook);
|
||||||
|
return R.SUCCESS(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "导入划线excel,并直接给合约添加划线数据, 最大处理1万条。 返回成功的条数", description = "")
|
||||||
|
@PostMapping(value="/importdo", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
|
||||||
|
public Object importExcelAndDo(@RequestPart(value = "file") MultipartFile excelFile) throws Exception {
|
||||||
|
|
||||||
|
List<ScribeExcelVo> list = new ArrayList<ScribeExcelVo>();
|
||||||
|
XSSFWorkbook workbook = new XSSFWorkbook(excelFile.getInputStream());
|
||||||
|
XSSFSheet worksheet = workbook.getSheetAt(0);
|
||||||
|
|
||||||
|
if(worksheet.getPhysicalNumberOfRows()>10000) {
|
||||||
|
return R.FALSE("批处理数据不能大于1万条");
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i=5;i<=worksheet.getPhysicalNumberOfRows() ;i++) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
XSSFRow row = worksheet.getRow(i);
|
||||||
|
ScribeExcelVo vo = new ScribeExcelVo();
|
||||||
|
vo.setName(row.getCell(0).getStringCellValue());
|
||||||
|
vo.setTs_code(row.getCell(1).getStringCellValue());
|
||||||
|
vo.setIdname(row.getCell(2).getStringCellValue());
|
||||||
|
vo.setScribe_value(BigDecimal.valueOf(row.getCell(3).getNumericCellValue()));
|
||||||
|
vo.setScribe_shor_name(row.getCell(4).getStringCellValue());
|
||||||
|
vo.setScribe_id(Double.valueOf(row.getCell(5).getNumericCellValue()).intValue());
|
||||||
|
vo.setScribe_name(row.getCell(6).getStringCellValue());
|
||||||
|
list.add(vo);
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
IOUtils.close(workbook);
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, List<ScribeExcelVo>> map = list.stream().collect(Collectors.groupingBy(ScribeExcelVo::getTs_code));
|
||||||
|
AtomicInteger item_sum = new AtomicInteger(0);
|
||||||
|
AtomicInteger ts_code_sum = new AtomicInteger(0);
|
||||||
|
map.forEach((ts_code, v)->{
|
||||||
|
int sum = scribeService.add(ts_code, v);
|
||||||
|
item_sum.addAndGet(sum);
|
||||||
|
ts_code_sum.addAndGet(1);
|
||||||
|
});
|
||||||
|
HashMap<String,Object> h = new HashMap<String,Object>();
|
||||||
|
h.put("item_sum", item_sum.intValue());
|
||||||
|
h.put("ts_code_sum", ts_code_sum.intValue());
|
||||||
|
return R.SUCCESS("item_sum:更新划线条数, ts_code_sum:合约数", h);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -85,6 +85,10 @@ public class SysAdminLoginController {
|
|||||||
return R.SUCCESS("logout is ok");
|
return R.SUCCESS("logout is ok");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(DigestUtils.sha3_256Hex("test114514@"));;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,6 @@
|
|||||||
|
package jj.tech.finance.biz.webadmin.controller;
|
||||||
|
|
||||||
|
public class UploadExcleController {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
package jj.tech.finance.biz.webadmin.service;
|
||||||
|
|
||||||
|
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.mutable.MutableInt;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import jj.tech.finance.biz.web.dao.ContractInfoSelectMapper;
|
||||||
|
import jj.tech.finance.biz.webadmin.vo.ScribeExcelVo;
|
||||||
|
import jj.tech.finance.repository.mybatis.dao.ContractInfoStatusMapper;
|
||||||
|
import jj.tech.finance.repository.mybatis.dao.ContractInfoStatusScribeMapper;
|
||||||
|
import jj.tech.finance.repository.mybatis.dao.support.ContractInfoStatusDynamicSqlSupport;
|
||||||
|
import jj.tech.finance.repository.mybatis.dao.support.ContractInfoStatusScribeDynamicSqlSupport;
|
||||||
|
import jj.tech.finance.repository.mybatis.entity.ContractInfoStatus;
|
||||||
|
import jj.tech.finance.repository.mybatis.entity.ContractInfoStatusScribe;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ScribeService {
|
||||||
|
|
||||||
|
@Autowired ContractInfoStatusMapper contractInfoStatusMapper;
|
||||||
|
@Autowired ContractInfoStatusScribeMapper contractInfoStatusScribeMapper;
|
||||||
|
@Autowired ContractInfoSelectMapper contractInfoSelectMapper;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Integer add(String ts_code, List<ScribeExcelVo> listExcel) {
|
||||||
|
|
||||||
|
|
||||||
|
contractInfoStatusScribeMapper.delete(d->d.where(
|
||||||
|
ContractInfoStatusScribeDynamicSqlSupport.ts_code, isEqualTo(ts_code)));
|
||||||
|
|
||||||
|
AtomicInteger sum = new AtomicInteger(0);
|
||||||
|
// MutableInt cnt = new MutableInt(0);//线程不安全
|
||||||
|
// BigDecimal sum = BigDecimal.ZERO;
|
||||||
|
listExcel.forEach(i->{
|
||||||
|
ContractInfoStatusScribe entity = new ContractInfoStatusScribe();
|
||||||
|
entity.setScribe_id(i.getScribe_id());
|
||||||
|
entity.setScribe_value(i.getScribe_value());
|
||||||
|
entity.setColour("");
|
||||||
|
entity.setTs_code(ts_code);
|
||||||
|
contractInfoStatusScribeMapper.insertSelective(entity);
|
||||||
|
sum.addAndGet(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
ContractInfoStatus info = contractInfoStatusMapper.selectOne(s->s
|
||||||
|
.where(ContractInfoStatusDynamicSqlSupport.ts_code, isEqualTo(ts_code))
|
||||||
|
.limit(1)
|
||||||
|
).orElse(null);
|
||||||
|
|
||||||
|
if(info==null) {
|
||||||
|
ContractInfoStatus bean = new ContractInfoStatus();
|
||||||
|
bean.setTs_code(ts_code);
|
||||||
|
bean.setContract_status(0);
|
||||||
|
bean.setScribe_status(0);
|
||||||
|
bean.setScribe_number(sum.intValue());
|
||||||
|
bean.setScribe_update_time(LocalDateTime.now());
|
||||||
|
contractInfoStatusMapper.insertSelective(bean);
|
||||||
|
}else {
|
||||||
|
ContractInfoStatus bean = new ContractInfoStatus();
|
||||||
|
bean.setId(info.getId());
|
||||||
|
bean.setScribe_update_time(LocalDateTime.now());
|
||||||
|
bean.setScribe_number(sum.intValue());
|
||||||
|
contractInfoStatusMapper.updateByPrimaryKeySelective(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return sum.intValue();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
package jj.tech.finance.biz.webadmin.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class ScribeExcelVo {
|
||||||
|
public String name;
|
||||||
|
public String ts_code;
|
||||||
|
public String idname;
|
||||||
|
public BigDecimal scribe_value;
|
||||||
|
public String scribe_shor_name;
|
||||||
|
public Integer scribe_id;
|
||||||
|
public String scribe_name;
|
||||||
|
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
public String getTs_code() {
|
||||||
|
return ts_code;
|
||||||
|
}
|
||||||
|
public void setTs_code(String ts_code) {
|
||||||
|
this.ts_code = ts_code;
|
||||||
|
}
|
||||||
|
public String getIdname() {
|
||||||
|
return idname;
|
||||||
|
}
|
||||||
|
public void setIdname(String idname) {
|
||||||
|
this.idname = idname;
|
||||||
|
}
|
||||||
|
public BigDecimal getScribe_value() {
|
||||||
|
return scribe_value;
|
||||||
|
}
|
||||||
|
public void setScribe_value(BigDecimal scribe_value) {
|
||||||
|
this.scribe_value = scribe_value;
|
||||||
|
}
|
||||||
|
public String getScribe_shor_name() {
|
||||||
|
return scribe_shor_name;
|
||||||
|
}
|
||||||
|
public void setScribe_shor_name(String scribe_shor_name) {
|
||||||
|
this.scribe_shor_name = scribe_shor_name;
|
||||||
|
}
|
||||||
|
public Integer getScribe_id() {
|
||||||
|
return scribe_id;
|
||||||
|
}
|
||||||
|
public void setScribe_id(Integer scribe_id) {
|
||||||
|
this.scribe_id = scribe_id;
|
||||||
|
}
|
||||||
|
public String getScribe_name() {
|
||||||
|
return scribe_name;
|
||||||
|
}
|
||||||
|
public void setScribe_name(String scribe_name) {
|
||||||
|
this.scribe_name = scribe_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
31
src/main/java/jj/tech/finance/config/enums/ScribeEnum.java
Normal file
31
src/main/java/jj/tech/finance/config/enums/ScribeEnum.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package jj.tech.finance.config.enums;
|
||||||
|
|
||||||
|
public enum ScribeEnum {
|
||||||
|
|
||||||
|
s1(1,"小动态支撑",""), s2(2,"普通/动态支撑",""), s3(3,"高级支撑",""),
|
||||||
|
s4(4,"小动态压力",""), s5(5,"普通/动态压力",""), s6(6,"高级压力",""),
|
||||||
|
s7(7,"小动态重合位",""), s8(8,"重合位",""), s9(9,"高级重合位","")
|
||||||
|
;
|
||||||
|
|
||||||
|
public Integer id;
|
||||||
|
public String scribe_name;
|
||||||
|
public String colour;
|
||||||
|
|
||||||
|
ScribeEnum(Integer id, String scribe_name, String colour) {
|
||||||
|
this.scribe_name=scribe_name;
|
||||||
|
this.colour=colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getScribeName() {
|
||||||
|
return this.scribe_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColour() {
|
||||||
|
return this.colour;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user