“linengliang”
2023-11-20 38c6f00b5efbbb9ce21669a887e03d6cb8ce3df9
生产线
已修改7个文件
123 ■■■■ 文件已修改
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EquipmentCategoryController.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/Equipment.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamEquipmentMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-system/lxzn-system-start/src/main/resources/db/2023_11_16(lnl)/sys_dict_update.sql 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java
@@ -6,6 +6,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
@@ -151,7 +152,7 @@
        if(StringUtils.isNotBlank(equipment.getEquipmentCategoryId())){
            queryWrapper.eq("equipment_category_id",equipment.getEquipmentCategoryId());
        }
        queryWrapper.isNull("line_id");
        queryWrapper.eq("status","1");
        queryWrapper.eq("del_flag",0);
        queryWrapper.orderByDesc("create_time");
@@ -332,6 +333,7 @@
    @DeleteMapping(value = "/delete")
    public Result<String> delete(@RequestParam(name="id",required=true) String id) {
        Equipment equipment = equipmentService.getById(id);
        equipmentService.update(new UpdateWrapper<Equipment>().eq("line_id",id).set("line_id",null).set("is_meta",null));
        equipment.setDelFlag(1);
        equipmentService.updateById(equipment);
        return Result.OK("删除成功!");
@@ -852,6 +854,30 @@
         IPage<DailyInspectionStandardDetail> pageList = equipmentService.getStandardList(page,standardDetail.getEquipmentId());
         return Result.OK(pageList);
     }
     @PostMapping("addLine")
     @Transactional(rollbackFor = {Exception.class})
     public Result<?> addLine(@RequestBody Equipment equipment){
          equipmentService.save(equipment);
          List<Equipment> equipmentList = equipment.getEquipmentOfLineTable();
          for(Equipment equipment1:equipmentList){
              equipment1.setId(equipment1.getShowId());
              equipment1.setLineId(equipment.getId());
         }
          equipmentService.updateBatchById(equipmentList);
          return Result.OK("添加成功");
     }
     @PutMapping("editLine")
     @Transactional(rollbackFor = {Exception.class})
     public Result<?> editLine(@RequestBody Equipment equipment){
         equipmentService.updateById(equipment);
         equipmentService.update(new UpdateWrapper<Equipment>().eq("line_id",equipment.getId()).set("line_id",null).set("is_meta",null));
         List<Equipment> equipmentList = equipment.getEquipmentOfLineTable();
         for(Equipment equipment1:equipmentList){
             equipment1.setLineId(equipment.getId());
         }
         equipmentService.updateBatchById(equipmentList);
         return Result.OK("编辑成功");
     }
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EquipmentCategoryController.java
@@ -10,6 +10,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.common.api.vo.CommonGenericTree;
@@ -25,6 +26,10 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.system.entity.SysDict;
import org.jeecg.modules.system.entity.SysDictItem;
import org.jeecg.modules.system.service.ISysDictItemService;
import org.jeecg.modules.system.service.ISysDictService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -54,6 +59,10 @@
public class EquipmentCategoryController extends JeecgController<EquipmentCategory, IEquipmentCategoryService> {
    @Autowired
    private IEquipmentCategoryService equipmentCategoryService;
    @Autowired
    private ISysDictService sysDictService;
    @Autowired
    private ISysDictItemService sysDictItemService;
    /**
     * 分页列表查询
@@ -121,32 +130,18 @@
    //@RequiresPermissions("org.jeecg.modules.demo:mom_eam_equipment_category:add")
    @PostMapping(value = "/add")
    public Result<String> add(@RequestBody EquipmentCategory equipmentCategory) {
        if(!StringUtils.isNotBlank( equipmentCategory.getParentId())){
            equipmentCategory.setParentId("-1");
            if("生产设备".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("producter");
            } else if("试验器".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("tester");
            }else if("数控回转库".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("filesCarousel");
            }else if("非标吊索具".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("nonStandardLiftingLocks");
            }else if("运输车".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("truck");
            }else if("起重设备".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("crane");
            }else if("平衡机".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("balanceMachine");
            }else if("焊机".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("weldingMachine");
            }else if("压力容器".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("pressureVessel");
            }else if("环保设备".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("envProEquipment");
            }else if("车台".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("ride");
            }else if("检测、计量设备".equals(equipmentCategory.getName())){
                equipmentCategory.setEquipmentCategoryUda1("checkoutEquipment");
        if(equipmentCategory.getParentId().equals("-1")){
            SysDict sysDict = sysDictService.getOne(new QueryWrapper<SysDict>().eq("dict_code","equipment_category"),false);
            if(ObjectUtils.isNotNull(sysDict)){
                List<SysDictItem> sysDictItems = sysDictItemService.selectItemsByMainId(sysDict.getId());
                for(SysDictItem sysDictItem:sysDictItems){
                    if(equipmentCategory.getName().equals(sysDictItem.getItemText())){
                        equipmentCategory.setEquipmentCategoryUda1(sysDictItem.getItemValue());
                    }
                }
            }
            else {
                return Result.error("添加失败,需要去维护数据字典设备大类!");
            }
        }
        equipmentCategoryService.save(equipmentCategory);
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/Equipment.java
@@ -359,6 +359,13 @@
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date     nextThirdMaintenanceTime;
    @ApiModelProperty(value = "生产线ID")
    private String lineId;
    @ApiModelProperty(value = "是否主设备")
    @Dict(dicCode = "is_product")
    private String isMeta;
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @TableField(exist = false)
@@ -376,4 +383,10 @@
    @TableField(exist = false)
    private String maintenanceOrderId;
    private String checkPeriod;
    @TableField(exist = false)
    private List<Equipment> equipmentOfLineTable;
    @TableField(exist = false)
    private String  showId;
    @TableField(exist = false)
    private Integer sumOfEquipment;
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamEquipmentMapper.java
@@ -78,6 +78,7 @@
                                       @Param("specificEquipment")String specificEquipment,
                                       @Param("warrantyStart")Date warrantyStart,
                                       @Param("warrantyEnd")Date warrantyEnd,
                                        @Param("lineId")String lineId,
                                       @Param("sql")String sql
    );
    List<DailyInspectionStandardDetail>  getStandardList(Page<DailyInspectionStandardDetail> page,@Param("mainId") String mainId);
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml
@@ -248,9 +248,14 @@
        t1.check_period checkPeriod,
        t1.next_technology_status_qualification_time nextTechnologyStatusQualificationTime,
        t1.technology_status_qualification_time technologyStatusQualificationTime,
        t1.technology_status_verification_type technologyStatusVerificationType
        t1.technology_status_verification_type technologyStatusVerificationType,
        t1.line_id lineId,
        t1.is_meta isMeta,
        t1.id showId,
        t3.sumOfEquipment
    from mom_eam_equipment t1
    left join (select * from mom_eam_equipment_category where del_flag = 0) t2 on t1.equipment_category_id = t2.id
    left join(select  count(id) sumOfEquipment,line_id  from mom_eam_equipment where del_flag=0 group by line_id) t3 on t3.line_id = t1.id
    where t1.del_flag  = 0
        <if test="num != null and num != ''">
            and t1.num like concat('%',#{num},'%')
@@ -294,7 +299,10 @@
        <if test="sql != null and sql != ''">
            and t2.equipment_category_uda1 = #{sql}
        </if>
        order by t1.create_time desc
        <if test="lineId != null and lineId != ''">
            and t1.line_id = #{lineId}
        </if>
        order by (CASE WHEN t1.is_meta='yes' then GETDATE() else t1.create_time end) desc
    </select>
    <select id="getStandardList" resultType="org.jeecg.modules.eam.entity.DailyInspectionStandardDetail">
        select t9.* from ( select
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java
@@ -115,6 +115,7 @@
                equipment.getSpecificEquipment(),
                equipment.getWarrantyStart(),
                equipment.getWarrantyEnd(),
                equipment.getLineId(),
                sql
        ));
    }
lxzn-module-system/lxzn-system-start/src/main/resources/db/2023_11_16(lnl)/sys_dict_update.sql
@@ -163,3 +163,24 @@
ALTER TABLE [dbo].[mom_eam_repair_order] ALTER COLUMN [part_time] decimal(18,3) NULL
ALTER TABLE [dbo].[mom_eam_equipment_report_repair] ALTER COLUMN [fault_hour] decimal(18,3) NULL
INSERT INTO [dbo].[sys_permission] ([id], [parent_id], [name], [url], [component], [component_name], [redirect], [menu_type], [perms], [perms_type], [sort_no], [always_show], [icon], [is_route], [is_leaf], [keep_alive], [hidden], [hide_tab], [description], [create_by], [create_time], [update_by], [update_time], [del_flag], [rule_flag], [status], [internal_or_external]) VALUES (N'1726425666842873858', N'1638420030147723265', N'生产线', N'/eam/equipmentOfLine', N'eam/equipmentOfLine', NULL, NULL, 1, NULL, N'1', 11, 0, NULL, 1, 1, 0, 0, 0, NULL, N'admin', '2023-11-20 10:22:09.0670000', NULL, NULL, 0, NULL, N'1', 0);
ALTER TABLE [dbo].[mom_eam_equipment] ADD [line_id] nvarchar(32) COLLATE Chinese_PRC_CI_AS  NULL
    GO
ALTER TABLE [dbo].[mom_eam_equipment] ADD [is_meta] nvarchar(32) NULL
    GO
    EXEC sp_addextendedproperty
    'MS_Description', N'生产线ID',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_equipment',
    'COLUMN', N'line_id'
    GO
    EXEC sp_addextendedproperty
    'MS_Description', N'是否主设备',
    'SCHEMA', N'dbo',
    'TABLE', N'mom_eam_equipment',
    'COLUMN', N'is_meta'