Merge branch 'develop_3' into 'develop_master'

Develop 3

See merge request LiuChao/foton-slrs-system-rest!287
This commit is contained in:
super_liu
2021-12-15 21:14:25 +08:00
6 changed files with 38 additions and 22 deletions
@@ -46,16 +46,17 @@ public class WaterMarkUtil {
// 获得PDF最顶层 // 获得PDF最顶层
under = stamper.getOverContent(i); under = stamper.getOverContent(i);
under.saveState(); under.saveState();
// set Transparency
PdfGState gs = new PdfGState();
// 设置透明度为0.2
gs.setFillOpacity(0.25f);
under.setGState(gs);
under.restoreState(); under.restoreState();
under.beginText(); under.beginText();
under.setFontAndSize(base, 30); under.setFontAndSize(base, 30);
under.setTextMatrix(30, 30); under.setTextMatrix(30, 30);
under.setColorFill(BaseColor.LIGHT_GRAY); under.setColorFill(BaseColor.LIGHT_GRAY);
// 设置透明度为0.2
// set Transparency
PdfGState gs = new PdfGState();
gs.setFillOpacity(0.2f);
under.setGState(gs);
for (int y = 0; y < 50; y++) { for (int y = 0; y < 50; y++) {
for (int x = 0; x < 50; x++) { for (int x = 0; x < 50; x++) {
// 水印文字成45度角倾斜 x位置 y位置 角度 // 水印文字成45度角倾斜 x位置 y位置 角度
@@ -5,6 +5,7 @@ import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result; import com.adc.da.http.Result;
import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage; import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterialPage;
import com.adc.da.slrs.fileMaterialCenter.service.IFileMaterialService; import com.adc.da.slrs.fileMaterialCenter.service.IFileMaterialService;
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.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@@ -15,8 +16,11 @@ import com.adc.da.slrs.fileMaterialCenter.entity.FileMaterial;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import com.adc.da.base.web.BaseController; import com.adc.da.base.web.BaseController;
import javax.xml.crypto.Data;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.text.SimpleDateFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -29,7 +33,7 @@ import java.util.List;
*/ */
@RestController @RestController
@Api(description = "资料中心") @Api(description = "资料中心")
@RequestMapping("/fileMaterialCenter/file-material") @RequestMapping("/${restPath}/fileMaterialCenter/file-material")
public class FileMaterialController extends BaseController<FileMaterial> { public class FileMaterialController extends BaseController<FileMaterial> {
@Autowired @Autowired
@@ -37,7 +41,14 @@ public class FileMaterialController extends BaseController<FileMaterial> {
@PostMapping @PostMapping
@ApiOperation("新增文件资料组") @ApiOperation("新增文件资料组")
public ResponseMessage addFileMaterial(FileMaterial material){ public ResponseMessage addFileMaterial(@RequestBody FileMaterial material){
// Date date = new Date();
// String strDateFormat = "yyyy-MM-dd HH:mm:ss";
// SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
material.setId(UUIDUtils.randomUUID20());
material.setDataUploadTime(new Date());
boolean save = iFileMaterialService.save(material); boolean save = iFileMaterialService.save(material);
return Result.success(save); return Result.success(save);
@@ -47,7 +58,7 @@ public class FileMaterialController extends BaseController<FileMaterial> {
@DeleteMapping @DeleteMapping
@ApiOperation("删除文件资料组") @ApiOperation("删除文件资料组")
public ResponseMessage deleteMaterial(String id){ public ResponseMessage deleteMaterial(String id){
List<String> idList = Arrays.asList(id.split(id)); List<String> idList = Arrays.asList(id.split(","));
boolean b = iFileMaterialService.removeByIds(idList); boolean b = iFileMaterialService.removeByIds(idList);
return Result.success(b); return Result.success(b);
@@ -6,6 +6,7 @@ import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.Tag; import io.swagger.annotations.Tag;
@@ -58,4 +59,8 @@ public class FileMaterial extends BaseEntity {
@ApiModelProperty(value = "置顶") @ApiModelProperty(value = "置顶")
@TableField("is_top") @TableField("is_top")
private Integer isTop; private Integer isTop;
@ApiModelProperty(value = "删除标志")
@TableLogic(value = "0",delval = "1")
private String delFlag;
} }
@@ -36,7 +36,7 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>(); QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>();
if (queryPage.getDataType()!=null){ if (queryPage.getDataType()!=null){
queryWrapper.eq("data_type",queryPage.getDataTitle()); queryWrapper.eq("data_type",queryPage.getDataType());
} }
if (queryPage.getDataTitle()!=null){ if (queryPage.getDataTitle()!=null){
@@ -48,9 +48,8 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
String strDateFormat = "yyyy-MM-dd HH:mm:ss"; String strDateFormat = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat); SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
queryWrapper.between("data_upload_time", queryWrapper.between("data_upload_time", queryPage.getStartDataUploadTime(),
sdf.format(queryPage.getStartDataUploadTime()), queryPage.getEndDataUploadTime());
sdf.format(queryPage.getEndDataUploadTime()));
} }
return this.page(new Page<>(queryPage.getPage(),queryPage.getPageSize()),queryWrapper); return this.page(new Page<>(queryPage.getPage(),queryPage.getPageSize()),queryWrapper);
@@ -60,7 +59,7 @@ public class FileMaterialServiceImpl extends ServiceImpl<FileMaterialDao, FileMa
public List<String> getFileMaterialType() { public List<String> getFileMaterialType() {
QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>(); QueryWrapper<FileMaterial> queryWrapper = new QueryWrapper<>();
queryWrapper.select("data_type"); queryWrapper.select("DISTINCT data_type");
return this.listObjs(queryWrapper, item -> item.toString()); return this.listObjs(queryWrapper, item -> item.toString());
} }
@@ -21,15 +21,15 @@ public class StandRegionalTimeDto {
@ApiModelProperty(value = "实施日期") @ApiModelProperty(value = "实施日期")
@DateTimeFormat(pattern="yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private Date putTime; private String putTime;
@ApiModelProperty(value = "在产车实施日期") @ApiModelProperty(value = "在产车实施日期")
@DateTimeFormat(pattern="yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private Date zccssrq; private String zccssrq;
@ApiModelProperty(value = "新车型实施日期") @ApiModelProperty(value = "新车型实施日期")
@DateTimeFormat(pattern="yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private Date xcxssrq; private String xcxssrq;
} }
@@ -301,14 +301,14 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
} }
private void dateTime(LinkedHashMap<String, List<String>> mapList, StandRegionalTimeDto s) { private void dateTime(LinkedHashMap<String, List<String>> mapList, StandRegionalTimeDto s) {
String putTime = new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime()); // String putTime = new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime());
String xcx = new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq()); // String xcx = new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq());
String zcc = new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq()); // String zcc = new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq());
// putTime.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime()); // putTime.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime());
// xcx.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq())); // xcx.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq()));
// zcc.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq())); // zcc.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq()));
mapList.put("实施日期("+s.getCountry()+")", Collections.singletonList(putTime)); mapList.put("实施日期("+s.getCountry()+")",Arrays.asList(s.getPutTime().split(",")));
mapList.put("新车型实施日期("+s.getCountry()+")", Collections.singletonList(xcx)); mapList.put("新车型实施日期("+s.getCountry()+")", Arrays.asList(s.getXcxssrq().split(",")));
mapList.put("在产车实施日期("+s.getCountry()+")", Collections.singletonList(zcc)); mapList.put("在产车实施日期("+s.getCountry()+")", Arrays.asList(s.getZccssrq().split(",")));
} }
} }