| | |
| | | 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; |
| | |
| | | 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"); |
| | |
| | | @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("删除成功!"); |
| | |
| | | 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("编辑成功"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | public class EquipmentCategoryController extends JeecgController<EquipmentCategory, IEquipmentCategoryService> { |
| | | @Autowired |
| | | private IEquipmentCategoryService equipmentCategoryService; |
| | | @Autowired |
| | | private ISysDictService sysDictService; |
| | | @Autowired |
| | | private ISysDictItemService sysDictItemService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | //@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); |
| | |
| | | @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) |
| | |
| | | @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; |
| | | } |
| | |
| | | @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); |
| | |
| | | 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 * 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},'%') |
| | |
| | | <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 |
| | |
| | | equipment.getSpecificEquipment(), |
| | | equipment.getWarrantyStart(), |
| | | equipment.getWarrantyEnd(), |
| | | equipment.getLineId(), |
| | | sql |
| | | )); |
| | | } |
| | |
| | | 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' |