diff --git a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql index 3c69a69fa..47a5df17f 100644 --- a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql +++ b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql @@ -202,6 +202,30 @@ ADD COLUMN `msg_content_info_cn` text NULL COMMENT '消息内容(中文)' AF -- 上报库-参数项查看页表头 责任领域更新为展示列表sql 2023-02-17 已同步生产环境 UPDATE `laws_weilai`.`onl_cgform_field` SET `is_show_list` = 1 WHERE `id` = 'c31d68e204960c073b1fb8126a443492'; +-- 文档库-分阶段实施详情表 2023-02-22 未同步生产环境 +CREATE TABLE `phased_implementation_details` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新日期', + `sys_org_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所属部门', + `buss_document_library_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文档库id', + `stand_number_or_clause` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '法规编号/条款', + `implementation_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '实施类型', + `implementation_date` datetime NULL DEFAULT NULL COMMENT '实施日期', + `remarks` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文档库-分阶段实施详情表' ROW_FORMAT = Dynamic; + +-- 标签内容管理 新增实施类型标签(在产车/新车形) 2023-02-22 未同步生产环境 +INSERT INTO `laws_weilai`.`sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `dict_en_name`, `is_tag_dict`, `is_read_only`, `attribute_type`, `order_num`) VALUES ('1628227874969300994', '实施类型', 'shi2_shi1_lei4_xing2', '文档库-分阶段实施详情-实施类型', 0, 'admin', '2023-02-22 10:59:11', NULL, NULL, NULL, NULL, 1, 0, '1', 1); +INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1628228171473039361', '1628227874969300994', '在产车', '34e90bd6a000471bbdcd0ff325898740', NULL, 1, 1, 'admin', '2023-02-22 11:00:22', NULL, NULL, 1, NULL, NULL, '0', 'Car in production'); +INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1628228101830815745', '1628227874969300994', '新车型', '2148610ff06641849106321531656bfc', NULL, 2, 1, 'admin', '2023-02-22 11:00:05', 'admin', '2023-02-22 11:00:27', 1, NULL, NULL, '0', 'New car model'); + +-- 文档库-分阶段实施详情表-增加排序号字段 2023-02-23 未同步生产环境 +ALTER TABLE `phased_implementation_details` ADD COLUMN `order_num` int(10) NULL COMMENT '排序号' AFTER `remarks`; + -- 任务清单-初始化 认证进度状态sql 2023-02-20 已同步生产环境 UPDATE `laws_weilai`.`project_task_inventory` SET `certification_progress` = 'Not start' diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/DateUtils.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/DateUtils.java index d58aa1d68..d3c878a23 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/DateUtils.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/DateUtils.java @@ -1,5 +1,6 @@ package com.jero.common.util; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.util.StringUtils; import java.beans.PropertyEditorSupport; @@ -8,6 +9,7 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; /** * 类描述:时间操作定义类 @@ -614,6 +616,28 @@ public class DateUtils extends PropertyEditorSupport { return 0; } + /** + * 日期数据转换字符串 + * @param dateList + * @return + */ + public static String formatDateList(List dateList) { + StringBuilder strSb = new StringBuilder(); + + if(CollectionUtils.isNotEmpty(dateList)){ + dateList = dateList.stream().distinct().sorted().collect(Collectors.toList()); + for (Date date : dateList) { + strSb.append(date_sdf.get().format(date)).append(","); + } + } + + String result = ""; + if(!StringUtils.isEmpty(strSb.toString())){ + result = strSb.substring(0,strSb.length()-1); + } + return result; + } + /** * String类型 转换为Date, 如果参数长度为10 转换格式”yyyy-MM-dd“ 如果参数长度为19 转换格式”yyyy-MM-dd * HH:mm:ss“ * @param text String类型的时间值 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhasedImplementationDetailsEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhasedImplementationDetailsEOController.java new file mode 100644 index 000000000..db40d261a --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhasedImplementationDetailsEOController.java @@ -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 { + @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 queryWrapper = QueryGenerator.initQueryWrapper(phasedImplementationDetailsEO, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage 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> queryList() { + List 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); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/entity/PhasedImplementationDetailsEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/entity/PhasedImplementationDetailsEO.java new file mode 100644 index 000000000..64aeb6b15 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/entity/PhasedImplementationDetailsEO.java @@ -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; +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/enums/ImplementationTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/enums/ImplementationTypeEnum.java new file mode 100644 index 000000000..312566ecb --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/enums/ImplementationTypeEnum.java @@ -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; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/mapper/PhasedImplementationDetailsEOMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/mapper/PhasedImplementationDetailsEOMapper.java new file mode 100644 index 000000000..60326ee70 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/mapper/PhasedImplementationDetailsEOMapper.java @@ -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 { + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/mapper/xml/PhasedImplementationDetailsEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/mapper/xml/PhasedImplementationDetailsEOMapper.xml new file mode 100644 index 000000000..9cc5e6f8a --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/mapper/xml/PhasedImplementationDetailsEOMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/IPhasedImplementationDetailsEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/IPhasedImplementationDetailsEOService.java new file mode 100644 index 000000000..7a878ca3e --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/IPhasedImplementationDetailsEOService.java @@ -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 { + + /** + * 保存 + * + * @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 ids); + + /** + * 通过id查询 + * + * @param id + * @return + */ + PhasedImplementationDetailsEO queryById(String id); + + /** + * 列表查询 + * + * @return + */ + List queryList(); + + boolean insertBatch(List phasedImplDetailsEOList); + + void disposeData(List datas, String cut); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java index bec609f0b..45b9a2129 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java @@ -31,11 +31,14 @@ import com.jero.modules.collection.entity.OnlCgformCollection; import com.jero.modules.collection.service.IOnlCgformCollectionService; import com.jero.modules.document.entity.BussDocumentLibraryEO; import com.jero.modules.document.entity.OSSFileForDocumentLibrary; +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.enums.LawsStateEnum; import com.jero.modules.document.enums.SearchEnum; import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper; import com.jero.modules.document.service.IBussDocumentLibraryEOService; +import com.jero.modules.document.service.IPhasedImplementationDetailsEOService; import com.jero.modules.document.utils.ReadPdfUtil; import com.jero.modules.document.utils.ReadWordUtil; import com.jero.modules.document.vo.QueryConditionVO; @@ -188,6 +191,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl fieldListTemp = fieldList.stream().filter(e -> onlCgformAreaTemp.getId().equals(e.getShowArea())).collect(Collectors.toList()); + OnlCgformField phasedOnlCgformField = new OnlCgformField(); + phasedOnlCgformField.setId(UUID.randomUUID().toString().replace("-", "")); + phasedOnlCgformField.setDbFieldTxt("分阶段实施详情"); + phasedOnlCgformField.setDbFieldEnName("Details of the phased implementation"); + phasedOnlCgformField.setDbFieldName("phasedImplDetails"); + fieldListTemp.add(phasedOnlCgformField); for (OnlCgformField onlCgformField : fieldListTemp) { String dictId = onlCgformField.getDictId(); List sysCategoryTreeVOList = new ArrayList<>(); @@ -893,6 +904,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl phasedImplDetailsQueryWrap = new QueryWrapper<>(); + phasedImplDetailsQueryWrap.lambda().eq(PhasedImplementationDetailsEO::getBussDocumentLibraryId,id); + List phasedImplementationDetailsEOList = this.phasedImplementationDetailsEOService.list(phasedImplDetailsQueryWrap); + this.phasedImplementationDetailsEOService.disposeData(phasedImplementationDetailsEOList,cut); + dataList.get(0).put("phasedImplementationDetailsEOList",phasedImplementationDetailsEOList); + return dataList; } // public List> getDocumentInfoById(String id, String cut) { @@ -1716,9 +1735,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl> fileTextList = new ArrayList<>(); List oSSFileAll = new ArrayList<>(); Map stringObjectMap = new HashMap<>(); @@ -1726,9 +1743,12 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl entry : map.entrySet()) { String key = entry.getKey(); + if(StringUtils.equals(key,"phasedImplementationDetailsEOList")){ + continue; + } Object value = entry.getValue(); //es全文新增数据(数据转换) - esFullText(cut, fieldList, categoryList, dictItemList, mapList, sbCn,sbEn, entry); + // esFullText(cut, fieldList, categoryList, dictItemList, mapList, sbCn,sbEn, entry); if (ObjectUtils.isNotEmpty(value)) { //处理日期格式 @@ -1776,6 +1796,27 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl entry : map.entrySet()) { + //es全文新增数据(数据转换) + esFullText(cut, fieldList, categoryList, dictItemList, mapList, sbCn,sbEn, entry); + } + + // 将用户选择、输入的在产车实施日期、新车型实施日期恢复 + map.put("implement_time",implement_time); + map.put("xin1_che1_xing2_shi2_shi1_ri4_qi1",xin1_che1_xing2_shi2_shi1_ri4_qi1); + //多文件es List fileIdList = oSSFileAll.stream().map(OSSFile::getId).collect(Collectors.toList()); @@ -1939,7 +1980,6 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl> dataList = bussDocumentLibraryEOMapper.selectMapsAll(id); if(dataList.size() != 0){ @@ -2436,14 +2478,12 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl oSSFileAll = new ArrayList<>(); - StringBuilder sbCn = new StringBuilder(); - StringBuilder sbEn = new StringBuilder(); Map stringObjectMap = new HashMap<>(); for (Map.Entry entry : mapNew.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); //es全文新增数据(数据转换) - esFullText(cut, fieldList, categoryList, dictItemList, listMap, sbCn,sbEn, entry); + // esFullText(cut, fieldList, categoryList, dictItemList, listMap, sbCn,sbEn, entry); if (ObjectUtils.isNotEmpty(value)) { //处理修改人和修改时间 @@ -2509,6 +2549,24 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl ossFileList = fileSort(fieldFileList, fileInfos, stringObjectMap); + // 将用户选择、输入的新车型实施日期、在产车实施日期备份出来。如果不处理的话,插入ES时会报 解析失败 错误。 + String implement_time = (String) map.get("implement_time"); + String xin1_che1_xing2_shi2_shi1_ri4_qi1 = (String) map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"); + + // 批量添加分阶段实施明细信息 + this.insertBatchPhasedImplementationDetailsInfo(map); + + StringBuilder sbCn = new StringBuilder(); + StringBuilder sbEn = new StringBuilder(); + for (Map.Entry entry : map.entrySet()) { + //es全文新增数据(数据转换) + esFullText(cut, fieldList, categoryList, dictItemList, listMap, sbCn,sbEn, entry); + } + + // 将用户选择、输入的在产车实施日期、新车型实施日期恢复 + map.put("implement_time",implement_time); + map.put("xin1_che1_xing2_shi2_shi1_ri4_qi1",xin1_che1_xing2_shi2_shi1_ri4_qi1); + List> mapListTempCn = new ArrayList<>(); List> mapListTempEn = new ArrayList<>(); String fileTextAll = ""; @@ -2623,6 +2681,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl= '" + value.split(",")[0] + "'" - + " and " + "date_format(" + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'"); - } else { - conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') = '" + value + "'"); + // 如果是查询实施日期,需要单独处理一下,刚加的分阶段实施详情需求 + if(StringUtils.equals("xin1_che1_xing2_shi2_shi1_ri4_qi1",key) || StringUtils.equals("implement_time",key)){ + //日期(区分单日期还时间范围) + if (value.contains(",")) { + conditionSb.append(" and ("); + conditionSb.append(" ("); + conditionSb.append("date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'" + + " and " + "date_format(" + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'"); + conditionSb.append(" )"); + conditionSb.append(" or id in ("); + conditionSb.append("select buss_document_library_id from phased_implementation_details"); + conditionSb.append(" where implementation_date >= '" + value.split(",")[0] + "' and implementation_date <= '" + value.split(",")[1] + "'"); + if(StringUtils.equals("xin1_che1_xing2_shi2_shi1_ri4_qi1",key)){ + conditionSb.append(" and implementation_type like concat(concat('%','" + ImplementationTypeEnum.NEW_CAR_MODEL.getItemValue() + "'),'%')"); + }else if(StringUtils.equals("implement_time",key)){ + conditionSb.append(" and implementation_type like concat(concat('%','" + ImplementationTypeEnum.CAR_IN_PRODUCTION.getItemValue() + "'),'%')"); + } + conditionSb.append(" )"); + conditionSb.append(" )"); + } else { + conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') = '" + value + "'"); + } + }else { + //日期(区分单日期还时间范围) + if (value.contains(",")) { + conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'" + + " and " + "date_format(" + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'"); + } else { + conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') = '" + value + "'"); + } } } else if (FieldTypeEnum.PERSON.getValue().equals(fieldType)) { //输入框 LIKE CONCAT("%", '/%', "%") ESCAPE '/' @@ -4583,6 +4667,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl !FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).collect(Collectors.toList()); @@ -4790,6 +4882,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl sysDictItems = sysDictItemServiceImpl.selectItemsAll(); //文件字段 @@ -4800,13 +4893,61 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl connectIdList = new ArrayList<>(); + List idList = datas.stream().map(data -> (String) data.get("id")).distinct().collect(Collectors.toList()); + + List phasedImplDetailsEOList = null; + if(CollectionUtils.isNotEmpty(idList)){ + QueryWrapper phasedImplDetailsQueryWrap = new QueryWrapper<>(); + phasedImplDetailsQueryWrap.lambda().in(PhasedImplementationDetailsEO::getBussDocumentLibraryId,idList); + phasedImplDetailsEOList = this.phasedImplementationDetailsEOService.list(phasedImplDetailsQueryWrap); + this.phasedImplementationDetailsEOService.disposeData(phasedImplDetailsEOList,cut); + } + for (Map data : datas) { + StringBuilder phasedImplDetailsSb = new StringBuilder(); + String id = (String) data.get("id"); + for (OnlCgformField onlCgformField : fileFieldList) { String value = StringUtils.valueOf(data.get(onlCgformField.getDbFieldName())); if (StringUtils.isNotBlank(value)) { connectIdList.add(value); } } + + if(CollectionUtils.isNotEmpty(phasedImplDetailsEOList)){ + List phasedImplDetailsEOListTemp = phasedImplDetailsEOList.stream().filter(phased -> { + boolean flag = false; + if(StringUtils.equals(id,phased.getBussDocumentLibraryId())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(phasedImplDetailsEOListTemp)){ + for (PhasedImplementationDetailsEO detailsEO : phasedImplDetailsEOListTemp) { + StringBuilder phasedImplDetailsSbTemp = new StringBuilder(); + if(StringUtils.isNotEmpty(phasedImplDetailsSb.toString())){ + phasedImplDetailsSb.append("#"); + } + if(StringUtils.isNotEmpty(detailsEO.getStandNumberOrClause())){ + phasedImplDetailsSbTemp.append(detailsEO.getStandNumberOrClause()).append(""); + } + if(StringUtils.isNotEmpty(detailsEO.getImplementationTypeText())){ + phasedImplDetailsSbTemp.append(detailsEO.getImplementationTypeText()).append(""); + } + if(detailsEO.getImplementationDate()!=null){ + phasedImplDetailsSbTemp.append(DateUtils.formatTime(detailsEO.getImplementationDate())).append(""); + } + if(StringUtils.isNotEmpty(detailsEO.getRemarks())){ + phasedImplDetailsSbTemp.append(detailsEO.getRemarks()).append(""); + } + if(StringUtils.isNotEmpty(phasedImplDetailsSbTemp.toString())){ + phasedImplDetailsSb.append(phasedImplDetailsSbTemp.toString().substring(0,phasedImplDetailsSbTemp.toString().length()-3)); + } + } + } + } + data.put("phasedImplDetails",phasedImplDetailsSb.toString()); } //所有的文件信息 List fileInfos = new ArrayList<>(); @@ -4856,7 +4997,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl list = new LinkedList<>(); list.add(title); list.add(sbTwo.toString()); @@ -5800,327 +5958,415 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl map : fieldList) { - String fieldNameCn = (String) map.get("db_field_txt");//中文名称 - String fieldName = (String) map.get("db_field_name");//字段名 - String mustInput = (String) map.get("field_must_input");//是否必填 - String dbLength = map.get("db_length").toString();//字段长度 - String fieldShowType = (String) map.get("field_show_type");//字段类型 + // 如果是分阶段实施字段,单独处理,如果是其它字段,按照原有逻辑处理 + if(StringUtils.equals(key,"分阶段实施详情") || StringUtils.equals(key,"Details of the phased implementation")){ + if(StringUtils.isNotEmpty(value)){ + List phasedImplementationDetailsEOList = new ArrayList<>(); + List phasedImplDetailsList = Arrays.asList(value.split("#")); + for (String phasedImplDetails : phasedImplDetailsList) { + PhasedImplementationDetailsEO phasedImplementationDetailsEO = new PhasedImplementationDetailsEO(); + String[] phasedImplDetailsArr = phasedImplDetails.split("

