From 5c412dd6ab7c5ec6123e5f494aa03ca37d30ac59 Mon Sep 17 00:00:00 2001 From: xiaosuonian <913474402@qq.com> Date: Tue, 3 Jun 2025 15:59:24 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E2=80=9C=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E7=A3=85=E7=82=B9=E2=80=9D=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BuspoundController.java | 105 ++++ .../com/ruoyi/basedata/domain/Buspound.java | 242 +++++++++ .../ruoyi/basedata/mapper/BuspoundMapper.java | 63 +++ .../basedata/service/IBuspoundService.java | 63 +++ .../service/impl/BuspoundServiceImpl.java | 95 ++++ .../measurement/basedata/BuspoundMapper.xml | 118 ++++ .../src/main/resources/application.yml | 2 +- .../src/api/measurement/basedata/buspound.js | 44 ++ .../measurement/basedata/buspound/index.vue | 507 ++++++++++++++++++ 9 files changed, 1238 insertions(+), 1 deletion(-) create mode 100644 measurement/src/main/java/com/ruoyi/basedata/controller/BuspoundController.java create mode 100644 measurement/src/main/java/com/ruoyi/basedata/domain/Buspound.java create mode 100644 measurement/src/main/java/com/ruoyi/basedata/mapper/BuspoundMapper.java create mode 100644 measurement/src/main/java/com/ruoyi/basedata/service/IBuspoundService.java create mode 100644 measurement/src/main/java/com/ruoyi/basedata/service/impl/BuspoundServiceImpl.java create mode 100644 measurement/src/main/resources/mapper/measurement/basedata/BuspoundMapper.xml create mode 100644 ruoyi-ui/src/api/measurement/basedata/buspound.js create mode 100644 ruoyi-ui/src/views/measurement/basedata/buspound/index.vue diff --git a/measurement/src/main/java/com/ruoyi/basedata/controller/BuspoundController.java b/measurement/src/main/java/com/ruoyi/basedata/controller/BuspoundController.java new file mode 100644 index 0000000..5171b52 --- /dev/null +++ b/measurement/src/main/java/com/ruoyi/basedata/controller/BuspoundController.java @@ -0,0 +1,105 @@ +package com.ruoyi.basedata.controller; + +import java.util.Arrays; +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.basedata.domain.Buspound; +import com.ruoyi.basedata.service.IBuspoundService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 业务磅点Controller + * + * @author ruoyi + * @date 2025-06-03 + */ +@RestController +@RequestMapping("/measurement/basedata/buspound") +public class BuspoundController extends BaseController +{ + @Autowired + private IBuspoundService buspoundService; + + /** + * 查询业务磅点列表 + */ + @PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:list')") + @GetMapping("/list") + public TableDataInfo list(Buspound buspound) + { + startPage(); + List list = buspoundService.selectBuspoundList(buspound); + return getDataTable(list); + } + + /** + * 导出业务磅点列表 + */ + @PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:export')") + @Log(title = "业务磅点", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Buspound buspound) + { + List list = buspoundService.selectBuspoundList(buspound); + ExcelUtil util = new ExcelUtil(Buspound.class); + util.exportExcel(response, list, "业务磅点数据"); + } + + /** + * 获取业务磅点详细信息 + */ + @PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return success(buspoundService.getById(id)); + } + + /** + * 新增业务磅点 + */ + @PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:add')") + @Log(title = "业务磅点", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Buspound buspound) + { + return toAjax(buspoundService.save(buspound)); + } + + /** + * 修改业务磅点 + */ + @PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:edit')") + @Log(title = "业务磅点", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Buspound buspound) + { + return toAjax(buspoundService.updateById(buspound)); + } + + /** + * 删除业务磅点 + */ + @PreAuthorize("@ss.hasPermi('measurement/basedata:buspound:remove')") + @Log(title = "业务磅点", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(buspoundService.removeByIds(Arrays.asList(ids))); + } +} diff --git a/measurement/src/main/java/com/ruoyi/basedata/domain/Buspound.java b/measurement/src/main/java/com/ruoyi/basedata/domain/Buspound.java new file mode 100644 index 0000000..17a7fd9 --- /dev/null +++ b/measurement/src/main/java/com/ruoyi/basedata/domain/Buspound.java @@ -0,0 +1,242 @@ +package com.ruoyi.basedata.domain; + +import java.util.Date; + +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 org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 业务磅点对象 t_data_buspound + * + * @author ruoyi + * @date 2025-06-03 + */ +@TableName(value = "t_data_buspound") +public class Buspound extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** ID */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + /** 磅点编号 */ + @Excel(name = "磅点编号") + private String usrcode; + + /** 磅点名称 */ + @Excel(name = "磅点名称") + private String name; + + /** 磅点类型 */ + @Excel(name = "磅点类型") + private String type; + + /** 磅点位置 */ + @Excel(name = "磅点位置") + private String pos; + + /** 磅点类型(出厂/入厂) */ + @Excel(name = "磅点类型", readConverterExp = "出=厂/入厂") + private String poundtype; + + /** 默认申请过磅 */ + @Excel(name = "默认申请过磅") + private String defweighttype; + + /** 独立过磅输入方式 */ + @Excel(name = "独立过磅输入方式") + private String caninput; + + /** 登记部门 */ + @Excel(name = "登记部门") + private Long crtorgid; + + /** 是否启用 */ + @Excel(name = "是否启用") + private String isinuse; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date crtdt; + + /** 创建人 */ + @Excel(name = "创建人") + private String crtopr; + + /** 最后修改日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "最后修改日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date lstedtdt; + + /** 最后修改人 */ + @Excel(name = "最后修改人") + private String lstedtopr; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + + public void setUsrcode(String usrcode) + { + this.usrcode = usrcode; + } + + public String getUsrcode() + { + return usrcode; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + + public void setPos(String pos) + { + this.pos = pos; + } + + public String getPos() + { + return pos; + } + + public void setPoundtype(String poundtype) + { + this.poundtype = poundtype; + } + + public String getPoundtype() + { + return poundtype; + } + + public void setDefweighttype(String defweighttype) + { + this.defweighttype = defweighttype; + } + + public String getDefweighttype() + { + return defweighttype; + } + + public void setCaninput(String caninput) + { + this.caninput = caninput; + } + + public String getCaninput() + { + return caninput; + } + + public void setCrtorgid(Long crtorgid) + { + this.crtorgid = crtorgid; + } + + public Long getCrtorgid() + { + return crtorgid; + } + + public void setIsinuse(String isinuse) + { + this.isinuse = isinuse; + } + + public String getIsinuse() + { + return isinuse; + } + + public void setCrtdt(Date crtdt) + { + this.crtdt = crtdt; + } + + public Date getCrtdt() + { + return crtdt; + } + + public void setCrtopr(String crtopr) + { + this.crtopr = crtopr; + } + + public String getCrtopr() + { + return crtopr; + } + + public void setLstedtdt(Date lstedtdt) + { + this.lstedtdt = lstedtdt; + } + + public Date getLstedtdt() + { + return lstedtdt; + } + + public void setLstedtopr(String lstedtopr) + { + this.lstedtopr = lstedtopr; + } + + public String getLstedtopr() + { + return lstedtopr; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("usrcode", getUsrcode()) + .append("name", getName()) + .append("type", getType()) + .append("pos", getPos()) + .append("poundtype", getPoundtype()) + .append("defweighttype", getDefweighttype()) + .append("caninput", getCaninput()) + .append("crtorgid", getCrtorgid()) + .append("isinuse", getIsinuse()) + .append("crtdt", getCrtdt()) + .append("crtopr", getCrtopr()) + .append("lstedtdt", getLstedtdt()) + .append("lstedtopr", getLstedtopr()) + .toString(); + } +} diff --git a/measurement/src/main/java/com/ruoyi/basedata/mapper/BuspoundMapper.java b/measurement/src/main/java/com/ruoyi/basedata/mapper/BuspoundMapper.java new file mode 100644 index 0000000..5e4aebc --- /dev/null +++ b/measurement/src/main/java/com/ruoyi/basedata/mapper/BuspoundMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.basedata.mapper; + +import java.util.List; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.basedata.domain.Buspound; + +/** + * 业务磅点Mapper接口 + * + * @author ruoyi + * @date 2025-06-03 + */ +public interface BuspoundMapper extends BaseMapper +{ + /** + * 查询业务磅点 + * + * @param id 业务磅点主键 + * @return 业务磅点 + */ + public Buspound selectBuspoundById(String id); + + /** + * 查询业务磅点列表 + * + * @param buspound 业务磅点 + * @return 业务磅点集合 + */ + public List selectBuspoundList(Buspound buspound); + + /** + * 新增业务磅点 + * + * @param buspound 业务磅点 + * @return 结果 + */ + public int insertBuspound(Buspound buspound); + + /** + * 修改业务磅点 + * + * @param buspound 业务磅点 + * @return 结果 + */ + public int updateBuspound(Buspound buspound); + + /** + * 删除业务磅点 + * + * @param id 业务磅点主键 + * @return 结果 + */ + public int deleteBuspoundById(String id); + + /** + * 批量删除业务磅点 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBuspoundByIds(String[] ids); +} diff --git a/measurement/src/main/java/com/ruoyi/basedata/service/IBuspoundService.java b/measurement/src/main/java/com/ruoyi/basedata/service/IBuspoundService.java new file mode 100644 index 0000000..d284582 --- /dev/null +++ b/measurement/src/main/java/com/ruoyi/basedata/service/IBuspoundService.java @@ -0,0 +1,63 @@ +package com.ruoyi.basedata.service; + +import java.util.List; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.basedata.domain.Buspound; + +/** + * 业务磅点Service接口 + * + * @author ruoyi + * @date 2025-06-03 + */ +public interface IBuspoundService extends IService +{ + /** + * 查询业务磅点 + * + * @param id 业务磅点主键 + * @return 业务磅点 + */ + public Buspound selectBuspoundById(String id); + + /** + * 查询业务磅点列表 + * + * @param buspound 业务磅点 + * @return 业务磅点集合 + */ + public List selectBuspoundList(Buspound buspound); + + /** + * 新增业务磅点 + * + * @param buspound 业务磅点 + * @return 结果 + */ + public int insertBuspound(Buspound buspound); + + /** + * 修改业务磅点 + * + * @param buspound 业务磅点 + * @return 结果 + */ + public int updateBuspound(Buspound buspound); + + /** + * 批量删除业务磅点 + * + * @param ids 需要删除的业务磅点主键集合 + * @return 结果 + */ + public int deleteBuspoundByIds(String[] ids); + + /** + * 删除业务磅点信息 + * + * @param id 业务磅点主键 + * @return 结果 + */ + public int deleteBuspoundById(String id); +} diff --git a/measurement/src/main/java/com/ruoyi/basedata/service/impl/BuspoundServiceImpl.java b/measurement/src/main/java/com/ruoyi/basedata/service/impl/BuspoundServiceImpl.java new file mode 100644 index 0000000..b7178de --- /dev/null +++ b/measurement/src/main/java/com/ruoyi/basedata/service/impl/BuspoundServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.basedata.service.impl; + +import java.util.List; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.basedata.mapper.BuspoundMapper; +import com.ruoyi.basedata.domain.Buspound; +import com.ruoyi.basedata.service.IBuspoundService; + +/** + * 业务磅点Service业务层处理 + * + * @author ruoyi + * @date 2025-06-03 + */ +@Service +public class BuspoundServiceImpl extends ServiceImpl implements IBuspoundService +{ + @Autowired + private BuspoundMapper buspoundMapper; + + /** + * 查询业务磅点 + * + * @param id 业务磅点主键 + * @return 业务磅点 + */ + @Override + public Buspound selectBuspoundById(String id) + { + return buspoundMapper.selectBuspoundById(id); + } + + /** + * 查询业务磅点列表 + * + * @param buspound 业务磅点 + * @return 业务磅点 + */ + @Override + public List selectBuspoundList(Buspound buspound) + { + return buspoundMapper.selectBuspoundList(buspound); + } + + /** + * 新增业务磅点 + * + * @param buspound 业务磅点 + * @return 结果 + */ + @Override + public int insertBuspound(Buspound buspound) + { + return buspoundMapper.insertBuspound(buspound); + } + + /** + * 修改业务磅点 + * + * @param buspound 业务磅点 + * @return 结果 + */ + @Override + public int updateBuspound(Buspound buspound) + { + return buspoundMapper.updateBuspound(buspound); + } + + /** + * 批量删除业务磅点 + * + * @param ids 需要删除的业务磅点主键 + * @return 结果 + */ + @Override + public int deleteBuspoundByIds(String[] ids) + { + return buspoundMapper.deleteBuspoundByIds(ids); + } + + /** + * 删除业务磅点信息 + * + * @param id 业务磅点主键 + * @return 结果 + */ + @Override + public int deleteBuspoundById(String id) + { + return buspoundMapper.deleteBuspoundById(id); + } +} diff --git a/measurement/src/main/resources/mapper/measurement/basedata/BuspoundMapper.xml b/measurement/src/main/resources/mapper/measurement/basedata/BuspoundMapper.xml new file mode 100644 index 0000000..38908fe --- /dev/null +++ b/measurement/src/main/resources/mapper/measurement/basedata/BuspoundMapper.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, usrcode, name, type, pos, poundtype, defweighttype, caninput, crtorgid, isinuse, crtdt, crtopr, lstedtdt, lstedtopr from t_data_buspound + + + + + + + + insert into t_data_buspound + + id, + usrcode, + name, + type, + pos, + poundtype, + defweighttype, + caninput, + crtorgid, + isinuse, + crtdt, + crtopr, + lstedtdt, + lstedtopr, + + + #{id}, + #{usrcode}, + #{name}, + #{type}, + #{pos}, + #{poundtype}, + #{defweighttype}, + #{caninput}, + #{crtorgid}, + #{isinuse}, + #{crtdt}, + #{crtopr}, + #{lstedtdt}, + #{lstedtopr}, + + + + + update t_data_buspound + + usrcode = #{usrcode}, + name = #{name}, + type = #{type}, + pos = #{pos}, + poundtype = #{poundtype}, + defweighttype = #{defweighttype}, + caninput = #{caninput}, + crtorgid = #{crtorgid}, + isinuse = #{isinuse}, + crtdt = #{crtdt}, + crtopr = #{crtopr}, + lstedtdt = #{lstedtdt}, + lstedtopr = #{lstedtopr}, + + where id = #{id} + + + + delete from t_data_buspound where id = #{id} + + + + delete from t_data_buspound where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 537c697..414f381 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -95,7 +95,7 @@ token: # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) - expireTime: 30 + expireTime: 600 # MyBatis Plus配置 mybatis-plus: diff --git a/ruoyi-ui/src/api/measurement/basedata/buspound.js b/ruoyi-ui/src/api/measurement/basedata/buspound.js new file mode 100644 index 0000000..e074d0a --- /dev/null +++ b/ruoyi-ui/src/api/measurement/basedata/buspound.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询业务磅点列表 +export function listBuspound(query) { + return request({ + url: '/measurement/basedata/buspound/list', + method: 'get', + params: query + }) +} + +// 查询业务磅点详细 +export function getBuspound(id) { + return request({ + url: '/measurement/basedata/buspound/' + id, + method: 'get' + }) +} + +// 新增业务磅点 +export function addBuspound(data) { + return request({ + url: '/measurement/basedata/buspound', + method: 'post', + data: data + }) +} + +// 修改业务磅点 +export function updateBuspound(data) { + return request({ + url: '/measurement/basedata/buspound', + method: 'put', + data: data + }) +} + +// 删除业务磅点 +export function delBuspound(id) { + return request({ + url: '/measurement/basedata/buspound/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/measurement/basedata/buspound/index.vue b/ruoyi-ui/src/views/measurement/basedata/buspound/index.vue new file mode 100644 index 0000000..80c5f4b --- /dev/null +++ b/ruoyi-ui/src/views/measurement/basedata/buspound/index.vue @@ -0,0 +1,507 @@ + + +