From cd8aba2547b4ae762b1f4c7ca045f92fe54b361a Mon Sep 17 00:00:00 2001 From: wanghao Date: Fri, 28 Nov 2025 17:07:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=82=B9=E5=87=BB=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=97=B6=E5=80=99=E6=8F=92=E5=85=A5=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/api/controller/ApiController.java | 41 +++++- .../controller/PmRecordPenaltyController.java | 4 +- .../ruoyi/pm/domain/PmBasePenaltyType.java | 6 +- .../com/ruoyi/pm/domain/PmRecordPenalty.java | 135 ++++++++++-------- .../java/com/ruoyi/pm/domain/PmRecordSan.java | 12 +- .../pm/service/IPmRecordPenaltyService.java | 2 + .../impl/PmRecordPenaltyServiceImpl.java | 12 ++ .../mapper/pm/PmRecordPenaltyMapper.xml | 3 +- .../resources/mapper/pm/PmRecordSanMapper.xml | 7 +- .../pm/record_penalty/record_penalty.html | 37 ++++- .../templates/pm/record_san/record_san.html | 35 +++-- 11 files changed, 208 insertions(+), 86 deletions(-) diff --git a/ruoyi-api/src/main/java/com/ruoyi/api/controller/ApiController.java b/ruoyi-api/src/main/java/com/ruoyi/api/controller/ApiController.java index 85c3d74..a067686 100644 --- a/ruoyi-api/src/main/java/com/ruoyi/api/controller/ApiController.java +++ b/ruoyi-api/src/main/java/com/ruoyi/api/controller/ApiController.java @@ -2,14 +2,22 @@ package com.ruoyi.api.controller; import com.ruoyi.api.service.impl.ApiService; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.pm.domain.PmBasePenaltyType; import com.ruoyi.pm.domain.PmBasePersonInfo; +import com.ruoyi.pm.domain.PmRecordPenalty; +import com.ruoyi.pm.domain.PmRecordSan; +import com.ruoyi.pm.service.IPmBasePenaltyTypeService; import com.ruoyi.pm.service.IPmBasePersonInfoService; +import com.ruoyi.pm.service.IPmRecordPenaltyService; import com.ruoyi.pm.service.IPmRecordSanService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * @author wanghao @@ -26,13 +34,44 @@ public class ApiController { private IPmRecordSanService pmRecordSanService; @Autowired private IPmBasePersonInfoService pmBasePersonInfoService; + @Autowired + private IPmBasePenaltyTypeService pmBasePenaltyTypeService; + + @Autowired + private IPmRecordPenaltyService pmRecordPenaltyService; + @PostMapping("/selectPersonInfo") - public AjaxResult selectPersonInfo(String epc) { + public AjaxResult selectPersonInfo(String epc, String user) { PmBasePersonInfo info = pmBasePersonInfoService.selectPersonInfoByEpc(epc); if (info != null) { + return AjaxResult.success(info); } return AjaxResult.error("未查询到该人员信息"); } + + @PostMapping("/selectPenaltyTypeList") + public AjaxResult selectPenaltyTypeList() { + List pmBasePenaltyTypes = pmBasePenaltyTypeService.selectPmBasePenaltyTypeList(null); + return AjaxResult.success(pmBasePenaltyTypes); + } + + @PostMapping("/insertRrecordPenalty") + public AjaxResult insertRrecordPenalty(@RequestBody PmRecordPenalty pmRecordPenalty) { + + + PmRecordSan recordSan = new PmRecordSan(); + recordSan.setQueryUser(pmRecordPenalty.getCreateBy()); + recordSan.setQueryRfid(pmRecordPenalty.getEpc()); + recordSan.setBasePersonId(pmRecordPenalty.getBasePersonId()); + String checkState = pmRecordPenalty.getCheckState(); + recordSan.setCheckState(checkState); + if (checkState.equals("1")) { + pmRecordPenaltyService.insertPmRecordPenalty(pmRecordPenalty); + } + + return pmRecordSanService.insertPmRecordSan(recordSan) > 0 ? AjaxResult.success() : AjaxResult.error("新增失败"); + } + } diff --git a/ruoyi-pm/src/main/java/com/ruoyi/pm/controller/PmRecordPenaltyController.java b/ruoyi-pm/src/main/java/com/ruoyi/pm/controller/PmRecordPenaltyController.java index 209c61c..cde9293 100644 --- a/ruoyi-pm/src/main/java/com/ruoyi/pm/controller/PmRecordPenaltyController.java +++ b/ruoyi-pm/src/main/java/com/ruoyi/pm/controller/PmRecordPenaltyController.java @@ -111,7 +111,7 @@ public class PmRecordPenaltyController extends BaseController { @Log(title = "处罚记录", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody - public AjaxResult remove(String ids) { - return toAjax(pmRecordPenaltyService.deletePmRecordPenaltyByRecordPenaltyIds(ids)); + public AjaxResult remove(Long ids) { + return toAjax(pmRecordPenaltyService.updatePmRecordPenaltyById(ids)); } } diff --git a/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmBasePenaltyType.java b/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmBasePenaltyType.java index 2391059..b6ee5e6 100644 --- a/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmBasePenaltyType.java +++ b/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmBasePenaltyType.java @@ -28,7 +28,7 @@ public class PmBasePenaltyType extends TreeEntity{ /** 处罚金额 */ @Excel(name = "处罚金额") - private BigDecimal penaltyAmount; + private Double penaltyAmount; /** 类型状态 */ @Excel(name = "类型状态") @@ -64,12 +64,12 @@ public class PmBasePenaltyType extends TreeEntity{ return penaltyInfo; } - public void setPenaltyAmount(BigDecimal penaltyAmount) + public void setPenaltyAmount(Double penaltyAmount) { this.penaltyAmount = penaltyAmount; } - public BigDecimal getPenaltyAmount() + public Double getPenaltyAmount() { return penaltyAmount; } diff --git a/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmRecordPenalty.java b/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmRecordPenalty.java index 98a9dae..28924fb 100644 --- a/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmRecordPenalty.java +++ b/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmRecordPenalty.java @@ -1,9 +1,9 @@ package com.ruoyi.pm.domain; -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; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; /** * 处罚记录对象 pm_record_penalty @@ -11,35 +11,60 @@ import com.ruoyi.common.core.domain.BaseEntity; * @author ruoyi * @date 2025-11-27 */ -public class PmRecordPenalty extends BaseEntity{ +public class PmRecordPenalty extends BaseEntity { private static final long serialVersionUID = 1L; - /** 处罚记录主键 */ + /** + * 处罚记录主键 + */ private Long recordPenaltyId; - /** 处罚类型 */ + /** + * 处罚类型 + */ @Excel(name = "处罚类型") private String penaltyType; - /** 类型编码 */ + /** + * 类型编码 + */ @Excel(name = "类型编码") private String penaltyTypeCode; - /** 处罚说明 */ + /** + * 处罚说明 + */ @Excel(name = "处罚说明") private String penaltyInfo; - /** 处罚金额 */ + /** + * 处罚金额 + */ @Excel(name = "处罚金额") private Double penaltyAmount; - /** 处罚人员 */ + /** + * 处罚人员 + */ @Excel(name = "处罚人员") private Long basePersonId; - /** 处理状态 */ + /** + * 处理状态 + */ @Excel(name = "处理状态") private String processState; + private String epc; + private String checkState; + + + public String getCheckState() { + return checkState; + } + + public void setCheckState(String checkState) { + this.checkState = checkState; + } private PmBasePersonInfo basePersonInfo; @@ -51,90 +76,84 @@ public class PmRecordPenalty extends BaseEntity{ this.basePersonInfo = basePersonInfo; } - public void setRecordPenaltyId(Long recordPenaltyId) - { - this.recordPenaltyId = recordPenaltyId; + public String getEpc() { + return epc; } - public Long getRecordPenaltyId() - { + public void setEpc(String epc) { + this.epc = epc; + } + + public Long getRecordPenaltyId() { return recordPenaltyId; } - public void setPenaltyType(String penaltyType) - { - this.penaltyType = penaltyType; + public void setRecordPenaltyId(Long recordPenaltyId) { + this.recordPenaltyId = recordPenaltyId; } - public String getPenaltyType() - { + public String getPenaltyType() { return penaltyType; } - public void setPenaltyTypeCode(String penaltyTypeCode) - { - this.penaltyTypeCode = penaltyTypeCode; + public void setPenaltyType(String penaltyType) { + this.penaltyType = penaltyType; } - public String getPenaltyTypeCode() - { + public String getPenaltyTypeCode() { return penaltyTypeCode; } - public void setPenaltyInfo(String penaltyInfo) - { - this.penaltyInfo = penaltyInfo; + public void setPenaltyTypeCode(String penaltyTypeCode) { + this.penaltyTypeCode = penaltyTypeCode; } - public String getPenaltyInfo() - { + public String getPenaltyInfo() { return penaltyInfo; } - public void setPenaltyAmount(Double penaltyAmount) - { - this.penaltyAmount = penaltyAmount; + public void setPenaltyInfo(String penaltyInfo) { + this.penaltyInfo = penaltyInfo; } - public Double getPenaltyAmount() - { + public Double getPenaltyAmount() { return penaltyAmount; } - public void setBasePersonId(Long basePersonId) - { - this.basePersonId = basePersonId; + public void setPenaltyAmount(Double penaltyAmount) { + this.penaltyAmount = penaltyAmount; } - public Long getBasePersonId() - { + public Long getBasePersonId() { return basePersonId; } - public void setProcessState(String processState) - { - this.processState = processState; + public void setBasePersonId(Long basePersonId) { + this.basePersonId = basePersonId; } - public String getProcessState() - { + public String getProcessState() { return processState; } + public void setProcessState(String processState) { + this.processState = processState; + } + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("recordPenaltyId", getRecordPenaltyId()) - .append("penaltyType", getPenaltyType()) - .append("penaltyTypeCode", getPenaltyTypeCode()) - .append("penaltyInfo", getPenaltyInfo()) - .append("penaltyAmount", getPenaltyAmount()) - .append("basePersonId", getBasePersonId()) - .append("processState", getProcessState()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("recordPenaltyId", getRecordPenaltyId()) + .append("penaltyType", getPenaltyType()) + .append("penaltyTypeCode", getPenaltyTypeCode()) + .append("penaltyInfo", getPenaltyInfo()) + .append("penaltyAmount", getPenaltyAmount()) + .append("basePersonId", getBasePersonId()) + .append("processState", getProcessState()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); } } diff --git a/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmRecordSan.java b/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmRecordSan.java index 2c62def..3e5f9e9 100644 --- a/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmRecordSan.java +++ b/ruoyi-pm/src/main/java/com/ruoyi/pm/domain/PmRecordSan.java @@ -26,8 +26,10 @@ public class PmRecordSan extends BaseEntity{ private String queryRfid; /** 人员表主键 */ - @Excel(name = "人员表主键") private Long basePersonId; + /** 查询结果 */ + @Excel(name = "查询结果") + private String checkState; private PmBasePersonInfo basePersonInfo; @@ -79,6 +81,14 @@ public class PmRecordSan extends BaseEntity{ return basePersonId; } + public String getCheckState() { + return checkState; + } + + public void setCheckState(String checkState) { + this.checkState = checkState; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-pm/src/main/java/com/ruoyi/pm/service/IPmRecordPenaltyService.java b/ruoyi-pm/src/main/java/com/ruoyi/pm/service/IPmRecordPenaltyService.java index a7ab8ac..fbe72c9 100644 --- a/ruoyi-pm/src/main/java/com/ruoyi/pm/service/IPmRecordPenaltyService.java +++ b/ruoyi-pm/src/main/java/com/ruoyi/pm/service/IPmRecordPenaltyService.java @@ -58,4 +58,6 @@ public interface IPmRecordPenaltyService { * @return 结果 */ public int deletePmRecordPenaltyByRecordPenaltyId(Long recordPenaltyId); + + int updatePmRecordPenaltyById(Long ids); } diff --git a/ruoyi-pm/src/main/java/com/ruoyi/pm/service/impl/PmRecordPenaltyServiceImpl.java b/ruoyi-pm/src/main/java/com/ruoyi/pm/service/impl/PmRecordPenaltyServiceImpl.java index f1495da..630e7ea 100644 --- a/ruoyi-pm/src/main/java/com/ruoyi/pm/service/impl/PmRecordPenaltyServiceImpl.java +++ b/ruoyi-pm/src/main/java/com/ruoyi/pm/service/impl/PmRecordPenaltyServiceImpl.java @@ -90,4 +90,16 @@ public class PmRecordPenaltyServiceImpl implements IPmRecordPenaltyService { public int deletePmRecordPenaltyByRecordPenaltyId(Long recordPenaltyId) { return pmRecordPenaltyMapper.deletePmRecordPenaltyByRecordPenaltyId(recordPenaltyId); } + + @Override + public int updatePmRecordPenaltyById(Long ids) { + + PmRecordPenalty pmRecordPenalty = new PmRecordPenalty(); + pmRecordPenalty.setRecordPenaltyId(ids); + pmRecordPenalty.setUpdateTime(DateUtils.getNowDate()); + pmRecordPenalty.setUpdateBy(ShiroUtils.getLoginName()); + pmRecordPenalty.setProcessState("1"); + + return pmRecordPenaltyMapper.updatePmRecordPenalty(pmRecordPenalty); + } } diff --git a/ruoyi-pm/src/main/resources/mapper/pm/PmRecordPenaltyMapper.xml b/ruoyi-pm/src/main/resources/mapper/pm/PmRecordPenaltyMapper.xml index a80346f..8065b15 100644 --- a/ruoyi-pm/src/main/resources/mapper/pm/PmRecordPenaltyMapper.xml +++ b/ruoyi-pm/src/main/resources/mapper/pm/PmRecordPenaltyMapper.xml @@ -34,7 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" rfid_id, employee_id, people_name, - driver_code + driver_code, + phone_number from pm_record_penalty rp left join pm_base_person_info pbpi on rp.base_person_id = pbpi.base_person_id diff --git a/ruoyi-pm/src/main/resources/mapper/pm/PmRecordSanMapper.xml b/ruoyi-pm/src/main/resources/mapper/pm/PmRecordSanMapper.xml index de2522b..550df41 100644 --- a/ruoyi-pm/src/main/resources/mapper/pm/PmRecordSanMapper.xml +++ b/ruoyi-pm/src/main/resources/mapper/pm/PmRecordSanMapper.xml @@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -26,10 +27,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" rs.create_time, rs.update_by, rs.update_time, + check_state, rfid_id, employee_id, people_name, - driver_code + driver_code, + phone_number from pm_record_san rs left join bgs_personnel_management.pm_base_person_info pbpi on rs.base_person_id = pbpi.base_person_id @@ -57,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, update_by, update_time, + check_state, #{queryUser}, @@ -66,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createTime}, #{updateBy}, #{updateTime}, + #{checkState}, diff --git a/ruoyi-pm/src/main/resources/templates/pm/record_penalty/record_penalty.html b/ruoyi-pm/src/main/resources/templates/pm/record_penalty/record_penalty.html index ed7fa78..4790fe5 100644 --- a/ruoyi-pm/src/main/resources/templates/pm/record_penalty/record_penalty.html +++ b/ruoyi-pm/src/main/resources/templates/pm/record_penalty/record_penalty.html @@ -28,7 +28,8 @@
  • - -
  • - - 修改 - - 删除 - + + + + 导出 @@ -89,6 +91,8 @@ removeUrl: prefix + "/remove", exportUrl: prefix + "/export", modalName: "处罚记录", + sortName: "createTime", + sortOrder: "desc", columns: [{ checkbox: true }, @@ -167,13 +171,32 @@ formatter: function (value, row, index) { var actions = []; actions.push('编辑 '); - actions.push('删除'); + actions.push('处理罚款'); return actions.join(''); } }] }; $.table.init(options); }); + + function updatePmRecordPenaltyById( recordPenaltyId, processState) { + if (processState === '1') { + $.modal.alertWarning('该记录已处理,不能重复处理!'); + return + } + $.modal.confirm("确定处理该条" + table.options.modalName + "信息吗?", function () { + // var url = : table.options.removeUrl.replace("{id}", id); + + $.operate.submit(table.options.removeUrl, "post", "json", {ids:recordPenaltyId}); + + }); + + // $.operate.confirm('确认处理罚款吗?', function (result) { + // if (result) { + // + // } + // }); + } \ No newline at end of file diff --git a/ruoyi-pm/src/main/resources/templates/pm/record_san/record_san.html b/ruoyi-pm/src/main/resources/templates/pm/record_san/record_san.html index 3434f3d..24ae7b7 100644 --- a/ruoyi-pm/src/main/resources/templates/pm/record_san/record_san.html +++ b/ruoyi-pm/src/main/resources/templates/pm/record_san/record_san.html @@ -54,6 +54,7 @@