diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaPartTypeController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaPartTypeController.java index 779cbb66..ab00d0a8 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaPartTypeController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaPartTypeController.java @@ -23,7 +23,7 @@ import java.util.List; * @since 2023-11-27 16:44:02 */ @RestController -@RequestMapping("maPartType") +@RequestMapping("/maPartType") public class MaPartTypeController extends BaseController { /** * 服务对象 @@ -37,11 +37,11 @@ public class MaPartTypeController extends BaseController { * @return */ @GetMapping("/list") - public TableDataInfo list(MaPartType maPartType) + public AjaxResult list(MaPartType maPartType) { startPage(); List list = maPartTypeService.selectMaPartList(maPartType); - return getDataTable(list); + return AjaxResult.success(list); } /** diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseCheckInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseCheckInfoController.java index 2cd4bdf8..7120bd09 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseCheckInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseCheckInfoController.java @@ -102,7 +102,6 @@ public class PurchaseCheckInfoController extends BaseController * 验收通知 */ @ApiOperation("验收通知") - @Log(title = "验收通知", businessType = BusinessType.INSERT) @PostMapping("/bmNoticeInfo") public AjaxResult bmNoticeInfo(@RequestBody NoticeInfoVO noticeInfoVO) throws Exception { return toAjax(purchaseCheckInfoService.insertBmNoticeInfo(noticeInfoVO)); diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseCheckDetails.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseCheckDetails.java index eb26f2a0..87597a11 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseCheckDetails.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseCheckDetails.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.material.domain; +import java.math.BigDecimal; import java.util.Date; import com.bonus.sgzb.common.core.web.domain.BaseEntity; @@ -40,7 +41,7 @@ public class PurchaseCheckDetails extends BaseEntity /** 验收数量 */ @ApiModelProperty(value = "验收数量") - private Long checkNum; + private BigDecimal checkNum; /** 验收结论 */ @ApiModelProperty(value = "验收结论") @@ -65,7 +66,7 @@ public class PurchaseCheckDetails extends BaseEntity /** 入库数量 */ @ApiModelProperty(value = "入库数量") - private double inputNum; + private BigDecimal inputNum; /** 验收图片 */ @ApiModelProperty(value = "验收图片") @@ -96,6 +97,12 @@ public class PurchaseCheckDetails extends BaseEntity @ApiModelProperty(value = "机具类型名称") private String machineTypeName; + @ApiModelProperty(value = "管理方式(0编号 1计数)") + private String manageType; + + @ApiModelProperty(value = "采购单号") + private String code; + public void setTaskId(Long taskId) { this.taskId = taskId; @@ -184,11 +191,11 @@ public class PurchaseCheckDetails extends BaseEntity this.supplier = supplier; } - public Long getCheckNum() { + public BigDecimal getCheckNum() { return checkNum; } - public void setCheckNum(Long checkNum) { + public void setCheckNum(BigDecimal checkNum) { this.checkNum = checkNum; } @@ -248,14 +255,30 @@ public class PurchaseCheckDetails extends BaseEntity this.machineTypeName = machineTypeName; } - public double getInputNum() { + public BigDecimal getInputNum() { return inputNum; } - public void setInputNum(double inputNum) { + public void setInputNum(BigDecimal inputNum) { this.inputNum = inputNum; } + public String getManageType() { + return manageType; + } + + public void setManageType(String manageType) { + this.manageType = manageType; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseCheckDetailsMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseCheckDetailsMapper.java index c4146e50..2c21ef7f 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseCheckDetailsMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseCheckDetailsMapper.java @@ -69,4 +69,6 @@ public interface PurchaseCheckDetailsMapper { int selectPurchaseCheckDetailsStatus(Long taskId); int deleteCheckDetailsByTaskId(Long taskId); + + int updateByTaskIdTypeId(PurchaseCheckDetails purchaseCheckDetails); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java index 211e2f57..bc05c9b8 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java @@ -2,6 +2,7 @@ package com.bonus.sgzb.material.mapper; import com.alibaba.fastjson.JSONObject; import com.bonus.sgzb.base.api.domain.MaMachine; +import com.bonus.sgzb.base.api.domain.MaType; import com.bonus.sgzb.material.domain.MaInputRecord; import com.bonus.sgzb.material.domain.PurchaseMacodeInfo; import org.apache.ibatis.annotations.Mapper; @@ -81,4 +82,11 @@ public interface PurchaseMacodeInfoMapper { Integer selectMacodeInfoStatusByTaskId(Long taskId); int insertMaInputRecord(MaInputRecord maInputRecord); + + MaType selectTypeByTypeId(Long typeId); + + int updateTypeByTypeId(MaType maType); + + int updateMaMachine(MaMachine maMachine); + } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/TaskMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/TaskMapper.java index 4eba5285..907cc736 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/TaskMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/TaskMapper.java @@ -3,22 +3,22 @@ package com.bonus.sgzb.material.mapper; import com.bonus.sgzb.base.api.domain.TmTask; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; /** * 任务tm_taskMapper接口 - * + * * @author bonus * @date 2023-12-13 */ @Mapper -public interface TaskMapper -{ +public interface TaskMapper { /** * 查询任务tm_task - * + * * @param taskId 任务tm_task主键 * @return 任务tm_task */ @@ -26,7 +26,7 @@ public interface TaskMapper /** * 查询任务tm_task列表 - * + * * @param tmTask 任务tm_task * @return 任务tm_task集合 */ @@ -34,7 +34,7 @@ public interface TaskMapper /** * 新增任务tm_task - * + * * @param tmTask 任务tm_task * @return 结果 */ @@ -42,7 +42,7 @@ public interface TaskMapper /** * 修改任务tm_task - * + * * @param tmTask 任务tm_task * @return 结果 */ @@ -50,7 +50,7 @@ public interface TaskMapper /** * 删除任务tm_task - * + * * @param taskId 任务tm_task主键 * @return 结果 */ @@ -58,11 +58,11 @@ public interface TaskMapper /** * 批量删除任务tm_task - * + * * @param taskIds 需要删除的数据主键集合 * @return 结果 */ public int deleteTmTaskByTaskIds(Long[] taskIds); - int selectTaskNumByMonth(Date date); + int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckDetailsServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckDetailsServiceImpl.java index d092ed37..292138be 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckDetailsServiceImpl.java @@ -79,10 +79,12 @@ public class PurchaseCheckDetailsServiceImpl implements IPurchaseCheckDetailsSer if ("通过".equals(purchaseCheckDetails.getCheckResult())) { purchaseCheckDetails.setStatus(1); // 通过之后往编码管理表里回填数据 - PurchaseMacodeInfo macodeInfo = new PurchaseMacodeInfo(); - macodeInfo.setTypeId(purchaseCheckDetails.getTypeId()); - macodeInfo.setTaskId(taskId); - macodeInfoService.insertPurchaseMacodeInfo(macodeInfo); + if ("0".equals(purchaseCheckDetails.getManageType())) { + PurchaseMacodeInfo macodeInfo = new PurchaseMacodeInfo(); + macodeInfo.setTypeId(purchaseCheckDetails.getTypeId()); + macodeInfo.setTaskId(taskId); + macodeInfoService.insertPurchaseMacodeInfo(macodeInfo); + } } else if ("不通过".equals(purchaseCheckDetails.getCheckResult())) { purchaseCheckDetails.setStatus(0); } else { diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java index 2a1e8ed1..39a86375 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java @@ -134,7 +134,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date nowDate = DateUtils.getNowDate(); String format = dateFormat.format(nowDate); - int taskNum = taskMapper.selectTaskNumByMonth(nowDate) + 1; + int taskNum = taskMapper.selectTaskNumByMonth(nowDate,23) + 1; String code = "XG" + format + "-000" + taskNum; return code; } @@ -205,7 +205,11 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService TmTask task = new TmTask(); Long taskId = noticeInfoVO.getTaskId(); if (taskId == null) { - throw new Exception("任务taskId为空"); + throw new Exception("任务taskId为空!!"); + } + TmTask task1 = taskMapper.selectTmTaskByTaskId(taskId); + if (task1.getTaskStatus() != 24) { + throw new Exception("任务状态不为待通知!!"); } task.setTaskId(taskId); task.setTaskStatus(25); @@ -218,11 +222,15 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService if (bmNoticeInfoList.size() <= 0) { throw new Exception("绑定用户为空"); } - Boolean send = false; + Boolean send = true; for (BmNoticeInfo bmNoticeInfo : bmNoticeInfoList) { + bmNoticeInfo.setContent(message); + bmNoticeInfo.setTaskId(taskId); + bmNoticeInfo.setModelName("新购机具验收"); + bmNoticeInfo.setCreateTime(new Date()); String phone = bmNoticeInfo.getPhone(); // 短信通知 - send = remoteUserService.send(phone, message); +// send = remoteUserService.send(phone, message); purchaseCheckInfoMapper.insertBmNoticeInfo(bmNoticeInfo); } return send; diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java index c9fa602a..89b11168 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.material.service.impl; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -7,13 +8,13 @@ import java.util.List; import com.alibaba.fastjson.JSONObject; import com.bonus.sgzb.base.api.domain.MaMachine; +import com.bonus.sgzb.base.api.domain.MaType; import com.bonus.sgzb.base.api.domain.TmTask; import com.bonus.sgzb.material.domain.BmQrcodeInfo; import com.bonus.sgzb.material.domain.MaInputRecord; +import com.bonus.sgzb.material.domain.PurchaseCheckDetails; import com.bonus.sgzb.material.domain.PurchaseMacodeInfo; -import com.bonus.sgzb.material.mapper.BmQrcodeInfoMapper; -import com.bonus.sgzb.material.mapper.PurchaseMacodeInfoMapper; -import com.bonus.sgzb.material.mapper.TaskMapper; +import com.bonus.sgzb.material.mapper.*; import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService; import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.material.vo.EquipmentNumberVO; @@ -39,6 +40,9 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService @Resource private BmQrcodeInfoMapper qrcodeInfoMapper; + @Resource + private PurchaseCheckDetailsMapper checkDetailsMapper; + /** @@ -197,10 +201,30 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService @Override public int modifyManageStatus(MaInputRecord maInputRecord) { Long taskId = maInputRecord.getTaskId(); + Long typeId = maInputRecord.getTypeId(); String checkResult = maInputRecord.getCheckResult(); List maCodeInfoIdList = maInputRecord.getMaCodeInfoIdList(); // 修改编码管理的入库状态 for (Long maCodeInfoId : maCodeInfoIdList) { + MaType maType = purchaseMacodeInfoMapper.selectTypeByTypeId(typeId); + // 库存添加 + maType.setNum(String.valueOf(maInputRecord.getInputNum().add(new BigDecimal(Integer.parseInt(maType.getNum()))))); + purchaseMacodeInfoMapper.updateTypeByTypeId(maType); + + // 修改机具入库状态 + MaMachine maMachine = new MaMachine(); + maMachine.setMaId(maInputRecord.getMaId()); + maMachine.setMaStatus("15"); + purchaseMacodeInfoMapper.updateMaMachine(maMachine); + + // 修改验收任务详细表入库数量 + PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails(); + purchaseCheckDetails.setTaskId(taskId); + purchaseCheckDetails.setTypeId(typeId); + purchaseCheckDetails.setInputNum(maInputRecord.getInputNum()); + checkDetailsMapper.updateByTaskIdTypeId(purchaseCheckDetails); + + // 修改编码管理表入库状态 PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo(); purchaseMacodeInfo.setId(maCodeInfoId); purchaseMacodeInfo.setTaskId(taskId); @@ -210,6 +234,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService purchaseMacodeInfoMapper.insertMaInputRecord(maInputRecord); } + // 当全部为已入库的时候任务改为入库状态 Integer count = purchaseMacodeInfoMapper.selectMacodeInfoStatusByTaskId(taskId); if (count <= 0) { TmTask task = new TmTask(); diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckDetailsMapper.xml index 023fa9df..2bdc9a6c 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckDetailsMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckDetailsMapper.xml @@ -35,11 +35,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select pcd.id,pcd.task_id, pcd.type_id, pcd.purchase_price, pcd.purchase_num, pcd.check_num, pcd.check_result, pcd.supplier_id, pcd.status, msi.supplier, pcd.create_by, pcd.production_time, pcd.create_time, pcd.check_url_name, pcd.check_url, pcd.file_name, pcd.file_url,pcd.update_by, pcd.update_time, pcd.remark, pcd.company_id, - mt1.type_name machineTypeName,mt.type_name specificationType + mt1.type_name machineTypeName,mt.type_name specificationType, mt.manage_type manageType, tk.code from purchase_check_details pcd left join ma_type mt on pcd.type_id = mt.type_id left join ma_type mt1 on mt.parent_id = mt1.type_id left join ma_supplier_info msi on pcd.supplier_id = msi.supplier_id + left join tm_task tk on pcd.task_id = tk.task_id and pcd.task_id = #{taskId} and pcd.type_id = #{typeId} @@ -198,4 +199,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from purchase_check_details where task_id = #{taskId} + + + update purchase_check_details set check_num = #{checkNum} where task_id = #{taskId} and type_id = #{typeId} + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml index 9555e981..c6140813 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml @@ -37,8 +37,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml index 6cb0d5f6..b6474fc8 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml @@ -227,4 +227,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{companyId}, + + + + + update ma_type set num = #{num} where type_id = #{typeId} + + + + update ma_machine set ma_status = #{maStatus} where ma_id = #{maId} + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TaskMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TaskMapper.xml index e5445d43..156bab49 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TaskMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/TaskMapper.xml @@ -90,6 +90,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" \ No newline at end of file diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/PurchaseNoticePersonController.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/PurchaseNoticePersonController.java new file mode 100644 index 00000000..3ef7e9ba --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/PurchaseNoticePersonController.java @@ -0,0 +1,71 @@ +package com.bonus.sgzb.system.controller; + +import java.util.List; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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.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.bonus.sgzb.common.log.annotation.Log; +import com.bonus.sgzb.common.log.enums.BusinessType; +import com.bonus.sgzb.common.security.annotation.RequiresPermissions; +import com.bonus.sgzb.system.domain.PurchaseNoticePerson; +import com.bonus.sgzb.system.service.IPurchaseNoticePersonService; +import com.bonus.sgzb.common.core.web.controller.BaseController; +import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.common.core.web.page.TableDataInfo; + +/** + * 新购短信通知人员 + * + * @author bonus + * @date 2023-12-16 + */ +@RestController +@Api(value = "新购短信通知人员") +@RequestMapping("/person") +public class PurchaseNoticePersonController extends BaseController +{ + @Autowired + private IPurchaseNoticePersonService purchaseNoticePersonService; + + /** + * 查询新购短信通知人员列表 + */ + @ApiOperation("查询新购短信通知人员") + @GetMapping("/list") + public AjaxResult list(PurchaseNoticePerson purchaseNoticePerson) + { + List list = purchaseNoticePersonService.selectPurchaseNoticePersonList(purchaseNoticePerson); + return AjaxResult.success(list); + } + + + /** + * 新增新购短信通知人员purchase_notice_person + */ + @ApiOperation(value ="新增新购短信通知人员") + @Log(title = "新购短信通知人员", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PurchaseNoticePerson purchaseNoticePerson) + { + return toAjax(purchaseNoticePersonService.insertPurchaseNoticePerson(purchaseNoticePerson)); + } + + /** + * 删除新购短信通知人员 + */ + @RequiresPermissions("删除新购短信通知人员") + @Log(title = "删除新购短信通知人员", businessType = BusinessType.DELETE) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) + { + return toAjax(purchaseNoticePersonService.deletePurchaseNoticePersonById(id)); + } +} diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/PurchaseNoticePerson.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/PurchaseNoticePerson.java new file mode 100644 index 00000000..a1ed164b --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/PurchaseNoticePerson.java @@ -0,0 +1,115 @@ +package com.bonus.sgzb.system.domain; + +import com.bonus.sgzb.common.core.web.domain.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 新购短信通知人员对象 + * + * @author bonus + * @date 2023-12-16 + */ +public class PurchaseNoticePerson extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 用户id */ + @ApiModelProperty(value = "用户id") + private Long userId; + + /** 用户名称 */ + @ApiModelProperty(value = "用户名称") + private String userName; + + /** 手机号 */ + @ApiModelProperty(value = "手机号") + private String telphone; + + /** 用户角色 */ + @ApiModelProperty(value = "用户角色") + private String roleName; + + /** 用户角色 */ + @ApiModelProperty(value = "用户角色Id") + private Long roleId; + + /** 所属机构名称 */ + @ApiModelProperty(value = "所属机构名称") + private String deptName; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setUserId(Long userId) + { + this.userId = userId; + } + + public Long getUserId() + { + return userId; + } + public void setUserName(String userName) + { + this.userName = userName; + } + + public String getUserName() + { + return userName; + } + public void setTelphone(String telphone) + { + this.telphone = telphone; + } + + public String getTelphone() + { + return telphone; + } + + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("userId", getUserId()) + .append("userName", getUserName()) + .append("telphone", getTelphone()) + .toString(); + } +} diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/PurchaseNoticePersonMapper.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/PurchaseNoticePersonMapper.java new file mode 100644 index 00000000..1df292e0 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/PurchaseNoticePersonMapper.java @@ -0,0 +1,63 @@ +package com.bonus.sgzb.system.mapper; + +import java.util.List; +import com.bonus.sgzb.system.domain.PurchaseNoticePerson; +import org.apache.ibatis.annotations.Mapper; + +/** + * 新购短信通知人员purchase_notice_personMapper接口 + * + * @author bonus + * @date 2023-12-16 + */ +@Mapper +public interface PurchaseNoticePersonMapper +{ + /** + * 查询新购短信通知人员purchase_notice_person + * + * @param id 新购短信通知人员purchase_notice_person主键 + * @return 新购短信通知人员purchase_notice_person + */ + public PurchaseNoticePerson selectPurchaseNoticePersonById(Long id); + + /** + * 查询新购短信通知人员purchase_notice_person列表 + * + * @param purchaseNoticePerson 新购短信通知人员purchase_notice_person + * @return 新购短信通知人员purchase_notice_person集合 + */ + public List selectPurchaseNoticePersonList(PurchaseNoticePerson purchaseNoticePerson); + + /** + * 新增新购短信通知人员purchase_notice_person + * + * @param purchaseNoticePerson 新购短信通知人员purchase_notice_person + * @return 结果 + */ + public int insertPurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson); + + /** + * 修改新购短信通知人员purchase_notice_person + * + * @param purchaseNoticePerson 新购短信通知人员purchase_notice_person + * @return 结果 + */ + public int updatePurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson); + + /** + * 删除新购短信通知人员purchase_notice_person + * + * @param id 新购短信通知人员purchase_notice_person主键 + * @return 结果 + */ + public int deletePurchaseNoticePersonById(Long id); + + /** + * 批量删除新购短信通知人员purchase_notice_person + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePurchaseNoticePersonByIds(Long[] ids); +} diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/PurchaseNoticePersonServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/PurchaseNoticePersonServiceImpl.java new file mode 100644 index 00000000..ec623671 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/PurchaseNoticePersonServiceImpl.java @@ -0,0 +1,95 @@ +package com.bonus.sgzb.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.bonus.sgzb.system.mapper.PurchaseNoticePersonMapper; +import com.bonus.sgzb.system.domain.PurchaseNoticePerson; +import com.bonus.sgzb.system.service.IPurchaseNoticePersonService; + +/** + * 新购短信通知人员purchase_notice_personService业务层处理 + * + * @author bonus + * @date 2023-12-16 + */ +@Service +public class PurchaseNoticePersonServiceImpl implements IPurchaseNoticePersonService +{ + @Autowired + private PurchaseNoticePersonMapper purchaseNoticePersonMapper; + + /** + * 查询新购短信通知人员purchase_notice_person + * + * @param id 新购短信通知人员purchase_notice_person主键 + * @return 新购短信通知人员purchase_notice_person + */ + @Override + public PurchaseNoticePerson selectPurchaseNoticePersonById(Long id) + { + return purchaseNoticePersonMapper.selectPurchaseNoticePersonById(id); + } + + /** + * 查询新购短信通知人员purchase_notice_person列表 + * + * @param purchaseNoticePerson 新购短信通知人员purchase_notice_person + * @return 新购短信通知人员purchase_notice_person + */ + @Override + public List selectPurchaseNoticePersonList(PurchaseNoticePerson purchaseNoticePerson) + { + List purchaseNoticePeople = purchaseNoticePersonMapper.selectPurchaseNoticePersonList(purchaseNoticePerson); + + return purchaseNoticePeople; + } + + /** + * 新增新购短信通知人员purchase_notice_person + * + * @param purchaseNoticePerson 新购短信通知人员purchase_notice_person + * @return 结果 + */ + @Override + public int insertPurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson) + { + return purchaseNoticePersonMapper.insertPurchaseNoticePerson(purchaseNoticePerson); + } + + /** + * 修改新购短信通知人员purchase_notice_person + * + * @param purchaseNoticePerson 新购短信通知人员purchase_notice_person + * @return 结果 + */ + @Override + public int updatePurchaseNoticePerson(PurchaseNoticePerson purchaseNoticePerson) + { + return purchaseNoticePersonMapper.updatePurchaseNoticePerson(purchaseNoticePerson); + } + + /** + * 批量删除新购短信通知人员purchase_notice_person + * + * @param ids 需要删除的新购短信通知人员purchase_notice_person主键 + * @return 结果 + */ + @Override + public int deletePurchaseNoticePersonByIds(Long[] ids) + { + return purchaseNoticePersonMapper.deletePurchaseNoticePersonByIds(ids); + } + + /** + * 删除新购短信通知人员purchase_notice_person信息 + * + * @param id 新购短信通知人员purchase_notice_person主键 + * @return 结果 + */ + @Override + public int deletePurchaseNoticePersonById(Long id) + { + return purchaseNoticePersonMapper.deletePurchaseNoticePersonById(id); + } +} diff --git a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/PurchaseNoticePersonMapper.xml b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/PurchaseNoticePersonMapper.xml new file mode 100644 index 00000000..b206e6a5 --- /dev/null +++ b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/PurchaseNoticePersonMapper.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + select id, user_id, user_name, telphone from purchase_notice_person + + + + + + + + insert into purchase_notice_person + + id, + user_id, + user_name, + telphone, + + + #{id}, + #{userId}, + #{userName}, + #{telphone}, + + + + + update purchase_notice_person + + user_id = #{userId}, + user_name = #{userName}, + telphone = #{telphone}, + + where id = #{id} + + + + delete from purchase_notice_person where id = #{id} + + + + delete from purchase_notice_person where id in + + #{id} + + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysUserMapper.xml b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysUserMapper.xml index 3f66ea12..91d6c5ec 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -228,6 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark from sys_user u - where u.status = '0' and u.del_flag = '0' + left join sys_user_role sur on u.user_id = sur.user_id + where u.status = '0' and u.del_flag = '0' and sur.role_id = #{roleId} \ No newline at end of file