update:清单导出,增加编辑,修复bug
This commit is contained in:
+138
-25
@@ -3,15 +3,14 @@ package com.adc.da.slrs.sarLawsAttrDetailedList.controller;
|
|||||||
|
|
||||||
import com.adc.da.att.entity.AttFileEO;
|
import com.adc.da.att.entity.AttFileEO;
|
||||||
import com.adc.da.att.service.IAttFileEOService;
|
import com.adc.da.att.service.IAttFileEOService;
|
||||||
import com.adc.da.http.PageInfo;
|
|
||||||
import com.adc.da.http.ResponseMessage;
|
import com.adc.da.http.ResponseMessage;
|
||||||
import com.adc.da.http.Result;
|
import com.adc.da.http.Result;
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao;
|
import com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao;
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.*;
|
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.*;
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.service.ISarLawsAttrDetailedListService;
|
import com.adc.da.slrs.sarLawsAttrDetailedList.service.ISarLawsAttrDetailedListService;
|
||||||
|
import com.adc.da.sys.service.IDicTypeEOService;
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -25,6 +24,7 @@ import java.io.IOException;
|
|||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -46,6 +46,8 @@ public class SarLawsAttrDetailedListController extends BaseController<SarLawsAtt
|
|||||||
private IAttFileEOService attFileEOService;
|
private IAttFileEOService attFileEOService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SarLawsAttrDetailedListDao sarLawsAttrDetailedListDao;
|
private SarLawsAttrDetailedListDao sarLawsAttrDetailedListDao;
|
||||||
|
@Autowired
|
||||||
|
private IDicTypeEOService iDicTypeEOService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -59,8 +61,8 @@ public class SarLawsAttrDetailedListController extends BaseController<SarLawsAtt
|
|||||||
**/
|
**/
|
||||||
@ApiOperation(value = "查询标准信息")
|
@ApiOperation(value = "查询标准信息")
|
||||||
@GetMapping("/selectLawsById")
|
@GetMapping("/selectLawsById")
|
||||||
public ResponseMessage selectLawsById(@RequestParam(defaultValue = "1")int Page, @RequestParam(defaultValue = "10") int Size, String id,String standName){
|
public ResponseMessage selectLawsById(SarFindDto sarFindDto){
|
||||||
List<LawsDto> laws = iSarLawsAttrDetailedList.selectLaws(id,Page-1,Size,standName);
|
List<LawsDto> laws = iSarLawsAttrDetailedList.selectLaws(sarFindDto);
|
||||||
return Result.success("200",laws);
|
return Result.success("200",laws);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,6 +87,26 @@ public class SarLawsAttrDetailedListController extends BaseController<SarLawsAtt
|
|||||||
public ResponseMessage selectByStandId(@RequestParam(defaultValue = "1")int Page, @RequestParam(defaultValue = "10") int Size, String id){
|
public ResponseMessage selectByStandId(@RequestParam(defaultValue = "1")int Page, @RequestParam(defaultValue = "10") int Size, String id){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param sarLawsAttrDetailedList
|
||||||
|
* @return
|
||||||
|
* @author zzy
|
||||||
|
* date 2021-07-20
|
||||||
|
**/
|
||||||
|
@ApiOperation(value = "修改日期")
|
||||||
|
@PostMapping("/setTimes")
|
||||||
|
public ResponseMessage setTimes(SarLawsAttrDetailedList sarLawsAttrDetailedList){
|
||||||
|
int a=iSarLawsAttrDetailedList.setTimes(sarLawsAttrDetailedList);
|
||||||
|
return Result.success("200",a);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据标准查询时间")
|
||||||
|
@GetMapping
|
||||||
|
public ResponseMessage selectTimes(String id){
|
||||||
|
Map<String ,List<StandTimeDto>> map = iSarLawsAttrDetailedList.selectTimes(id);
|
||||||
|
return Result.success("200",map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,29 +136,120 @@ public class SarLawsAttrDetailedListController extends BaseController<SarLawsAtt
|
|||||||
}else {
|
}else {
|
||||||
data=sarLawsAttrDetailedListDao.selectLawsById(standExcelVo.getIds(),null);
|
data=sarLawsAttrDetailedListDao.selectLawsById(standExcelVo.getIds(),null);
|
||||||
}
|
}
|
||||||
for (LawsDto lawsDto:data){
|
//适用车型
|
||||||
if (StringUtils.isNoneBlank(sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()).toString())){
|
Map<String,Object> map= iDicTypeEOService.getDicTypeListCode();
|
||||||
lawsDto.setTypeApplicable(sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()).toString());
|
List<Map<String, String>> typeApplicable = (List<Map<String, String>>)map.get("ENERGYTYPES");
|
||||||
|
for (LawsDto list1:data){
|
||||||
|
if (StringUtils.isNotBlank(list1.getTypeApplicable()) && list1.getTypeApplicable().contains(",")){
|
||||||
|
String[] split = list1.getTypeApplicable().split(",");
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String s:split){
|
||||||
|
for (Map<String,String> map1:typeApplicable) {
|
||||||
|
if (map1.get("value").equals(s)){
|
||||||
|
s=map1.get("label");
|
||||||
|
builder.append(s+",");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||||
|
list1.setTypeApplicable(completedString);
|
||||||
|
}else {
|
||||||
|
for (Map<String, String> map1 : typeApplicable) {
|
||||||
|
if (map1.get("value").equals(list1.getTypeApplicable())) {
|
||||||
|
list1.setTypeApplicable(map1.get("label"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<StandExcelDto> standExcelDtos = new ArrayList<>();
|
//能源类型
|
||||||
for (LawsDto lawsDto:data){
|
List<Map<String, String>> nylx = (List<Map<String, String>>)map.get("NYLXCLASS");
|
||||||
StandExcelDto standExcelDto = StandExcelDto.builder()
|
for (LawsDto list1:data){
|
||||||
.standNumber(lawsDto.getStandNumber())
|
if (StringUtils.isNotBlank(list1.getNYLX()) && list1.getNYLX().contains(",")){
|
||||||
.standName(lawsDto.getStandName())
|
String[] split = list1.getNYLX().split(",");
|
||||||
.standEnName(lawsDto.getStandEnName())
|
StringBuilder builder = new StringBuilder();
|
||||||
.typeApplicable(lawsDto.getTypeApplicable())
|
for (String s:split){
|
||||||
.NYLX(lawsDto.getNYLX())
|
for (Map<String,String> map1:nylx) {
|
||||||
.putTime(lawsDto.getPutTime())
|
if (map1.get("value").equals(s)){
|
||||||
.newCarTime(lawsDto.getXCXSSRQGJ())
|
s=map1.get("label");
|
||||||
.nowCarTime(lawsDto.getZCCSSRQGJ())
|
builder.append(s+",");
|
||||||
.ZRBM(lawsDto.getZRBM())
|
break;
|
||||||
.SYCPX(lawsDto.getSYCPX())
|
}
|
||||||
.CYCVPPSBM(lawsDto.getCYCVPPSBM())
|
}
|
||||||
.CYCVPPSCN(lawsDto.getCYCVPPSCN())
|
}
|
||||||
.KCCVPPSBM(lawsDto.getKCCVPPSBM())
|
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||||
.KCCVPPSCN(lawsDto.getKCCVPPSCN())
|
list1.setNYLX(completedString);
|
||||||
.build();
|
}else {
|
||||||
|
for (Map<String, String> map1 : nylx) {
|
||||||
|
if (map1.get("value").equals(list1.getNYLX())) {
|
||||||
|
list1.setNYLX(map1.get("label"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//责任部门
|
||||||
|
List<Map<String, String>> zrbn = (List<Map<String, String>>)map.get("ZRBMCLASS");
|
||||||
|
for (LawsDto list1:data){
|
||||||
|
if (StringUtils.isNotBlank(list1.getZRBM()) && list1.getZRBM().contains(",")){
|
||||||
|
String[] split = list1.getZRBM().split(",");
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String s:split){
|
||||||
|
for (Map<String,String> map1:zrbn) {
|
||||||
|
if (map1.get("value").equals(s)){
|
||||||
|
s=map1.get("label");
|
||||||
|
builder.append(s+",");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||||
|
list1.setZRBM(completedString);
|
||||||
|
}else {
|
||||||
|
for (Map<String, String> map1 : zrbn) {
|
||||||
|
if (map1.get("value").equals(list1.getZRBM())) {
|
||||||
|
list1.setZRBM(map1.get("label"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//产品线
|
||||||
|
List<Map<String, String>> sycpx = (List<Map<String, String>>)map.get("SYCPXCLASS");
|
||||||
|
for (LawsDto list1:data){
|
||||||
|
if (list1.getPutTime()!=null){
|
||||||
|
list1.setPutTime(list1.getPutTime().substring(0,10));
|
||||||
|
}
|
||||||
|
if (list1.getZCCSSRQGJ()!=null){
|
||||||
|
list1.setZCCSSRQGJ(list1.getZCCSSRQGJ().substring(0,10));
|
||||||
|
}
|
||||||
|
if (list1.getXCXSSRQGJ()!=null){
|
||||||
|
list1.setXCXSSRQGJ(list1.getXCXSSRQGJ().substring(0,10));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(list1.getSYCPX()) && list1.getSYCPX().contains(",")){
|
||||||
|
String[] split = list1.getSYCPX().split(",");
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String s:split){
|
||||||
|
for (Map<String,String> map1:sycpx) {
|
||||||
|
if (map1.get("value").equals(s)){
|
||||||
|
s=map1.get("label");
|
||||||
|
builder.append(s+",");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||||
|
list1.setSYCPX(completedString);
|
||||||
|
}else {
|
||||||
|
for (Map<String, String> map1 : sycpx) {
|
||||||
|
if (map1.get("value").equals(list1.getSYCPX())) {
|
||||||
|
list1.setSYCPX(map1.get("label"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EasyExcel.write(response.getOutputStream(), LawsDto.class).useDefaultStyle(false).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
EasyExcel.write(response.getOutputStream(), LawsDto.class).useDefaultStyle(false).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||||
.doWrite(data);
|
.doWrite(data);
|
||||||
|
|||||||
+3
-2
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarLawsAttrDetailedList.dao;
|
|||||||
|
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto;
|
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto;
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarLawsAttrDetailedList;
|
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarLawsAttrDetailedList;
|
||||||
|
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -25,8 +26,8 @@ public interface SarLawsAttrDetailedListDao extends BaseMapper<SarLawsAttrDetail
|
|||||||
List<LawsDto> selectLawsById(@Param("param1") List<String> LawsIds, @Param("standName") String standName);
|
List<LawsDto> selectLawsById(@Param("param1") List<String> LawsIds, @Param("standName") String standName);
|
||||||
//根据标准id查出数据
|
//根据标准id查出数据
|
||||||
List<LawsDto> selectLawsByIdC(@Param("param1") List<String> LawsIds, @Param("standName") String standName,@Param("standType")String standType);
|
List<LawsDto> selectLawsByIdC(@Param("param1") List<String> LawsIds, @Param("standName") String standName,@Param("standType")String standType);
|
||||||
//查询适用车型
|
//查询时间
|
||||||
List<String> selectTypeApplicable(@Param("param1") String LawsId);
|
List<StandRegionalTimeDto> selectTimes(String standId);
|
||||||
List<String> selectLawsId2(String standId);
|
List<String> selectLawsId2(String standId);
|
||||||
Boolean insertList(@Param("sarLawsAttrDetailedLists") List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists);
|
Boolean insertList(@Param("sarLawsAttrDetailedLists") List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists);
|
||||||
Boolean deleteByStandId(String standId);
|
Boolean deleteByStandId(String standId);
|
||||||
|
|||||||
+8
-1
@@ -1,7 +1,10 @@
|
|||||||
package com.adc.da.slrs.sarLawsAttrDetailedList.entity;
|
package com.adc.da.slrs.sarLawsAttrDetailedList.entity;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -11,7 +14,7 @@ import lombok.NoArgsConstructor;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* //Dto,用于从标准主表中查询和检索信息
|
* //Dto,用于从标准主表中查询和检索信息
|
||||||
* 主表还未完善需修改
|
*
|
||||||
*
|
*
|
||||||
* @author ZhangZhiYuan
|
* @author ZhangZhiYuan
|
||||||
* date 2021-06-16
|
* date 2021-06-16
|
||||||
@@ -20,6 +23,7 @@ import lombok.NoArgsConstructor;
|
|||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
public class LawsDto {
|
public class LawsDto {
|
||||||
@ApiModelProperty(value = "主键")
|
@ApiModelProperty(value = "主键")
|
||||||
private String id;
|
private String id;
|
||||||
@@ -41,14 +45,17 @@ public class LawsDto {
|
|||||||
@ColumnWidth(16)
|
@ColumnWidth(16)
|
||||||
@ExcelProperty(value = "标准实施日期", index = 5)
|
@ExcelProperty(value = "标准实施日期", index = 5)
|
||||||
@ApiModelProperty(value = "标准实施日期")
|
@ApiModelProperty(value = "标准实施日期")
|
||||||
|
@DateTimeFormat("yyyy年MM月dd日")
|
||||||
private String putTime;
|
private String putTime;
|
||||||
@ColumnWidth(16)
|
@ColumnWidth(16)
|
||||||
@ExcelProperty(value = "新车型实施日期", index = 6)
|
@ExcelProperty(value = "新车型实施日期", index = 6)
|
||||||
@ApiModelProperty(value = "新车型实施日期")
|
@ApiModelProperty(value = "新车型实施日期")
|
||||||
|
@DateTimeFormat("yyyy年MM月dd日")
|
||||||
private String XCXSSRQGJ;
|
private String XCXSSRQGJ;
|
||||||
@ColumnWidth(16)
|
@ColumnWidth(16)
|
||||||
@ExcelProperty(value = "在产车实施日期", index = 7)
|
@ExcelProperty(value = "在产车实施日期", index = 7)
|
||||||
@ApiModelProperty(value = "在产车实施日期")
|
@ApiModelProperty(value = "在产车实施日期")
|
||||||
|
@DateTimeFormat("yyyy年MM月dd日")
|
||||||
private String ZCCSSRQGJ;
|
private String ZCCSSRQGJ;
|
||||||
@ExcelProperty(value = "责任部门", index = 8)
|
@ExcelProperty(value = "责任部门", index = 8)
|
||||||
@ApiModelProperty(value = "责任部门")
|
@ApiModelProperty(value = "责任部门")
|
||||||
|
|||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package com.adc.da.slrs.sarLawsAttrDetailedList.entity;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高级检索
|
||||||
|
*
|
||||||
|
* @author ZhangZhiYuan
|
||||||
|
* @date 2021-07-22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SarFindDto {
|
||||||
|
private int Page;
|
||||||
|
private int Size;
|
||||||
|
private String id;
|
||||||
|
private String standName;
|
||||||
|
private String standNumber;
|
||||||
|
private String standEnName;
|
||||||
|
private String typeApplicable;
|
||||||
|
private String NYLX;
|
||||||
|
private String putTime;
|
||||||
|
private String XCXSSRQGJ;
|
||||||
|
private String ZCCSSRQGJ;
|
||||||
|
private String ZRBM;
|
||||||
|
private String SYCPX;
|
||||||
|
|
||||||
|
}
|
||||||
+11
@@ -43,5 +43,16 @@ public class SarLawsAttrDetailedList extends BaseEntity {
|
|||||||
@TableField(value = "number")
|
@TableField(value = "number")
|
||||||
private String number;
|
private String number;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准实施日期")
|
||||||
|
@TableField(value = "putTime")
|
||||||
|
private String putTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "新车型实施日期")
|
||||||
|
@TableField(value = "xcxssrq")
|
||||||
|
private String xcxssrq;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "在产车实施日期")
|
||||||
|
@TableField(value = "zccssrq")
|
||||||
|
private String zccssrq;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
package com.adc.da.slrs.sarLawsAttrDetailedList.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //TODO 添加类、接口描述
|
||||||
|
*
|
||||||
|
* @author ZhangZhiYuan
|
||||||
|
* @date 2021-07-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StandRegionalTimeDto {
|
||||||
|
@ApiModelProperty(value = "国家")
|
||||||
|
private String country;
|
||||||
|
@ApiModelProperty(value = "实施日期")
|
||||||
|
private String putTime;
|
||||||
|
@ApiModelProperty(value = "在产车实施日期")
|
||||||
|
private String zccssrq;
|
||||||
|
@ApiModelProperty(value = "新车型实施日期")
|
||||||
|
private String xcxssrq;
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.adc.da.slrs.sarLawsAttrDetailedList.entity;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //TODO 添加类、接口描述
|
||||||
|
*
|
||||||
|
* @author ZhangZhiYuan
|
||||||
|
* @date 2021-07-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StandTimeDto {
|
||||||
|
@ApiModelProperty(value = "实施日期")
|
||||||
|
private String putTime;
|
||||||
|
@ApiModelProperty(value = "在产车实施日期")
|
||||||
|
private String zccssrq;
|
||||||
|
@ApiModelProperty(value = "新车型实施日期")
|
||||||
|
private String xcxssrq;
|
||||||
|
}
|
||||||
+8
-6
@@ -1,12 +1,12 @@
|
|||||||
package com.adc.da.slrs.sarLawsAttrDetailedList.service;
|
package com.adc.da.slrs.sarLawsAttrDetailedList.service;
|
||||||
|
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarLawsAttrDetailedList;
|
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.*;
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto;
|
import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto;
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandExcelVo;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -18,8 +18,10 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface ISarLawsAttrDetailedListService extends IService<SarLawsAttrDetailedList> {
|
public interface ISarLawsAttrDetailedListService extends IService<SarLawsAttrDetailedList> {
|
||||||
|
|
||||||
List<LawsDto> selectLaws(String standId, Integer Page, Integer Size,String standName);
|
List<LawsDto> selectLaws(SarFindDto sarFindDto);
|
||||||
Boolean insertDetailedList(String id,String[] lawsIds);
|
Boolean insertDetailedList(String id,List<TimeDto> timeDto);
|
||||||
Boolean updateDetailedLaws(String id,String[] lawsIds);
|
Boolean updateDetailedLaws(String id,List<TimeDto> timeDtos);
|
||||||
void exportExcel(HttpServletResponse response, StandExcelVo standExcelVo);
|
void exportExcel(HttpServletResponse response, StandExcelVo standExcelVo);
|
||||||
|
int setTimes(SarLawsAttrDetailedList sarLawsAttrDetailedList);
|
||||||
|
Map<String ,List<StandTimeDto>> selectTimes(String id);
|
||||||
}
|
}
|
||||||
|
|||||||
+134
-15
@@ -1,10 +1,10 @@
|
|||||||
package com.adc.da.slrs.sarLawsAttrDetailedList.service.impl;
|
package com.adc.da.slrs.sarLawsAttrDetailedList.service.impl;
|
||||||
|
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao;
|
import com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao;
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto;
|
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.*;
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.SarLawsAttrDetailedList;
|
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandExcelVo;
|
|
||||||
import com.adc.da.slrs.sarLawsAttrDetailedList.service.ISarLawsAttrDetailedListService;
|
import com.adc.da.slrs.sarLawsAttrDetailedList.service.ISarLawsAttrDetailedListService;
|
||||||
|
import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto;
|
||||||
|
import com.adc.da.sys.service.IDicTypeEOService;
|
||||||
import com.adc.da.util.UUIDUtils;
|
import com.adc.da.util.UUIDUtils;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -16,7 +16,9 @@ import org.springframework.util.CollectionUtils;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -31,19 +33,107 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
SarLawsAttrDetailedListDao sarLawsAttrDetailedListDao;
|
SarLawsAttrDetailedListDao sarLawsAttrDetailedListDao;
|
||||||
|
@Autowired
|
||||||
|
private IDicTypeEOService iDicTypeEOService;
|
||||||
|
|
||||||
//从主表中查询信息
|
//从主表中查询信息
|
||||||
@Override
|
@Override
|
||||||
public List<LawsDto> selectLaws(String standId, Integer Page, Integer Size,String standName) {
|
public List<LawsDto> selectLaws(SarFindDto sarFindDto) {
|
||||||
List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(standId,Page,Size);
|
List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(sarFindDto.getId(),(sarFindDto.getPage())-1,sarFindDto.getSize());
|
||||||
if (CollectionUtils.isEmpty(lawsIds)){
|
if (CollectionUtils.isEmpty(lawsIds)){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
List<LawsDto> list = sarLawsAttrDetailedListDao.selectLawsById(lawsIds,standName);
|
List<LawsDto> list = sarLawsAttrDetailedListDao.selectLawsById(lawsIds,sarFindDto.getStandName());
|
||||||
for (LawsDto lawsDto:list){
|
for (LawsDto lawsDto:list){
|
||||||
if (sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()).size()!=0){
|
QueryWrapper<SarLawsAttrDetailedList> queryWrapper = new QueryWrapper<>();
|
||||||
lawsDto.setTypeApplicable(StringUtils.join(sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()), ","));
|
queryWrapper.eq("stand_id",lawsDto.getId())
|
||||||
System.out.println(StringUtils.join(sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()), ","));
|
.eq("detailed_list_id",sarFindDto.getId());
|
||||||
|
List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists = sarLawsAttrDetailedListDao.selectList(queryWrapper);
|
||||||
|
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getPutTime())){
|
||||||
|
lawsDto.setPutTime(sarLawsAttrDetailedLists.get(0).getPutTime());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getXcxssrq())){
|
||||||
|
lawsDto.setXCXSSRQGJ(sarLawsAttrDetailedLists.get(0).getXcxssrq());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getZccssrq())){
|
||||||
|
lawsDto.setZCCSSRQGJ(sarLawsAttrDetailedLists.get(0).getZccssrq());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//适用车型
|
||||||
|
Map<String,Object> map= iDicTypeEOService.getDicTypeListCode();
|
||||||
|
List<Map<String, String>> typeApplicable = (List<Map<String, String>>)map.get("ENERGYTYPES");
|
||||||
|
for (LawsDto list1:list){
|
||||||
|
if (StringUtils.isNotBlank(list1.getTypeApplicable()) && list1.getTypeApplicable().contains(",")){
|
||||||
|
String[] split = list1.getTypeApplicable().split(",");
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String s:split){
|
||||||
|
for (Map<String,String> map1:typeApplicable) {
|
||||||
|
if (map1.get("value").equals(s)){
|
||||||
|
s=map1.get("label");
|
||||||
|
builder.append(s+",");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||||
|
list1.setTypeApplicable(completedString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//能源类型
|
||||||
|
List<Map<String, String>> nylx = (List<Map<String, String>>)map.get("NYLXCLASS");
|
||||||
|
for (LawsDto list1:list){
|
||||||
|
if (StringUtils.isNotBlank(list1.getNYLX()) && list1.getNYLX().contains(",")){
|
||||||
|
String[] split = list1.getNYLX().split(",");
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String s:split){
|
||||||
|
for (Map<String,String> map1:nylx) {
|
||||||
|
if (map1.get("value").equals(s)){
|
||||||
|
s=map1.get("label");
|
||||||
|
builder.append(s+",");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||||
|
list1.setNYLX(completedString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//责任部门
|
||||||
|
List<Map<String, String>> zrbn = (List<Map<String, String>>)map.get("ZRBMCLASS");
|
||||||
|
for (LawsDto list1:list){
|
||||||
|
if (StringUtils.isNotBlank(list1.getZRBM()) && list1.getZRBM().contains(",")){
|
||||||
|
String[] split = list1.getZRBM().split(",");
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String s:split){
|
||||||
|
for (Map<String,String> map1:zrbn) {
|
||||||
|
if (map1.get("value").equals(s)){
|
||||||
|
s=map1.get("label");
|
||||||
|
builder.append(s+",");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||||
|
list1.setZRBM(completedString);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//产品线
|
||||||
|
List<Map<String, String>> sycpx = (List<Map<String, String>>)map.get("SYCPXCLASS");
|
||||||
|
for (LawsDto list1:list){
|
||||||
|
if (StringUtils.isNotBlank(list1.getSYCPX()) && list1.getSYCPX().contains(",")){
|
||||||
|
String[] split = list1.getSYCPX().split(",");
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (String s:split){
|
||||||
|
for (Map<String,String> map1:sycpx) {
|
||||||
|
if (map1.get("value").equals(s)){
|
||||||
|
s=map1.get("label");
|
||||||
|
builder.append(s+",");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||||
|
list1.setSYCPX(completedString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
@@ -51,17 +141,20 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
|||||||
|
|
||||||
//向清单表和主表中的关联表插入信息
|
//向清单表和主表中的关联表插入信息
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertDetailedList(String standId, String[] lawsIds) {
|
public Boolean insertDetailedList(String standId, List<TimeDto> timeDto) {
|
||||||
if (lawsIds.length !=0 && lawsIds!=null){
|
if (null !=timeDto && !timeDto.isEmpty()){
|
||||||
try {
|
try {
|
||||||
List<SarLawsAttrDetailedList> attrDetailedLists = new ArrayList<>();
|
List<SarLawsAttrDetailedList> attrDetailedLists = new ArrayList<>();
|
||||||
int a=0;
|
int a=0;
|
||||||
for (String lawsId:lawsIds){
|
for (TimeDto timeDto1:timeDto){
|
||||||
SarLawsAttrDetailedList sarLawsAttrDetailedList = SarLawsAttrDetailedList.builder()
|
SarLawsAttrDetailedList sarLawsAttrDetailedList = SarLawsAttrDetailedList.builder()
|
||||||
.id(UUIDUtils.randomUUID20())
|
.id(UUIDUtils.randomUUID20())
|
||||||
.standId(lawsId)
|
.standId(timeDto1.getStandId())
|
||||||
.detailedListId(standId)
|
.detailedListId(standId)
|
||||||
.number(String.valueOf(a))
|
.number(String.valueOf(a))
|
||||||
|
.putTime(timeDto1.getPutTime())
|
||||||
|
.xcxssrq(timeDto1.getXcxssrqgj())
|
||||||
|
.zccssrq(timeDto1.getZccssrqgj())
|
||||||
.build();
|
.build();
|
||||||
attrDetailedLists.add(sarLawsAttrDetailedList);
|
attrDetailedLists.add(sarLawsAttrDetailedList);
|
||||||
a++;
|
a++;
|
||||||
@@ -77,12 +170,12 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
|||||||
|
|
||||||
//修改关联表中的信息,先删除后修改
|
//修改关联表中的信息,先删除后修改
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateDetailedLaws(String id, String[] lawsIds) {
|
public Boolean updateDetailedLaws(String id,List<TimeDto> timeDto) {
|
||||||
try {
|
try {
|
||||||
QueryWrapper<SarLawsAttrDetailedList> wrapper = new QueryWrapper<>();
|
QueryWrapper<SarLawsAttrDetailedList> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq("detailed_list_id",id);
|
wrapper.eq("detailed_list_id",id);
|
||||||
sarLawsAttrDetailedListDao.delete(wrapper);
|
sarLawsAttrDetailedListDao.delete(wrapper);
|
||||||
insertDetailedList(id,lawsIds);
|
insertDetailedList(id,timeDto);
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
@@ -94,5 +187,31 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int setTimes(SarLawsAttrDetailedList sarLawsAttrDetailedList) {
|
||||||
|
return sarLawsAttrDetailedListDao.updateById(sarLawsAttrDetailedList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, List<StandTimeDto>> selectTimes(String id) {
|
||||||
|
List<StandRegionalTimeDto> standRegionalTimeDto= sarLawsAttrDetailedListDao.selectTimes(id);
|
||||||
|
Map<String, List<StandTimeDto>> mapList = new HashMap<String, List<StandTimeDto>>();
|
||||||
|
for (StandRegionalTimeDto s:standRegionalTimeDto){
|
||||||
|
List<StandTimeDto> list;
|
||||||
|
if (mapList.containsKey(s.getCountry())){
|
||||||
|
list = mapList.get(s.getCountry());
|
||||||
|
}else {
|
||||||
|
list = new ArrayList<>();
|
||||||
|
}
|
||||||
|
StandTimeDto standTimeDto = new StandTimeDto();
|
||||||
|
standTimeDto.setPutTime(s.getPutTime());
|
||||||
|
standTimeDto.setXcxssrq(s.getXcxssrq());
|
||||||
|
standTimeDto.setZccssrq(s.getZccssrq());
|
||||||
|
list.add(standTimeDto);
|
||||||
|
mapList.put(s.getCountry(),list);
|
||||||
|
}
|
||||||
|
return mapList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@ public class SarLawsDetailedListController extends BaseController<SarLawsDetaile
|
|||||||
**/
|
**/
|
||||||
@ApiOperation(value = "增加清单")
|
@ApiOperation(value = "增加清单")
|
||||||
@PostMapping("/insertList")
|
@PostMapping("/insertList")
|
||||||
public ResponseMessage insertList(AddDetailedDto addDetailedDto) {
|
public ResponseMessage insertList( AddDetailedDto addDetailedDto) {
|
||||||
String src = sarLawsDetailedListService.add(addDetailedDto);
|
String src = sarLawsDetailedListService.add(addDetailedDto);
|
||||||
return Result.success(src);
|
return Result.success(src);
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-4
@@ -1,11 +1,7 @@
|
|||||||
package com.adc.da.slrs.sarLawsDetailedList.entity;
|
package com.adc.da.slrs.sarLawsDetailedList.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* //TODO 添加类、接口描述
|
* //TODO 添加类、接口描述
|
||||||
@@ -38,4 +34,11 @@ public class AddDetailedDto {
|
|||||||
private String fileIds;
|
private String fileIds;
|
||||||
@ApiModelProperty(value = "要添加的清单id")
|
@ApiModelProperty(value = "要添加的清单id")
|
||||||
private String inforlist;
|
private String inforlist;
|
||||||
|
@ApiModelProperty(value = "实施时间")
|
||||||
|
private String inforlist1;
|
||||||
|
@ApiModelProperty(value = "在产车实施时间")
|
||||||
|
private String inforlist2;
|
||||||
|
@ApiModelProperty(value = "新车型实施时间")
|
||||||
|
private String inforlist3;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* //TODO 添加类、接口描述
|
* //TODO 添加类、接口描述
|
||||||
@@ -58,4 +59,13 @@ public class DetailedUpDto {
|
|||||||
@ApiModelProperty(value = "清单详情")
|
@ApiModelProperty(value = "清单详情")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "实施时间")
|
||||||
|
private String inforlist1;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "在产车实施时间")
|
||||||
|
private String inforlist2;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "新车型实施时间")
|
||||||
|
private String inforlist3;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,6 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class IdListDto {
|
public class IdListDto {
|
||||||
@ApiModelProperty("未符合项ID列表")
|
@ApiModelProperty("ID列表")
|
||||||
private List<String> Ids;
|
private List<String> Ids;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.adc.da.slrs.sarLawsDetailedList.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* //TODO 添加类、接口描述
|
||||||
|
*
|
||||||
|
* @author ZhangZhiYuan
|
||||||
|
* @date 2021-07-21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TimeDto {
|
||||||
|
@ApiModelProperty(value = "标准id")
|
||||||
|
private String standId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "实施日期")
|
||||||
|
private String putTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "在产车实施日期")
|
||||||
|
private String zccssrqgj;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "新车型实施日期")
|
||||||
|
private String xcxssrqgj;
|
||||||
|
|
||||||
|
}
|
||||||
+72
-4
@@ -8,6 +8,7 @@ import com.adc.da.slrs.sarLawsDetailedList.dao.SarLawsDetailedListDao;
|
|||||||
import com.adc.da.slrs.sarLawsDetailedList.entity.AddDetailedDto;
|
import com.adc.da.slrs.sarLawsDetailedList.entity.AddDetailedDto;
|
||||||
import com.adc.da.slrs.sarLawsDetailedList.entity.SarLawsDetailedList;
|
import com.adc.da.slrs.sarLawsDetailedList.entity.SarLawsDetailedList;
|
||||||
import com.adc.da.slrs.sarLawsDetailedList.entity.DetailedUpDto;
|
import com.adc.da.slrs.sarLawsDetailedList.entity.DetailedUpDto;
|
||||||
|
import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto;
|
||||||
import com.adc.da.slrs.sarLawsDetailedList.service.ISarLawsDetailedListService;
|
import com.adc.da.slrs.sarLawsDetailedList.service.ISarLawsDetailedListService;
|
||||||
import com.adc.da.sys.service.IDicTypeEOService;
|
import com.adc.da.sys.service.IDicTypeEOService;
|
||||||
import com.adc.da.util.UUIDUtils;
|
import com.adc.da.util.UUIDUtils;
|
||||||
@@ -89,8 +90,42 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
|||||||
else {sarLawsDetailedList.setUpdatePeople(getUserName());}
|
else {sarLawsDetailedList.setUpdatePeople(getUserName());}
|
||||||
sarLawsDetailedListDao.insert(sarLawsDetailedList);
|
sarLawsDetailedListDao.insert(sarLawsDetailedList);
|
||||||
addDetailedDto.setInforlist(addDetailedDto.getInforlist().substring(1,addDetailedDto.getInforlist().length()-1));
|
addDetailedDto.setInforlist(addDetailedDto.getInforlist().substring(1,addDetailedDto.getInforlist().length()-1));
|
||||||
String[] split = addDetailedDto.getInforlist().split(",");
|
List<TimeDto> timeDto = new ArrayList<>();
|
||||||
service.insertDetailedList(sarLawsDetailedList.getId(),split);
|
if (addDetailedDto.getInforlist().indexOf(",") >= 0){
|
||||||
|
String[] id = addDetailedDto.getInforlist().split(",");
|
||||||
|
String[] putTime = addDetailedDto.getInforlist1().split(",");
|
||||||
|
String[] zcc = addDetailedDto.getInforlist2().split(",");
|
||||||
|
String[] xcx = addDetailedDto.getInforlist3().split(",");
|
||||||
|
for (int a =0;a< id.length;a++){
|
||||||
|
TimeDto dto = new TimeDto();
|
||||||
|
dto.setStandId(id[a]);
|
||||||
|
if ("\"".equals(putTime[a])){
|
||||||
|
dto.setPutTime(null);
|
||||||
|
}else {
|
||||||
|
dto.setPutTime(putTime[a]);
|
||||||
|
}
|
||||||
|
if ("\"".equals(putTime[a])){
|
||||||
|
dto.setXcxssrqgj(null);
|
||||||
|
}else {
|
||||||
|
dto.setXcxssrqgj(xcx[a]);
|
||||||
|
}
|
||||||
|
if ("\"".equals(putTime[a])){
|
||||||
|
dto.setZccssrqgj(null);
|
||||||
|
}else {
|
||||||
|
dto.setZccssrqgj(zcc[a]);
|
||||||
|
}
|
||||||
|
timeDto.add(dto);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
TimeDto dto = new TimeDto();
|
||||||
|
dto.setStandId(addDetailedDto.getInforlist());
|
||||||
|
dto.setPutTime(addDetailedDto.getInforlist1());
|
||||||
|
dto.setXcxssrqgj(addDetailedDto.getInforlist2());
|
||||||
|
dto.setZccssrqgj(addDetailedDto.getInforlist3());
|
||||||
|
timeDto.add(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
service.insertDetailedList(sarLawsDetailedList.getId(),timeDto);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -195,8 +230,41 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
|||||||
|
|
||||||
sarLawsDetailedListDao.updateById(list);
|
sarLawsDetailedListDao.updateById(list);
|
||||||
detailedUpDto.setInforlist(detailedUpDto.getInforlist().substring(1,detailedUpDto.getInforlist().length()-1));
|
detailedUpDto.setInforlist(detailedUpDto.getInforlist().substring(1,detailedUpDto.getInforlist().length()-1));
|
||||||
String[] split = detailedUpDto.getInforlist().split(",");
|
List<TimeDto> timeDto = new ArrayList<>();
|
||||||
service.updateDetailedLaws(detailedUpDto.getId(), split);
|
if (detailedUpDto.getInforlist().indexOf(",") >= 0){
|
||||||
|
String[] id = detailedUpDto.getInforlist().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 ("\"".equals(putTime[a])){
|
||||||
|
dto.setPutTime(null);
|
||||||
|
}else {
|
||||||
|
dto.setPutTime(putTime[a]);
|
||||||
|
}
|
||||||
|
if ("\"".equals(putTime[a])){
|
||||||
|
dto.setXcxssrqgj(null);
|
||||||
|
}else {
|
||||||
|
dto.setXcxssrqgj(xcx[a]);
|
||||||
|
}
|
||||||
|
if ("\"".equals(putTime[a])){
|
||||||
|
dto.setZccssrqgj(null);
|
||||||
|
}else {
|
||||||
|
dto.setZccssrqgj(zcc[a]);
|
||||||
|
}
|
||||||
|
timeDto.add(dto);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
TimeDto dto = new TimeDto();
|
||||||
|
dto.setStandId(detailedUpDto.getInforlist());
|
||||||
|
dto.setPutTime(detailedUpDto.getInforlist1());
|
||||||
|
dto.setXcxssrqgj(detailedUpDto.getInforlist2());
|
||||||
|
dto.setZccssrqgj(detailedUpDto.getInforlist3());
|
||||||
|
timeDto.add(dto);
|
||||||
|
}
|
||||||
|
service.updateDetailedLaws(detailedUpDto.getId(), timeDto);
|
||||||
return "修改成功";
|
return "修改成功";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-6
@@ -150,12 +150,6 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
|
|||||||
list = null;
|
list = null;
|
||||||
}else {
|
}else {
|
||||||
list = sarLawsAttrDetailedListDao.selectLawsByIdC(standId,findStandDto.getStandName(), findStandDto.getStandType());
|
list = sarLawsAttrDetailedListDao.selectLawsByIdC(standId,findStandDto.getStandName(), findStandDto.getStandType());
|
||||||
for (LawsDto lawsDto:list){
|
|
||||||
if (sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()).size()!=0){
|
|
||||||
lawsDto.setTypeApplicable(StringUtils.join(sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()), ","));
|
|
||||||
System.out.println(StringUtils.join(sarLawsAttrDetailedListDao.selectTypeApplicable(lawsDto.getId()), ","));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
IPage<LawsDto> page1=new Page<>();
|
IPage<LawsDto> page1=new Page<>();
|
||||||
page1.setRecords(list);
|
page1.setRecords(list);
|
||||||
|
|||||||
+17
-9
@@ -3,7 +3,7 @@
|
|||||||
<mapper namespace="com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao">
|
<mapper namespace="com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao">
|
||||||
|
|
||||||
<select id="selectLawsById" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
|
<select id="selectLawsById" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
|
||||||
SELECT a.ID,a.STAND_NUMBER,a.STAND_NAME,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQGJ,b.ZCCSSRQGJ,b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN
|
SELECT a.ID,a.STAND_NUMBER,a.STAND_NAME,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQGJ,b.ZCCSSRQGJ,b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable
|
||||||
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||||
a.ID = b.STAND_ID
|
a.ID = b.STAND_ID
|
||||||
<where>
|
<where>
|
||||||
@@ -41,13 +41,8 @@
|
|||||||
</where>
|
</where>
|
||||||
order by number
|
order by number
|
||||||
</select>
|
</select>
|
||||||
<select id="selectTypeApplicable" resultType="java.lang.String">
|
|
||||||
SELECT APPLY_ARCTIC
|
|
||||||
FROM sar_stand_items
|
|
||||||
WHERE ID =#{param1,jdbcType=VARCHAR}
|
|
||||||
</select>
|
|
||||||
<select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
|
<select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
|
||||||
SELECT a.ID,a.STAND_NUMBER,a.STAND_NAME,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQGJ,b.ZCCSSRQGJ,b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN
|
SELECT a.ID,a.STAND_NUMBER,a.STAND_NAME,a.STAND_EN_NAME,b.NYLX,a.PUT_TIME,b.XCXSSRQGJ,b.ZCCSSRQGJ,b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable
|
||||||
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
|
||||||
a.ID = b.STAND_ID
|
a.ID = b.STAND_ID
|
||||||
<where>
|
<where>
|
||||||
@@ -65,12 +60,25 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">
|
||||||
|
SELECT
|
||||||
|
b.country_area AS country,
|
||||||
|
a.putTime AS putTime,
|
||||||
|
a.xcxssrq AS xcxssrq,
|
||||||
|
a.zccssrq AS zccssrq
|
||||||
|
FROM
|
||||||
|
sar_laws_attr_detailed_list a
|
||||||
|
LEFT JOIN sar_laws_detailed_list b ON b.id = a.detailed_list_id
|
||||||
|
WHERE
|
||||||
|
b.sort_key = 1
|
||||||
|
AND a.stand_id = #{standId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<insert id="insertList">
|
<insert id="insertList">
|
||||||
INSERT INTO sar_laws_attr_detailed_list ( id, number, detailed_list_id, stand_id ) VALUES
|
INSERT INTO sar_laws_attr_detailed_list ( id, number, detailed_list_id, stand_id ,putTime,xcxssrq,zccssrq) VALUES
|
||||||
<foreach collection ="sarLawsAttrDetailedLists" item="list" separator =",">
|
<foreach collection ="sarLawsAttrDetailedLists" item="list" separator =",">
|
||||||
(#{list.id,jdbcType=VARCHAR}, #{list.number}, #{list.detailedListId,jdbcType=VARCHAR}, #{list.standId,jdbcType=VARCHAR})
|
(#{list.id,jdbcType=VARCHAR}, #{list.number}, #{list.detailedListId,jdbcType=VARCHAR}, #{list.standId,jdbcType=VARCHAR},#{list.putTime,jdbcType=VARCHAR},#{list.xcxssrq,jdbcType=VARCHAR},#{list.zccssrq,jdbcType=VARCHAR})
|
||||||
</foreach >
|
</foreach >
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user