From 69d3e86c11635a1205e74a55988b75278d4b2ac1 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期三, 11 十月 2023 14:32:31 +0800 Subject: [PATCH] 大屏车间管理 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml | 16 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopEquipmentServiceImpl.java | 17 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopInfoMapper.java | 15 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcWorkshopInfoController.java | 248 ++++++++++++++++++++++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopEquipmentMapper.xml | 5 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/MdcEquipmentDto.java | 4 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcWorkshopEquipmentVo.java | 25 ++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WorkshopEquipmentVo.java | 16 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopEquipment.java | 63 ++++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopEquipmentService.java | 13 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopInfoService.java | 15 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java | 19 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopEquipmentMapper.java | 13 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopInfo.java | 43 ++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java | 22 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentMapper.java | 6 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml | 5 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentService.java | 7 18 files changed, 545 insertions(+), 7 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcWorkshopInfoController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcWorkshopInfoController.java new file mode 100644 index 0000000..b85d532 --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcWorkshopInfoController.java @@ -0,0 +1,248 @@ +package org.jeecg.modules.mdc.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.mdc.entity.MdcEquipment; +import org.jeecg.modules.mdc.entity.MdcWorkshopEquipment; +import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; +import org.jeecg.modules.mdc.service.IMdcEquipmentService; +import org.jeecg.modules.mdc.service.IMdcWorkshopEquipmentService; +import org.jeecg.modules.mdc.service.IMdcWorkshopInfoService; +import org.jeecg.modules.mdc.vo.MdcWorkshopEquipmentVo; +import org.jeecg.modules.mdc.vo.WorkshopEquipmentVo; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: 澶у睆杞﹂棿淇℃伅 + * @Author: Lius + * @Date: 2023-10-11 + * @Version: V1.0 + */ +@Slf4j +@Api(tags = "澶у睆杞﹂棿淇℃伅") +@RestController +@RequestMapping("/mdc/mdcWorkshopInfo") +public class MdcWorkshopInfoController extends JeecgController<MdcWorkshopInfo, IMdcWorkshopInfoService> { + @Resource + private IMdcWorkshopInfoService mdcWorkshopInfoService; + + @Resource + private IMdcEquipmentService mdcEquipmentService; + + @Resource + private IMdcWorkshopEquipmentService mdcWorkshopEquipmentService; + + /** + * 鍒嗛〉鍒楄〃鏌ヨ + * + * @param mdcWorkshopInfo + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "澶у睆杞﹂棿淇℃伅-鍒嗛〉鍒楄〃鏌ヨ") + @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-鍒嗛〉鍒楄〃鏌ヨ", notes = "澶у睆杞﹂棿淇℃伅-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/list") + public Result<?> queryPageList(MdcWorkshopInfo mdcWorkshopInfo, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper<MdcWorkshopInfo> queryWrapper = QueryGenerator.initQueryWrapper(mdcWorkshopInfo, req.getParameterMap()); + Page<MdcWorkshopInfo> page = new Page<MdcWorkshopInfo>(pageNo, pageSize); + IPage<MdcWorkshopInfo> pageList = mdcWorkshopInfoService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 娣诲姞 + * + * @param mdcWorkshopInfo + * @return + */ + @AutoLog(value = "澶у睆杞﹂棿淇℃伅-娣诲姞") + @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-娣诲姞", notes = "澶у睆杞﹂棿淇℃伅-娣诲姞") + @PostMapping(value = "/add") + public Result<?> add(@RequestBody MdcWorkshopInfo mdcWorkshopInfo) { + mdcWorkshopInfoService.save(mdcWorkshopInfo); + return Result.OK("娣诲姞鎴愬姛锛�"); + } + + /** + * 缂栬緫 + * + * @param mdcWorkshopInfo + * @return + */ + @AutoLog(value = "澶у睆杞﹂棿淇℃伅-缂栬緫") + @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-缂栬緫", notes = "澶у睆杞﹂棿淇℃伅-缂栬緫") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result<?> edit(@RequestBody MdcWorkshopInfo mdcWorkshopInfo) { + mdcWorkshopInfoService.updateById(mdcWorkshopInfo); + 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) { + mdcWorkshopInfoService.removeById(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.mdcWorkshopInfoService.removeByIds(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) { + MdcWorkshopInfo mdcWorkshopInfo = mdcWorkshopInfoService.getById(id); + return Result.OK(mdcWorkshopInfo); + } + + /** + * 瀵煎嚭excel + * + * @param request + * @param mdcWorkshopInfo + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, MdcWorkshopInfo mdcWorkshopInfo) { + return super.exportXls(request, mdcWorkshopInfo, MdcWorkshopInfo.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, MdcWorkshopInfo.class); + } + + /** + * 鑾峰彇璁惧鍒楄〃 + * @return + */ + @AutoLog(value = "澶у睆杞﹂棿淇℃伅-鏍规嵁澶у睆杞﹂棿id鏌ヨ璁惧鍒楄〃") + @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-鏍规嵁澶у睆杞﹂棿id鏌ヨ璁惧鍒楄〃", notes = "澶у睆杞﹂棿淇℃伅-鏍规嵁澶у睆杞﹂棿id鏌ヨ璁惧鍒楄〃") + @GetMapping(value = "/workshopEquipmentList") + public Result<IPage<MdcEquipment>> workshopEquipmentList(WorkshopEquipmentVo workshopEquipmentVo, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + Page<MdcEquipment> page = new Page<>(pageNo, pageSize); + IPage<MdcEquipment> pageList = mdcEquipmentService.getEquipmentByWorkshopId(page, workshopEquipmentVo); + return Result.OK(pageList); + } + + /** + * 鍒犻櫎鎸囧畾澶у睆杞﹂棿鍜岃澶囧叧绯� + */ + @AutoLog(value = "澶у睆杞﹂棿淇℃伅-鍒犻櫎鎸囧畾澶у睆杞﹂棿鍜岃澶囧叧绯�") + @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-鍒犻櫎鎸囧畾澶у睆杞﹂棿鍜岃澶囧叧绯�", notes = "澶у睆杞﹂棿淇℃伅-鍒犻櫎鎸囧畾澶у睆杞﹂棿鍜岃澶囧叧绯�") + @DeleteMapping(value = "/deleteWorkshopEquipment") + public Result deleteWorkshopEquipment(@RequestParam(name = "workshopId") String workshopId, + @RequestParam(name = "equipmentId", required = true) String equipmentId) { + try { + LambdaQueryWrapper<MdcWorkshopEquipment> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(MdcWorkshopEquipment::getWorkshopId, workshopId).eq(MdcWorkshopEquipment::getEquipmentId, equipmentId); + mdcWorkshopEquipmentService.remove(queryWrapper); + return Result.OK("鍒犻櫎鎴愬姛锛�"); + } catch (Exception e) { + return Result.error("鍒犻櫎澶辫触锛�"); + } + } + + /** + * 鎵归噺鍒犻櫎鎸囧畾澶у睆杞﹂棿鍜岃澶囧叧绯� + */ + @AutoLog(value = "澶у睆杞﹂棿淇℃伅-鎵归噺鍒犻櫎鎸囧畾澶у睆杞﹂棿鍜岃澶囧叧绯�") + @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-鎵归噺鍒犻櫎鎸囧畾澶у睆杞﹂棿鍜岃澶囧叧绯�", notes = "澶у睆杞﹂棿淇℃伅-鎵归噺鍒犻櫎鎸囧畾澶у睆杞﹂棿鍜岃澶囧叧绯�") + @DeleteMapping(value = "/deleteWorkshopEquipmentBatch") + public Result deleteWorkshopEquipmentBatch(@RequestParam(name = "workshopId") String workshopId, + @RequestParam(name = "equipmentIds", required = true) String equipmentIds) { + try { + LambdaQueryWrapper<MdcWorkshopEquipment> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(MdcWorkshopEquipment::getWorkshopId, workshopId).in(MdcWorkshopEquipment::getEquipmentId, Arrays.asList(equipmentIds.split(","))); + mdcWorkshopEquipmentService.remove(queryWrapper); + return Result.OK("鍒犻櫎鎴愬姛锛�"); + } catch (Exception e) { + return Result.error("鍒犻櫎澶辫触锛�"); + } + } + + /** + * 鏂板澶у睆杞﹂棿涓庤澶囧叧绯� + */ + @AutoLog(value = "澶у睆杞﹂棿淇℃伅-鏂板澶у睆杞﹂棿涓庤澶囧叧绯�") + @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-鏂板澶у睆杞﹂棿涓庤澶囧叧绯�", notes = "澶у睆杞﹂棿淇℃伅-鏂板澶у睆杞﹂棿涓庤澶囧叧绯�") + @PostMapping(value = "/addWorkshopEquipment") + public Result addWorkshopEquipment(MdcWorkshopEquipmentVo mdcWorkshopEquipmentVo) { + try { + String workshopId = mdcWorkshopEquipmentVo.getWorkshopId(); + for (String equipmentId : mdcWorkshopEquipmentVo.getEquipmentIdList()) { + MdcWorkshopEquipment mdcWorkshopEquipment = new MdcWorkshopEquipment(); + mdcWorkshopEquipment.setWorkshopId(workshopId); + mdcWorkshopEquipment.setEquipmentId(equipmentId); + mdcWorkshopEquipment.setCoordinateLeft(0); + mdcWorkshopEquipment.setCoordinateTop(0); + mdcWorkshopEquipment.setVw(100); + mdcWorkshopEquipment.setVh(100); + LambdaQueryWrapper<MdcWorkshopEquipment> queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(MdcWorkshopEquipment::getWorkshopId, workshopId).eq(MdcWorkshopEquipment::getEquipmentId, equipmentId); + MdcWorkshopEquipment one = mdcWorkshopEquipmentService.getOne(queryWrapper); + if (one == null) { + mdcWorkshopEquipmentService.save(mdcWorkshopEquipment); + } + } + return Result.OK("娣诲姞鎴愬姛锛�"); + } catch (Exception e) { + return Result.error("鏂板澶辫触锛�"); + } + } + +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/MdcEquipmentDto.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/MdcEquipmentDto.java index 796493d..6beaab2 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/MdcEquipmentDto.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/MdcEquipmentDto.java @@ -199,8 +199,8 @@ private String equipmentNormalTime; // 璁惧ID - @JSONField(name = "EquipmentID") - private String EquipmentID; +// @JSONField(name = "EquipmentID") +// private String EquipmentID; // KI1鐘舵�� @JSONField(name = "P1001") private String P1001; diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopEquipment.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopEquipment.java new file mode 100644 index 0000000..9583205 --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopEquipment.java @@ -0,0 +1,63 @@ +package org.jeecg.modules.mdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.system.base.entity.JeecgEntity; + +import java.io.Serializable; + +/** + * @Description: 澶у睆杞﹂棿璁惧鍏崇郴琛� + * @Author: Lius + * @Date: 2023-10-11 + * @Version: V1.0 + */ +@Data +@TableName("mdc_workshop_equipment") +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "mdc_workshop_equipment瀵硅薄", description = "澶у睆杞﹂棿璁惧鍏崇郴琛�") +public class MdcWorkshopEquipment extends JeecgEntity implements Serializable { + + private static final long serialVersionUID = -7123561842190776830L; + + /** + * 杞﹂棿id + */ + @ApiModelProperty(value = "杞﹂棿id") + private String workshopId; + + /** + * 璁惧缂栫爜 + */ + @ApiModelProperty(value = "璁惧缂栫爜") + private String equipmentId; + + /** + * 鍧愭爣-宸� + */ + @ApiModelProperty(value = "鍧愭爣-宸�") + private Integer coordinateLeft; + + /** + * 鍧愭爣-宸� + */ + @ApiModelProperty(value = "鍧愭爣-涓�") + private Integer coordinateTop; + + /** + * 澶у皬-瀹� + */ + @ApiModelProperty(value = "澶у皬-瀹�") + private Integer vw; + + /** + * 澶у皬-楂� + */ + @ApiModelProperty(value = "澶у皬-楂�") + private Integer vh; +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopInfo.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopInfo.java new file mode 100644 index 0000000..2370922 --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopInfo.java @@ -0,0 +1,43 @@ +package org.jeecg.modules.mdc.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.system.base.entity.JeecgEntity; +import org.jeecgframework.poi.excel.annotation.Excel; + +import java.io.Serializable; + +/** + * @Description: 澶у睆杞﹂棿淇℃伅 + * @Author: Lius + * @Date: 2023-10-11 + * @Version: V1.0 + */ +@Data +@TableName("mdc_workshop_info") +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "mdc_workshop_info瀵硅薄", description = "澶у睆杞﹂棿淇℃伅") +public class MdcWorkshopInfo extends JeecgEntity implements Serializable { + + private static final long serialVersionUID = 8254003853088493834L; + + /** + * 杞﹂棿鍚嶇О + */ + @Excel(name = "杞﹂棿鍚嶇О", width = 15) + @ApiModelProperty(value = "杞﹂棿鍚嶇О") + private String workshopName; + /** + * 鑳屾櫙鍥� + */ + @Excel(name = "鑳屾櫙鍥�", width = 15) + @ApiModelProperty(value = "鑳屾櫙鍥�") + private String backgroundImage; + +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentMapper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentMapper.java index 30fa299..f78b623 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentMapper.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentMapper.java @@ -10,6 +10,7 @@ import org.jeecg.modules.mdc.entity.MdcEquipmentMonitor; import org.jeecg.modules.mdc.vo.MdcEquipmentDepVo; import org.jeecg.modules.mdc.vo.MdcEquipmentProVo; +import org.jeecg.modules.mdc.vo.WorkshopEquipmentVo; import java.util.List; @@ -81,4 +82,9 @@ * @return */ List<MdcEquProDto> findEquProList(@Param("equipmentIdList") List<String> equipmentIdList); + + /** + * 鏍规嵁澶у睆杞﹂棿id鏌ヨ璁惧鍒楄〃 + */ + IPage<MdcEquipment> getEquipmentByWorkshopId(Page<MdcEquipment> page, @Param("workshopEquipmentVo") WorkshopEquipmentVo workshopEquipmentVo); } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopEquipmentMapper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopEquipmentMapper.java new file mode 100644 index 0000000..67cbd27 --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopEquipmentMapper.java @@ -0,0 +1,13 @@ +package org.jeecg.modules.mdc.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.mdc.entity.MdcWorkshopEquipment; + +/** + * @Description: 澶у睆杞﹂棿璁惧 + * @Author: Lius + * @Date: 2023-10-11 + * @Version: V1.0 + */ +public interface MdcWorkshopEquipmentMapper extends BaseMapper<MdcWorkshopEquipment> { +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopInfoMapper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopInfoMapper.java new file mode 100644 index 0000000..443366c --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopInfoMapper.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.mdc.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; + +/** + * @Description: 澶у睆杞﹂棿淇℃伅 + * @Author: Lius + * @Date: 2023-10-11 + * @Version: V1.0 + */ +public interface MdcWorkshopInfoMapper extends BaseMapper<MdcWorkshopInfo> { + +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml index 880b1ad..cef5f36 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml @@ -194,5 +194,21 @@ ORDER BY me.equipment_id </select> + <!--鏍规嵁澶у睆杞﹂棿id鏌ヨ璁惧鍒楄〃--> + <select id="getEquipmentByWorkshopId" resultType="org.jeecg.modules.mdc.entity.MdcEquipment"> + SELECT + me.* + FROM + mdc_workshop_equipment mwe + LEFT JOIN mdc_equipment me ON me.equipment_id = mwe.equipment_id + <where> + AND mwe.workshop_id = #{ workshopEquipmentVo.workshopId } + <if test="workshopEquipmentVo.equipmentId != null and workshopEquipmentVo.equipmentId != ''"> + AND mwe.equipment_id = #{equipmentId} + </if> + </where> + ORDER BY me.equipment_id + </select> + </mapper> \ No newline at end of file diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopEquipmentMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopEquipmentMapper.xml new file mode 100644 index 0000000..5f8acec --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopEquipmentMapper.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.jeecg.modules.mdc.mapper.MdcWorkshopEquipmentMapper"> + +</mapper> \ No newline at end of file diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml new file mode 100644 index 0000000..e5b93ca --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.jeecg.modules.mdc.mapper.MdcWorkshopInfoMapper"> + +</mapper> \ No newline at end of file diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentService.java index d70061b..512c043 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentService.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentService.java @@ -10,6 +10,7 @@ import org.jeecg.modules.mdc.entity.MdcEquipmentMonitor; import org.jeecg.modules.mdc.model.MdcEquipmentTree; import org.jeecg.modules.mdc.vo.MdcEquipmentVo; +import org.jeecg.modules.mdc.vo.WorkshopEquipmentVo; import java.util.List; import java.util.Map; @@ -162,4 +163,10 @@ * 鏍规嵁閮ㄩ棬灞傜骇鏌ヨ璁惧鍗曚釜 */ MdcEquipment getEquipmentByDepPid(String pid, String userId); + + /** + * 鏍规嵁澶у睆杞﹂棿id鏌ヨ璁惧鍒楄〃 + */ + IPage<MdcEquipment> getEquipmentByWorkshopId(Page<MdcEquipment> page, WorkshopEquipmentVo workshopEquipmentVo); + } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopEquipmentService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopEquipmentService.java new file mode 100644 index 0000000..b0751ab --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopEquipmentService.java @@ -0,0 +1,13 @@ +package org.jeecg.modules.mdc.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.mdc.entity.MdcWorkshopEquipment; + +/** + * @Description: 澶у睆杞﹂棿璁惧鍏崇郴 + * @Author: Lius + * @Date: 2023-10-11 + * @Version: V1.0 + */ +public interface IMdcWorkshopEquipmentService extends IService<MdcWorkshopEquipment> { +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopInfoService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopInfoService.java new file mode 100644 index 0000000..7692fbb --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopInfoService.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.mdc.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; + +/** + * @Description: 澶у睆杞﹂棿淇℃伅 + * @Author: Lius + * @Date: 2023-10-11 + * @Version: V1.0 + */ +public interface IMdcWorkshopInfoService extends IService<MdcWorkshopInfo> { + +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java index 9dc6fee..65ac02d 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java @@ -5,25 +5,29 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.google.common.base.CaseFormat; import org.apache.commons.lang3.StringUtils; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.util.oConvertUtils; -import org.jeecg.modules.mdc.dto.EquipmentTemperatureDto; import org.jeecg.modules.mdc.dto.MdcEquDepDto; import org.jeecg.modules.mdc.dto.MdcEquProDto; import org.jeecg.modules.mdc.dto.MdcEquipmentDto; -import org.jeecg.modules.mdc.entity.*; +import org.jeecg.modules.mdc.entity.ControlSystem; +import org.jeecg.modules.mdc.entity.MdcDriveTypeParamConfig; +import org.jeecg.modules.mdc.entity.MdcEquipment; +import org.jeecg.modules.mdc.entity.MdcEquipmentMonitor; import org.jeecg.modules.mdc.mapper.MdcEquipmentMapper; -import org.jeecg.modules.mdc.mapper.XYZAliasesMapper; import org.jeecg.modules.mdc.model.MdcEquipmentTree; -import org.jeecg.modules.mdc.service.*; +import org.jeecg.modules.mdc.service.IControlSystemService; +import org.jeecg.modules.mdc.service.IEquipmentWorkLineService; +import org.jeecg.modules.mdc.service.IMdcDriveTypeParamConfigService; +import org.jeecg.modules.mdc.service.IMdcEquipmentService; import org.jeecg.modules.mdc.util.DateUtils; import org.jeecg.modules.mdc.util.FindsEquipmentDepartUtil; import org.jeecg.modules.mdc.util.FindsEquipmentProductionUtil; import org.jeecg.modules.mdc.vo.MdcEquipmentDepVo; import org.jeecg.modules.mdc.vo.MdcEquipmentProVo; import org.jeecg.modules.mdc.vo.MdcEquipmentVo; +import org.jeecg.modules.mdc.vo.WorkshopEquipmentVo; import org.jeecg.modules.system.entity.MdcEquipmentDepart; import org.jeecg.modules.system.entity.MdcProduction; import org.jeecg.modules.system.entity.MdcProductionEquipment; @@ -696,4 +700,12 @@ return null; } + /** + * 鏍规嵁澶у睆杞﹂棿id鏌ヨ璁惧鍒楄〃 + */ + @Override + public IPage<MdcEquipment> getEquipmentByWorkshopId(Page<MdcEquipment> page, WorkshopEquipmentVo workshopEquipmentVo) { + return this.baseMapper.getEquipmentByWorkshopId(page, workshopEquipmentVo); + } + } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopEquipmentServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopEquipmentServiceImpl.java new file mode 100644 index 0000000..5e2e8c6 --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopEquipmentServiceImpl.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.mdc.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.mdc.entity.MdcWorkshopEquipment; +import org.jeecg.modules.mdc.mapper.MdcWorkshopEquipmentMapper; +import org.jeecg.modules.mdc.service.IMdcWorkshopEquipmentService; +import org.springframework.stereotype.Service; + +/** + * @Description: 澶у睆杞﹂棿璁惧鍏崇郴 + * @Author: Lius + * @Date: 2023-10-11 + * @Version: V1.0 + */ +@Service +public class MdcWorkshopEquipmentServiceImpl extends ServiceImpl<MdcWorkshopEquipmentMapper, MdcWorkshopEquipment> implements IMdcWorkshopEquipmentService { +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java new file mode 100644 index 0000000..c7327be --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.mdc.service.impl; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; +import org.jeecg.modules.mdc.mapper.MdcWorkshopInfoMapper; +import org.jeecg.modules.mdc.service.IMdcWorkshopInfoService; +import org.springframework.stereotype.Service; + +/** + * @Description: 澶у睆杞﹂棿淇℃伅 + * @Author: Lius + * @Date: 2023-10-11 + * @Version: V1.0 + */ +@Service +public class MdcWorkshopInfoServiceImpl extends ServiceImpl<MdcWorkshopInfoMapper, MdcWorkshopInfo> implements IMdcWorkshopInfoService { + +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcWorkshopEquipmentVo.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcWorkshopEquipmentVo.java new file mode 100644 index 0000000..a2d1d26 --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcWorkshopEquipmentVo.java @@ -0,0 +1,25 @@ +package org.jeecg.modules.mdc.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description: 杞﹂棿璁惧vo + * @author: lius + */ +@Data +public class MdcWorkshopEquipmentVo implements Serializable { + + private static final long serialVersionUID = 3911516861920572440L; + + /** + * 杞﹂棿id + */ + private String workshopId; + /** + * 璁惧id闆嗗悎 + */ + private List<String> equipmentIdList; +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WorkshopEquipmentVo.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WorkshopEquipmentVo.java new file mode 100644 index 0000000..bf6b336 --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WorkshopEquipmentVo.java @@ -0,0 +1,16 @@ +package org.jeecg.modules.mdc.vo; + +import lombok.Data; + +/** + * @author: LiuS + * @create: 2023-10-11 14:33 + */ +@Data +public class WorkshopEquipmentVo { + + private String workshopId; + + private String equipmentId; + +} -- Gitblit v1.9.3