diff --git a/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue b/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue new file mode 100644 index 00000000..49b489ba --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue @@ -0,0 +1,236 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue new file mode 100644 index 00000000..2bd149cb --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue @@ -0,0 +1,219 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal.vue b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal.vue new file mode 100644 index 00000000..ac2423ef --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal__Style#Drawer.vue b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal__Style#Drawer.vue new file mode 100644 index 00000000..297b3480 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/hanger/modules/ZyHangModal__Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangController.java new file mode 100644 index 00000000..8fd4607e --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangController.java @@ -0,0 +1,172 @@ +package org.jeecg.modules.hanger.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.hanger.entity.ZyHang; +import org.jeecg.modules.hanger.service.IZyHangService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.ObjectUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; + +/** + * @Description: 吊挂表 + * @Author: jeecg-boot + * @Date: 2023-02-02 + * @Version: V1.0 + */ +@Api(tags = "吊挂表") +@RestController +@RequestMapping("/org.jeecg.modules.hanger/zyHang") +@Slf4j +public class ZyHangController extends JeecgController { + @Autowired + private IZyHangService zyHangService; + + /** + * 分页列表查询 + * + * @param zyHang + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "吊挂表-分页列表查询") + @ApiOperation(value = "吊挂表-分页列表查询", notes = "吊挂表-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(ZyHang zyHang, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyHang, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyHangService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param zyHang + * @return + */ + @AutoLog(value = "吊挂表-添加") + @ApiOperation(value = "吊挂表-添加", notes = "吊挂表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody ZyHang zyHang) { + List list = zyHangService.list(new LambdaQueryWrapper() + .eq(ZyHang::getStatus, "0") + .orderByDesc(ZyHang::getCode)); + String code = ""; + if (ObjectUtils.isEmpty(list)) { + code = "DG1000"; + } else { + String[] dgs = list.get(0).getCode().split("DG"); + int val = new Integer(dgs[1]).intValue() + 1 ; + code = "DG" + val+ ""; + } + zyHang.setCode(code); + zyHang.setStatus("0"); + zyHangService.save(zyHang); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param zyHang + * @return + */ + @AutoLog(value = "吊挂表-编辑") + @ApiOperation(value = "吊挂表-编辑", notes = "吊挂表-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody ZyHang zyHang) { + zyHangService.updateById(zyHang); + 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) { + zyHangService.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.zyHangService.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) { + ZyHang zyHang = zyHangService.getById(id); + if (zyHang == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zyHang); + } + + /** + * 导出excel + * + * @param request + * @param zyHang + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ZyHang zyHang) { + return super.exportXls(request, zyHang, ZyHang.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, ZyHang.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHang.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHang.java new file mode 100644 index 00000000..8273c52c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHang.java @@ -0,0 +1,149 @@ +package org.jeecg.modules.hanger.entity; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description: 吊挂表 + * @Author: jeecg-boot + * @Date: 2023-02-02 + * @Version: V1.0 + */ +@Data +@TableName("zy_hang") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "zy_hang对象", description = "吊挂表") +public class ZyHang 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; + /** + * 车间 + */ + @Excel(name = "车间", width = 15) + @ApiModelProperty(value = "车间") + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + private String workshopId; + /** + * 品牌 + */ + @Excel(name = "品牌", width = 15) + @ApiModelProperty(value = "品牌") + private String brand; + /** + * 型号 + */ + @Excel(name = "型号", width = 15) + @ApiModelProperty(value = "型号") + private String model; + /** + * 编号 + */ + @Excel(name = "编号", width = 15) + @ApiModelProperty(value = "编号") + private String code; + /** + * 工站数 + */ + @Excel(name = "工站数", width = 15) + @ApiModelProperty(value = "工站数") + private Integer pointnumber; + /** + * 购买时间 + */ + @Excel(name = "购买时间", width = 15) + @ApiModelProperty(value = "购买时间") + private String buydate; + /** + * 经办人 + */ + @Excel(name = "经办人", width = 15) + @ApiModelProperty(value = "经办人") + private String agent; + /** + * 状态 + */ + @Excel(name = "状态", width = 15) + @ApiModelProperty(value = "状态") + private String status; + /** + * 二维码 + */ + @Excel(name = "二维码", width = 15) + @ApiModelProperty(value = "二维码") + private String qrcode; + /** + * 维护周期 + */ + @Excel(name = "维护周期", width = 15) + @ApiModelProperty(value = "维护周期") + private Integer maintenancecycle; + /** + * 管理 人 + */ + @Excel(name = "管理 人", width = 15) + @ApiModelProperty(value = "管理 人") + private String administrator; + /** + * 上次维护时间 + */ + @Excel(name = "上次维护时间", width = 15) + @ApiModelProperty(value = "上次维护时间") + private String maintenancedate; + /** + * 图片 + */ + @Excel(name = "图片", width = 15) + @ApiModelProperty(value = "图片") + private String img; + /** + * 3d模型 + */ + @Excel(name = "3d模型", width = 15) + @ApiModelProperty(value = "3d模型") + private String img3d; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangMapper.java new file mode 100644 index 00000000..769d78bd --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/mapper/ZyHangMapper.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.hanger.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.jeecg.modules.hanger.entity.ZyHang; + +/** + * @Description: 吊挂表 + * @Author: jeecg-boot + * @Date: 2023-02-02 + * @Version: V1.0 + */ +public interface ZyHangMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangService.java new file mode 100644 index 00000000..8b12290b --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangService.java @@ -0,0 +1,15 @@ +package org.jeecg.modules.hanger.service; + + +import org.jeecg.modules.hanger.entity.ZyHang; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 吊挂表 + * @Author: jeecg-boot + * @Date: 2023-02-02 + * @Version: V1.0 + */ +public interface IZyHangService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangServiceImpl.java new file mode 100644 index 00000000..ba2daec4 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.hanger.service.impl; + +import org.jeecg.modules.hanger.entity.ZyHang; +import org.jeecg.modules.hanger.mapper.ZyHangMapper; +import org.jeecg.modules.hanger.service.IZyHangService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 吊挂表 + * @Author: jeecg-boot + * @Date: 2023-02-02 + * @Version: V1.0 + */ +@Service +public class ZyHangServiceImpl extends ServiceImpl implements IZyHangService { + +}