From 0f536b2dc438fca98f7fcede2715b4b88d03aecb Mon Sep 17 00:00:00 2001 From: yanyan <513352169@qq.com> Date: Mon, 9 Mar 2026 16:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=9F=BA=E7=A1=80=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=9A=E5=A2=9E/=E5=88=A0/=E6=94=B9/=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../part/controller/PartController.java | 82 ++++++++++++++++ .../xujie/modules/part/dao/PartMapper.java | 27 ++++++ .../com/xujie/modules/part/entity/Part.java | 95 +++++++++++++++++++ .../part/service/Iface/IPartService.java | 28 ++++++ .../part/service/Impl/PartServiceImpl.java | 72 ++++++++++++++ .../com/xujie/modules/part/vo/PartVo.java | 88 +++++++++++++++++ .../mapper/part/mapperXml/PartMapper.xml | 85 +++++++++++++++++ 7 files changed, 477 insertions(+) create mode 100644 src/main/java/com/xujie/modules/part/controller/PartController.java create mode 100644 src/main/java/com/xujie/modules/part/dao/PartMapper.java create mode 100644 src/main/java/com/xujie/modules/part/entity/Part.java create mode 100644 src/main/java/com/xujie/modules/part/service/Iface/IPartService.java create mode 100644 src/main/java/com/xujie/modules/part/service/Impl/PartServiceImpl.java create mode 100644 src/main/java/com/xujie/modules/part/vo/PartVo.java create mode 100644 src/main/resources/mapper/part/mapperXml/PartMapper.xml diff --git a/src/main/java/com/xujie/modules/part/controller/PartController.java b/src/main/java/com/xujie/modules/part/controller/PartController.java new file mode 100644 index 0000000..772e0e2 --- /dev/null +++ b/src/main/java/com/xujie/modules/part/controller/PartController.java @@ -0,0 +1,82 @@ +package com.xujie.modules.part.controller; +import com.xujie.common.utils.PageUtils; +import com.xujie.common.utils.R; +import com.xujie.modules.part.entity.Part; +import com.xujie.modules.part.service.Iface.IPartService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + *
+ * API + *
+ * + * @author jyy + * @since 2026-03-09 + */ +@Api(tags = "") +@RestController +@RequestMapping("/part") +public class PartController { + + @Autowired + private IPartService baseService; + + /** + * 保存数据 + */ + @PostMapping("/save") + @ApiOperation("保存") + public R save(@Validated @RequestBody Part model) { + baseService.saveModel(model); + return R.ok(); + } + + + /** + * 获取分页 + */ + @PostMapping("/searchPartList") + @ApiOperation("分頁") + public R page(@RequestBody Part page){ + PageUtils myPage = baseService.myPage(page); + return R.ok().put("page", myPage); + } + + + /** + * 获取list + */ + @PostMapping("/list") + @ApiOperation("获取list") + public R list(@RequestBody Part query){ + List+ * Mapper 接口 + *
+ * + * @author jyy + * @since 2026-03-09 + */ +@Mapper +public interface PartMapper extends BaseMapper+ * + *
+ * + * @author jyy + * @since 2026-03-09 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@TableName("part") +@ApiModel(value = "Part对象", description = "") +public class Part extends QueryPage { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "工厂") + private String site; + + @ApiModelProperty(value = "产品编码") + private String partNo; + + @ApiModelProperty(value = "产品名称") + private String partDesc; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "修改人") + private String updateBy; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiModelProperty(value = "修改时间") + private Date updateDate; + + @ApiModelProperty(value = "NPC货号") + private String npc; + + @ApiModelProperty(value = "产品规格") + private String partSpec; + + @ApiModelProperty(value = "采购员名称") + private String buyerName; + + @ApiModelProperty(value = "采购员id") + private Integer buyerId; + + @ApiModelProperty(value = "sourcing负责人名称") + private String sourcingName; + + @ApiModelProperty(value = "sourcing负责人id") + private Integer sourcingId; + + @ApiModelProperty(value = "产品分类") + private String category; + + @ApiModelProperty(value = "计量单位") + private String unit; + + @ApiModelProperty(value = "状态(启用N,禁用Y)") + private String status; + + @ApiModelProperty(value = "属性模板") + private String codeNo; + + private Integer id; + + public Object getKey() { + return this.id; + } +} diff --git a/src/main/java/com/xujie/modules/part/service/Iface/IPartService.java b/src/main/java/com/xujie/modules/part/service/Iface/IPartService.java new file mode 100644 index 0000000..3d5d22e --- /dev/null +++ b/src/main/java/com/xujie/modules/part/service/Iface/IPartService.java @@ -0,0 +1,28 @@ +package com.xujie.modules.part.service.Iface; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.xujie.common.utils.PageUtils; +import com.xujie.modules.part.entity.Part; + +import java.util.List; + +/** + *+ * 服务类 + *
+ * + * @author jyy + * @since 2026-03-09 + */ +public interface IPartService extends IService+ * 服务实现类 + *
+ * + * @author jyy + * @since 2026-03-09 + */ +@Service +public class PartServiceImpl extends ServiceImpl+ * + *
+ * + * @author jyy + * @since 2026-03-09 + */ +@Data +@ApiModel(value = "PartVo对象", description = "") +public class PartVo extends QueryPage { + + @ApiModelProperty(value = "工厂") + private String site; + + @ApiModelProperty(value = "产品编码") + private String partNo; + + @ApiModelProperty(value = "产品名称") + private String partDesc; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiModelProperty(value = "创建时间") + private Date createDate; + + @ApiModelProperty(value = "修改人") + private String updateBy; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiModelProperty(value = "修改时间") + private Date updateDate; + + @ApiModelProperty(value = "NPC货号") + private String npc; + + @ApiModelProperty(value = "产品规格") + private String partSpec; + + @ApiModelProperty(value = "采购员名称") + private String buyerName; + + @ApiModelProperty(value = "采购员id") + private Integer buyerId; + + @ApiModelProperty(value = "sourcing负责人名称") + private String sourcingName; + + @ApiModelProperty(value = "sourcing负责人id") + private Integer sourcingId; + + @ApiModelProperty(value = "产品分类") + private String category; + + @ApiModelProperty(value = "计量单位") + private String unit; + + @ApiModelProperty(value = "状态(启用N,禁用Y)") + private String status; + + @ApiModelProperty(value = "属性模板") + private String codeNo; + + private Integer id; + + public Object getKey() { + return this.id; + } +} diff --git a/src/main/resources/mapper/part/mapperXml/PartMapper.xml b/src/main/resources/mapper/part/mapperXml/PartMapper.xml new file mode 100644 index 0000000..1954ee2 --- /dev/null +++ b/src/main/resources/mapper/part/mapperXml/PartMapper.xml @@ -0,0 +1,85 @@ + + +