"); + if(phasedImplDetailsArr.length >= 1){ + String standNumberOrClause = phasedImplDetailsArr[0]; + if (StringUtils.isNotBlank(standNumberOrClause) && standNumberOrClause.length() > 100) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += "分阶段实施详情-法规编号/条款不能超过" + 100 + "个字符, "; + }else{ + errorMsg += "Details of the phased implementation standNumberOrClause Can not be more than " + 100 + " char, "; + } + countError++; + }else { + phasedImplementationDetailsEO.setStandNumberOrClause(standNumberOrClause); + } + } + if(phasedImplDetailsArr.length >= 2){ + String implementationTypeName = phasedImplDetailsArr[1]; + if(StringUtils.isNotEmpty(implementationTypeName)){ + String[] implementationTypeNameArr = implementationTypeName.split(","); + ImplementationTypeEnum[] implementationTypeEnums = ImplementationTypeEnum.values(); + List implementationTypeList = Arrays.stream(implementationTypeEnums).filter(implementationTypeEnum -> { + boolean flag = false; + for (String type : implementationTypeNameArr) { + if(StringUtils.equals(type,implementationTypeEnum.getNameCn()) || StringUtils.equals(type,implementationTypeEnum.getNameEn())){ + flag = true; + } + } + return flag; + }).map(ImplementationTypeEnum::getItemValue).collect(Collectors.toList()); - if (key.equals(fieldNameCn)) { - field = fieldName; - //验证字段是否必填,长度,下拉框和树形的值是否匹配 - if (FieldTypeEnum.TREE.getValue().equals(fieldShowType)) { - //树形 - //判断是否必填 - if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "为必填项,不能为空, "; - }else{ - errorMsg += key + " This parameter is mandatory and cannot be empty, "; - } - countError++; - } - //判断长度 - if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "不能超过" + dbLength + "个字符, "; - }else{ - errorMsg += key + " Can not be more than " + dbLength + " char, "; - } - countError++; - } - //判断数据是否匹配 - if (StringUtils.isNotBlank(value)) { - for (String valueTemp : value.split(",")) { - if (!treeNameList.contains(valueTemp)) { + if(implementationTypeNameArr.length != implementationTypeList.size()){ if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, "; + errorMsg += "分阶段实施详情-实施类型填写有误,填写值为'新车型 或 在产车', "; }else{ - errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, "; + errorMsg += "Details of the phased implementation implementationType The value is set to 'New car model or Car in production', "; } countError++; + }else { + phasedImplementationDetailsEO.setImplementationType(implementationTypeList.stream().collect(Collectors.joining(","))); } } } - String valueId = ""; - //文字转ID - if (StringUtils.isNotBlank(value)) { - for (String valueTemp : value.split(",")) { - if (treeNameList.contains(valueTemp)) { - List collect = new ArrayList<>(); - if(CutEnum.CN.getValue().equals(cut)){ - collect = categoryList.stream().filter(e -> e.getName().equals(valueTemp)).collect(Collectors.toList()); - }else{ - collect = categoryList.stream().filter(e -> e.getEnName().equals(valueTemp)).collect(Collectors.toList()); - } - valueId += collect.get(0).getId()+","; - } + if(phasedImplDetailsArr.length >= 3){ + Date implementationDate = null; + try { + implementationDate = DateUtils.parseDate(phasedImplDetailsArr[2], "yyyy-MM-dd"); + } catch (ParseException e) { + e.printStackTrace(); } - if(StringUtils.isNotBlank(valueId)){ - value = valueId.substring(0, valueId.length() - 1); - } - } - - } else if (FieldTypeEnum.TEXT_STRING.getValue().equals(fieldShowType)) { - //输入框 - //判断是否必填 - if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "为必填项,不能为空, "; - }else{ - errorMsg += key + " This parameter is mandatory and cannot be empty, "; - } - countError++; - } - //判断长度 - if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "不能超过" + dbLength + "个字符, "; - }else{ - errorMsg += key + " Can not be more than" + dbLength + "char, "; - } - countError++; - } - - } else if (FieldTypeEnum.TEXT_NUMBER.getValue().equals(fieldShowType)) { - //正则判断仅能为 负号(-),小数点(.)和数字 - - - } else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldShowType)) { - //下拉单选 - //判断是否必填 - if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "为必填项,不能为空, "; - }else{ - errorMsg += key + " This parameter is mandatory and cannot be empty, "; - } - countError++; - } - //判断长度 - if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "不能超过" + dbLength + "个字符, "; - }else{ - errorMsg += key + " Can not be more than" + dbLength + " char, "; - } - countError++; - } - //判断是否是单选 - if (StringUtils.isNotBlank(value) && value.contains(",")) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "为单选项, "; - }else{ - errorMsg += key + " Is multiple choice, "; - } - - countError++; - } - //判断数据是否匹配 - if (StringUtils.isNotBlank(value)) { - if (!itemNameList.contains(value)) { + if(implementationDate == null){ if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "中的" + value + "与数据字典不匹配, "; + errorMsg += "分阶段实施详情-实施日期格式错误,正确格式为'yyyy-MM-dd', "; }else{ - errorMsg += key + " " + value + " Does not match the data dictionary, "; + errorMsg += "Details of the phased implementation implementationDate format is incorrect. The correct format is 'yyyy-MM-dd', "; + } + countError++; + }else { + phasedImplementationDetailsEO.setImplementationDate(implementationDate); + } + } + if(phasedImplDetailsArr.length >= 4){ + String remarks = phasedImplDetailsArr[3]; + if (StringUtils.isNotBlank(remarks) && remarks.length() > 1000) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += "分阶段实施详情-备注不能超过" + 1000 + "个字符, "; + }else{ + errorMsg += "Details of the phased implementation ramarks Can not be more than " + 1000 + " char, "; + } + countError++; + }else { + phasedImplementationDetailsEO.setRemarks(remarks); + } + } + phasedImplementationDetailsEOList.add(phasedImplementationDetailsEO); + } + + mapResult.put("phasedImplementationDetailsEOList",phasedImplementationDetailsEOList); + } + }else { + for (Map map : fieldList) { + String fieldNameCn = (String) map.get("db_field_txt");//中文名称 + String fieldName = (String) map.get("db_field_name");//字段名 + if(StringUtils.equals(fieldName,"phasedImplDetails")){ + continue; + } + String mustInput = (String) map.get("field_must_input");//是否必填 + String dbLength = map.get("db_length").toString();//字段长度 + String fieldShowType = (String) map.get("field_show_type");//字段类型 + + if (key.equals(fieldNameCn)) { + field = fieldName; + //验证字段是否必填,长度,下拉框和树形的值是否匹配 + if (FieldTypeEnum.TREE.getValue().equals(fieldShowType)) { + //树形 + //判断是否必填 + if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "为必填项,不能为空, "; + }else{ + errorMsg += key + " This parameter is mandatory and cannot be empty, "; } countError++; } - } - //文字转数据字典编码 - if (itemNameList.contains(value)) { - String finalValue = value; - List collect = new ArrayList<>(); - if(CutEnum.CN.getValue().equals(cut)){ - collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(finalValue)).collect(Collectors.toList()); - }else{ - collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(finalValue)).collect(Collectors.toList()); - } - if (collect.size() != 0) { - value = collect.get(0).getItemValue(); - } - } - } else if (FieldTypeEnum.PULL_MORE.getValue().equals(fieldShowType)) { - //判断是否必填 - if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "为必填项,不能为空, "; - }else{ - errorMsg += key + " This parameter is mandatory and cannot be empty, "; - } - countError++; - } - //判断长度 - if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "不能超过" + dbLength + "个字符, "; - }else{ - errorMsg += key + " Can not be more than" + dbLength + " char, "; - } - countError++; - } - //下拉多选 - if (StringUtils.isNotBlank(value)) { - for (String valueTemp : value.split(",")) { - if (!itemNameList.contains(valueTemp)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, "; - }else{ - errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, "; - } - countError++; + //判断长度 + if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "不能超过" + dbLength + "个字符, "; + }else{ + errorMsg += key + " Can not be more than " + dbLength + " char, "; } + countError++; } - } - - String valueId = ""; - //文字转数据字典id - if (StringUtils.isNotBlank(value)) { - for (String valueTemp : value.split(",")) { - if (itemNameList.contains(valueTemp)) { - List collect = new ArrayList<>(); - if(CutEnum.CN.getValue().equals(cut)){ - collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(valueTemp)).collect(Collectors.toList()); - }else{ - collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(valueTemp)).collect(Collectors.toList()); - } - - valueId += collect.get(0).getItemValue() + ","; - } - } - if (StringUtils.isNotBlank(valueId)) { - value = valueId.substring(0, valueId.length() - 1); - } - } - - - } else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldShowType)) { - value = value.replaceAll("/","-"); - //单选日期 - //判断是否必填 - if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "为必填项,不能为空, "; - }else{ - errorMsg += key + " This parameter is mandatory and cannot be empty, "; - } - countError++; - } - //a判断是否是单日期选择 - if (StringUtils.isNotBlank(value) && value.contains(",")) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "为单日期选项, "; - }else{ - errorMsg += key + " Is single date option, "; - } - countError++; - } - //判断格式是否正确 - if (!DateUtils.isValidDate((String) value)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; - }else{ - errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; - } - countError++; - } - - } else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldShowType)) { - //多选日期 - //判断是否必填 - if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "为必填项,不能为空, "; - }else{ - errorMsg += key + " This parameter is mandatory and cannot be empty, "; - } - countError++; - } - //判断格式是否正确 - if (!DateUtils.isValidDate((String) value)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; - }else{ - errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; - } - countError++; - } - - - } else if (FieldTypeEnum.FILE.getValue().equals(fieldShowType)) { - //文件 - //判断是否必填 - if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "为必填项,不能为空, "; - }else{ - errorMsg += key + " This parameter is mandatory and cannot be empty, "; - } - countError++; - } - //判断长度 - if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "不能超过" + dbLength + "个字符, "; - }else{ - errorMsg += key + " Can not be more than " + dbLength + " char, "; - } - countError++; - } - if (StringUtils.isNotBlank(value)) { - StringBuilder sb = new StringBuilder(); - for (String fileName : value.split(",")) { - List nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,cut,errorMsg,null,key,key); - if (nowFileList.size() == 0) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + " 压缩包中没有" + fileName + "文件, "; - }else{ - errorMsg += key + " Not in the zip package" + fileName + "file, "; - } - countError++; - } else { - try { - FileInputStream input = new FileInputStream(nowFileList.get(0)); - MultipartFile multipartFile = - new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input); - //文件存入文件表 - OSSFile ossFile = iOSSFileService.uploadLocalOfCos(multipartFile, "", null,null); - if (ObjectUtils.isNotEmpty(ossFile)) { - sb.append(ossFile.getId() + ","); + //判断数据是否匹配 + if (StringUtils.isNotBlank(value)) { + for (String valueTemp : value.split(",")) { + if (!treeNameList.contains(valueTemp)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, "; + }else{ + errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, "; } - } catch (IOException e) { - e.printStackTrace(); + countError++; } } } - if (StringUtils.isNotBlank(sb)) { - String substring = sb.substring(0, sb.length() - 1); - value = substring; + String valueId = ""; + //文字转ID + if (StringUtils.isNotBlank(value)) { + for (String valueTemp : value.split(",")) { + if (treeNameList.contains(valueTemp)) { + List collect = new ArrayList<>(); + if(CutEnum.CN.getValue().equals(cut)){ + collect = categoryList.stream().filter(e -> e.getName().equals(valueTemp)).collect(Collectors.toList()); + }else{ + collect = categoryList.stream().filter(e -> e.getEnName().equals(valueTemp)).collect(Collectors.toList()); + } + valueId += collect.get(0).getId()+","; + } + } + if(StringUtils.isNotBlank(valueId)){ + value = valueId.substring(0, valueId.length() - 1); + } } - } - } else if (FieldTypeEnum.STANDARD.getValue().equals(fieldShowType)) { - //标准选择 - //判断是否必填 - if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "为必填项,不能为空, "; - }else{ - errorMsg += key + " This parameter is mandatory and cannot be empty, "; + } else if (FieldTypeEnum.TEXT_STRING.getValue().equals(fieldShowType)) { + //输入框 + //判断是否必填 + if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "为必填项,不能为空, "; + }else{ + errorMsg += key + " This parameter is mandatory and cannot be empty, "; + } + countError++; } - countError++; - } - //判断长度 - if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { - if(CutEnum.CN.getValue().equals(cut)){ - errorMsg += key + "不能超过" + dbLength + "个字符, "; - }else{ - errorMsg += key + " Can not be more than " + dbLength + " char, "; + //判断长度 + if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "不能超过" + dbLength + "个字符, "; + }else{ + errorMsg += key + " Can not be more than" + dbLength + "char, "; + } + countError++; } - countError++; - } - //判断库中是否存在,如果存在则存id,如果不存在则存输入的值 + + } else if (FieldTypeEnum.TEXT_NUMBER.getValue().equals(fieldShowType)) { + //正则判断仅能为 负号(-),小数点(.)和数字 + + + } else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldShowType)) { + //下拉单选 + //判断是否必填 + if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "为必填项,不能为空, "; + }else{ + errorMsg += key + " This parameter is mandatory and cannot be empty, "; + } + countError++; + } + //判断长度 + if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "不能超过" + dbLength + "个字符, "; + }else{ + errorMsg += key + " Can not be more than" + dbLength + " char, "; + } + countError++; + } + //判断是否是单选 + if (StringUtils.isNotBlank(value) && value.contains(",")) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "为单选项, "; + }else{ + errorMsg += key + " Is multiple choice, "; + } + + countError++; + } + //判断数据是否匹配 + if (StringUtils.isNotBlank(value)) { + if (!itemNameList.contains(value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "中的" + value + "与数据字典不匹配, "; + }else{ + errorMsg += key + " " + value + " Does not match the data dictionary, "; + } + countError++; + } + } + //文字转数据字典编码 + if (itemNameList.contains(value)) { + String finalValue = value; + List collect = new ArrayList<>(); + if(CutEnum.CN.getValue().equals(cut)){ + collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(finalValue)).collect(Collectors.toList()); + }else{ + collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(finalValue)).collect(Collectors.toList()); + } + if (collect.size() != 0) { + value = collect.get(0).getItemValue(); + } + } + } else if (FieldTypeEnum.PULL_MORE.getValue().equals(fieldShowType)) { + //判断是否必填 + if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "为必填项,不能为空, "; + }else{ + errorMsg += key + " This parameter is mandatory and cannot be empty, "; + } + countError++; + } + //判断长度 + if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "不能超过" + dbLength + "个字符, "; + }else{ + errorMsg += key + " Can not be more than" + dbLength + " char, "; + } + countError++; + } + //下拉多选 + if (StringUtils.isNotBlank(value)) { + for (String valueTemp : value.split(",")) { + if (!itemNameList.contains(valueTemp)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "中的" + valueTemp + "与数据字典不匹配, "; + }else{ + errorMsg += key +" "+ valueTemp + " Does not match the data dictionary, "; + } + countError++; + } + } + } + + String valueId = ""; + //文字转数据字典id + if (StringUtils.isNotBlank(value)) { + for (String valueTemp : value.split(",")) { + if (itemNameList.contains(valueTemp)) { + List collect = new ArrayList<>(); + if(CutEnum.CN.getValue().equals(cut)){ + collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getItemText()) && e.getItemText().equals(valueTemp)).collect(Collectors.toList()); + }else{ + collect = dictItemList.stream().filter(e -> StringUtils.isNotBlank(e.getEnName()) && e.getEnName().equals(valueTemp)).collect(Collectors.toList()); + } + + valueId += collect.get(0).getItemValue() + ","; + } + } + if (StringUtils.isNotBlank(valueId)) { + value = valueId.substring(0, valueId.length() - 1); + } + } + + + } else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldShowType)) { + value = value.replaceAll("/","-"); + //单选日期 + //判断是否必填 + if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "为必填项,不能为空, "; + }else{ + errorMsg += key + " This parameter is mandatory and cannot be empty, "; + } + countError++; + } + //a判断是否是单日期选择 + if (StringUtils.isNotBlank(value) && value.contains(",")) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "为单日期选项, "; + }else{ + errorMsg += key + " Is single date option, "; + } + countError++; + } + //判断格式是否正确 + if (!DateUtils.isValidDate((String) value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; + }else{ + errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; + } + countError++; + } + + } else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldShowType)) { + //多选日期 + //判断是否必填 + if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "为必填项,不能为空, "; + }else{ + errorMsg += key + " This parameter is mandatory and cannot be empty, "; + } + countError++; + } + //判断格式是否正确 + if (!DateUtils.isValidDate((String) value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; + }else{ + errorMsg += key + " Incorrect format correct format is:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日, "; + } + countError++; + } + + + } else if (FieldTypeEnum.FILE.getValue().equals(fieldShowType)) { + //文件 + //判断是否必填 + if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "为必填项,不能为空, "; + }else{ + errorMsg += key + " This parameter is mandatory and cannot be empty, "; + } + countError++; + } + //判断长度 + if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "不能超过" + dbLength + "个字符, "; + }else{ + errorMsg += key + " Can not be more than " + dbLength + " char, "; + } + countError++; + } + if (StringUtils.isNotBlank(value)) { + StringBuilder sb = new StringBuilder(); + for (String fileName : value.split(",")) { + List nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,cut,errorMsg,null,key,key); + if (nowFileList.size() == 0) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + " 压缩包中没有" + fileName + "文件, "; + }else{ + errorMsg += key + " Not in the zip package" + fileName + "file, "; + } + countError++; + } else { + try { + FileInputStream input = new FileInputStream(nowFileList.get(0)); + MultipartFile multipartFile = + new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input); + //文件存入文件表 + OSSFile ossFile = iOSSFileService.uploadLocalOfCos(multipartFile, "", null,null); + if (ObjectUtils.isNotEmpty(ossFile)) { + sb.append(ossFile.getId() + ","); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + if (StringUtils.isNotBlank(sb)) { + String substring = sb.substring(0, sb.length() - 1); + value = substring; + } + } + + } else if (FieldTypeEnum.STANDARD.getValue().equals(fieldShowType)) { + //标准选择 + //判断是否必填 + if (IsMustEnum.YES.getValue().equals(mustInput) && StringUtils.isBlank(value)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "为必填项,不能为空, "; + }else{ + errorMsg += key + " This parameter is mandatory and cannot be empty, "; + } + countError++; + } + //判断长度 + if (StringUtils.isNotBlank(value) && value.length() > Long.parseLong(dbLength)) { + if(CutEnum.CN.getValue().equals(cut)){ + errorMsg += key + "不能超过" + dbLength + "个字符, "; + }else{ + errorMsg += key + " Can not be more than " + dbLength + " char, "; + } + countError++; + } + //判断库中是否存在,如果存在则存id,如果不存在则存输入的值 // List> listBySerialNumber = getListBySerialNumber(value); // String serialNumberStr = ""; // StringBuilder sb = new StringBuilder(); @@ -6143,14 +6389,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl 0) { -// msgList.add(errorMsg); -// } - mapResult.put(field, value); +// if (countError > 0) { +// msgList.add(errorMsg); +// } + mapResult.put(field, value); + } } if (countError > 0) { if(errorMsg.endsWith(", ")){ @@ -6632,6 +6879,85 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl insertBatchPhasedImplementationDetailsInfo(Map map){ + String id = (String) map.get("id"); + + List phasedImplDetailsEOList = new ArrayList<>(); + if(map.containsKey("phasedImplementationDetailsEOList")){ + PhasedImplementationDetailsEO phasedImplDetailsEO = null; + JSONArray phasedImplDetailsEOJsonArr = JSONObject.parseArray(JSONObject.toJSONString(map.get("phasedImplementationDetailsEOList"))); + Integer orderNum = 1; + for (Object phasedImplDetailsEOJson : phasedImplDetailsEOJsonArr) { + phasedImplDetailsEO = JSONObject.parseObject(JSONObject.toJSONString(phasedImplDetailsEOJson),PhasedImplementationDetailsEO.class); + phasedImplDetailsEO.setBussDocumentLibraryId(id); + phasedImplDetailsEO.setOrderNum(orderNum); + phasedImplDetailsEOList.add(phasedImplDetailsEO); + orderNum ++; + } + + boolean insertPhasedBatchFlag = this.phasedImplementationDetailsEOService.insertBatch(phasedImplDetailsEOList); + if(!insertPhasedBatchFlag){ + throw new JeroBootException("添加分阶段实施详情信息失败!"); + } + + // 处理插入ES数据的正文 新车型、在产车实施日期信息。 + // 处理新车型实施日期 + List newCarModelDateList = phasedImplDetailsEOList.stream().filter(phasedDetails -> { + boolean flag = false; + if (StringUtils.contains(phasedDetails.getImplementationType(), ImplementationTypeEnum.NEW_CAR_MODEL.getItemValue())) { + flag = true; + } + return flag; + }).map(PhasedImplementationDetailsEO::getImplementationDate).collect(Collectors.toList()); + + Date newCarModelDate = null; + try { + if (StringUtils.isNotEmpty((String) map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"))) { + newCarModelDate = DateUtils.parseDate((String) map.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); + map.put("xin1_che1_xing2_shi2_shi1_ri4_qi1",newCarModelDateStr); + + // 处理在产车实施日期 + List carInProductionDateList = phasedImplDetailsEOList.stream().filter(phasedDetails -> { + boolean flag = false; + if (StringUtils.contains(phasedDetails.getImplementationType(), ImplementationTypeEnum.CAR_IN_PRODUCTION.getItemValue())) { + flag = true; + } + return flag; + }).map(PhasedImplementationDetailsEO::getImplementationDate).collect(Collectors.toList()); + + Date carInProductionDateDate = null; + try { + if (StringUtils.isNotEmpty((String) map.get("implement_time"))) { + carInProductionDateDate = DateUtils.parseDate((String) map.get("implement_time"), "yyyy-MM-dd"); + } + } catch (ParseException e) { + e.printStackTrace(); + } + if(carInProductionDateDate != null){ + carInProductionDateList.add(carInProductionDateDate); + } + + String carInProductionDateStr = DateUtils.formatDateList(carInProductionDateList); + map.put("implement_time",carInProductionDateStr); + } + + return phasedImplDetailsEOList; + } @Override public BussDocumentLibraryEO getBySerialNumber(String serialNumber) { BussDocumentLibraryEO bySerialNumber = bussDocumentLibraryEOMapper.getBySerialNumber(serialNumber); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/PhasedImplementationDetailsEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/PhasedImplementationDetailsEOServiceImpl.java new file mode 100644 index 000000000..f3da21a6a --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/PhasedImplementationDetailsEOServiceImpl.java @@ -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 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 ids) { + removeByIds(ids); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @Override + public PhasedImplementationDetailsEO queryById(String id) { + return getById(id); + } + + /** + * 列表查询 + * + * @return + */ + @Override + public List queryList() { + return list(); + } + + @Override + public boolean insertBatch(List phasedImplDetailsEOList) { + boolean flag = true; + if(CollectionUtils.isNotEmpty(phasedImplDetailsEOList)){ + try { + String bussDocumentLibraryId = phasedImplDetailsEOList.get(0).getBussDocumentLibraryId(); + QueryWrapper 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 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); + } + } + } + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryInfoEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryInfoEOServiceImpl.java index 4ce6816a3..7f5215223 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryInfoEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryInfoEOServiceImpl.java @@ -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 getPageInfo(DummyInventoryInfoEO dummyInventoryInfoEO,HttpServletRequest req) { @@ -401,6 +406,52 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl 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 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 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 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 dummyInventoryInfoEOList = this.list(queryWrapper); log.info("一阶段消耗时间:" + (System.currentTimeMillis() - startTime)); //数据字典 @@ -412,6 +463,9 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl datas, String cut) { + if(CollectionUtils.isNotEmpty(datas)){ + List bussDocumentLibraryIdList = datas.stream().map(DummyInventoryInfoEO::getBussDocumentLibraryId).distinct().collect(Collectors.toList()); + QueryWrapper phasedDetailsQueryWrap = new QueryWrapper<>(); + phasedDetailsQueryWrap.lambda().in(PhasedImplementationDetailsEO::getBussDocumentLibraryId,bussDocumentLibraryIdList); + List phasedDetailsList = this.phasedImplementationDetailsEOService.list(phasedDetailsQueryWrap); + + // 新车型分阶段实施数据信息 + List 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 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 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 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 hearSort(String orderBy, String orderByField, List dummyInventoryInfoEOList) { if(ObjectUtils.isNotEmpty(orderByField)){ Collator comparator = Collator.getInstance(Locale.CHINESE); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java index 527eb8527..de4f64d82 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java @@ -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 parameter) { String cut = (String) parameter.get("cut");//中英文切换标识 @@ -183,8 +192,85 @@ public class LawsWarnService { } } } + + this.disposeData(records,cut); + return infoPage; } + + private void disposeData(List datas, String cut) { + if(CollectionUtils.isNotEmpty(datas)){ + List bussDocumentLibraryIdList = datas.stream().map(data -> (String) data.get("id")).distinct().collect(Collectors.toList()); + QueryWrapper phasedDetailsQueryWrap = new QueryWrapper<>(); + phasedDetailsQueryWrap.lambda().in(PhasedImplementationDetailsEO::getBussDocumentLibraryId,bussDocumentLibraryIdList); + List phasedDetailsList = this.phasedImplementationDetailsEOService.list(phasedDetailsQueryWrap); + + // 新车型分阶段实施数据信息 + List 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 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 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 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(); diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index d3185f7af..d58817f63 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -123,8 +123,12 @@ module.exports = { MergeAll: 'Merge All', TreeOperation: 'Tree Operation', essentialInformation: 'General Information', + DetailsPhasedImplementation: 'Details of the phased implementation', + Statutenumberclause: 'Statute number/clause', OrganizationName: 'Organization Name', EnterOrganizationDepartment: 'Please enter organization / department name', + Typeofimplementation: 'Type of implementation', + ImplementationDate: 'Implementation date', SuperiorDepartment: 'Superior Department', enterOrganizationCode: 'Please enter organization code', nothing: 'Nothing', diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 8eb8405be..e9268f5ba 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -125,6 +125,10 @@ module.exports = { MergeAll: '合并所有', TreeOperation: '树操作', essentialInformation: '基本信息', + DetailsPhasedImplementation: '分阶段实施详情', + Statutenumberclause: '法规编号/条款', + Typeofimplementation: '实施类型', + ImplementationDate: '实施时间', OrganizationName: '机构名称', EnterOrganizationDepartment: '请输入机构/部门名称', SuperiorDepartment: '上级部门', diff --git a/jero-web/src/components/dict/JDictSelectTag.vue b/jero-web/src/components/dict/JDictSelectTag.vue index 6362c6bc7..b73e30232 100644 --- a/jero-web/src/components/dict/JDictSelectTag.vue +++ b/jero-web/src/components/dict/JDictSelectTag.vue @@ -109,7 +109,7 @@ } }) if (this.triggerChange) { - this.$emit('change', val) + this.$emit('change', val,content) } else { this.$emit('input', val) this.$emit('changeQuery', content, this.db_field_name) diff --git a/jero-web/src/components/libraryAddForm/index.vue b/jero-web/src/components/libraryAddForm/index.vue index 86cd81291..2f3f5c3d5 100644 --- a/jero-web/src/components/libraryAddForm/index.vue +++ b/jero-web/src/components/libraryAddForm/index.vue @@ -225,11 +225,184 @@ + + +

+
+ {{$t('DetailsPhasedImplementation')}} +
+ + {{ $t('newlyAdded') }} + + + + + {{$t('edit')}} + + + {{$t("deleteLib")}} + + + +
+ + + + +
+
+ {{$t('Statutenumberclause')}} +
+ + + +
+
+ +
+
+ {{$t('Typeofimplementation')}} +
+ + + +
+
+ +
+
+ {{$t('ImplementationDate')}} +
+ + + + +
+
+ +
+
+ {{$t('remarks')}} +
+ + + +
+
+
+
+ +
+ + + + +
+
+ {{$t('Statutenumberclause')}} +
+ + + +
+
+ +
+
+ {{$t('Typeofimplementation')}} +
+ + + +
+
+ +
+
+ {{$t('ImplementationDate')}} +
+ + + + +
+
+ +
+
+ {{$t('remarks')}} +
+ + + +
+
+
+
+ +
@@ -266,9 +439,32 @@ }, data() { return { + tablevisibleGrad: false, + visibleGrad: false, + loading: false, formInline: {}, + tabledataGrad: {}, + dataGradto: [], isFormInline: false, rules: {}, + tablerules: { + standNumberOrClause: [ + { + // required: true, + max: 200, + message: this.$t('Statutenumberclause') + this.$t('cannotExceed') + 200 + this.$t('Characters'), + trigger: 'blur' + } + ], + remarks: [ + { + // required: true, + max: 1000, + message: this.$t('remarks') + this.$t('cannotExceed') + 1000 + this.$t('Characters'), + trigger: 'blur' + } + ] + }, labelCol: { xs: { span: 24 }, sm: { span: 6 } @@ -296,13 +492,88 @@ text: this.$t('relatedInformation'), content: [] } - ] + ], + columnsGrading: [ + { + title: this.$t('Statutenumberclause'), + dataIndex: 'standNumberOrClause', + align: 'left', + ellipsis: true, + width: 160 + }, + { + title: this.$t('Typeofimplementation'), + dataIndex: 'implementationTypeText', + align: 'left', + ellipsis: true, + width: 150 + }, + { + title: this.$t('ImplementationDate'), + dataIndex: 'implementationDate', + align: 'left', + ellipsis: true, + width: 150 + }, + { + title: this.$t('remarks'), + dataIndex: 'remarks', + align: 'left', + ellipsis: true, + width: 204 + }, + { + title: this.$t('operation'), + align: 'left', + fixed: 'right', + width: 180, + scopedSlots: { customRender: 'Gradoperation' } + } + ], + dataGrad: [], } }, mounted() { }, methods: { + tablehandleSubmit(){ + this.$refs.tableruleFormedit.validate((valid) => { + if(valid){ + this.tablevisibleGrad = false + console.log(this.tabledataGrad) + this.dataGradto[this.tabledataIndex] = this.tabledataGrad + this.dataGradto= [... this.dataGradto] + } + }) + }, + deleteLib(val,index) { + let _this = this + this.$confirm({ + content: _this.$t('ConfirmDelete'), + onOk() { + _this.dataGradto.splice(index,1) + _this.dataGradto = [..._this.dataGradto] + } + }) + }, + newlyAdded(){ + this.tabledataGrad = {} + this.visibleGrad = true + }, + handeredit(result,index){ + this.tablevisibleGrad = true + this.tabledataIndex = index + this.tabledataGrad = JSON.parse(JSON.stringify(result)) + }, + handleSubmit(){ + this.$refs.tableruleForm.validate(valid => { + if (valid){ + this.dataGradto.push(this.tabledataGrad) + this.visibleGrad = false + } + }) + }, disabledDate(current) { return current && current < moment().subtract(1, 'day') }, @@ -314,6 +585,7 @@ this.formInline = { ...this.formInline } }, sumber() { + // this.postTable() this.$refs.ruleForm.validate(valid => { if (valid) { this.confirmLoading = true @@ -329,6 +601,7 @@ formInline[res] = formInline[res].join(',') } }) + formInline.phasedImplementationDetailsEOList = this.dataGradto postAction(url, formInline).then((res) => { if (res.success) { this.confirmLoading = false @@ -361,6 +634,13 @@ dateChange(item) { this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : '' }, + dateChangeOne(item) { + this.tabledataGrad.implementationDate = this.tabledataGrad.implementationDate ? moment(this.tabledataGrad.implementationDate).format('YYYY-MM-DD') : '' + console.log(this.tabledataGrad.implementationDate) + }, + implementationTypeChange(val){ + this.tabledataGrad.implementationTypeText = val + }, onChange(item) { let dateOne = moment(this.formInline[item][0]).format('YYYY-MM-DD') let dateTwo = moment(this.formInline[item][1]).format('YYYY-MM-DD') @@ -479,18 +759,33 @@ } }) }, + postTable(){ + let params = this.dataGradto + postAction(this.url.getDocumentInfo, params).then((res) => { + if (res.success) { + this.$message.success(this.$t('OperationSuccessful')) + } + }) + }, edit(item) { this.type = 'edit' + this.loading = true this.getForm(() => { getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => { if (res.success) { this.formInline = res.result[0] + this.dataGrad = res.result[0].phasedImplementationDetailsEOList + this.dataGradto = this.dataGrad + this.loading = false + } else { + this.loading = false } }) }) }, add() { this.formInline = {} + this.dataGrad = [] this.type = 'add' this.getForm() }, @@ -642,4 +937,13 @@ line-height: 6px; color: #fff; } + + .table { + margin-top: 5px; + } + + .page { + text-align: right; + margin-top: 20px; + } \ No newline at end of file diff --git a/jero-web/src/views/documentManage/library/docDetail/index.vue b/jero-web/src/views/documentManage/library/docDetail/index.vue index b923275cb..fa7898358 100644 --- a/jero-web/src/views/documentManage/library/docDetail/index.vue +++ b/jero-web/src/views/documentManage/library/docDetail/index.vue @@ -162,9 +162,34 @@ +
+
+
+ {{$t('DetailsPhasedImplementation')}} +
+ + +
+ +
+
+
- { + if (res.success) { + this.dataGrad = res.result.records + this.tabletotal=res.result.total + this.loading = false + } else { + this.dataGrad = [] + this.loading = false + } + }) + }, clickButtonToUpload(item) { this.loading = true this.visibleFile = true @@ -518,11 +595,20 @@ this.pageNo = page this.bussLogList() }, + onTableChange(page, pageSize) { + this.tablepageNo = page + this.getPage() + }, SizeChange(page, pageSize) { this.pageNo = 1 this.pageSize = pageSize this.bussLogList() }, + tableSizeChange(page, pageSize) { + this.tablepageNo = 1 + this.tablepageSize = pageSize + this.getPage() + }, DocumentSplitting() { let serial_number = '' if (this.detailList.length > 0) { @@ -835,6 +921,10 @@ //} /deep/ .ant-table-placeholder{ - margin-top: 8px !important; + margin-top: 0px !important; + } + + .text { + margin-right: 10px } \ No newline at end of file diff --git a/jero-web/src/views/documentManage/library/index.vue b/jero-web/src/views/documentManage/library/index.vue index d261d2fa8..da37839a2 100644 --- a/jero-web/src/views/documentManage/library/index.vue +++ b/jero-web/src/views/documentManage/library/index.vue @@ -127,7 +127,8 @@ deleteBatch: 'document/bussDocumentLibraryEO/deleteBatch', //删除 pullMessage: 'document/bussDocumentLibraryEO/pullMessage',//推送 importZipUrl: '/document/bussDocumentLibraryEO/importZip',//导入 - verifyBind: '/document/bussDocumentLibraryEO/verifyBind' //验证当前的数据是否可以删除 + verifyBind: '/document/bussDocumentLibraryEO/verifyBind', //验证当前的数据是否可以删除 + getPage : '/document/phasedImplementationDetailsEO/page' }, idList: [] } diff --git a/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue b/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue index 507e800ba..afcddbf77 100644 --- a/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue +++ b/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue @@ -72,6 +72,26 @@ v-model="queryParam.subtitle"> + {{$t('query')}} {{$t('reset')}} + + {{ !toggleSearchStatus ? $t('open') : $t('away') }} + + @@ -328,6 +352,7 @@ title: '维护虚拟清单', queryParam: {}, components: {}, + toggleSearchStatus: false, visibleFile: false, transferList: false, orderBy: '1', @@ -439,14 +464,16 @@ title: this.$t('ImplementationDate'), align: 'left', width: 200, - dataIndex: 'xin1Che1Xing2Shi2Shi1Ri4Qi1', + dataIndex: 'xin1Che1Xing2Shi2Shi1Ri4Qi1String', + scopedSlots: { customRender: 'titleName' }, ellipsis: true }, { title: this.$t('vehicleInProductionDate'), align: 'left', width: 220, - dataIndex: 'implementTime', + dataIndex: 'implementTimeString', + scopedSlots: { customRender: 'titleName' }, ellipsis: true }, { @@ -981,7 +1008,7 @@ name: this.$t('ImplementationDate'), headFieldCn:'标准实施日期', headFieldEn:'New Type Execution Date', - field: 'xin1Che1Xing2Shi2Shi1Ri4Qi1', + field: 'xin1Che1Xing2Shi2Shi1Ri4Qi1String', key: 9, moduleFlag:this.$route.query.title == '虚拟清单详情' ? '虚拟清单详情' : '维护清单', }, @@ -990,7 +1017,7 @@ name: this.$t('vehicleInProductionDate'), headFieldCn:'在产车实施日期', headFieldEn:'New Vehicle Execution Date', - field: 'implementTime', + field: 'implementTimeString', key: 10, moduleFlag:this.$route.query.title == '虚拟清单详情' ? '虚拟清单详情' : '维护清单', }, @@ -1271,16 +1298,16 @@ text: this.$t('implementationCategory'), dictCode: 'implement_type'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框 }, - { - type: 'date', - value: 'xin1Che1Xing2Shi2Shi1Ri4Qi1', - text: this.$t('ImplementationDate') - }, - { - type: 'date', - value: 'implementTime', - text: this.$t('vehicleInProductionDate') - }, + // { + // type: 'date', + // value: 'xin1Che1Xing2Shi2Shi1Ri4Qi1', + // text: this.$t('ImplementationDate') + // }, + // { + // type: 'date', + // value: 'implementTime', + // text: this.$t('vehicleInProductionDate') + // }, { type: 'string', value: 'wvtaId', @@ -1363,9 +1390,9 @@ this.getList() }, searchReset() { + this.queryParam = {} this.$refs.globalAdvancedQueryRef.resetLine() this.$refs.globalAdvancedQueryRef.emitCallback() - this.queryParam = {} this.getList() }, //模板下载 @@ -1451,6 +1478,9 @@ } this.getList() }, + handleToggleSearch() { + this.toggleSearchStatus = !this.toggleSearchStatus + }, getHeader(){ getAction('head/headCustomEO/list', { moduleFlag: this.$route.query.title == '虚拟清单详情' ? '虚拟清单详情' : '维护清单' @@ -1482,6 +1512,14 @@ item.scopedSlots = { customRender: 'titleName' } + }else if(item.title == '在产车实施日期'){ + item.scopedSlots = { + customRender: 'titleName' + } + }else if(item.title == '标准实施日期'){ + item.scopedSlots = { + customRender: 'titleName' + } } else if(item.title == '清单确认状态' || item.title == '任务确认状态' || item.title == '认证级别' || item.title == 'WVTA ID' || item.title == '责任领域' || item.title == '法规工程师' || item.title == '认证工程师' || item.title == '工程接口人'){ @@ -1516,6 +1554,12 @@ }) }, getList() { + if(this.queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String && this.queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String instanceof Array){ + this.queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String = this.queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String.join(',') + } + if(this.queryParam.implementTimeString && this.queryParam.implementTimeString instanceof Array){ + this.queryParam.implementTimeString = this.queryParam.implementTimeString.join(',') + } let query = { ...this.queryParam, ...this.queryParamQuery, @@ -1564,6 +1608,22 @@ onChange(){ this.selectedValue = this.checkedList }, + onChangedatet(values){ + let StartTime = values[0].format('YYYY-MM-DD') + let EndTime = values[1].format('YYYY-MM-DD') + let array = [] + array.push(StartTime,EndTime) + console.log(array) + this.queryParam.xin1Che1Xing2Shi2Shi1Ri4Qi1String = array + }, + onChangedate(values){ + let StartTime = values[0].format('YYYY-MM-DD') + let EndTime = values[1].format('YYYY-MM-DD') + let array = [] + array.push(StartTime,EndTime) + console.log(array) + this.queryParam.implementTimeString = array + }, getcustomize(){ this.customizevisible = true },