Merge branch 'feature_dev_20230222_FJDSS' into dev_2nd_LCYH
# Conflicts: # jero-boot/db/蔚来标准sql/dev_2nd_period.sql # jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java
This commit is contained in:
+172
@@ -0,0 +1,172 @@
|
||||
package com.jero.modules.document.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档库-分阶段实施详情表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-02-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="文档库-分阶段实施详情表")
|
||||
@RestController
|
||||
@RequestMapping("/document/phasedImplementationDetailsEO")
|
||||
@Slf4j
|
||||
public class PhasedImplementationDetailsEOController extends JeroController<PhasedImplementationDetailsEO, IPhasedImplementationDetailsEOService> {
|
||||
@Autowired
|
||||
private IPhasedImplementationDetailsEOService phasedImplementationDetailsEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param phasedImplementationDetailsEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-分页列表查询")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-分页列表查询", notes="文档库-分阶段实施详情表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(PhasedImplementationDetailsEO phasedImplementationDetailsEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name="cut", defaultValue="cn") String cut,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<PhasedImplementationDetailsEO> queryWrapper = QueryGenerator.initQueryWrapper(phasedImplementationDetailsEO, req.getParameterMap());
|
||||
Page<PhasedImplementationDetailsEO> page = new Page<PhasedImplementationDetailsEO>(pageNo, pageSize);
|
||||
IPage<PhasedImplementationDetailsEO> pageList = phasedImplementationDetailsEOService.page(page, queryWrapper);
|
||||
this.phasedImplementationDetailsEOService.disposeData(pageList.getRecords(),cut);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-列表查询")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-列表查询", notes="文档库-分阶段实施详情表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<PhasedImplementationDetailsEO>> queryList() {
|
||||
List<PhasedImplementationDetailsEO> list = phasedImplementationDetailsEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param phasedImplementationDetailsEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-添加")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-添加", notes="文档库-分阶段实施详情表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
phasedImplementationDetailsEOService.add(phasedImplementationDetailsEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param phasedImplementationDetailsEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-编辑")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-编辑", notes="文档库-分阶段实施详情表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
phasedImplementationDetailsEOService.editById(phasedImplementationDetailsEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-通过id删除")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-通过id删除", notes="文档库-分阶段实施详情表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
phasedImplementationDetailsEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-批量删除")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-批量删除", notes="文档库-分阶段实施详情表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.phasedImplementationDetailsEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-通过id查询")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-通过id查询", notes="文档库-分阶段实施详情表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
PhasedImplementationDetailsEO phasedImplementationDetailsEO = phasedImplementationDetailsEOService.queryById(id);
|
||||
if(phasedImplementationDetailsEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(phasedImplementationDetailsEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param phasedImplementationDetailsEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
return super.exportXls(request, phasedImplementationDetailsEO, PhasedImplementationDetailsEO.class, "文档库-分阶段实施详情表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, PhasedImplementationDetailsEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package com.jero.modules.document.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档库-分阶段实施详情表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-02-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("phased_implementation_details")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="phased_implementation_details对象", description="文档库-分阶段实施详情表")
|
||||
public class PhasedImplementationDetailsEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**文档库id*/
|
||||
@Excel(name = "文档库id", width = 15)
|
||||
@ApiModelProperty(value = "文档库id")
|
||||
private String bussDocumentLibraryId;
|
||||
|
||||
/**法规编号/条款*/
|
||||
@Excel(name = "法规编号/条款", width = 15)
|
||||
@ApiModelProperty(value = "法规编号/条款")
|
||||
private String standNumberOrClause;
|
||||
|
||||
/**实施类型*/
|
||||
@Excel(name = "实施类型", width = 15)
|
||||
@ApiModelProperty(value = "实施类型")
|
||||
private String implementationType;
|
||||
|
||||
/**实施类型展示文本**/
|
||||
@TableField(exist = false)
|
||||
private String implementationTypeText;
|
||||
|
||||
/**实施日期*/
|
||||
@Excel(name = "实施日期", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
private Date implementationDate;
|
||||
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
/**排序号*/
|
||||
@Excel(name = "排序号", width = 15)
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer orderNum;
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.jero.modules.document.enums;
|
||||
|
||||
/**
|
||||
* 实施类型枚举类
|
||||
*/
|
||||
public enum ImplementationTypeEnum {
|
||||
CAR_IN_PRODUCTION("1628228171473039361","在产车","Car in production","34e90bd6a000471bbdcd0ff325898740"),
|
||||
NEW_CAR_MODEL("1628228101830815745","新车型","New car model","2148610ff06641849106321531656bfc");
|
||||
|
||||
String id;
|
||||
String nameCn;
|
||||
String nameEn;
|
||||
String itemValue;
|
||||
|
||||
private ImplementationTypeEnum(String id,String nameCn, String nameEn,String itemValue) {
|
||||
this.id = id;
|
||||
this.nameCn = nameCn;
|
||||
this.nameEn = nameEn;
|
||||
this.itemValue = itemValue;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNameCn() {
|
||||
return nameCn;
|
||||
}
|
||||
|
||||
public void setNameCn(String nameCn) {
|
||||
this.nameCn = nameCn;
|
||||
}
|
||||
|
||||
public String getNameEn() {
|
||||
return nameEn;
|
||||
}
|
||||
|
||||
public void setNameEn(String nameEn) {
|
||||
this.nameEn = nameEn;
|
||||
}
|
||||
|
||||
public String getItemValue() {
|
||||
return itemValue;
|
||||
}
|
||||
|
||||
public void setItemValue(String itemValue) {
|
||||
this.itemValue = itemValue;
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.document.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 文档库-分阶段实施详情表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-02-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface PhasedImplementationDetailsEOMapper extends BaseMapper<PhasedImplementationDetailsEO> {
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.document.mapper.PhasedImplementationDetailsEOMapper">
|
||||
<resultMap id="PhasedImplementationDetailsEOResultMap" type="com.jero.modules.document.entity.PhasedImplementationDetailsEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="buss_document_library_id" property="bussDocumentLibraryId" />
|
||||
<result column="stand_number_or_clause" property="standNumberOrClause" />
|
||||
<result column="implementation_type" property="implementationType" />
|
||||
<result column="implementation_date" property="implementationDate" />
|
||||
<result column="remarks" property="remarks" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.jero.modules.document.service;
|
||||
|
||||
import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 文档库-分阶段实施详情表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-02-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IPhasedImplementationDetailsEOService extends IService<PhasedImplementationDetailsEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param phasedImplementationDetailsEO
|
||||
* @return
|
||||
*/
|
||||
void add(PhasedImplementationDetailsEO phasedImplementationDetailsEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param phasedImplementationDetailsEO
|
||||
* @return
|
||||
*/
|
||||
void editById(PhasedImplementationDetailsEO phasedImplementationDetailsEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
PhasedImplementationDetailsEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<PhasedImplementationDetailsEO> queryList();
|
||||
|
||||
boolean insertBatch(List<PhasedImplementationDetailsEO> phasedImplDetailsEOList);
|
||||
|
||||
void disposeData(List<PhasedImplementationDetailsEO> datas, String cut);
|
||||
}
|
||||
+644
-318
File diff suppressed because it is too large
Load Diff
+155
@@ -0,0 +1,155 @@
|
||||
package com.jero.modules.document.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
import com.jero.modules.document.enums.ImplementationTypeEnum;
|
||||
import com.jero.modules.document.mapper.PhasedImplementationDetailsEOMapper;
|
||||
import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
|
||||
import me.zhyd.oauth.utils.StringUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 文档库-分阶段实施详情表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-02-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class PhasedImplementationDetailsEOServiceImpl extends ServiceImpl<PhasedImplementationDetailsEOMapper, PhasedImplementationDetailsEO> implements IPhasedImplementationDetailsEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param phasedImplementationDetailsEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
Date now = new Date();
|
||||
phasedImplementationDetailsEO.setCreateTime(now);
|
||||
phasedImplementationDetailsEO.setUpdateTime(now);
|
||||
save(phasedImplementationDetailsEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param phasedImplementationDetailsEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
Date now = new Date();
|
||||
phasedImplementationDetailsEO.setUpdateTime(now);
|
||||
saveOrUpdate(phasedImplementationDetailsEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PhasedImplementationDetailsEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PhasedImplementationDetailsEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertBatch(List<PhasedImplementationDetailsEO> phasedImplDetailsEOList) {
|
||||
boolean flag = true;
|
||||
if(CollectionUtils.isNotEmpty(phasedImplDetailsEOList)){
|
||||
try {
|
||||
String bussDocumentLibraryId = phasedImplDetailsEOList.get(0).getBussDocumentLibraryId();
|
||||
QueryWrapper<PhasedImplementationDetailsEO> deleteWrap = new QueryWrapper<>();
|
||||
deleteWrap.lambda().eq(PhasedImplementationDetailsEO::getBussDocumentLibraryId,bussDocumentLibraryId);
|
||||
this.baseMapper.delete(deleteWrap);
|
||||
|
||||
this.saveBatch(phasedImplDetailsEOList);
|
||||
}catch (Exception ex){
|
||||
flag = false;
|
||||
ex.printStackTrace();
|
||||
log.error("批量添加分阶段实施详情信息失败:" + ex.getMessage());
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeData(List<PhasedImplementationDetailsEO> datas, String cut) {
|
||||
if(CollectionUtils.isNotEmpty(datas)){
|
||||
for (PhasedImplementationDetailsEO data : datas) {
|
||||
String implementationType = data.getImplementationType();
|
||||
if(StringUtils.isNotEmpty(implementationType)){
|
||||
String[] implementationTypeArr = implementationType.split(",");
|
||||
ImplementationTypeEnum[] implementationTypeEnums = ImplementationTypeEnum.values();
|
||||
|
||||
String implementationTypeText = "";
|
||||
if(org.apache.commons.lang3.StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
implementationTypeText = Arrays.stream(implementationTypeEnums).filter(implementationTypeEnum -> {
|
||||
boolean flag = false;
|
||||
for (String type : implementationTypeArr) {
|
||||
if (org.apache.commons.lang3.StringUtils.equals(type, implementationTypeEnum.getItemValue())) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).map(ImplementationTypeEnum::getNameCn).collect(Collectors.joining(","));
|
||||
}else {
|
||||
implementationTypeText = Arrays.stream(implementationTypeEnums).filter(implementationTypeEnum -> {
|
||||
boolean flag = false;
|
||||
for (String type : implementationTypeArr) {
|
||||
if (org.apache.commons.lang3.StringUtils.equals(type, implementationTypeEnum.getItemValue())) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}).map(ImplementationTypeEnum::getNameEn).collect(Collectors.joining(","));
|
||||
}
|
||||
data.setImplementationTypeText(implementationTypeText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+116
@@ -16,8 +16,11 @@ import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.DateUtils;
|
||||
import com.jero.common.util.oss.CosBootUtil;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
import com.jero.modules.document.enums.ImplementationTypeEnum;
|
||||
import com.jero.modules.document.enums.LawsStateEnum;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryInfoEO;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryInfoEOEn;
|
||||
@@ -98,6 +101,8 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
|
||||
private DummyInventoryBaseEOServiceImpl dummyInventoryBaseEOService;
|
||||
@Autowired
|
||||
SysCategoryMapper sysCategoryMapper;
|
||||
@Autowired
|
||||
private IPhasedImplementationDetailsEOService phasedImplementationDetailsEOService;
|
||||
|
||||
@Override
|
||||
public IPage<DummyInventoryInfoEO> getPageInfo(DummyInventoryInfoEO dummyInventoryInfoEO,HttpServletRequest req) {
|
||||
@@ -401,6 +406,52 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
|
||||
queryWrapper.orderByDesc("create_time","serial_number");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(dummyInventoryInfoEO.getImplementTimeString())){
|
||||
String[] implementTimeArr = dummyInventoryInfoEO.getImplementTimeString().split(",");
|
||||
|
||||
QueryWrapper<PhasedImplementationDetailsEO> phasedDetailsQueryWrap = new QueryWrapper<>();
|
||||
phasedDetailsQueryWrap.lambda().like(PhasedImplementationDetailsEO::getImplementationType,ImplementationTypeEnum.CAR_IN_PRODUCTION.getItemValue());
|
||||
phasedDetailsQueryWrap.lambda().ge(PhasedImplementationDetailsEO::getImplementationDate,implementTimeArr[0]);
|
||||
phasedDetailsQueryWrap.lambda().le(PhasedImplementationDetailsEO::getImplementationDate,implementTimeArr[1]);
|
||||
List<String> bussDocumentLibraryIdList = this.phasedImplementationDetailsEOService.list(phasedDetailsQueryWrap)
|
||||
.stream().map(PhasedImplementationDetailsEO::getBussDocumentLibraryId).collect(Collectors.toList());
|
||||
|
||||
queryWrapper.and(query -> {
|
||||
query.and(q -> {
|
||||
q.lambda().ge(DummyInventoryInfoEO::getImplementTime,implementTimeArr[0]);
|
||||
q.lambda().le(DummyInventoryInfoEO::getImplementTime,implementTimeArr[1]);
|
||||
});
|
||||
|
||||
if(CollectionUtils.isNotEmpty(bussDocumentLibraryIdList)){
|
||||
query.or(q -> {
|
||||
q.lambda().in(DummyInventoryInfoEO::getBussDocumentLibraryId,bussDocumentLibraryIdList);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if(StringUtils.isNotEmpty(dummyInventoryInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String())){
|
||||
String[] newCarTimeArr = dummyInventoryInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String().split(",");
|
||||
|
||||
QueryWrapper<PhasedImplementationDetailsEO> phasedDetailsQueryWrap = new QueryWrapper<>();
|
||||
phasedDetailsQueryWrap.lambda().like(PhasedImplementationDetailsEO::getImplementationType,ImplementationTypeEnum.NEW_CAR_MODEL.getItemValue());
|
||||
phasedDetailsQueryWrap.lambda().ge(PhasedImplementationDetailsEO::getImplementationDate,newCarTimeArr[0]);
|
||||
phasedDetailsQueryWrap.lambda().le(PhasedImplementationDetailsEO::getImplementationDate,newCarTimeArr[1]);
|
||||
List<String> bussDocumentLibraryIdList = this.phasedImplementationDetailsEOService.list(phasedDetailsQueryWrap)
|
||||
.stream().map(PhasedImplementationDetailsEO::getBussDocumentLibraryId).collect(Collectors.toList());
|
||||
|
||||
queryWrapper.and(query -> {
|
||||
query.and(q -> {
|
||||
q.lambda().ge(DummyInventoryInfoEO::getXin1Che1Xing2Shi2Shi1Ri4Qi1,newCarTimeArr[0]);
|
||||
q.lambda().le(DummyInventoryInfoEO::getXin1Che1Xing2Shi2Shi1Ri4Qi1,newCarTimeArr[1]);
|
||||
});
|
||||
if(CollectionUtils.isNotEmpty(bussDocumentLibraryIdList)){
|
||||
query.or(q -> {
|
||||
q.lambda().in(DummyInventoryInfoEO::getBussDocumentLibraryId,bussDocumentLibraryIdList);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
List<DummyInventoryInfoEO> dummyInventoryInfoEOList = this.list(queryWrapper);
|
||||
log.info("一阶段消耗时间:" + (System.currentTimeMillis() - startTime));
|
||||
//数据字典
|
||||
@@ -412,6 +463,9 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
|
||||
log.info("三阶段消耗时间:" + (System.currentTimeMillis() - startTime));
|
||||
treeDict(dummyInventoryInfoEO, dummyInventoryInfoEOList,sysDictItems);
|
||||
|
||||
// 数据处理
|
||||
this.disposeData(dummyInventoryInfoEOList,dummyInventoryInfoEO.getCut());
|
||||
|
||||
//表头排序
|
||||
dummyInventoryInfoEOList = hearSort(orderBy, orderByField, dummyInventoryInfoEOList);
|
||||
|
||||
@@ -419,6 +473,68 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
|
||||
return dummyInventoryInfoEOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据处理
|
||||
* @param datas
|
||||
* @param cut
|
||||
*/
|
||||
private void disposeData(List<DummyInventoryInfoEO> datas, String cut) {
|
||||
if(CollectionUtils.isNotEmpty(datas)){
|
||||
List<String> bussDocumentLibraryIdList = datas.stream().map(DummyInventoryInfoEO::getBussDocumentLibraryId).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<PhasedImplementationDetailsEO> phasedDetailsQueryWrap = new QueryWrapper<>();
|
||||
phasedDetailsQueryWrap.lambda().in(PhasedImplementationDetailsEO::getBussDocumentLibraryId,bussDocumentLibraryIdList);
|
||||
List<PhasedImplementationDetailsEO> phasedDetailsList = this.phasedImplementationDetailsEOService.list(phasedDetailsQueryWrap);
|
||||
|
||||
// 新车型分阶段实施数据信息
|
||||
List<PhasedImplementationDetailsEO> newCarModelPhasedDetailsList = phasedDetailsList.stream().filter(phasedDetails -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.contains(phasedDetails.getImplementationType(), ImplementationTypeEnum.NEW_CAR_MODEL.getItemValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 在产车分阶段实施数据信息
|
||||
List<PhasedImplementationDetailsEO> carInProductionPhasedDetailsList = phasedDetailsList.stream().filter(phasedDetails -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.contains(phasedDetails.getImplementationType(), ImplementationTypeEnum.CAR_IN_PRODUCTION.getItemValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
for (DummyInventoryInfoEO data : datas) {
|
||||
// 处理新车型实施日期展示
|
||||
List<Date> newCarModelDateList = newCarModelPhasedDetailsList.stream().filter(phasedDetails -> {
|
||||
boolean flag = false;
|
||||
if (StringUtils.equals(phasedDetails.getBussDocumentLibraryId(), data.getBussDocumentLibraryId())) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(PhasedImplementationDetailsEO::getImplementationDate).collect(Collectors.toList());
|
||||
if(data.getXin1Che1Xing2Shi2Shi1Ri4Qi1() != null){
|
||||
newCarModelDateList.add(data.getXin1Che1Xing2Shi2Shi1Ri4Qi1());
|
||||
}
|
||||
String newCarModelDateStr = DateUtils.formatDateList(newCarModelDateList);
|
||||
data.setXin1Che1Xing2Shi2Shi1Ri4Qi1String(newCarModelDateStr);
|
||||
|
||||
// 处理在产车实施日期展示
|
||||
List<Date> carInProductionDateList = carInProductionPhasedDetailsList.stream().filter(phasedDetails -> {
|
||||
boolean flag = false;
|
||||
if (StringUtils.equals(phasedDetails.getBussDocumentLibraryId(), data.getBussDocumentLibraryId())) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(PhasedImplementationDetailsEO::getImplementationDate).collect(Collectors.toList());
|
||||
if(data.getImplementTime() != null){
|
||||
carInProductionDateList.add(data.getImplementTime());
|
||||
}
|
||||
String carInProductionDateStr = DateUtils.formatDateList(carInProductionDateList);
|
||||
data.setImplementTimeString(carInProductionDateStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<DummyInventoryInfoEO> hearSort(String orderBy, String orderByField, List<DummyInventoryInfoEO> dummyInventoryInfoEOList) {
|
||||
if(ObjectUtils.isNotEmpty(orderByField)){
|
||||
Collator comparator = Collator.getInstance(Locale.CHINESE);
|
||||
|
||||
+86
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.warn.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
@@ -7,11 +8,16 @@ import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.ModuleEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.DateUtils;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||
import com.jero.modules.document.enums.ImplementationTypeEnum;
|
||||
import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
|
||||
import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
|
||||
import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryInfoEO;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.system.entity.SysAnnouncement;
|
||||
@@ -24,6 +30,7 @@ import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
@@ -82,6 +89,8 @@ public class LawsWarnService {
|
||||
private ISysAnnouncementService sysAnnouncementService;
|
||||
@Resource
|
||||
private IFeishuService iFeishuService;
|
||||
@Autowired
|
||||
private IPhasedImplementationDetailsEOService phasedImplementationDetailsEOService;
|
||||
|
||||
public IPage getInfoPage(Map<String, Object> parameter) {
|
||||
String cut = (String) parameter.get("cut");//中英文切换标识
|
||||
@@ -183,8 +192,85 @@ public class LawsWarnService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.disposeData(records,cut);
|
||||
|
||||
return infoPage;
|
||||
}
|
||||
|
||||
private void disposeData(List<Map> datas, String cut) {
|
||||
if(CollectionUtils.isNotEmpty(datas)){
|
||||
List<String> bussDocumentLibraryIdList = datas.stream().map(data -> (String) data.get("id")).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<PhasedImplementationDetailsEO> phasedDetailsQueryWrap = new QueryWrapper<>();
|
||||
phasedDetailsQueryWrap.lambda().in(PhasedImplementationDetailsEO::getBussDocumentLibraryId,bussDocumentLibraryIdList);
|
||||
List<PhasedImplementationDetailsEO> phasedDetailsList = this.phasedImplementationDetailsEOService.list(phasedDetailsQueryWrap);
|
||||
|
||||
// 新车型分阶段实施数据信息
|
||||
List<PhasedImplementationDetailsEO> newCarModelPhasedDetailsList = phasedDetailsList.stream().filter(phasedDetails -> {
|
||||
boolean flag = false;
|
||||
if(org.apache.commons.lang3.StringUtils.contains(phasedDetails.getImplementationType(), ImplementationTypeEnum.NEW_CAR_MODEL.getItemValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 在产车分阶段实施数据信息
|
||||
List<PhasedImplementationDetailsEO> carInProductionPhasedDetailsList = phasedDetailsList.stream().filter(phasedDetails -> {
|
||||
boolean flag = false;
|
||||
if(org.apache.commons.lang3.StringUtils.contains(phasedDetails.getImplementationType(), ImplementationTypeEnum.CAR_IN_PRODUCTION.getItemValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
for (Map data : datas) {
|
||||
String bussDocumentLibraryId = (String) data.get("id");
|
||||
|
||||
// 处理新车型实施日期展示
|
||||
List<Date> newCarModelDateList = newCarModelPhasedDetailsList.stream().filter(phasedDetails -> {
|
||||
boolean flag = false;
|
||||
if (org.apache.commons.lang3.StringUtils.equals(phasedDetails.getBussDocumentLibraryId(), bussDocumentLibraryId)) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(PhasedImplementationDetailsEO::getImplementationDate).collect(Collectors.toList());
|
||||
|
||||
|
||||
Date newCarModelDate = null;
|
||||
try {
|
||||
newCarModelDate = DateUtils.parseDate((String) data.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"), "yyyy-MM-dd");
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(newCarModelDate != null){
|
||||
newCarModelDateList.add(newCarModelDate);
|
||||
}
|
||||
String newCarModelDateStr = DateUtils.formatDateList(newCarModelDateList);
|
||||
data.put("xin1_che1_xing2_shi2_shi1_ri4_qi1",newCarModelDateStr);
|
||||
|
||||
// 处理在产车实施日期展示
|
||||
List<Date> carInProductionDateList = carInProductionPhasedDetailsList.stream().filter(phasedDetails -> {
|
||||
boolean flag = false;
|
||||
if (org.apache.commons.lang3.StringUtils.equals(phasedDetails.getBussDocumentLibraryId(), bussDocumentLibraryId)) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(PhasedImplementationDetailsEO::getImplementationDate).collect(Collectors.toList());
|
||||
Date implementTime = null;
|
||||
try {
|
||||
implementTime = DateUtils.parseDate((String) data.get("implement_time"), "yyyy-MM-dd");
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if(implementTime != null){
|
||||
carInProductionDateList.add(implementTime);
|
||||
}
|
||||
String carInProductionDateStr = DateUtils.formatDateList(carInProductionDateList);
|
||||
data.put("implement_time",carInProductionDateStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String beforeTime (int month, Date date){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendarBefore = Calendar.getInstance();
|
||||
|
||||
Reference in New Issue
Block a user