DTO封装、任务task接口开发

This commit is contained in:
syruan 2024-08-21 10:18:31 +08:00
parent 1b269d95c4
commit a22543eeb3
20 changed files with 1432 additions and 14 deletions

View File

@ -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<BpmNoticeUser> list = this.bpmNoticeUserService.selectAll();
return getDataTable(list);
}
/**
* 根据任务ID查询数据
*/
@GetMapping(value = "/listByTaskId/{taskId}")
public ResultBean<Object> getListByTaskId(@PathVariable("taskId") Integer taskId) {
List<BpmNoticeUser> list = this.bpmNoticeUserService.selectByTaskId(taskId);
return ResultBean.success(list);
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResultBean<BpmNoticeUser> 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);
}
}

View File

@ -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<List<Map<String, Object>>> getCascaderData() {
return ResultBean.success(this.bpmPurchaseInfoService.getCascaderData());
}
/**
* ElementPlus级联选择器数据接口--根据id查询节点的父级信息
*/
@GetMapping(value = "/cascaderById")
public ResultBean<Object> 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<BpmPurchaseInfo> items) {
this.bpmPurchaseInfoService.insertList(items);
return ResultBean.success(true);
public ResultBean<Boolean> add(@RequestBody PurchaseTaskDto purchaseTaskDto) {
return ResultBean.toIsSuccess(this.bpmPurchaseInfoService.insertList(purchaseTaskDto));
}
/**

View File

@ -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<BpmTask> list = this.bpmTaskService.selectAll(bpmTask);
return getDataTable(list);
}*/
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResultBean<BpmTask> 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);
}
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -1,4 +1,4 @@
package com.bonus.purchase.domain;
package com.bonus.purchase.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -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<BpmPurchaseInfo> bpmPurchaseDetailsList;
}

View File

@ -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<BpmNoticeUser> selectAll();
List<BpmNoticeUser> selectByTaskId(@Param("taskId")Integer taskId);
}

View File

