diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmNoticeUserController.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmNoticeUserController.java new file mode 100644 index 0000000..9fa5283 --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmNoticeUserController.java @@ -0,0 +1,97 @@ +package com.bonus.purchase.controller; +import com.bonus.common.core.domain.ResultBean; +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.page.TableDataInfo; +import com.bonus.purchase.domain.BpmNoticeUser; +import com.bonus.purchase.service.impl.BpmNoticeUserService; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.validation.Valid; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** +* 短信人员(bpm_notice_user)表控制层 +* +* @author 阮世耀 +*/ +@RestController +@RequestMapping("/notice") +public class BpmNoticeUserController extends BaseController { + + /** + * 服务对象 + */ + @Autowired + private BpmNoticeUserService bpmNoticeUserService; + + + /** + * 分页查询数据 + */ + @GetMapping(value = "/list") + public TableDataInfo getList(BpmNoticeUser bpmNoticeUser) { + startPage(); + List list = this.bpmNoticeUserService.selectAll(); + return getDataTable(list); + } + + /** + * 根据任务ID查询数据 + */ + @GetMapping(value = "/listByTaskId/{taskId}") + public ResultBean getListByTaskId(@PathVariable("taskId") Integer taskId) { + List list = this.bpmNoticeUserService.selectByTaskId(taskId); + return ResultBean.success(list); + } + + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResultBean queryById(@PathVariable("id") Integer id) { + return ResultBean.success(this.bpmNoticeUserService.selectByPrimaryKey(id)); + } + + /** + * 新增数据 + * + * @param bpmNoticeUser 实体 + * @return 新增结果 + */ + @PostMapping(value = "/add") + public ResultBean< Boolean> add(@RequestBody @NotNull @Valid BpmNoticeUser bpmNoticeUser) { + this.bpmNoticeUserService.insertSelective(bpmNoticeUser); + return ResultBean.success(true); + } + + /** + * 编辑数据 + * + * @param bpmNoticeUser 实体 + * @return 编辑结果 + */ + @PutMapping(value = "/update") + public ResultBean< Boolean> edit(@RequestBody @NotNull @Valid BpmNoticeUser bpmNoticeUser) { + this.bpmNoticeUserService.updateByPrimaryKeySelective(bpmNoticeUser); + return ResultBean.success(true); + } + + /** + * 删除数据 + * + * @param id 主键 + * @return 删除是否成功 + */ + @DeleteMapping(value = "/delete/{id}") + public ResultBean< Boolean> deleteById(@PathVariable("id") Integer id) { + this.bpmNoticeUserService.deleteByPrimaryKey(id); + return ResultBean.success(true); + } +} diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmPurchaseInfoController.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmPurchaseInfoController.java index 332f111..f41b50b 100644 --- a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmPurchaseInfoController.java +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmPurchaseInfoController.java @@ -4,7 +4,9 @@ import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.page.TableDataInfo; import com.bonus.common.security.annotation.RequiresPermissions; import com.bonus.purchase.domain.BpmPurchaseInfo; +import com.bonus.purchase.dto.PurchaseTaskDto; import com.bonus.purchase.service.impl.BpmPurchaseInfoService; +import org.apache.poi.ss.formula.functions.T; import org.springframework.web.bind.annotation.*; import org.springframework.beans.factory.annotation.Autowired; @@ -13,13 +15,14 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import javax.validation.constraints.Positive; import java.util.List; +import java.util.Map; /** * 新购到货验收表(bpm_purchase_info)控制层 * @author 阮世耀 */ @RestController -@RequestMapping("/bpm_purchase_info") +@RequestMapping("/arrival") public class BpmPurchaseInfoController extends BaseController { /** @@ -40,6 +43,24 @@ public class BpmPurchaseInfoController extends BaseController { return getDataTable(list); } + /** + * ElementPlus级联选择器数据接口--获取设备类型 + */ + @GetMapping(value = "/cascader") + public ResultBean>> getCascaderData() { + return ResultBean.success(this.bpmPurchaseInfoService.getCascaderData()); + } + + /** + * ElementPlus级联选择器数据接口--根据id查询节点的父级信息 + */ + @GetMapping(value = "/cascaderById") + public ResultBean getCascaderDataById(@RequestParam("id") + @NotNull(message = "ID不能为空") + @Positive(message = "ID必须为正整数") Integer id) { + return ResultBean.success(this.bpmPurchaseInfoService.selectMaTypeById(id)); + } + /** * 通过主键查询单条数据 @@ -58,14 +79,13 @@ public class BpmPurchaseInfoController extends BaseController { /** * 新增数据---批量导入 * - * @param items 新购设备列表 + * @param purchaseTaskDto 新购设备DTO * @return 新增结果 */ @PostMapping(value = "/add") @RequiresPermissions("purchase:bpmPurchaseInfo:add") - public ResultBean< Boolean> add(@RequestBody @Valid @NotEmpty List items) { - this.bpmPurchaseInfoService.insertList(items); - return ResultBean.success(true); + public ResultBean add(@RequestBody PurchaseTaskDto purchaseTaskDto) { + return ResultBean.toIsSuccess(this.bpmPurchaseInfoService.insertList(purchaseTaskDto)); } /** diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmTaskController.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmTaskController.java new file mode 100644 index 0000000..6a0b131 --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/BpmTaskController.java @@ -0,0 +1,86 @@ +package com.bonus.purchase.controller; +import com.bonus.common.core.domain.ResultBean; +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.page.TableDataInfo; +import com.bonus.purchase.domain.BpmTask; +import com.bonus.purchase.service.impl.BpmTaskService; +import org.springframework.web.bind.annotation.*; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** +* bpm_task任务表:新购任务、领料任务、退料任务、维修任务、报废任务、入库任务(bpm_task)表控制层 +* +* @author 阮世耀 +*/ +@RestController +@RequestMapping("/task") +public class BpmTaskController extends BaseController { + + /** + * 服务对象 + */ + @Autowired + private BpmTaskService bpmTaskService; + + + /** + * 分页查询数据 + + @GetMapping(value = "/list") + public TableDataInfo getList(BpmTask bpmTask) { + startPage(); + List list = this.bpmTaskService.selectAll(bpmTask); + return getDataTable(list); + }*/ + + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResultBean queryById(@PathVariable("id") Integer id) { + return ResultBean.success(this.bpmTaskService.selectByPrimaryKey(id)); + } + + /** + * 新增数据 + * + * @param bpmTask 实体 + * @return 新增结果 + */ + @PostMapping(value = "/add") + public ResultBean< Boolean> add(@NotNull @RequestBody BpmTask bpmTask) { + this.bpmTaskService.insertSelective(bpmTask); + return ResultBean.success(true); + } + + /** + * 编辑数据 + * + * @param bpmTask 实体 + * @return 编辑结果 + */ + @PutMapping(value = "/update") + public ResultBean< Boolean> edit(@NotNull @RequestBody BpmTask bpmTask) { + this.bpmTaskService.updateByPrimaryKeySelective(bpmTask); + return ResultBean.success(true); + } + + /** + * 删除数据 + * + * @param id 主键 + * @return 删除是否成功 + */ + @DeleteMapping(value = "/delete/{id}") + public ResultBean< Boolean> deleteById(@PathVariable("id") Integer id) { + this.bpmTaskService.deleteByPrimaryKey(id); + return ResultBean.success(true); + } +} diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/PurchaseAcceptController.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/PurchaseAcceptController.java index f24245f..8d73524 100644 --- a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/PurchaseAcceptController.java +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/controller/PurchaseAcceptController.java @@ -4,7 +4,7 @@ import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.page.TableDataInfo; import com.bonus.common.security.annotation.RequiresPermissions; -import com.bonus.purchase.domain.PurchaseDto; +import com.bonus.purchase.dto.PurchaseDto; import com.bonus.purchase.service.PurchaseAcceptService; import com.bonus.purchase.vo.PurchaseVo; import io.swagger.annotations.ApiOperation; diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/BpmNoticeUser.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/BpmNoticeUser.java new file mode 100644 index 0000000..b7d239a --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/BpmNoticeUser.java @@ -0,0 +1,53 @@ +package com.bonus.purchase.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + + +/** + * 短信人员bpm_notice_user + * @author 阮世耀 + */ +@ApiModel(description="短信人员bpm_notice_user") +@Data +public class BpmNoticeUser implements Serializable { + + @ApiModelProperty(value="id") + private Integer id; + + @ApiModelProperty(value="用户ID") + @NotNull(message = "用户ID不能为空") + private Integer userId; + + @ApiModelProperty(value="用户名") + private String userName; + + @ApiModelProperty(value="用户角色") + private String userRole; + + /** + * 任务ID + */ + @ApiModelProperty(value="任务ID") + @NotNull(message = "任务ID不能为空") + private Integer taskId; + + @ApiModelProperty(value="手机号") + @NotBlank(message = "手机号不能为空") + @Size(min = 11, max = 11, message = "手机号长度必须为11位") + private String phone; + + /** + * 类型 1:新购 + */ + @ApiModelProperty(value="类型") + private String type; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/BpmTask.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/BpmTask.java new file mode 100644 index 0000000..fbf789c --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/BpmTask.java @@ -0,0 +1,114 @@ +package com.bonus.purchase.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + *@PackagePath: com.bonus.purchase + *@author : 阮世耀 + *@CreateTime: 2024-08-20 16:51 + *@Description: 描述 + *@version : 1.0 +*/ +/** + * bpm_task任务表:新购任务、领料任务、退料任务、维修任务、报废任务、入库任务 + */ +@ApiModel(description="bpm_task任务表:新购任务、领料任务、退料任务、维修任务、报废任务、入库任务") +@Data +public class BpmTask implements Serializable { + + @ApiModelProperty(value="id") + private Integer id; + + /** + * 模块id + */ + @ApiModelProperty(value="模块id") + private Integer definitionId; + + /** + * 上级id + */ + @ApiModelProperty(value="上级id") + private Integer parentId; + + /** + * 编号 + */ + @ApiModelProperty(value="编号") + private String code; + + /** + * 状态(关联数据字典) + */ + @ApiModelProperty(value="状态(关联数据字典)") + private Integer status; + + /** + * 到货时间 + */ + @ApiModelProperty(value="到货时间") + private Date arrivalTime; + + /** + * 创建人 + */ + @ApiModelProperty(value="创建人") + private String creator; + + /** + * 创建时间 + */ + @ApiModelProperty(value="创建时间") + private Date createTime; + + /** + * 审核人 + */ + @ApiModelProperty(value="审核人") + private Integer auditor; + + /** + * 审核时间 + */ + @ApiModelProperty(value="审核时间") + private Date auditTime; + + /** + * 备注 + */ + @ApiModelProperty(value="备注") + private String remark; + + /** + * 协议id(讨论一下是否放到任务表中,还是建立关联表) + */ + @ApiModelProperty(value="协议id(讨论一下是否放到任务表中,还是建立关联表)") + private Integer agreementId; + + /** + * 领料/退料人 + */ + @ApiModelProperty(value="领料/退料人") + private String linkMan; + + /** + * 联系方式 + */ + @ApiModelProperty(value="联系方式") + private String phone; + + /** + * 数据所属 + */ + @ApiModelProperty(value="数据所属") + private Integer companyId; + + @ApiModelProperty(value="是否启用") + private Byte isActive; + + private static final long serialVersionUID = -5914900302805893744L; +} \ No newline at end of file diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/PurchaseDto.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/dto/PurchaseDto.java similarity index 95% rename from bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/PurchaseDto.java rename to bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/dto/PurchaseDto.java index a915cc7..f7d6078 100644 --- a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/domain/PurchaseDto.java +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/dto/PurchaseDto.java @@ -1,4 +1,4 @@ -package com.bonus.purchase.domain; +package com.bonus.purchase.dto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/dto/PurchaseTaskDto.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/dto/PurchaseTaskDto.java new file mode 100644 index 0000000..90ace89 --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/dto/PurchaseTaskDto.java @@ -0,0 +1,40 @@ +package com.bonus.purchase.dto; + +import com.bonus.purchase.domain.BpmPurchaseInfo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author : 阮世耀 + * @version : 1.0 + * 2024-08-20 17:12 + * 新购任务创建DTO、包含任务信息及新购设备信息 + */ +@Data +public class PurchaseTaskDto implements Serializable { + + @ApiModelProperty(value="到货时间") + private Date arrivalTime; + + @ApiModelProperty(value="备注") + private String remark; + + @ApiModelProperty(value="协议id(讨论一下是否放到任务表中,还是建立关联表)") + private Integer agreementId; + + @ApiModelProperty(value="领料/退料人") + private String linkMan; + + @ApiModelProperty(value="联系方式") + private String phone; + + @ApiModelProperty(value="数据所属") + private Integer companyId; + + @ApiModelProperty(value="新购设备信息列表") + private List bpmPurchaseDetailsList; +} diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmNoticeUserMapper.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmNoticeUserMapper.java new file mode 100644 index 0000000..cbc3aa7 --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmNoticeUserMapper.java @@ -0,0 +1,68 @@ +package com.bonus.purchase.mapper; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +import com.bonus.purchase.domain.BpmNoticeUser; +import org.apache.ibatis.annotations.Mapper; + +/** + *@PackagePath: com.bonus.purchase + *@author : 阮世耀 + *@CreateTime: 2024-08-20 14:00 + *@Description: 描述 + *@version : 1.0 +*/ +@Mapper +public interface BpmNoticeUserMapper { + /** + * delete by primary key + * @param id primaryKey + * @return deleteCount + */ + int deleteByPrimaryKey(Integer id); + + /** + * insert record to table + * @param record the record + * @return insert count + */ + int insert(BpmNoticeUser record); + + int insertOrUpdate(BpmNoticeUser record); + + int insertOrUpdateSelective(BpmNoticeUser record); + + /** + * insert record to table selective + * @param record the record + * @return insert count + */ + int insertSelective(BpmNoticeUser record); + + /** + * select by primary key + * @param id primary key + * @return object by primary key + */ + BpmNoticeUser selectByPrimaryKey(Integer id); + + /** + * update record selective + * @param record the updated record + * @return update count + */ + int updateByPrimaryKeySelective(BpmNoticeUser record); + + /** + * update record + * @param record the updated record + * @return update count + */ + int updateByPrimaryKey(BpmNoticeUser record); + + List selectAll(); + + List selectByTaskId(@Param("taskId")Integer taskId); + + +} \ No newline at end of file diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmPurchaseInfoMapper.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmPurchaseInfoMapper.java index 6356da7..381ce7b 100644 --- a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmPurchaseInfoMapper.java +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmPurchaseInfoMapper.java @@ -1,4 +1,5 @@ package com.bonus.purchase.mapper; +import com.bonus.base.api.domain.MaType; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -19,6 +20,14 @@ public interface BpmPurchaseInfoMapper { int insertList(@Param("list")List list); + /** + * 查询所有设备类型 + * @return List + */ + List selectMaTypeCascader(); + + MaType selectMaTypeById(@Param("id") Integer id); + /** * delete by primary key * @param id primaryKey diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmTaskMapper.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmTaskMapper.java new file mode 100644 index 0000000..e3e28fe --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/BpmTaskMapper.java @@ -0,0 +1,60 @@ +package com.bonus.purchase.mapper; + +import com.bonus.purchase.domain.BpmTask; +import org.apache.ibatis.annotations.Mapper; + +/** + *@PackagePath: com.bonus.purchase + *@author : 阮世耀 + *@CreateTime: 2024-08-20 16:51 + *@Description: 描述 + *@version : 1.0 +*/ +@Mapper +public interface BpmTaskMapper { + /** + * delete by primary key + * @param id primaryKey + * @return deleteCount + */ + int deleteByPrimaryKey(Integer id); + + /** + * insert record to table + * @param record the record + * @return insert count + */ + int insert(BpmTask record); + + int insertOrUpdate(BpmTask record); + + int insertOrUpdateSelective(BpmTask record); + + /** + * insert record to table selective + * @param record the record + * @return insert count + */ + int insertSelective(BpmTask record); + + /** + * select by primary key + * @param id primary key + * @return object by primary key + */ + BpmTask selectByPrimaryKey(Integer id); + + /** + * update record selective + * @param record the updated record + * @return update count + */ + int updateByPrimaryKeySelective(BpmTask record); + + /** + * update record + * @param record the updated record + * @return update count + */ + int updateByPrimaryKey(BpmTask record); +} \ No newline at end of file diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/PurchaseAcceptMapper.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/PurchaseAcceptMapper.java index 0a1b713..394f45b 100644 --- a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/PurchaseAcceptMapper.java +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/mapper/PurchaseAcceptMapper.java @@ -1,6 +1,6 @@ package com.bonus.purchase.mapper; -import com.bonus.purchase.domain.PurchaseDto; +import com.bonus.purchase.dto.PurchaseDto; import com.bonus.purchase.vo.PurchaseVo; import java.util.List; diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/PurchaseAcceptService.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/PurchaseAcceptService.java index e1f3eeb..a549d6d 100644 --- a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/PurchaseAcceptService.java +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/PurchaseAcceptService.java @@ -1,6 +1,6 @@ package com.bonus.purchase.service; -import com.bonus.purchase.domain.PurchaseDto; +import com.bonus.purchase.dto.PurchaseDto; import com.bonus.purchase.vo.PurchaseVo; import java.util.List; diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmNoticeUserService.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmNoticeUserService.java new file mode 100644 index 0000000..701848c --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmNoticeUserService.java @@ -0,0 +1,79 @@ +package com.bonus.purchase.service.impl; +import java.util.List; + +import com.bonus.purchase.domain.BpmNoticeUser; +import com.bonus.purchase.mapper.BpmNoticeUserMapper; +import org.springframework.stereotype.Service; + +import org.springframework.beans.factory.annotation.Autowired; + +/** + *@PackagePath: com.bonus.purchase + *@author : 阮世耀 + *@CreateTime: 2024-08-20 13:46 + *@Description: 描述 + *@version : 1.0 +*/ +@Service +public class BpmNoticeUserService{ + + @Autowired + private BpmNoticeUserMapper bpmNoticeUserMapper; + + + public int deleteByPrimaryKey(Integer id) { + return bpmNoticeUserMapper.deleteByPrimaryKey(id); + } + + + public int insert(BpmNoticeUser record) { + return bpmNoticeUserMapper.insert(record); + } + + + public int insertOrUpdate(BpmNoticeUser record) { + return bpmNoticeUserMapper.insertOrUpdate(record); + } + + + public int insertOrUpdateSelective(BpmNoticeUser record) { + return bpmNoticeUserMapper.insertOrUpdateSelective(record); + } + + + public int insertSelective(BpmNoticeUser record) { + record.setType("1"); + return bpmNoticeUserMapper.insertSelective(record); + } + + + public BpmNoticeUser selectByPrimaryKey(Integer id) { + return bpmNoticeUserMapper.selectByPrimaryKey(id); + } + + + public int updateByPrimaryKeySelective(BpmNoticeUser record) { + return bpmNoticeUserMapper.updateByPrimaryKeySelective(record); + } + + public int updateByPrimaryKey(BpmNoticeUser record) { + return bpmNoticeUserMapper.updateByPrimaryKey(record); + } + + public List selectAll(){ + return bpmNoticeUserMapper.selectAll(); + } + + public List selectByTaskId(Integer taskId){ + return bpmNoticeUserMapper.selectByTaskId(taskId); + } + + + + + + + + + +} diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmPurchaseInfoService.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmPurchaseInfoService.java index bb97887..d64b47b 100644 --- a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmPurchaseInfoService.java +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmPurchaseInfoService.java @@ -1,7 +1,20 @@ package com.bonus.purchase.service.impl; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import cn.hutool.core.bean.BeanUtil; +import com.bonus.base.api.domain.MaType; +import com.bonus.common.core.utils.StringHelper; +import com.bonus.common.security.auth.AuthLogic; +import com.bonus.common.security.auth.AuthUtil; +import com.bonus.common.security.utils.SecurityUtils; +import com.bonus.purchase.domain.BpmTask; +import com.bonus.purchase.dto.PurchaseTaskDto; import com.bonus.purchase.mapper.BpmPurchaseInfoMapper; +import com.bonus.purchase.mapper.BpmTaskMapper; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; @@ -23,7 +36,9 @@ public class BpmPurchaseInfoService{ @Resource private BpmPurchaseInfoMapper bpmPurchaseInfoMapper; - + @Resource + private BpmTaskMapper bpmTaskMapper; + public int deleteByPrimaryKey(Integer id) { return bpmPurchaseInfoMapper.deleteByPrimaryKey(id); } @@ -63,16 +78,93 @@ public class BpmPurchaseInfoService{ return bpmPurchaseInfoMapper.updateByPrimaryKey(record); } - public List selectAll(BpmPurchaseInfo bpmPurchaseInfo){ + public List selectAll(BpmPurchaseInfo bpmPurchaseInfo) { return bpmPurchaseInfoMapper.selectAll(bpmPurchaseInfo); } - public int insertList(List list){ - return bpmPurchaseInfoMapper.insertList(list); + + public int insertList(PurchaseTaskDto purchaseTaskDto) { + // 映射Dto至Pojo对象 + BpmTask task = new BpmTask(); + List list = purchaseTaskDto.getBpmPurchaseDetailsList(); + BeanUtil.copyProperties(purchaseTaskDto, task); + + // 新购设备前,先进行任务表创建 + int inserted = bpmTaskMapper.insertSelective(task); + if (inserted <= 0) { + return 0; + } + + if (task.getId() != null) { + // 给集合中所有对象赋值任务ID + list.replaceAll(obj -> { + obj.setTaskId(task.getId()); + obj.setStatus((byte)1); + obj.setUpdater(String.valueOf(SecurityUtils.getLoginUser().getUserid())); + return obj; + }); + } else { + return 0; + } + + + return bpmPurchaseInfoMapper.insertList(list); } + public MaType selectMaTypeById(Integer id) { + return bpmPurchaseInfoMapper.selectMaTypeById(id); + } + /** + * 获取物料类型级联数据 + * @return 集合键值对JSON数据 + */ + public List> getCascaderData() { + List allItems = bpmPurchaseInfoMapper.selectMaTypeCascader(); + Map itemMap = new HashMap<>(); + for (MaType item : allItems) { + itemMap.put(Long.valueOf(item.getId()), item); + } + + List> rootItems = new ArrayList<>(); + for (MaType item : allItems) { + if (item.getParentId() == null || item.getParentId().isEmpty() || "0".equals(item.getParentId())) { + rootItems.add(buildItem(item, itemMap)); + } + } + + return rootItems; + } + + + /** + * 递归构建级联数据 + * @param item 当前节点 + * @param itemMap 节点集合 + * @return 级联节点数据 + */ + private Map buildItem(MaType item, Map itemMap) { + Map itemNode = new HashMap<>(); + itemNode.put("value", item.getId()); + itemNode.put("label", item.getName()); + if (StringHelper.isNotEmpty(item.getUnitName())) { + itemNode.put("unitName", item.getName()); + } + List> children = new ArrayList<>(); + + for (MaType child : itemMap.values()) { + if (child.getParentId() != null && child.getParentId().equals(item.getId())) { + children.add(buildItem(child, itemMap)); + } + } + + if (!children.isEmpty()) { + itemNode.put("children", children); + } + + return itemNode; + } diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmTaskService.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmTaskService.java new file mode 100644 index 0000000..5235df6 --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/BpmTaskService.java @@ -0,0 +1,62 @@ +package com.bonus.purchase.service.impl; + +import com.bonus.purchase.mapper.BpmTaskMapper; +import org.springframework.stereotype.Service; + +import org.springframework.beans.factory.annotation.Autowired; + +import com.bonus.purchase.domain.BpmTask; +/** + *@PackagePath: com.bonus.purchase + *@author : 阮世耀 + *@CreateTime: 2024-08-20 16:51 + *@Description: 描述 + *@version : 1.0 +*/ +@Service +public class BpmTaskService{ + + @Autowired + private BpmTaskMapper bpmTaskMapper; + + + public int deleteByPrimaryKey(Integer id) { + return bpmTaskMapper.deleteByPrimaryKey(id); + } + + + public int insert(BpmTask record) { + return bpmTaskMapper.insert(record); + } + + + public int insertOrUpdate(BpmTask record) { + return bpmTaskMapper.insertOrUpdate(record); + } + + + public int insertOrUpdateSelective(BpmTask record) { + return bpmTaskMapper.insertOrUpdateSelective(record); + } + + + public int insertSelective(BpmTask record) { + return bpmTaskMapper.insertSelective(record); + } + + + public BpmTask selectByPrimaryKey(Integer id) { + return bpmTaskMapper.selectByPrimaryKey(id); + } + + + public int updateByPrimaryKeySelective(BpmTask record) { + return bpmTaskMapper.updateByPrimaryKeySelective(record); + } + + + public int updateByPrimaryKey(BpmTask record) { + return bpmTaskMapper.updateByPrimaryKey(record); + } + +} diff --git a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/PurchaseAcceptServiceImpl.java b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/PurchaseAcceptServiceImpl.java index bb4adfe..512b0ed 100644 --- a/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/PurchaseAcceptServiceImpl.java +++ b/bonus-modules/bonus-purchase/src/main/java/com/bonus/purchase/service/impl/PurchaseAcceptServiceImpl.java @@ -1,6 +1,6 @@ package com.bonus.purchase.service.impl; -import com.bonus.purchase.domain.PurchaseDto; +import com.bonus.purchase.dto.PurchaseDto; import com.bonus.purchase.mapper.PurchaseAcceptMapper; import com.bonus.purchase.service.PurchaseAcceptService; import com.bonus.purchase.vo.PurchaseVo; diff --git a/bonus-modules/bonus-purchase/src/main/resources/mapper/BpmNoticeUserMapper.xml b/bonus-modules/bonus-purchase/src/main/resources/mapper/BpmNoticeUserMapper.xml new file mode 100644 index 0000000..3006a02 --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/resources/mapper/BpmNoticeUserMapper.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + bpm_notice_user.id, bpm_notice_user.user_id, bpm_notice_user.task_id, bpm_notice_user.phone, + bpm_notice_user.`type` + + + + + delete from bpm_notice_user + where id = #{id,jdbcType=INTEGER} + + + + + insert into bpm_notice_user (user_id, task_id, phone, `type`) + values (#{userId,jdbcType=INTEGER}, #{taskId,jdbcType=INTEGER}, #{phone,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}) + + + + + insert into bpm_notice_user + + + user_id, + + + task_id, + + + phone, + + + `type`, + + + + + #{userId,jdbcType=INTEGER}, + + + #{taskId,jdbcType=INTEGER}, + + + #{phone,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + + + + update bpm_notice_user + + + user_id = #{userId,jdbcType=INTEGER}, + + + task_id = #{taskId,jdbcType=INTEGER}, + + + phone = #{phone,jdbcType=VARCHAR}, + + + `type` = #{type,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + + update bpm_notice_user + set user_id = #{userId,jdbcType=INTEGER}, + task_id = #{taskId,jdbcType=INTEGER}, + phone = #{phone,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + insert into bpm_notice_user + + + id, + + user_id, + task_id, + phone, + `type`, + + values + + + #{id,jdbcType=INTEGER}, + + #{userId,jdbcType=INTEGER}, + #{taskId,jdbcType=INTEGER}, + #{phone,jdbcType=VARCHAR}, + #{type,jdbcType=VARCHAR}, + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + user_id = #{userId,jdbcType=INTEGER}, + task_id = #{taskId,jdbcType=INTEGER}, + phone = #{phone,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=VARCHAR}, + + + + + insert into bpm_notice_user + + + id, + + + user_id, + + + task_id, + + + phone, + + + `type`, + + + values + + + #{id,jdbcType=INTEGER}, + + + #{userId,jdbcType=INTEGER}, + + + #{taskId,jdbcType=INTEGER}, + + + #{phone,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + + user_id = #{userId,jdbcType=INTEGER}, + + + task_id = #{taskId,jdbcType=INTEGER}, + + + phone = #{phone,jdbcType=VARCHAR}, + + + `type` = #{type,jdbcType=VARCHAR}, + + + + + + + + + + \ No newline at end of file diff --git a/bonus-modules/bonus-purchase/src/main/resources/mapper/BpmPurchaseInfoMapper.xml b/bonus-modules/bonus-purchase/src/main/resources/mapper/BpmPurchaseInfoMapper.xml index 91e537c..6ac40cb 100644 --- a/bonus-modules/bonus-purchase/src/main/resources/mapper/BpmPurchaseInfoMapper.xml +++ b/bonus-modules/bonus-purchase/src/main/resources/mapper/BpmPurchaseInfoMapper.xml @@ -25,6 +25,26 @@ + + + + + + + + + + + + + + + + + + + + id, task_id, type_id, purchase_num, check_num, purchase_price, notax_price, tax_rate, @@ -591,4 +611,23 @@ ) + + + + \ No newline at end of file diff --git a/bonus-modules/bonus-purchase/src/main/resources/mapper/BpmTaskMapper.xml b/bonus-modules/bonus-purchase/src/main/resources/mapper/BpmTaskMapper.xml new file mode 100644 index 0000000..8eef122 --- /dev/null +++ b/bonus-modules/bonus-purchase/src/main/resources/mapper/BpmTaskMapper.xml @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + id, definition_id, parent_id, code, `status`, arrival_time, creator, create_time, + auditor, audit_time, remark, agreement_id, link_man, phone, company_id + + + + + delete from bpm_task + where id = #{id,jdbcType=INTEGER} + + + + insert into bpm_task (id, definition_id, parent_id, + code, `status`, arrival_time, + creator, create_time, auditor, + audit_time, remark, agreement_id, + link_man, phone, company_id + ) + values (#{id,jdbcType=INTEGER}, #{definitionId,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER}, + #{code,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{arrivalTime,jdbcType=TIMESTAMP}, + #{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{auditor,jdbcType=INTEGER}, + #{auditTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{agreementId,jdbcType=INTEGER}, + #{linkMan,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER} + ) + + + + insert into bpm_task + + + id, + + + definition_id, + + + parent_id, + + + code, + + + `status`, + + + arrival_time, + + + creator, + + + create_time, + + + auditor, + + + audit_time, + + + remark, + + + agreement_id, + + + link_man, + + + phone, + + + company_id, + + + + + #{id,jdbcType=INTEGER}, + + + #{definitionId,jdbcType=INTEGER}, + + + #{parentId,jdbcType=INTEGER}, + + + #{code,jdbcType=VARCHAR}, + + + #{status,jdbcType=INTEGER}, + + + #{arrivalTime,jdbcType=TIMESTAMP}, + + + #{creator,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{auditor,jdbcType=INTEGER}, + + + #{auditTime,jdbcType=TIMESTAMP}, + + + #{remark,jdbcType=VARCHAR}, + + + #{agreementId,jdbcType=INTEGER}, + + + #{linkMan,jdbcType=VARCHAR}, + + + #{phone,jdbcType=VARCHAR}, + + + #{companyId,jdbcType=INTEGER}, + + + + + + update bpm_task + + + definition_id = #{definitionId,jdbcType=INTEGER}, + + + parent_id = #{parentId,jdbcType=INTEGER}, + + + code = #{code,jdbcType=VARCHAR}, + + + `status` = #{status,jdbcType=INTEGER}, + + + arrival_time = #{arrivalTime,jdbcType=TIMESTAMP}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + auditor = #{auditor,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + agreement_id = #{agreementId,jdbcType=INTEGER}, + + + link_man = #{linkMan,jdbcType=VARCHAR}, + + + phone = #{phone,jdbcType=VARCHAR}, + + + company_id = #{companyId,jdbcType=INTEGER}, + + + where id = #{id,jdbcType=INTEGER} + + + + update bpm_task + set definition_id = #{definitionId,jdbcType=INTEGER}, + parent_id = #{parentId,jdbcType=INTEGER}, + code = #{code,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=INTEGER}, + arrival_time = #{arrivalTime,jdbcType=TIMESTAMP}, + creator = #{creator,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + auditor = #{auditor,jdbcType=INTEGER}, + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + remark = #{remark,jdbcType=VARCHAR}, + agreement_id = #{agreementId,jdbcType=INTEGER}, + link_man = #{linkMan,jdbcType=VARCHAR}, + phone = #{phone,jdbcType=VARCHAR}, + company_id = #{companyId,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} + + + + insert into bpm_task + (id, definition_id, parent_id, code, `status`, arrival_time, creator, create_time, + auditor, audit_time, remark, agreement_id, link_man, phone, company_id) + values + (#{id,jdbcType=INTEGER}, #{definitionId,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER}, + #{code,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{arrivalTime,jdbcType=TIMESTAMP}, + #{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{auditor,jdbcType=INTEGER}, + #{auditTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{agreementId,jdbcType=INTEGER}, + #{linkMan,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER} + ) + on duplicate key update + id = #{id,jdbcType=INTEGER}, + definition_id = #{definitionId,jdbcType=INTEGER}, + parent_id = #{parentId,jdbcType=INTEGER}, + code = #{code,jdbcType=VARCHAR}, + `status` = #{status,jdbcType=INTEGER}, + arrival_time = #{arrivalTime,jdbcType=TIMESTAMP}, + creator = #{creator,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + auditor = #{auditor,jdbcType=INTEGER}, + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + remark = #{remark,jdbcType=VARCHAR}, + agreement_id = #{agreementId,jdbcType=INTEGER}, + link_man = #{linkMan,jdbcType=VARCHAR}, + phone = #{phone,jdbcType=VARCHAR}, + company_id = #{companyId,jdbcType=INTEGER} + + + + insert into bpm_task + + + id, + + + definition_id, + + + parent_id, + + + code, + + + `status`, + + + arrival_time, + + + creator, + + + create_time, + + + auditor, + + + audit_time, + + + remark, + + + agreement_id, + + + link_man, + + + phone, + + + company_id, + + + values + + + #{id,jdbcType=INTEGER}, + + + #{definitionId,jdbcType=INTEGER}, + + + #{parentId,jdbcType=INTEGER}, + + + #{code,jdbcType=VARCHAR}, + + + #{status,jdbcType=INTEGER}, + + + #{arrivalTime,jdbcType=TIMESTAMP}, + + + #{creator,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{auditor,jdbcType=INTEGER}, + + + #{auditTime,jdbcType=TIMESTAMP}, + + + #{remark,jdbcType=VARCHAR}, + + + #{agreementId,jdbcType=INTEGER}, + + + #{linkMan,jdbcType=VARCHAR}, + + + #{phone,jdbcType=VARCHAR}, + + + #{companyId,jdbcType=INTEGER}, + + + on duplicate key update + + + id = #{id,jdbcType=INTEGER}, + + + definition_id = #{definitionId,jdbcType=INTEGER}, + + + parent_id = #{parentId,jdbcType=INTEGER}, + + + code = #{code,jdbcType=VARCHAR}, + + + `status` = #{status,jdbcType=INTEGER}, + + + arrival_time = #{arrivalTime,jdbcType=TIMESTAMP}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + auditor = #{auditor,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + agreement_id = #{agreementId,jdbcType=INTEGER}, + + + link_man = #{linkMan,jdbcType=VARCHAR}, + + + phone = #{phone,jdbcType=VARCHAR}, + + + company_id = #{companyId,jdbcType=INTEGER}, + + + + \ No newline at end of file