Merge remote-tracking branch 'origin/develop_3' into develop_3

This commit is contained in:
zhaokaiyao@91isoft.com
2021-08-20 12:19:22 +08:00
21 changed files with 343 additions and 101 deletions
+5
View File
@@ -24,6 +24,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- scheduled所属资源为spring-context-support -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>com.adc</groupId>
<artifactId>adc-da-convert</artifactId>
@@ -12,11 +12,13 @@ import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerF
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableEurekaClient
@EnableFeignClients
@ServletComponentScan
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
@EnableScheduling
@MapperScan(value = {"com.adc.da.file.store"})
public class AdcDaApplication {
@@ -0,0 +1,25 @@
package com.adc.da.main.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
* @Description: TODO
* @author: super_liu
* @date: 2021年08月19日 11:28
*/
@Configuration
public class MyConfiguration implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowCredentials(true)
.allowedMethods("GET", "POST", "DELETE", "PUT")
.maxAge(3600);
}
}
@@ -2,6 +2,7 @@ package com.adc.da.main.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -26,20 +27,8 @@ public class RestTemplateConfig {
@Bean
@LoadBalanced
public RestTemplate restTemplate(ClientHttpRequestFactory factory){
RestTemplate restTemplate = new RestTemplate(factory);
// 使用 utf-8 编码集的 conver 替换默认的 conver(默认的 string conver 的编码集为"ISO-8859-1"
List<HttpMessageConverter<?>> messageConverters = restTemplate.getMessageConverters();
Iterator<HttpMessageConverter<?>> iterator = messageConverters.iterator();
while (iterator.hasNext()) {
HttpMessageConverter<?> converter = iterator.next();
if (converter instanceof StringHttpMessageConverter) {
iterator.remove();
}
}
messageConverters.add(new StringHttpMessageConverter(Charset.forName("UTF-8")));
return restTemplate;
public RestTemplate restTemplate(RestTemplateBuilder builder){
return builder.build();
}
@Bean
@@ -152,3 +152,8 @@ elas.flag=true
# 文档转换TCP通讯地址
convert.host=127.0.0.1
#convert.host=0.0.0.0
# =============================================================================
# scheduled 配置
# =============================================================================
isNotScheduled=false
+5
View File
@@ -11,6 +11,11 @@
<artifactId>adc-da-slrs</artifactId>
<dependencies>
<!-- scheduled所属资源为spring-context-support -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>com.adc</groupId>
<artifactId>adc-da-base</artifactId>
@@ -0,0 +1,38 @@
package com.adc.da.scheduled;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
@EnableScheduling
@Component
@Slf4j
public class ScheduledJob {
/**
* 根据配置文件设置是否开启定时器
*/
@Value("${isNotScheduled}")
private boolean isNotScheduled; //是否开启定时器
@Scheduled(cron="*/5 * * * * ?")
@Async
public void StandScheduledJob(){
if(isNotScheduled){
System.out.println(Thread.currentThread().getName() + " cron=0 0 1 1 * ? --- " + new Date()+"---START-01");
System.out.println(Thread.currentThread().getName() + " cron=0 0 1 1 * ? --- " + new Date()+"---End-01");
try{
Thread.sleep(2000);
}catch(Exception e){
}
}
}
}
@@ -22,7 +22,7 @@ import java.util.List;
public interface SarLawsAttrDetailedListDao extends BaseMapper<SarLawsAttrDetailedList> {
//根据清单id,查出标准的id并排序
List<String> selectLawsId(@Param("standId") String standId,@Param("param3") Integer page,@Param("param2") Integer size);
List<String> selectLawsId(@Param("standId") String standId,@Param("param3") Integer page,@Param("param2") Integer size,@Param("sar") SarFindDto sarFindDto);
//根据标准id查出数据
List<LawsDto> selectLawsById(@Param("param1") List<String> LawsIds, @Param("sarFindDto") SarFindDto sarFindDto);
//根据标准id查出数据用于清单查询
@@ -23,5 +23,8 @@ public class SarFindDto {
// private String ZCCSSRQGJ;
private String zrbm;
private String sycpx;
private String standSort;
private String standType;
private String standNumber;
}
@@ -45,7 +45,7 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
wrapper.eq("detailed_list_id", sarFindDto.getId());
IPage<SarLawsAttrDetailedList> selectPage = sarLawsAttrDetailedListDao.selectPage(pageRes,wrapper);
//查询标准id
List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(sarFindDto.getId(),(sarFindDto.getPage())-1,sarFindDto.getSize());
List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(sarFindDto.getId(),(sarFindDto.getPage())-1,sarFindDto.getSize(),sarFindDto);
if (CollectionUtils.isEmpty(lawsIds)){
return null;
}
@@ -117,6 +117,9 @@ public class SarLawsDetailedListController extends BaseController<SarLawsDetaile
list1.set(a,fileNameDto);
}else if (null!=list.get(a).getFileIds()){
AttFileEO attFileEO = attFileEOController.getAttFileInfo(list.get(a).getFileIds()).getData();
FindFileNameDto fileNameDto = list1.get(a);
fileNameDto.setFileName(attFileEO.getOldFileName());
list1.set(a,fileNameDto);
}
}
IPage<FindFileNameDto> publicList = new Page<>();
@@ -16,6 +16,8 @@ public class AddDetailedDto {
private String countryArea;
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "车型类别")
private String carType;
@ApiModelProperty(value = "清单类别")
private String detailedList;
@ApiModelProperty(value = "区分,国家地区为1,项目名称为2,清单类别为3")
@@ -40,6 +42,4 @@ public class AddDetailedDto {
private String inforlist2;
@ApiModelProperty(value = "新车型实施时间")
private String inforlist3;
@ApiModelProperty(value = "车辆类别")
private String carType;
}
@@ -23,6 +23,9 @@ public class DetailedUpDto {
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "车型类别")
private String carType;
@ApiModelProperty(value = "清单类别")
private String detailedList;
@@ -12,7 +12,7 @@ import lombok.experimental.Accessors;
/**
* <p>
*
*
* </p>
*
* @author szc
@@ -41,6 +41,10 @@ public class SarLawsDetailedList extends BaseEntity {
@TableField("project_name")
private String projectName;
@ApiModelProperty(value = "车型类别")
@TableField("car_type")
private String carType;
@ApiModelProperty(value = "清单类别")
@TableField("detailed_list")
private String detailedList;
@@ -81,8 +85,5 @@ public class SarLawsDetailedList extends BaseEntity {
@TableField("file_id")
private String fileIds;
@ApiModelProperty(value = "附件id")
@TableField("car_type")
private String carType;
}
@@ -60,6 +60,149 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
@Override
public String add(AddDetailedDto addDetailedDto) {
//判断页面的国家地区是否和数据库里的字段长度相等
QueryWrapper<SarLawsDetailedList> wrapper = new QueryWrapper<>();
wrapper.select("DISTINCT country_area,car_type");
List<SarLawsDetailedList> sarLawsDetailedLists = sarLawsDetailedListDao.selectList(wrapper);
//国家/地区清单 多选是否可以添加的标识,true表示可以添加,false表示不许添加
boolean multiAddFlag = true;
//国家/地区清单 单选是否可以添加的标识,true表示可以添加,false表示不许添加
boolean singleAddFlag = true;
//车型类别是否可以添加的标识,true表示可以添加,false表示不许添加
boolean carAddFlag = true;
// System.out.println("数据库的值"+sarLawsDetailedLists);
// System.out.println("数据库里有多少条数据"+sarLawsDetailedLists.size());
// System.out.println("数据库里第一条"+sarLawsDetailedLists.get(1));
//先判断数据库里有没有值,如果没有,就直接新增
if (sarLawsDetailedLists.size() == 0) {
//下面放添加的具体方法
newListMethod(addDetailedDto);
return "数据库为空,添加成功";
}
//如果数据库有值,根据页面的字段进行判断是哪个清单的新增
else {
//如果是其他新增
if (addDetailedDto.getCountryArea() == null && addDetailedDto.getCarType() == null) {
//下面放添加的具体方法
newListMethod(addDetailedDto);
return "其他清单添加成功";
}
//如果是车辆新增
else if (addDetailedDto.getCarType() != null) {
//就判断页面的值和数据库里的值是否相等
for (int i = 0; i < sarLawsDetailedLists.size(); i++) {
//判断数据库里的数据的车型类别字段是否为空
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()){
System.out.println("数据库里第" + (i + 1) + "条的车型类别字段长度为空,不重复,目前可以添加");
}
//相等就不许添加
else if (Objects.equals(addDetailedDto.getCarType(), sarLawsDetailedLists.get(i).getCarType())) {
System.out.println("数据库里第" + (i + 1) + "条的车型类别字段和页面一样,重复,不许添加");
carAddFlag = false;
}
}
}
//如果是国家新增
else if (addDetailedDto.getCountryArea() != null) {
for (int i = 0; i < sarLawsDetailedLists.size(); i++) {
//就先判断数据库里的数据的国家/地区字段是否为空
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCountryArea()) {
System.out.println("数据库里第" + (i + 1) + "条的国家地区字段长度为空,不重复,目前可以添加");
}
//再判断页面字段长度是否与数据库里的长度一样,如果长度不一样,允许新增
else if (addDetailedDto.getCountryArea().length() != sarLawsDetailedLists.get(i).getCountryArea().length()) {
System.out.println("数据库里第" + (i + 1) + "条的国家地区字段长度和页面的国家地区字段长度不一样,不重复,目前可以添加");
}
//如果不为空且长度一样
else {
//判断页面的国家地区是单选还是多选(判断能不能拆)
if (addDetailedDto.getCountryArea().contains(",")) {
System.out.println("页面是多选");
//如果数据库里的国家地区字段存在",",说明是多选,如果不存在说明是单选
if (sarLawsDetailedLists.get(i).getCountryArea().contains(",")) {
System.out.println("数据库是多选,如果页面字段拆分之后都包含于数据库字段拆分之后,则说明重复,目前不许添加");
System.out.println("页面字段为" + addDetailedDto.getCountryArea());
//页面字段以“,”为分隔符拆分后的结果
String[] frontCountryArea = addDetailedDto.getCountryArea().split(",");
//数据库字段以“,”为分隔符拆分后的结果
String[] databaseCountryArea = sarLawsDetailedLists.get(i).getCountryArea().split(",");
//如果页面字段拆分之后都包含于数据库字段拆分之后,则说明重复,不许添加
for (int j = 0; j < frontCountryArea.length; j++) {
//如果数据库包含了页面字段的所有值,说明这俩完全相同,重复,不许添加
List<String> databaseCountryAreaList = Arrays.asList(databaseCountryArea);
if (databaseCountryAreaList.contains(frontCountryArea[j])) {
System.out.println("数据库" + databaseCountryAreaList);
System.out.println("页面" + frontCountryArea[j]);
System.out.println("数据库里的字段包含页面里的字段,可能重复,目前不许添加");
multiAddFlag = false;
} else {
System.out.println("数据库" + databaseCountryAreaList);
System.out.println("页面" + frontCountryArea[j]);
System.out.println("数据库里的字段和页面字段虽然长度相同,但是里面有不一样的元素,可以添加");
multiAddFlag = true;
}
}
if (multiAddFlag == true) {
System.out.println("长度相同,只要有一个不重复,就可以添加");
} else {
System.out.println("长度相同,整个循环下来都重复,说明两个字段重复,不许添加");
break;
}
}
} else {
System.out.println("页面是单选");
//如果数据库里的国家地区字段存在",",说明是多选,如果不存在说明是单选
if (sarLawsDetailedLists.get(i).getCountryArea().contains(",")) {
System.out.println("数据库是多选,肯定不重复,目前可以添加");
} else {
System.out.println("数据库是单选,如果数据库里的字段和页面的字段相等,重复,不许添加");
//如果数据库里的字段和页面的字段相等,重复,不许添加
if (Objects.equals(sarLawsDetailedLists.get(i).getCountryArea(), addDetailedDto.getCountryArea())) {
System.out.println("数据库里的字段和页面的字段相等,重复,不许添加");
singleAddFlag = false;
break;
} else {
System.out.println("数据库里的字段和页面的字段不相等,不重复,允许添加");
}
}
}
}
}
}
}
//如果是国家和车型清单
//如果整个循环下来都没有重复,则可以添加,不然就说明有重复,不能添加
if (carAddFlag == true && multiAddFlag == true && singleAddFlag == true) {
//下面放添加的具体方法
newListMethod(addDetailedDto);
return "车型类别清单添加成功";
//添加方法结束
} else if (carAddFlag == false){
//0表示添加成功,1表示添加失败
return "车型类别清单添加失败";
}
//如果循环完整个数据库,都没有重复使当前数据无法添加,则添加
if (multiAddFlag == true && singleAddFlag == true && carAddFlag == true) {
//下面放添加的具体方法
newListMethod(addDetailedDto);
//0表示添加成功,1表示添加失败
return "国家/地区清单添加成功";
//添加方法结束
} else {
//0表示添加成功,1表示添加失败
return "国家/地区清单添加失败";
}
}
/**
* 具体用来新增清单的方法
*
* @param addDetailedDto
*/
private void newListMethod(AddDetailedDto addDetailedDto) {
try {
SarLawsDetailedList sarLawsDetailedList = SarLawsDetailedList.builder()
.id(UUIDUtils.randomUUID20())
@@ -72,7 +215,6 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
.remark(addDetailedDto.getRemark())
.updatePeople(getUserName())
.fileIds(addDetailedDto.getFileIds())
.carType(addDetailedDto.getCarType())
.build();
List<TimeDto> timeDto = new ArrayList<>();
switch (addDetailedDto.getSortKey()) {
@@ -81,7 +223,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
break;
case "2":
sarLawsDetailedList.setProjectName(addDetailedDto.getProjectName());
sarLawsDetailedList.setCarType(addDetailedDto.getCarType());
break;
@@ -92,36 +234,38 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
default:
break;
}
if ("admin".equals(getUserName()))sarLawsDetailedList.setUpdatePeople("管理员");
else {sarLawsDetailedList.setUpdatePeople(getUserName());}
if ("admin".equals(getUserName())) sarLawsDetailedList.setUpdatePeople("管理员");
else {
sarLawsDetailedList.setUpdatePeople(getUserName());
}
sarLawsDetailedListDao.insert(sarLawsDetailedList);
if (addDetailedDto.getInforlist()!=null){
if (addDetailedDto.getInforlist().contains(",")){
if (addDetailedDto.getInforlist() != null) {
if (addDetailedDto.getInforlist().contains(",")) {
String[] id = addDetailedDto.getInforlist().split(",");
String[] ssrq = addDetailedDto.getInforlist1().split(",");
String[] putTime = addDetailedDto.getInforlist1().split(",");
String[] zcc = addDetailedDto.getInforlist2().split(",");
String[] xcx = addDetailedDto.getInforlist3().split(",");
for (int a =0;a< id.length;a++){
for (int a = 0; a < id.length; a++) {
TimeDto dto = new TimeDto();
dto.setStandId(id[a]);
if ("-".equals(ssrq[a]) || null==ssrq[a] ){
if ("-".equals(putTime[a]) || null == putTime[a]) {
dto.setSsrq(null);
}else {
dto.setSsrq(ssrq[a]);
} else {
dto.setSsrq(putTime[a]);
}
if ("-".equals(ssrq[a]) || null == xcx[a]){
if ("-".equals(putTime[a]) || null == xcx[a]) {
dto.setXcxssrqgj(null);
}else {
} else {
dto.setXcxssrqgj(xcx[a]);
}
if ("-".equals(ssrq[a]) || null == zcc[a]){
if ("-".equals(putTime[a]) || null == zcc[a]) {
dto.setZccssrqgj(null);
}else {
} else {
dto.setZccssrqgj(zcc[a]);
}
timeDto.add(dto);
}
}else {
} else {
TimeDto dto = new TimeDto();
dto.setStandId(addDetailedDto.getInforlist());
dto.setSsrq(addDetailedDto.getInforlist1());
@@ -129,30 +273,28 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
dto.setZccssrqgj(addDetailedDto.getInforlist3());
timeDto.add(dto);
}
}else {
timeDto=null;
} else {
timeDto = null;
}
service.insertDetailedList(sarLawsDetailedList.getId(),timeDto);
service.insertDetailedList(sarLawsDetailedList.getId(), timeDto);
} catch (Exception e) {
e.printStackTrace();
}
return "添加成功";
}
@Override
public IPage<SarLawsDetailedList> AllSelectD(Integer page, Integer pageSize, String sortKey,
String countryArea, String projectName,
String detailedList, String detailedListName,String carType) {
String countryArea, String projectName, String carType,
String detailedList, String detailedListName) {
QueryWrapper<SarLawsDetailedList> wrapper = new QueryWrapper<>();
if ("1".equals(sortKey)) {
wrapper.like(StringUtils.isNotEmpty(countryArea), "country_area", countryArea).
like(StringUtils.isNotEmpty(detailedListName), "detailed_list_name", detailedListName);
} else if ("2".equals(sortKey)) {
wrapper.like(StringUtils.isNotEmpty(projectName), "project_name", projectName).
like(StringUtils.isNotEmpty(detailedListName), "detailed_list_name", detailedListName).
like(StringUtils.isNotEmpty(carType), "car_type", carType);
wrapper.like(StringUtils.isNotEmpty(carType), "car_type", carType).
like(StringUtils.isNotEmpty(detailedListName), "detailed_list_name", detailedListName);
} else if ("3".equals(sortKey)) {
wrapper.like(StringUtils.isNotEmpty(detailedList), "detailed_list", detailedList).
@@ -178,11 +320,14 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
}
}
}
String completedString = builder.delete(builder.length() - 1, builder.length()).toString();
String completedString = "";
if (builder.length()>0) {
completedString = builder.delete(builder.length() - 1, builder.length()).toString();
}
list1.setCountryArea(completedString);
}else {
for (Map<String,String> map1:arr) {
if (map1.get("value").equals(list1.getCountryArea())){
} else {
for (Map<String, String> map1 : arr) {
if (map1.get("value").equals(list1.getCountryArea())) {
list1.setCountryArea(map1.get("label"));
break;
}
@@ -198,49 +343,53 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
@Override
public String updateList(DetailedUpDto detailedUpDto) {
//list是数据库里根据id查出来的数据;detailedUpDto是页面传回来的数据
SarLawsDetailedList list = sarLawsDetailedListDao.selectById(detailedUpDto.getId());
//国家或地区
//如果页面的国家地区为空,就把数据库里的国家地区字段也设为空
if (StringUtils.isBlank(detailedUpDto.getCountryArea())) list.setCountryArea(null);
else if ("null".equals(detailedUpDto.getCountryArea()));
else if ("null".equals(detailedUpDto.getCountryArea())) ;
//把数据库里的国家地区字段设为页面的国家地区
else list.setCountryArea(detailedUpDto.getCountryArea());
//项目名称
if (StringUtils.isBlank(detailedUpDto.getProjectName())) list.setProjectName(null);
else if ("null".equals(detailedUpDto.getProjectName()));
else list.setProjectName(detailedUpDto.getProjectName());
//车型类别
if (StringUtils.isBlank(detailedUpDto.getCarType())) list.setCarType(null);
else if ("null".equals(detailedUpDto.getCarType())) ;
else list.setCarType(detailedUpDto.getCarType());
//清单类别
if (StringUtils.isBlank(detailedUpDto.getDetailedList())) list.setDetailedList(null);
else if ("null".equals(detailedUpDto.getDetailedList()));
else if ("null".equals(detailedUpDto.getDetailedList())) ;
else list.setDetailedList(detailedUpDto.getDetailedList());
//清单名称
if (StringUtils.isBlank(detailedUpDto.getDetailedListName())) list.setDetailedListName(null);
else if ("null".equals(detailedUpDto.getDetailedListName()));
else if ("null".equals(detailedUpDto.getDetailedListName())) ;
else list.setDetailedListName(detailedUpDto.getDetailedListName());
//适用领域
if (StringUtils.isBlank(detailedUpDto.getApplicationScope())) list.setApplicationScope(null);
else if ("null".equals(detailedUpDto.getApplicationScope()));
else if ("null".equals(detailedUpDto.getApplicationScope())) ;
else list.setApplicationScope(detailedUpDto.getApplicationScope());
//清单详情
if (StringUtils.isBlank(detailedUpDto.getRemark())) list.setRemark(null);
else if ("null".equals(detailedUpDto.getRemark()));
else if ("null".equals(detailedUpDto.getRemark())) ;
list.setRemark(detailedUpDto.getRemark());
//版本号
if (StringUtils.isBlank(detailedUpDto.getDetailedListVision())) list.setDetailedListVision(null);
else if ("null".equals(detailedUpDto.getDetailedListVision()));
else if ("null".equals(detailedUpDto.getDetailedListVision())) ;
list.setDetailedListVision(detailedUpDto.getDetailedListVision());
//更新时间
list.setUpdateTime(new Date());
//更新人
if (StringUtils.isBlank(detailedUpDto.getReNewPeople())) list.setUpdatePeople(null);
else if ("null".equals(detailedUpDto.getReNewPeople()));
else if ("null".equals(detailedUpDto.getReNewPeople())) ;
else list.setUpdatePeople(detailedUpDto.getReNewPeople());
//更新人
if (StringUtils.isBlank(detailedUpDto.getDetailedListState())) list.setDetailedListState(null);
else if ("null".equals(detailedUpDto.getDetailedListState()));
else if ("null".equals(detailedUpDto.getDetailedListState())) ;
else list.setDetailedListState(detailedUpDto.getDetailedListState());
//文件
if (StringUtils.isBlank(detailedUpDto.getFileIds())) list.setFileIds(null);
else if ("null".equals(detailedUpDto.getFileIds()));
else if ("null".equals(detailedUpDto.getFileIds())) ;
else list.setFileIds(detailedUpDto.getFileIds());
sarLawsDetailedListDao.updateById(list);
@@ -248,31 +397,31 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
if (src.equals(detailedUpDto.getInforlist()) || null != detailedUpDto.getInforlist()) {
List<TimeDto> timeDto = new ArrayList<>();
if ( detailedUpDto.getInforlist().contains(",")) {
if (detailedUpDto.getInforlist().contains(",")) {
String[] id = detailedUpDto.getInforlist().split(",");
String[] ssrq = detailedUpDto.getInforlist1().split(",");
String[] putTime = detailedUpDto.getInforlist1().split(",");
String[] zcc = detailedUpDto.getInforlist2().split(",");
String[] xcx = detailedUpDto.getInforlist3().split(",");
for (int a = 0; a < id.length; a++) {
TimeDto dto = new TimeDto();
dto.setStandId(id[a]);
if (ssrq.length<=a) {
dto.setSsrq(null);
} else {
dto.setSsrq(ssrq[a]);
}
if (ssrq.length<=a) {
dto.setXcxssrqgj(null);
} else {
dto.setXcxssrqgj(xcx[a]);
}
if (ssrq.length<=a) {
dto.setZccssrqgj(null);
} else {
dto.setZccssrqgj(zcc[a]);
}
timeDto.add(dto);
for (int a = 0; a < id.length; a++) {
TimeDto dto = new TimeDto();
dto.setStandId(id[a]);
if (putTime.length <= a) {
dto.setSsrq(null);
} else {
dto.setSsrq(putTime[a]);
}
if (putTime.length <= a) {
dto.setXcxssrqgj(null);
} else {
dto.setXcxssrqgj(xcx[a]);
}
if (putTime.length <= a) {
dto.setZccssrqgj(null);
} else {
dto.setZccssrqgj(zcc[a]);
}
timeDto.add(dto);
}
} else {
TimeDto dto = new TimeDto();
dto.setStandId(detailedUpDto.getInforlist());
@@ -26,6 +26,7 @@ import java.util.stream.Collectors;
* @since 2021-06-30
*/
@RestController
@CrossOrigin
@Api(tags = "资源管理")
@RequestMapping("/api/sarResource/ts-resource")
public class TsResourceController extends BaseController<TsResource> {
@@ -8,6 +8,6 @@ public class DetAllStandDto {
Integer size;
String cid;
String userId;
String startTime;
String endTime;
String Account;
}
@@ -49,6 +49,15 @@ public class SarPublicIdeaAll extends BaseEntity {
@TableField("dept_name")
private String deptName;
@TableField("reason")
private String reason;
@TableField("old_text")
private String oldText;
@TableField("new_text")
private String newText;
public static final String CID = "cid";
}
@@ -40,11 +40,11 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
@Override
public IPage<SarPublicIdeaAllSUD> selectAll(DetAllStandDto detAllStandDto) {
if (detAllStandDto.getStartTime() != null) {
if (detAllStandDto.getEndTime() != null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date Time = null;
try {
Time = sdf.parse(detAllStandDto.getStartTime());
Time = sdf.parse(detAllStandDto.getEndTime());
} catch (ParseException e) {
e.printStackTrace();
}
@@ -110,7 +110,7 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date Time = null;
try {
Time = sdf.parse(detAllStandDto.getStartTime());
Time = sdf.parse(detAllStandDto.getEndTime());
} catch (ParseException e) {
e.printStackTrace();
}
@@ -85,9 +85,7 @@ public class SarStandardComplianceAssessResultController {
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
}
// if (eo.getType() != null && !eo.getType().trim().equals("")) {
// queryWrapper.like("type",eo.getType().trim());
// }
IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper);
while (page.getRecords().remove(null)) ;
@@ -103,17 +101,15 @@ public class SarStandardComplianceAssessResultController {
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
}
// if (eo.getType() != null && !eo.getType().trim().equals("")) {
// queryWrapper.like("type",eo.getType().trim());
// }
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
while (page.getRecords().remove(null)) ;
while(page.getRecords().remove(null));
return Result.success(page);
}
}
}
private static class InsertEntity<T> {
private static class InsertEntity<T>{
List<Map> entityList;
T eo;
}
@@ -145,7 +141,7 @@ public class SarStandardComplianceAssessResultController {
}
iSarInterpretationNationalStandardService.saveOrUpdateBatch(entityList);
} else {
}else{
List<SarInterpretationForeignStandard> entityList = new ArrayList<>();
for (int i = 0; i < insertEntity.entityList.size(); i++) {
SarInterpretationForeignStandard obj = new SarInterpretationForeignStandard();
@@ -166,10 +162,10 @@ public class SarStandardComplianceAssessResultController {
public ResponseMessage<IPage<SarStandardComplianceProductAssess>> selectProduct(SarStandardComplianceProductAssessEO eo) throws Exception {
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
if (eo.getType() != null) queryWrapper.eq("type", eo.getType());
if (eo.getProductName() != null) queryWrapper.like("product_name", eo.getProductName());
if (eo.getStandId() != null) queryWrapper.like("STAND_ID", eo.getStandId());
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
// if (eo.getStandId() != null) queryWrapper.like("STAND_ID", eo.getStandId());
// if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
return Result.success(page);
}
@@ -91,6 +91,10 @@ public class SarStandardComplianceProductAssess extends BaseEntity {
@ApiModelProperty(value = "在产产品合规信息")
private String productionCompliance;
@ApiModelProperty(value = "在产产品不合规信息")
@TableField("production_non_compliance")
private String productionNonCompliance;
@ApiModelProperty(value = "在产产品不合规应对措施")
private String productionCountermeasures;
@@ -113,6 +117,10 @@ public class SarStandardComplianceProductAssess extends BaseEntity {
@TableField("clause_name")
private String clauseName;
@ApiModelProperty(value = "流程UUID")
@TableField("type")
private String type;
private String id;