@ -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<BpmPurchaseInfo> list);
/**
* 查询所有设备类型
* @return List<MaType>
*/
List<MaType> selectMaTypeCascader();
MaType selectMaTypeById(@Param("id") Integer id);
/**
* delete by primary key
* @param id primaryKey

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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<BpmNoticeUser> selectAll(){
return bpmNoticeUserMapper.selectAll();
}
public List<BpmNoticeUser> selectByTaskId(Integer taskId){
return bpmNoticeUserMapper.selectByTaskId(taskId);
}
}

View File

@ -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<BpmPurchaseInfo> selectAll(BpmPurchaseInfo bpmPurchaseInfo){
public List<BpmPurchaseInfo> selectAll(BpmPurchaseInfo bpmPurchaseInfo) {
return bpmPurchaseInfoMapper.selectAll(bpmPurchaseInfo);
}
public int insertList(List<BpmPurchaseInfo> list){
return bpmPurchaseInfoMapper.insertList(list);
public int insertList(PurchaseTaskDto purchaseTaskDto) {
// 映射Dto至Pojo对象
BpmTask task = new BpmTask();
List<BpmPurchaseInfo> 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<Map<String, Object>> getCascaderData() {
List<MaType> allItems = bpmPurchaseInfoMapper.selectMaTypeCascader();
Map<Long, MaType> itemMap = new HashMap<>();
for (MaType item : allItems) {
itemMap.put(Long.valueOf(item.getId()), item);
}
List<Map<String, Object>> 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<String, Object> buildItem(MaType item, Map<Long, MaType> itemMap) {
Map<String, Object> itemNode = new HashMap<>();
itemNode.put("value", item.getId());
itemNode.put("label", item.getName());
if (StringHelper.isNotEmpty(item.getUnitName())) {
itemNode.put("unitName", item.getName());
}
List<Map<String, Object>> 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;
}

View File

@ -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);
}
}

View File

@ -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;

View File

@ -0,0 +1,201 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.purchase.mapper.BpmNoticeUserMapper">
<resultMap id="BaseResultMap" type="com.bonus.purchase.domain.BpmNoticeUser">
<!--@mbg.generated-->
<!--@Table bpm_notice_user-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="task_id" jdbcType="INTEGER" property="taskId" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="type" jdbcType="VARCHAR" property="type" />
</resultMap>
<sql id="Base_Column_List">
bpm_notice_user.id, bpm_notice_user.user_id, bpm_notice_user.task_id, bpm_notice_user.phone,
bpm_notice_user.`type`
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from bpm_notice_user
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from bpm_notice_user
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.bonus.purchase.domain.BpmNoticeUser" useGeneratedKeys="true">
<!--@mbg.generated-->
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>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.purchase.domain.BpmNoticeUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into bpm_notice_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="taskId != null">
task_id,
</if>
<if test="phone != null and phone != ''">
phone,
</if>
<if test="type != null and type != ''">
`type`,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="taskId != null">
#{taskId,jdbcType=INTEGER},
</if>
<if test="phone != null and phone != ''">
#{phone,jdbcType=VARCHAR},
</if>
<if test="type != null and type != ''">
#{type,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.bonus.purchase.domain.BpmNoticeUser">
<!--@mbg.generated-->
update bpm_notice_user
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="taskId != null">
task_id = #{taskId,jdbcType=INTEGER},
</if>
<if test="phone != null and phone != ''">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="type != null and type != ''">
`type` = #{type,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bonus.purchase.domain.BpmNoticeUser">
<!--@mbg.generated-->
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}
</update>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.bonus.purchase.domain.BpmNoticeUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into bpm_notice_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
user_id,
task_id,
phone,
`type`,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{userId,jdbcType=INTEGER},
#{taskId,jdbcType=INTEGER},
#{phone,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
user_id = #{userId,jdbcType=INTEGER},
task_id = #{taskId,jdbcType=INTEGER},
phone = #{phone,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.bonus.purchase.domain.BpmNoticeUser" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into bpm_notice_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="taskId != null">
task_id,
</if>
<if test="phone != null and phone != ''">
phone,
</if>
<if test="type != null and type != ''">
`type`,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="taskId != null">
#{taskId,jdbcType=INTEGER},
</if>
<if test="phone != null and phone != ''">
#{phone,jdbcType=VARCHAR},
</if>
<if test="type != null and type != ''">
#{type,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="taskId != null">
task_id = #{taskId,jdbcType=INTEGER},
</if>
<if test="phone != null and phone != ''">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="type != null and type != ''">
`type` = #{type,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<!--by syruan on 2024-08-20-->
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from bpm_notice_user
</select>
<!--by syruan on 2024-08-20-->
<select id="selectByTaskId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from bpm_notice_user
where bpm_notice_user.task_id = #{taskId,jdbcType=INTEGER}
</select>
</mapper>

View File

@ -25,6 +25,26 @@
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="file_url" jdbcType="VARCHAR" property="fileUrl" />
</resultMap>
<resultMap type="com.bonus.base.api.domain.MaType" id="MaTypeMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="code" column="code" jdbcType="VARCHAR"/>
<result property="parentId" column="parent_id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="parentName" column="parent_name" jdbcType="VARCHAR"/>
<result property="level" column="level" jdbcType="VARCHAR"/>
<result property="storageNum" column="storage_num" jdbcType="INTEGER"/>
<result property="unitId" column="unit_id" jdbcType="VARCHAR"/>
<result property="buyPrice" column="buy_price" jdbcType="INTEGER"/>
<result property="leasePrice" column="lease_price" jdbcType="INTEGER"/>
<result property="manageType" column="manage_type" jdbcType="VARCHAR"/>
<result property="isActive" column="is_active" jdbcType="VARCHAR"/>
<result property="rateLoad" column="rate_load" jdbcType="VARCHAR"/>
<result property="testLoad" column="test_load" jdbcType="VARCHAR"/>
<result property="holdTime" column="hold_time" jdbcType="VARCHAR"/>
<result property="unitName" column="dict_label" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, task_id, type_id, purchase_num, check_num, purchase_price, notax_price, tax_rate,
@ -591,4 +611,23 @@
)
</foreach>
</insert>
<select id="selectMaTypeCascader" resultMap="MaTypeMap">
select
id as id, code as code, parent_id, name, level, storage_num, unit_id, sda.dict_label,
buy_price, lease_price, manage_type, is_active,test_load,rate_load , hold_time
from ma_type mt
left join sys_dict_data sda on mt.unit_id = sda.dict_code
where is_active = '1'
</select>
<select id="selectMaTypeById" resultMap="MaTypeMap">
select
mt.id as id, mt.code as code, mt.parent_id, mt.name, mt.level, mt.storage_num, mt.unit_id, sda.dict_label,
mt.buy_price, mt.lease_price, mt.manage_type, mt.is_active,mt.test_load,mt.rate_load, mt.hold_time,mt1.`name` as parent_name
from ma_type mt
left join sys_dict_data sda on mt.unit_id = sda.dict_code
left join ma_type mt1 ON mt.parent_id = mt1.id
where mt.is_active = '1' and mt.id = #{id,jdbcType=INTEGER}
</select>
</mapper>

View File

@ -0,0 +1,398 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.purchase.mapper.BpmTaskMapper">
<resultMap id="BaseResultMap" type="com.bonus.purchase.domain.BpmTask">
<!--@mbg.generated-->
<!--@Table bpm_task-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="definition_id" jdbcType="INTEGER" property="definitionId" />
<result column="parent_id" jdbcType="INTEGER" property="parentId" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="arrival_time" jdbcType="TIMESTAMP" property="arrivalTime" />
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="auditor" jdbcType="INTEGER" property="auditor" />
<result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="agreement_id" jdbcType="INTEGER" property="agreementId" />
<result column="link_man" jdbcType="VARCHAR" property="linkMan" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="company_id" jdbcType="INTEGER" property="companyId" />
<result column="is_active" jdbcType="TINYINT" property="isActive" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, definition_id, parent_id, code, `status`, arrival_time, creator, create_time,
auditor, audit_time, remark, agreement_id, link_man, phone, company_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from bpm_task
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from bpm_task
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.bonus.purchase.domain.BpmTask">
<!--@mbg.generated-->
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>
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.bonus.purchase.domain.BpmTask">
<!--@mbg.generated-->
insert into bpm_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="definitionId != null">
definition_id,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="code != null and code != ''">
code,
</if>
<if test="status != null">
`status`,
</if>
<if test="arrivalTime != null">
arrival_time,
</if>
<if test="creator != null and creator != ''">
creator,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="auditor != null">
auditor,
</if>
<if test="auditTime != null">
audit_time,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
<if test="agreementId != null">
agreement_id,
</if>
<if test="linkMan != null and linkMan != ''">
link_man,
</if>
<if test="phone != null and phone != ''">
phone,
</if>
<if test="companyId != null">
company_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="definitionId != null">
#{definitionId,jdbcType=INTEGER},
</if>
<if test="parentId != null">
#{parentId,jdbcType=INTEGER},
</if>
<if test="code != null and code != ''">
#{code,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="arrivalTime != null">
#{arrivalTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null and creator != ''">
#{creator,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="auditor != null">
#{auditor,jdbcType=INTEGER},
</if>
<if test="auditTime != null">
#{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
<if test="agreementId != null">
#{agreementId,jdbcType=INTEGER},
</if>
<if test="linkMan != null and linkMan != ''">
#{linkMan,jdbcType=VARCHAR},
</if>
<if test="phone != null and phone != ''">
#{phone,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.bonus.purchase.domain.BpmTask">
<!--@mbg.generated-->
update bpm_task
<set>
<if test="definitionId != null">
definition_id = #{definitionId,jdbcType=INTEGER},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="code != null and code != ''">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="arrivalTime != null">
arrival_time = #{arrivalTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null and creator != ''">
creator = #{creator,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="auditor != null">
auditor = #{auditor,jdbcType=INTEGER},
</if>
<if test="auditTime != null">
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="agreementId != null">
agreement_id = #{agreementId,jdbcType=INTEGER},
</if>
<if test="linkMan != null and linkMan != ''">
link_man = #{linkMan,jdbcType=VARCHAR},
</if>
<if test="phone != null and phone != ''">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.bonus.purchase.domain.BpmTask">
<!--@mbg.generated-->
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}
</update>
<insert id="insertOrUpdate" parameterType="com.bonus.purchase.domain.BpmTask">
<!--@mbg.generated-->
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>
<insert id="insertOrUpdateSelective" parameterType="com.bonus.purchase.domain.BpmTask">
<!--@mbg.generated-->
insert into bpm_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="definitionId != null">
definition_id,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="code != null and code != ''">
code,
</if>
<if test="status != null">
`status`,
</if>
<if test="arrivalTime != null">
arrival_time,
</if>
<if test="creator != null and creator != ''">
creator,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="auditor != null">
auditor,
</if>
<if test="auditTime != null">
audit_time,
</if>
<if test="remark != null and remark != ''">
remark,
</if>
<if test="agreementId != null">
agreement_id,
</if>
<if test="linkMan != null and linkMan != ''">
link_man,
</if>
<if test="phone != null and phone != ''">
phone,
</if>
<if test="companyId != null">
company_id,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="definitionId != null">
#{definitionId,jdbcType=INTEGER},
</if>
<if test="parentId != null">
#{parentId,jdbcType=INTEGER},
</if>
<if test="code != null and code != ''">
#{code,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="arrivalTime != null">
#{arrivalTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null and creator != ''">
#{creator,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="auditor != null">
#{auditor,jdbcType=INTEGER},
</if>
<if test="auditTime != null">
#{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null and remark != ''">
#{remark,jdbcType=VARCHAR},
</if>
<if test="agreementId != null">
#{agreementId,jdbcType=INTEGER},
</if>
<if test="linkMan != null and linkMan != ''">
#{linkMan,jdbcType=VARCHAR},
</if>
<if test="phone != null and phone != ''">
#{phone,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="definitionId != null">
definition_id = #{definitionId,jdbcType=INTEGER},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="code != null and code != ''">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=INTEGER},
</if>
<if test="arrivalTime != null">
arrival_time = #{arrivalTime,jdbcType=TIMESTAMP},
</if>
<if test="creator != null and creator != ''">
creator = #{creator,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="auditor != null">
auditor = #{auditor,jdbcType=INTEGER},
</if>
<if test="auditTime != null">
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null and remark != ''">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="agreementId != null">
agreement_id = #{agreementId,jdbcType=INTEGER},
</if>
<if test="linkMan != null and linkMan != ''">
link_man = #{linkMan,jdbcType=VARCHAR},
</if>
<if test="phone != null and phone != ''">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
</if>
</trim>
</insert>
</mapper>