Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
572a5fdae1
|
|
@ -72,7 +72,7 @@ public class MaType extends BaseEntity implements Serializable {
|
|||
*/
|
||||
private Integer leasePrice;
|
||||
/**
|
||||
* 管理类型(0是编码 1数量和编码 2数量)
|
||||
* 管理类型(0是编码 1数量)
|
||||
*/
|
||||
private String manageType;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.common.core.domain;
|
|||
import com.bonus.common.core.constant.HttpStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
|
|
@ -71,15 +72,34 @@ public final class ResultBean<T> implements java.io.Serializable{
|
|||
/**
|
||||
* 删除/修改/新增操作 根据影响条数返回响应内容
|
||||
*
|
||||
* @param msg 消息
|
||||
* @return 构建的ResultBean实例
|
||||
*/
|
||||
public static <T> ResultBean<T> toIsSuccess(int record, String msg) {
|
||||
// 检查msg是否为null
|
||||
if (msg == null) {
|
||||
if (record > 0) {
|
||||
return new ResultBean<>(HttpStatus.SUCCESS, "success", null);
|
||||
} else {
|
||||
return new ResultBean<>(HttpStatus.NOT_MODIFIED, "资源没有被修改", null);
|
||||
}
|
||||
}
|
||||
return new ResultBean<>(record > 0 ? HttpStatus.SUCCESS : HttpStatus.NOT_MODIFIED, msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除/修改/新增操作 根据影响条数返回响应内容
|
||||
*
|
||||
* @param msg 消息
|
||||
* @param data 数据
|
||||
* @return 构建的ResultBean实例
|
||||
*/
|
||||
public static <T> ResultBean<T> toIsSuccess(int record,T data) {
|
||||
public static <T> ResultBean<T> toIsSuccess(int record, String msg, T data) {
|
||||
// 检查data是否为null
|
||||
if (data == null) {
|
||||
return new ResultBean<>(record > 0 ? HttpStatus.SUCCESS : HttpStatus.NO_CONTENT, "success", null);
|
||||
return new ResultBean<>(record > 0 ? HttpStatus.SUCCESS : HttpStatus.NO_CONTENT, msg, null);
|
||||
}
|
||||
return new ResultBean<>(record > 0 ? HttpStatus.SUCCESS : HttpStatus.NO_CONTENT, "error", data);
|
||||
return new ResultBean<>(record > 0 ? HttpStatus.SUCCESS : HttpStatus.NOT_MODIFIED, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -98,4 +98,13 @@ public class BaseTreeController {
|
|||
return R.ok(bmProNature);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新购状态
|
||||
*/
|
||||
@RequestMapping("/getStatus")
|
||||
public R<Object> getStatus(){
|
||||
R<List<Object>> bmProNature = remoteDictService.getDictData("purchase_status");
|
||||
return R.ok(bmProNature);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ 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.dto.NoticeDto;
|
||||
import com.bonus.purchase.service.impl.BpmNoticeUserService;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import com.bonus.task.service.BpmTaskService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
|
@ -14,11 +15,11 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 短信人员(bpm_notice_user)表控制层
|
||||
* 新购到货通知业务
|
||||
* 新购到货通知
|
||||
* @author 阮世耀
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/notice")
|
||||
@RequestMapping("/purchase/notice")
|
||||
public class BpmNoticeUserController extends BaseController {
|
||||
|
||||
/**
|
||||
|
|
@ -27,6 +28,9 @@ public class BpmNoticeUserController extends BaseController {
|
|||
@Autowired
|
||||
private BpmNoticeUserService bpmNoticeUserService;
|
||||
|
||||
@Autowired
|
||||
private BpmTaskService bpmTaskService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询数据
|
||||
|
|
@ -38,13 +42,32 @@ public class BpmNoticeUserController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知--发起验收
|
||||
*/
|
||||
@PostMapping(value = "/startAccept")
|
||||
public ResultBean<String> startAccept(@RequestBody @Valid NoticeDto noticeDto) {
|
||||
return this.bpmNoticeUserService.startAccept(noticeDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务ID查询数据
|
||||
*/
|
||||
@GetMapping(value = "/listByTaskId/{taskId}")
|
||||
public ResultBean<Object> getListByTaskId(@PathVariable("taskId") Integer taskId) {
|
||||
@GetMapping(value = "/getUserList")
|
||||
public TableDataInfo getListByTaskId(@RequestParam("taskId") Integer taskId) {
|
||||
startPage();
|
||||
List<BpmNoticeUser> list = this.bpmNoticeUserService.selectByTaskId(taskId);
|
||||
return ResultBean.success(list);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有用户人员信息表
|
||||
*/
|
||||
@GetMapping(value = "/getAllUser")
|
||||
public TableDataInfo getAllUser() {
|
||||
startPage();
|
||||
List<BpmNoticeUser> list = this.bpmNoticeUserService.getAllUser();
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class BpmPurchaseAcceptController extends BaseController {
|
|||
*/
|
||||
@ApiOperation("单个或批量验收合格")
|
||||
@PostMapping ("/approve")
|
||||
public AjaxResult updateTask(PurchaseDto purchaseDto)
|
||||
public AjaxResult updateTask(@RequestBody PurchaseDto purchaseDto)
|
||||
{
|
||||
return purchaseAcceptService.updateTask(purchaseDto);
|
||||
}
|
||||
|
|
@ -71,21 +71,21 @@ public class BpmPurchaseAcceptController extends BaseController {
|
|||
*/
|
||||
@ApiOperation("二级页面不合格")
|
||||
@PostMapping ("/reject")
|
||||
public AjaxResult updateDetails(PurchaseDto purchaseDto)
|
||||
public AjaxResult updateDetails(@RequestBody PurchaseDto purchaseDto)
|
||||
{
|
||||
return purchaseAcceptService.updateDetails(purchaseDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出新购验证列表
|
||||
* 导出新购验收列表
|
||||
*/
|
||||
@ApiOperation(value = "导出新购验证列表")
|
||||
@ApiOperation(value = "导出新购验收列表")
|
||||
@RequiresPermissions("purchase:purchaseDto:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PurchaseDto purchaseDto)
|
||||
{
|
||||
List<PurchaseAcceptVo> list = purchaseAcceptService.selectAll(purchaseDto);
|
||||
ExcelUtil<PurchaseAcceptVo> util = new ExcelUtil<>(PurchaseAcceptVo.class);
|
||||
util.exportExcel(response, list, "新购验证列表");
|
||||
util.exportExcel(response, list, "新购验收列表");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.purchase.controller;
|
||||
import com.bonus.common.core.domain.ResultBean;
|
||||
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;
|
||||
|
|
@ -14,13 +15,17 @@ import org.springframework.web.bind.annotation.*;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Positive;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.bonus.purchase.utils.Constants.*;
|
||||
|
||||
/**
|
||||
* 新购到货管理(bpm_purchase_info)
|
||||
* @author 阮世耀
|
||||
|
|
@ -39,7 +44,7 @@ public class BpmPurchaseInfoController extends BaseController {
|
|||
private BpmTaskService bpmTaskService;
|
||||
|
||||
/**
|
||||
* 分页查询--新购任务列表
|
||||
* 分页查询--新购任务一级列表
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
@RequiresPermissions("purchase:bpmPurchaseInfo:query")
|
||||
|
|
@ -50,16 +55,41 @@ public class BpmPurchaseInfoController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 分页查询---新购任务详情列表
|
||||
* 分页查询---新购任务详情列表--内层
|
||||
*/
|
||||
@GetMapping(value = "/detailsList")
|
||||
@RequiresPermissions("purchase:bpmPurchaseInfo:query")
|
||||
public TableDataInfo getDetailsList(PurchaseDto record) {
|
||||
public TableDataInfo getDetailsList(@Valid PurchaseDto record) {
|
||||
startPage();
|
||||
List<PurchaseAcceptVo> list = this.bpmPurchaseInfoService.getDetailsList(record);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出新购任务一级列表
|
||||
*/
|
||||
@PostMapping(value = "/export")
|
||||
@RequiresPermissions("purchase:bpmPurchaseInfo:export")
|
||||
public void export(HttpServletResponse response,@NotEmpty(message = "任务数组不能为空") Integer[] taskArray) {
|
||||
List<PurchaseVo> list = this.bpmPurchaseInfoService.selectMangerListInId(Arrays.asList(taskArray));
|
||||
ExcelUtil<PurchaseVo> util = new ExcelUtil<>(PurchaseVo.class);
|
||||
util.exportExcel(response, list, "新购任务列表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出新购任务设备列表
|
||||
* @param response 响应--导出操作
|
||||
* @param deviceArray 领用详情表ID数组
|
||||
*/
|
||||
@PostMapping(value = "/exportDevices")
|
||||
@RequiresPermissions("purchase:bpmPurchaseInfo:export")
|
||||
public void exportDevices(HttpServletResponse response,@NotEmpty(message = "设备数组不能为空") Integer[] deviceArray) {
|
||||
List<PurchaseAcceptVo> list = this.bpmPurchaseInfoService.getDetailsListInId(Arrays.asList(deviceArray));
|
||||
ExcelUtil<PurchaseAcceptVo> util = new ExcelUtil<>(PurchaseAcceptVo.class);
|
||||
util.exportExcel(response, list, "新购任务设备列表");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ElementPlus级联选择器数据接口--获取设备类型
|
||||
*/
|
||||
|
|
@ -84,11 +114,10 @@ public class BpmPurchaseInfoController extends BaseController {
|
|||
*/
|
||||
@PutMapping(value = "/commit")
|
||||
@RequiresPermissions("purchase:bpmPurchaseInfo:edit")
|
||||
public ResultBean<Boolean> commit(@RequestBody @NotEmpty Integer[] taskArray) {
|
||||
public ResultBean<Boolean> commit(@RequestBody @NotEmpty(message = "请求参数不能为空") Integer[] taskArray) {
|
||||
int result = 0;
|
||||
for (Integer taskId : taskArray) {
|
||||
result += this.bpmTaskService.updateStatusById(48, taskId);
|
||||
}
|
||||
result += this.bpmTaskService.updateStatusById(PENDING_CONFIRMATION, Arrays.asList(taskArray));
|
||||
result += this.bpmPurchaseInfoService.updateStatusByTaskId(PENDING_CONFIRMATION, Arrays.asList(taskArray));
|
||||
return ResultBean.toIsSuccess(result);
|
||||
}
|
||||
|
||||
|
|
@ -98,11 +127,10 @@ public class BpmPurchaseInfoController extends BaseController {
|
|||
*/
|
||||
@PutMapping(value = "/confirm")
|
||||
@RequiresPermissions("purchase:bpmPurchaseInfo:edit")
|
||||
public ResultBean<Boolean> confirm(@RequestBody @NotEmpty Integer[] taskArray) {
|
||||
public ResultBean<Boolean> confirm(@RequestBody @NotEmpty(message = "请求参数不能为空") Integer[] taskArray) {
|
||||
int result = 0;
|
||||
for (Integer taskId : taskArray) {
|
||||
result += this.bpmTaskService.updateStatusById(49, taskId);
|
||||
}
|
||||
result += this.bpmTaskService.updateStatusById(PENDING_NOTIFICATION, Arrays.asList(taskArray));
|
||||
result += this.bpmPurchaseInfoService.updateStatusByTaskId(PENDING_NOTIFICATION, Arrays.asList(taskArray));
|
||||
return ResultBean.toIsSuccess(result);
|
||||
}
|
||||
|
||||
|
|
@ -161,6 +189,6 @@ public class BpmPurchaseInfoController extends BaseController {
|
|||
@DeleteMapping(value = "/deleteDetails/{id}")
|
||||
@RequiresPermissions("purchase:bpmPurchaseInfo:remove")
|
||||
public ResultBean< Boolean> deleteDetailsById(@PathVariable("id") Integer id) {
|
||||
return ResultBean.toIsSuccess(this.bpmPurchaseInfoService.deleteByPrimaryKey(id));
|
||||
return ResultBean.toIsSuccess(this.bpmPurchaseInfoService.updateIsActiveById(id));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
package com.bonus.purchase.controller;
|
||||
|
||||
import com.bonus.common.core.domain.ResultBean;
|
||||
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.purchase.domain.PurchaseStorageDto;
|
||||
import com.bonus.purchase.service.BpmPurchaseStorageService;
|
||||
import com.bonus.purchase.service.impl.BpmPurchaseInfoService;
|
||||
import com.bonus.purchase.vo.PurchaseVo;
|
||||
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.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Positive;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -29,6 +29,8 @@ public class BpmPurchaseStorageController extends BaseController {
|
|||
@Autowired
|
||||
private BpmPurchaseStorageService purchaseStorageService;
|
||||
|
||||
@Autowired
|
||||
private BpmPurchaseInfoService bpmPurchaseInfoService;
|
||||
|
||||
/**
|
||||
* 一级分页查询
|
||||
|
|
@ -40,9 +42,37 @@ public class BpmPurchaseStorageController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/*
|
||||
* 查看功能
|
||||
* */
|
||||
@GetMapping("{id}")
|
||||
public ResultBean<PurchaseStorageDto> queryById(@PathVariable("id") @NotNull(message = "ID不能为空")
|
||||
@Positive(message = "ID必须为正整数") Integer id) {
|
||||
return ResultBean.success(this.purchaseStorageService.selectByPrimaryKey(id));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 入库
|
||||
* */
|
||||
@PostMapping(value = "")
|
||||
public int warehouse(PurchaseStorageDto purchaseStorageDto) {
|
||||
bpmPurchaseInfoService.updateStatusByIdIn(Integer.valueOf(purchaseStorageDto.getStatus()),purchaseStorageDto.getId());
|
||||
PurchaseStorageDto purchaseStorageDto1 = purchaseStorageService.selectByPrimaryKey(purchaseStorageDto.getId());
|
||||
if (purchaseStorageDto1.getId() == null){
|
||||
throw new RuntimeException("未找到对应的数据");
|
||||
}
|
||||
return purchaseStorageService.insertWarehouse(purchaseStorageDto1);
|
||||
}
|
||||
/*
|
||||
* 入库驳回
|
||||
* */
|
||||
@PutMapping(value = "reject")
|
||||
public int reject(PurchaseStorageDto purchaseStorageDto) {
|
||||
return bpmPurchaseInfoService.updateStatusByIdIn(Integer.valueOf(purchaseStorageDto.getStatus()),purchaseStorageDto.getId());
|
||||
}
|
||||
/**
|
||||
* 查看验收单详情
|
||||
*
|
||||
* 明细
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ public class BpmNoticeUser implements Serializable {
|
|||
@ApiModelProperty(value="用户角色")
|
||||
private String userRole;
|
||||
|
||||
@ApiModelProperty(value="所属机构")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package com.bonus.purchase.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
* @PackagePath: com.bonus.purchase.dto
|
||||
* @CreateTime: 2024-08-22 15:49
|
||||
* @Description: 通知DTO
|
||||
*/
|
||||
@Data
|
||||
public class NoticeDto {
|
||||
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
@NotNull(message = "任务ID不能为空")
|
||||
private Integer taskId;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "用户ID数组")
|
||||
private Integer[] userIdArray;
|
||||
|
||||
@ApiModelProperty(value = "手机号数组")
|
||||
@NotEmpty(message = "手机号数组不能为空")
|
||||
private String[] phoneArray;
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.bonus.purchase.dto;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -14,7 +15,7 @@ import java.util.List;
|
|||
public class PurchaseDto {
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "类型id")
|
||||
private Integer typeId;
|
||||
|
|
@ -41,6 +42,7 @@ public class PurchaseDto {
|
|||
private List<Integer> taskIds;
|
||||
|
||||
@ApiModelProperty(value = "任务id")
|
||||
@NotNull(message = "查询详情任务id不能为空")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty(value = "二级明细id")
|
||||
|
|
|
|||
|
|
@ -64,5 +64,10 @@ public interface BpmNoticeUserMapper {
|
|||
|
||||
List<BpmNoticeUser> selectByTaskId(@Param("taskId")Integer taskId);
|
||||
|
||||
/**
|
||||
* 获取所有用户人员信息表
|
||||
* @return
|
||||
*/
|
||||
List<BpmNoticeUser> getAllUser();
|
||||
|
||||
}
|
||||
|
|
@ -33,27 +33,12 @@ public interface BpmPurchaseAcceptMapper {
|
|||
*/
|
||||
List<Integer> selectStatus(PurchaseDto purchaseDto);
|
||||
|
||||
/**
|
||||
* 更新任务状态
|
||||
* @param purchaseDto
|
||||
* @return
|
||||
*/
|
||||
int updateTask(@Param("purchaseDto") PurchaseDto purchaseDto);
|
||||
|
||||
/**
|
||||
* 审批合格或不合格
|
||||
* @param split
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
int updateDetails(@Param("array") String[] split, @Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* 查询状态
|
||||
* @param split
|
||||
* @param idList
|
||||
* @return
|
||||
*/
|
||||
List<PurchaseAcceptVo> select(@Param("array") String[] split);
|
||||
List<PurchaseAcceptVo> select(@Param("array") List<String> idList);
|
||||
|
||||
/**
|
||||
* 更新采购数量
|
||||
|
|
@ -61,5 +46,6 @@ public interface BpmPurchaseAcceptMapper {
|
|||
* @param purchaseNum
|
||||
* @return
|
||||
*/
|
||||
int updateCheckNum(@Param("id") Integer id, @Param("purchaseNum") Integer purchaseNum);
|
||||
int updateCheckNum(@Param("id") String id, @Param("purchaseNum") Integer purchaseNum);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
package com.bonus.purchase.mapper;
|
||||
import java.util.Collection;
|
||||
import com.bonus.base.api.domain.MaType;
|
||||
import com.bonus.purchase.dto.PurchaseDto;
|
||||
import com.bonus.purchase.vo.PurchaseAcceptVo;
|
||||
|
|
@ -28,7 +29,9 @@ public interface BpmPurchaseInfoMapper {
|
|||
*/
|
||||
List<PurchaseVo> selectMangerList(PurchaseDto purchaseDto);
|
||||
|
||||
int insertList(@Param("list")List<BpmPurchaseInfo> list);
|
||||
List<PurchaseVo> selectMangerListInId(@Param("idCollection") Collection<Integer> idCollection);
|
||||
|
||||
int insertList(@Param("list") List<BpmPurchaseInfo> list);
|
||||
|
||||
/**
|
||||
* 查询所有设备类型
|
||||
|
|
@ -44,6 +47,21 @@ public interface BpmPurchaseInfoMapper {
|
|||
*/
|
||||
List<PurchaseAcceptVo> getDetailsList(PurchaseDto record);
|
||||
|
||||
/**
|
||||
* 查询---根据任务ID详情设备列表
|
||||
*
|
||||
* @param taskId 任务id
|
||||
* @return 详情列表
|
||||
*/
|
||||
List<PurchaseAcceptVo> getDetailsList(Integer taskId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据ID查询领用明细
|
||||
* @param idCollection 领用详情表ID集合
|
||||
*/
|
||||
List<PurchaseAcceptVo> getDetailsListInId(@Param("idCollection") Collection<Integer> idCollection);
|
||||
|
||||
MaType selectMaTypeById(@Param("id") Integer id);
|
||||
|
||||
/**
|
||||
|
|
@ -53,6 +71,14 @@ public interface BpmPurchaseInfoMapper {
|
|||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* 删除领用明细--逻辑删除
|
||||
*/
|
||||
int updateIsActiveById(@Param("id")Integer id);
|
||||
|
||||
int updateStatusByIdIn(@Param("updatedStatus")Integer updatedStatus,@Param("idCollection")Collection<Integer> idCollection);
|
||||
|
||||
|
||||
/**
|
||||
* insert record to table
|
||||
* @param record the record
|
||||
|
|
@ -85,10 +111,18 @@ public interface BpmPurchaseInfoMapper {
|
|||
*/
|
||||
int updateByPrimaryKeySelective(BpmPurchaseInfo record);
|
||||
|
||||
|
||||
int updateStatusByTaskId(@Param("updatedStatus") Integer updatedStatus,@Param("taskId")Integer taskId);
|
||||
|
||||
int updateStatusByTaskIdIn(@Param("updatedStatus") Integer updatedStatus,@Param("taskIdCollection")Collection<Integer> taskIdCollection);
|
||||
|
||||
|
||||
/**
|
||||
* update record
|
||||
* @param record the updated record
|
||||
* @return update count
|
||||
*/
|
||||
int updateByPrimaryKey(BpmPurchaseInfo record);
|
||||
|
||||
int updateStatusById(@Param("updatedStatus") Integer updatedStatus, @Param("id") Integer id);
|
||||
}
|
||||
|
|
@ -10,5 +10,10 @@ public interface BpmPurchaseStorageMapper {
|
|||
List<PurchaseVo> selectAll(PurchaseStorageDto purchaseStorageDto);
|
||||
|
||||
List<PurchaseVo> getDetails(PurchaseStorageDto purchaseStorageDto);
|
||||
|
||||
PurchaseStorageDto selectByPrimaryKey(Integer id);
|
||||
|
||||
|
||||
int insertWarehouse(PurchaseStorageDto purchaseStorageDto);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,5 +26,8 @@ public interface BpmPurchaseStorageService {
|
|||
List<PurchaseVo> getDetails(PurchaseStorageDto purchaseStorageDto);
|
||||
|
||||
|
||||
PurchaseStorageDto selectByPrimaryKey(Integer id);
|
||||
|
||||
|
||||
int insertWarehouse(PurchaseStorageDto purchaseStorageDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,20 @@
|
|||
package com.bonus.purchase.service.impl;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.bonus.common.core.domain.ResultBean;
|
||||
import com.bonus.common.core.utils.sms.SmsUtils;
|
||||
import com.bonus.purchase.domain.BpmNoticeUser;
|
||||
import com.bonus.purchase.dto.NoticeDto;
|
||||
import com.bonus.purchase.mapper.BpmNoticeUserMapper;
|
||||
import com.bonus.purchase.mapper.BpmPurchaseInfoMapper;
|
||||
import com.bonus.purchase.vo.PurchaseAcceptVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import static com.bonus.purchase.utils.Constants.PENDING_ACCEPTANCE;
|
||||
|
||||
/**
|
||||
*@PackagePath: com.bonus.purchase
|
||||
*@author : 阮世耀
|
||||
|
|
@ -20,6 +28,41 @@ public class BpmNoticeUserService{
|
|||
@Autowired
|
||||
private BpmNoticeUserMapper bpmNoticeUserMapper;
|
||||
|
||||
@Autowired
|
||||
private BpmPurchaseInfoMapper bpmPurchaseInfoMapper;
|
||||
|
||||
/**
|
||||
* 发起验收
|
||||
*/
|
||||
public ResultBean<String> startAccept(NoticeDto noticeDto) {
|
||||
// 1. 拿到DTO中所有的手机号码
|
||||
String[] phoneArray = noticeDto.getPhoneArray();
|
||||
// 2. 根据任务ID查待验收机具信息
|
||||
List<PurchaseAcceptVo> deviceArray = bpmPurchaseInfoMapper.getDetailsList(noticeDto.getTaskId());
|
||||
if (CollectionUtil.isEmpty(deviceArray)) {
|
||||
return ResultBean.error("该任务下没有待验收的机具信息");
|
||||
}
|
||||
// 3. 组装短信发送内容
|
||||
StringBuilder content = new StringBuilder("【机具系统】各位同事您好,机具验收任务已发起,请及时进行机具验收。验收内容如下:");
|
||||
for (PurchaseAcceptVo device : deviceArray) {
|
||||
if (device == null || device.getPurchaseNum() == null || device.getPurchaseNum() == 0) {
|
||||
continue;
|
||||
}
|
||||
content.append("机具类型:")
|
||||
.append(device.getMaterialName()).append(",规格型号:")
|
||||
.append(device.getMaterialModel())
|
||||
.append(",数量:")
|
||||
.append(Double.valueOf(device.getPurchaseNum()) / 1000);
|
||||
}
|
||||
// 4. 调用工具类发送短信
|
||||
try {
|
||||
SmsUtils.smsToken(String.join(",", phoneArray), String.valueOf(content),"");
|
||||
} catch (Exception e) {
|
||||
System.out.println("新购发起验收短信发送失败:" + e.getMessage());
|
||||
}
|
||||
// 5. 修改任务状态
|
||||
return ResultBean.toIsSuccess(bpmPurchaseInfoMapper.updateStatusByTaskId(PENDING_ACCEPTANCE, noticeDto.getTaskId()));
|
||||
}
|
||||
|
||||
public int deleteByPrimaryKey(Integer id) {
|
||||
return bpmNoticeUserMapper.deleteByPrimaryKey(id);
|
||||
|
|
@ -27,10 +70,14 @@ public class BpmNoticeUserService{
|
|||
|
||||
|
||||
public int insert(BpmNoticeUser record) {
|
||||
setDefaultType(record);
|
||||
return bpmNoticeUserMapper.insert(record);
|
||||
}
|
||||
|
||||
|
||||
private static void setDefaultType(BpmNoticeUser record) {
|
||||
record.setType("1");
|
||||
}
|
||||
|
||||
public int insertOrUpdate(BpmNoticeUser record) {
|
||||
return bpmNoticeUserMapper.insertOrUpdate(record);
|
||||
}
|
||||
|
|
@ -42,7 +89,7 @@ public class BpmNoticeUserService{
|
|||
|
||||
|
||||
public int insertSelective(BpmNoticeUser record) {
|
||||
record.setType("1");
|
||||
setDefaultType(record);
|
||||
return bpmNoticeUserMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
|
|
@ -69,11 +116,11 @@ public class BpmNoticeUserService{
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有用户人员信息表
|
||||
* @return
|
||||
*/
|
||||
public List<BpmNoticeUser> getAllUser() {
|
||||
return bpmNoticeUserMapper.getAllUser();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,17 @@ import com.alibaba.nacos.common.utils.CollectionUtils;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.purchase.dto.PurchaseDto;
|
||||
import com.bonus.purchase.mapper.BpmPurchaseAcceptMapper;
|
||||
import com.bonus.purchase.mapper.BpmPurchaseInfoMapper;
|
||||
import com.bonus.purchase.service.BpmPurchaseAcceptService;
|
||||
import com.bonus.purchase.utils.Constants;
|
||||
import com.bonus.purchase.vo.PurchaseAcceptVo;
|
||||
import com.bonus.task.mapper.BpmTaskMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -26,6 +29,12 @@ public class BpmPurchaseAcceptServiceImpl implements BpmPurchaseAcceptService {
|
|||
@Resource
|
||||
private BpmPurchaseAcceptMapper mapper;
|
||||
|
||||
@Resource
|
||||
private BpmTaskMapper bpmTaskMapper;
|
||||
|
||||
@Resource
|
||||
private BpmPurchaseInfoMapper bpmPurchaseInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询采购单
|
||||
* @param purchaseDto
|
||||
|
|
@ -55,13 +64,13 @@ public class BpmPurchaseAcceptServiceImpl implements BpmPurchaseAcceptService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult updateTask(PurchaseDto purchaseDto) {
|
||||
//只有任务状态为待验收时,方可批量验收合格
|
||||
if (purchaseDto.getTaskId() != null) {
|
||||
String[] split = purchaseDto.getTaskId().split(",");
|
||||
ArrayList<Integer> list = new ArrayList<>();
|
||||
if (purchaseDto.getId() != null) {
|
||||
String[] split = purchaseDto.getId().split(",");
|
||||
List<Integer> taskIdList = new ArrayList<>();
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
list.add(Integer.parseInt(split[i]));
|
||||
taskIdList.add(Integer.parseInt(split[i]));
|
||||
}
|
||||
purchaseDto.setTaskIds(list);
|
||||
purchaseDto.setTaskIds(taskIdList);
|
||||
List<Integer> statusList = mapper.selectStatus(purchaseDto);
|
||||
if (CollectionUtils.isNotEmpty(statusList)) {
|
||||
for (Integer status : statusList) {
|
||||
|
|
@ -70,42 +79,68 @@ public class BpmPurchaseAcceptServiceImpl implements BpmPurchaseAcceptService {
|
|||
}
|
||||
}
|
||||
}
|
||||
purchaseDto.setStatus(Constants.PURCHASE_ACCEPTED);
|
||||
int result;
|
||||
int result = 0;
|
||||
try {
|
||||
result = mapper.updateTask(purchaseDto);
|
||||
//根据任务id查询详情表
|
||||
List<Integer> taskIds = purchaseDto.getTaskIds();
|
||||
for (Integer taskId : taskIds) {
|
||||
purchaseDto.setId(taskId);
|
||||
for (Integer taskId : taskIdList) {
|
||||
purchaseDto.setId(String.valueOf(taskId));
|
||||
List<PurchaseAcceptVo> details = mapper.getDetails(purchaseDto);
|
||||
//根据查询的采购数量,更新验收数量
|
||||
for (PurchaseAcceptVo purchaseVo : details) {
|
||||
result = mapper.updateCheckNum(purchaseVo.getId(), purchaseVo.getPurchaseNum());
|
||||
result += mapper.updateCheckNum(purchaseVo.getPurchaseId(), purchaseVo.getPurchaseNum());
|
||||
if ("0".equals(purchaseVo.getManageType())) {
|
||||
result += bpmPurchaseInfoMapper.updateStatusById(Constants.PENDING_BINDING, Integer.parseInt(purchaseVo.getPurchaseId()));
|
||||
} else if ("1".equals(purchaseVo.getManageType())) {
|
||||
result += bpmPurchaseInfoMapper.updateStatusById(Constants.PENDING_INVENTORY, Integer.parseInt(purchaseVo.getPurchaseId()));
|
||||
}
|
||||
}
|
||||
// 提取 PurchaseId
|
||||
List<String> idList = details.stream().map(PurchaseAcceptVo::getPurchaseId).collect(Collectors.toList());
|
||||
//根据详情id查询详情状态,更新任务表状态
|
||||
List<PurchaseAcceptVo> idStatusList = mapper.select(idList);
|
||||
// 使用流 API 按 id 分组,并提取 status
|
||||
Map<Integer, List<Integer>> groupedByIdStatus = idStatusList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
PurchaseAcceptVo::getId,
|
||||
Collectors.mapping(PurchaseAcceptVo::getStatus, Collectors.toList())
|
||||
));
|
||||
for (Map.Entry<Integer, List<Integer>> entry : groupedByIdStatus.entrySet()) {
|
||||
Integer id = entry.getKey();
|
||||
List<Integer> statusList1 = entry.getValue();
|
||||
if (statusList1.contains(Constants.PENDING_BINDING)) {
|
||||
//如果详情状态包含待绑定,则外部任务状态为待绑定
|
||||
result += bpmTaskMapper.updateStatusById(Constants.PENDING_BINDING, id);
|
||||
} else if (!statusList1.contains(Constants.PENDING_BINDING) && statusList1.contains(Constants.PENDING_INVENTORY)) {
|
||||
result += bpmTaskMapper.updateStatusById(Constants.PENDING_INVENTORY, id);
|
||||
}
|
||||
}
|
||||
if (result > 0) {
|
||||
return AjaxResult.success("批量验收合格成功");
|
||||
}
|
||||
}
|
||||
if (result > 0) {
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else if (purchaseDto.getPurchaseId() != null) {
|
||||
String[] split = purchaseDto.getPurchaseId().split(",");
|
||||
purchaseDto.setStatus(Constants.PURCHASE_ACCEPTED);
|
||||
int result;
|
||||
purchaseDto.setStatus(Constants.PENDING_BINDING);
|
||||
int result = 0;
|
||||
try {
|
||||
result = mapper.updateDetails(split, purchaseDto.getStatus());
|
||||
//根据采购单id查询详情id
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
purchaseDto.setPurchaseId(split[i]);
|
||||
List<PurchaseAcceptVo> details = mapper.getDetails(purchaseDto);
|
||||
for (PurchaseAcceptVo purchaseVo : details) {
|
||||
result = mapper.updateCheckNum(purchaseVo.getId(), purchaseVo.getPurchaseNum());
|
||||
if (CollectionUtils.isNotEmpty(details)) {
|
||||
if ("0".equals(details.get(0).getManageType())) {
|
||||
bpmPurchaseInfoMapper.updateStatusById(Constants.PENDING_BINDING, Integer.parseInt(split[i]));
|
||||
} else if ("1".equals(details.get(0).getManageType())) {
|
||||
bpmPurchaseInfoMapper.updateStatusById(Constants.PENDING_INVENTORY, Integer.parseInt(split[i]));
|
||||
}
|
||||
}
|
||||
result = mapper.updateCheckNum(details.get(0).getPurchaseId(), details.get(0).getPurchaseNum());
|
||||
}
|
||||
//根据详情id查询详情状态,更新任务表状态
|
||||
List<PurchaseAcceptVo> statusList = mapper.select(split);
|
||||
List<PurchaseAcceptVo> statusList = mapper.select(Arrays.asList(split));
|
||||
// 使用流 API 按 id 分组,并提取 status
|
||||
Map<Integer, List<Integer>> groupedByIdStatus = statusList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
|
|
@ -114,24 +149,16 @@ public class BpmPurchaseAcceptServiceImpl implements BpmPurchaseAcceptService {
|
|||
));
|
||||
for (Map.Entry<Integer, List<Integer>> entry : groupedByIdStatus.entrySet()) {
|
||||
Integer id = entry.getKey();
|
||||
ArrayList<Integer> list = new ArrayList<>();
|
||||
List<Integer> statusList1 = entry.getValue();
|
||||
if (!statusList1.contains(Constants.PENDING_ACCEPTANCE) && statusList1.contains(Constants.PURCHASE_ACCEPTED)
|
||||
&& !statusList1.contains(Constants.PURCHASE_NO_PASSED)) {
|
||||
//如果不包含47和49,则更新任务状态为48 全部通过
|
||||
list.add(id);
|
||||
purchaseDto.setTaskIds(list);
|
||||
purchaseDto.setStatus(Constants.PURCHASE_ACCEPTED);
|
||||
result = mapper.updateTask(purchaseDto);
|
||||
} else if (!statusList1.contains(Constants.PENDING_ACCEPTANCE) && statusList1.contains(Constants.PURCHASE_NO_PASSED)) {
|
||||
list.add(id);
|
||||
purchaseDto.setTaskIds(list);
|
||||
purchaseDto.setStatus(Constants.PURCHASE_NO_PASSED);
|
||||
result = mapper.updateTask(purchaseDto);
|
||||
if (statusList1.contains(Constants.PENDING_BINDING)) {
|
||||
//如果详情状态包含待绑定,则外部任务状态为待绑定
|
||||
result += bpmTaskMapper.updateStatusById(Constants.PENDING_BINDING, id);
|
||||
} else if (!statusList1.contains(Constants.PENDING_BINDING) && statusList1.contains(Constants.PENDING_INVENTORY)) {
|
||||
result += bpmTaskMapper.updateStatusById(Constants.PENDING_INVENTORY, id);
|
||||
}
|
||||
}
|
||||
if (result > 0) {
|
||||
return AjaxResult.success("操作成功");
|
||||
return AjaxResult.success("批量验收合格成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
@ -150,12 +177,13 @@ public class BpmPurchaseAcceptServiceImpl implements BpmPurchaseAcceptService {
|
|||
public AjaxResult updateDetails(PurchaseDto purchaseDto) {
|
||||
if (purchaseDto.getPurchaseId() != null) {
|
||||
String[] split = purchaseDto.getPurchaseId().split(",");
|
||||
purchaseDto.setStatus(Constants.PURCHASE_NO_PASSED);
|
||||
int result;
|
||||
// 将字符串数组转换为 List<Integer>
|
||||
List<Integer> idList = Arrays.stream(split).map(Integer::parseInt).collect(Collectors.toList());
|
||||
int result = 0;
|
||||
try {
|
||||
result = mapper.updateDetails(split, purchaseDto.getStatus());
|
||||
result += bpmPurchaseInfoMapper.updateStatusByTaskIdIn(Constants.PURCHASE_NO_PASSED, idList);
|
||||
//根据详情id查询详情状态,更新任务表状态
|
||||
List<PurchaseAcceptVo> statusList = mapper.select(split);
|
||||
List<PurchaseAcceptVo> statusList = mapper.select(Arrays.asList(split));
|
||||
// 使用流 API 按 id 分组,并提取 status
|
||||
Map<Integer, List<Integer>> groupedByIdStatus = statusList.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
|
|
@ -164,20 +192,13 @@ public class BpmPurchaseAcceptServiceImpl implements BpmPurchaseAcceptService {
|
|||
));
|
||||
for (Map.Entry<Integer, List<Integer>> entry : groupedByIdStatus.entrySet()) {
|
||||
Integer id = entry.getKey();
|
||||
ArrayList<Integer> list = new ArrayList<>();
|
||||
List<Integer> statusList1 = entry.getValue();
|
||||
if (!statusList1.contains(Constants.PENDING_ACCEPTANCE) && statusList1.contains(Constants.PURCHASE_ACCEPTED)
|
||||
&& !statusList1.contains(Constants.PURCHASE_NO_PASSED)) {
|
||||
//如果不包含47和49,则更新任务状态为48 全部通过
|
||||
list.add(id);
|
||||
purchaseDto.setTaskIds(list);
|
||||
purchaseDto.setStatus(Constants.PURCHASE_ACCEPTED);
|
||||
result = mapper.updateTask(purchaseDto);
|
||||
result += bpmTaskMapper.updateStatusById(Constants.PURCHASE_ACCEPTED, id);
|
||||
} else if (!statusList1.contains(Constants.PENDING_ACCEPTANCE) && statusList1.contains(Constants.PURCHASE_NO_PASSED)) {
|
||||
list.add(id);
|
||||
purchaseDto.setTaskIds(list);
|
||||
purchaseDto.setStatus(Constants.PURCHASE_NO_PASSED);
|
||||
result = mapper.updateTask(purchaseDto);
|
||||
result += bpmTaskMapper.updateStatusById(Constants.PURCHASE_NO_PASSED, id);
|
||||
}
|
||||
}
|
||||
if (result > 0) {
|
||||
|
|
|
|||
|
|
@ -1,27 +1,25 @@
|
|||
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 cn.hutool.core.util.RandomUtil;
|
||||
import com.bonus.base.api.domain.MaType;
|
||||
import com.bonus.common.core.utils.DateTimeHelper;
|
||||
import com.bonus.common.core.utils.StringHelper;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.purchase.domain.BpmPurchaseInfo;
|
||||
import com.bonus.purchase.dto.PurchaseDto;
|
||||
import com.bonus.purchase.dto.PurchaseTaskDto;
|
||||
import com.bonus.purchase.mapper.BpmPurchaseInfoMapper;
|
||||
import com.bonus.purchase.vo.PurchaseAcceptVo;
|
||||
import com.bonus.purchase.vo.PurchaseVo;
|
||||
import com.bonus.task.domain.BpmTask;
|
||||
import com.bonus.purchase.dto.PurchaseTaskDto;
|
||||
import com.bonus.purchase.mapper.BpmPurchaseInfoMapper;
|
||||
import com.bonus.task.mapper.BpmTaskMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.bonus.purchase.domain.BpmPurchaseInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
import static com.bonus.purchase.utils.Constants.PENDING_SUBMISSION;
|
||||
import static com.bonus.purchase.utils.Constants.PENDING_SUBMISSION_BYTE;
|
||||
|
||||
/**
|
||||
*@PackagePath: com.bonus.purchase
|
||||
|
|
@ -43,37 +41,37 @@ public class BpmPurchaseInfoService{
|
|||
return bpmPurchaseInfoMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int insert(BpmPurchaseInfo record) {
|
||||
return bpmPurchaseInfoMapper.insert(record);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int insertOrUpdate(BpmPurchaseInfo record) {
|
||||
return bpmPurchaseInfoMapper.insertOrUpdate(record);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int insertOrUpdateSelective(BpmPurchaseInfo record) {
|
||||
return bpmPurchaseInfoMapper.insertOrUpdateSelective(record);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int insertSelective(BpmPurchaseInfo record) {
|
||||
return bpmPurchaseInfoMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public BpmPurchaseInfo selectByPrimaryKey(Integer id) {
|
||||
return bpmPurchaseInfoMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int updateByPrimaryKeySelective(BpmPurchaseInfo record) {
|
||||
return bpmPurchaseInfoMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int updateByPrimaryKey(BpmPurchaseInfo record) {
|
||||
return bpmPurchaseInfoMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
|
|
@ -92,6 +90,17 @@ public class BpmPurchaseInfoService{
|
|||
return bpmPurchaseInfoMapper.getDetailsList(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询--根据ID集合查设备列表
|
||||
*/
|
||||
public List<PurchaseAcceptVo> getDetailsListInId(Collection<Integer> idCollection) {
|
||||
return bpmPurchaseInfoMapper.getDetailsListInId(idCollection);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新购设备任务创建
|
||||
* @param purchaseTaskDto 任务数据、设备数据集合
|
||||
*/
|
||||
public int insertList(PurchaseTaskDto purchaseTaskDto) {
|
||||
// 映射Dto至Pojo对象
|
||||
BpmTask task = new BpmTask();
|
||||
|
|
@ -107,7 +116,7 @@ public class BpmPurchaseInfoService{
|
|||
String code = "XG" + DateTimeHelper.getNowMonthFomart() + "-" + formatTaskNumber;
|
||||
task.setCode(code);
|
||||
// 赋值任务状态
|
||||
task.setStatus(47);
|
||||
task.setStatus(PENDING_SUBMISSION);
|
||||
String creator = String.valueOf(SecurityUtils.getLoginUser().getUserid());
|
||||
task.setCreator(creator);
|
||||
// 处理任务表数据 ---------------- end ------
|
||||
|
|
@ -122,7 +131,7 @@ public class BpmPurchaseInfoService{
|
|||
// 给集合中所有对象赋值任务ID
|
||||
list.replaceAll(obj -> {
|
||||
obj.setTaskId(task.getId());
|
||||
obj.setStatus((byte)47);
|
||||
obj.setStatus(PENDING_SUBMISSION_BYTE);
|
||||
obj.setUpdater(creator);
|
||||
return obj;
|
||||
});
|
||||
|
|
@ -139,6 +148,10 @@ public class BpmPurchaseInfoService{
|
|||
return bpmPurchaseInfoMapper.selectMangerList(purchaseDto);
|
||||
}
|
||||
|
||||
public List<PurchaseVo> selectMangerListInId(Collection<Integer> idCollection) {
|
||||
return bpmPurchaseInfoMapper.selectMangerListInId(idCollection);
|
||||
}
|
||||
|
||||
public MaType selectMaTypeById(Integer id) {
|
||||
return bpmPurchaseInfoMapper.selectMaTypeById(id);
|
||||
}
|
||||
|
|
@ -193,6 +206,26 @@ public class BpmPurchaseInfoService{
|
|||
return itemNode;
|
||||
}
|
||||
|
||||
public int updateStatusByTaskId(Integer updatedStatus,Integer taskId){
|
||||
return bpmPurchaseInfoMapper.updateStatusByTaskId(updatedStatus,taskId);
|
||||
}
|
||||
|
||||
public int updateStatusByTaskId(Integer updatedStatus, Collection<Integer> taskIdCollection){
|
||||
return bpmPurchaseInfoMapper.updateStatusByTaskIdIn(updatedStatus,taskIdCollection);
|
||||
}
|
||||
|
||||
public int updateIsActiveById(Integer id){
|
||||
return bpmPurchaseInfoMapper.updateIsActiveById(id);
|
||||
}
|
||||
|
||||
public int updateStatusByIdIn(Integer updatedStatus,Integer id){
|
||||
return bpmPurchaseInfoMapper.updateStatusById(updatedStatus,id);
|
||||
}
|
||||
|
||||
public int updateStatusByIdIn(Integer updatedStatus,Collection<Integer> idCollection){
|
||||
return bpmPurchaseInfoMapper.updateStatusByIdIn(updatedStatus,idCollection);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -26,4 +26,17 @@ public class BpmPurchaseStorageServiceImpl implements BpmPurchaseStorageService
|
|||
return bpmPurchaseStorageMapper.getDetails(purchaseStorageDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchaseStorageDto selectByPrimaryKey(Integer id) {
|
||||
return bpmPurchaseStorageMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWarehouse(PurchaseStorageDto purchaseStorageDto) {
|
||||
|
||||
return bpmPurchaseStorageMapper.insertWarehouse(purchaseStorageDto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@ public class Constants {
|
|||
*/
|
||||
public static final Integer PENDING_SUBMISSION = 47;
|
||||
|
||||
/**
|
||||
* 待提交--byte类型
|
||||
*/
|
||||
public static final Byte PENDING_SUBMISSION_BYTE = 47;
|
||||
|
||||
/**
|
||||
* 待确认
|
||||
*/
|
||||
|
|
@ -22,6 +27,11 @@ public class Constants {
|
|||
*/
|
||||
public static final Integer PENDING_NOTIFICATION = 49;
|
||||
|
||||
/**
|
||||
* 待通知--byte类型
|
||||
*/
|
||||
public static final Byte PENDING_NOTIFICATION_BYTE = 49;
|
||||
|
||||
/**
|
||||
* 待验收
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ public class PurchaseAcceptVo {
|
|||
private String materialName;
|
||||
|
||||
@ApiModelProperty("规格型号")
|
||||
private String specificationCode;
|
||||
private String materialModel;
|
||||
|
||||
@ApiModelProperty(value="单位")
|
||||
@ApiModelProperty(value="单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value="供应商名称")
|
||||
|
|
@ -60,8 +60,7 @@ public class PurchaseAcceptVo {
|
|||
private Integer notaxPrice;
|
||||
|
||||
@ApiModelProperty(value="税率")
|
||||
@Excel(name = "税率")
|
||||
private Integer taxRate;
|
||||
private String taxRate;
|
||||
|
||||
@ApiModelProperty(value="验收数量")
|
||||
@Excel(name = "验收数量")
|
||||
|
|
@ -89,4 +88,11 @@ public class PurchaseAcceptVo {
|
|||
@ApiModelProperty(value="备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "二级明细id")
|
||||
private String purchaseId;
|
||||
|
||||
@ApiModelProperty(value = "管理类型0是编码1计数")
|
||||
private String manageType;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class PurchaseVo {
|
|||
private String materialName;
|
||||
|
||||
@ApiModelProperty("规格型号")
|
||||
private String specificationCode;
|
||||
private String materialModel;
|
||||
|
||||
@ApiModelProperty(value="单位")
|
||||
private String unitName;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
package com.bonus.task.mapper;
|
||||
import java.util.Collection;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.bonus.task.domain.BpmTask;
|
||||
|
|
@ -63,4 +64,8 @@ public interface BpmTaskMapper {
|
|||
|
||||
int updateStatusById(@Param("updatedStatus")Integer updatedStatus,@Param("id")Integer id);
|
||||
|
||||
int updateStatusByIdIn(@Param("updatedStatus")Integer updatedStatus,@Param("idCollection")Collection<Integer> idCollection);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
package com.bonus.task.service;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.task.mapper.BpmTaskMapper;
|
||||
|
|
@ -75,6 +76,13 @@ public class BpmTaskService{
|
|||
return bpmTaskMapper.updateStatusById(updatedStatus,id);
|
||||
}
|
||||
|
||||
public int updateStatusById(Integer updatedStatus, Collection<Integer> idCollection){
|
||||
return bpmTaskMapper.updateStatusByIdIn(updatedStatus,idCollection);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,18 +2,21 @@
|
|||
<!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="user_name" jdbcType="VARCHAR" property="userName" />
|
||||
<result column="user_role" jdbcType="VARCHAR" property="userRole" />
|
||||
<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
|
||||
|
|
@ -194,8 +197,32 @@
|
|||
<!--by syruan on 2024-08-20-->
|
||||
<select id="selectByTaskId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
<include refid="Base_Column_List"/>,
|
||||
sys_user.user_name,
|
||||
sys_role.role_name as user_role,
|
||||
CONCAT(sd2.dept_name,'/',sd1.dept_name,'/',sd.dept_name) as deptName
|
||||
from bpm_notice_user
|
||||
left join sys_user on bpm_notice_user.user_id = sys_user.user_id
|
||||
left join sys_user_role on sys_user.user_id = sys_user_role.user_id
|
||||
left join sys_role on sys_user_role.role_id = sys_role.role_id
|
||||
LEFT JOIN sys_dept sd on sys_user.dept_id = sd.dept_id
|
||||
LEFT JOIN sys_dept sd1 on sd.parent_id = sd1.dept_id
|
||||
LEFT JOIN sys_dept sd2 on sd1.parent_id = sd2.dept_id
|
||||
where bpm_notice_user.task_id = #{taskId,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="getAllUser" resultType="com.bonus.purchase.domain.BpmNoticeUser">
|
||||
SELECT
|
||||
su.user_id as userId,
|
||||
su.user_name as userName,
|
||||
sr.role_name AS userRole,
|
||||
su.phonenumber as phone,
|
||||
CONCAT( sd2.dept_name, '/', sd1.dept_name, '/', sd.dept_name ) as deptName
|
||||
FROM
|
||||
sys_user su
|
||||
LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id
|
||||
LEFT JOIN sys_role sr ON sur.role_id = sr.role_id
|
||||
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
||||
LEFT JOIN sys_dept sd1 ON sd.parent_id = sd1.dept_id
|
||||
LEFT JOIN sys_dept sd2 ON sd1.parent_id = sd2.dept_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -3,25 +3,7 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.purchase.mapper.BpmPurchaseAcceptMapper">
|
||||
<update id="updateTask">
|
||||
UPDATE bpm_task bt
|
||||
SET bt.`status` = #{purchaseDto.status}
|
||||
WHERE
|
||||
bt.task_id IN
|
||||
<foreach collection="purchaseDto.taskIds" item="taskId" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateDetails">
|
||||
UPDATE bpm_purchase_info bp
|
||||
SET bp.`status` = #{status}
|
||||
WHERE
|
||||
bp.id IN
|
||||
<foreach item="purchaseId" collection="array" open="(" separator="," close=")">
|
||||
#{purchaseId}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateCheckNum">
|
||||
UPDATE bpm_purchase_info bp
|
||||
SET bp.check_num = #{purchaseNum}
|
||||
|
|
@ -38,7 +20,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SUM( bp.purchase_num ) AS purchaseNum,
|
||||
SUM( bp.purchase_price ) AS purchasePrice,
|
||||
SUM( bp.notax_price ) AS notaxPrice,
|
||||
CONCAT(bp.tax_rate, '%') AS taxRate,
|
||||
su.nick_name AS createBy,
|
||||
bt.create_time AS createTime,
|
||||
bt.`status` AS STATUS,
|
||||
|
|
@ -77,12 +58,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
bp.id AS purchaseId,
|
||||
mt1.`name` AS materialName,
|
||||
mt.`name` AS specificationCode,
|
||||
mt.`name` AS materialModel,
|
||||
mt.manage_type AS manageType,
|
||||
sda.dict_label AS unitName,
|
||||
bp.purchase_price AS purchasePrice,
|
||||
bp.notax_price AS notaxPrice,
|
||||
bp.purchase_num AS purchaseNum,
|
||||
bs.`name` AS supplierName,
|
||||
CONCAT(bp.tax_rate, '%') AS taxRate,
|
||||
bp.product_date AS productDate,
|
||||
bp.`status` AS STATUS,
|
||||
sda1.dict_label AS statusName
|
||||
|
|
@ -97,10 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
bp.is_active = '1'
|
||||
<if test="typeId != null and typeId != ''">
|
||||
AND (
|
||||
mt1.id = #{typeId}
|
||||
OR mt.id = #{typeId}
|
||||
)
|
||||
AND mt.id = #{typeId}
|
||||
</if>
|
||||
<if test="supplierId != null and supplierId != ''">
|
||||
AND bs.id = #{supplierId}
|
||||
|
|
@ -117,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectStatus" resultType="java.lang.Integer">
|
||||
select status from bpm_task bt
|
||||
select status from bpm_task
|
||||
where id in
|
||||
<foreach collection="taskIds" item="taskId" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
|
|
@ -127,11 +107,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="select" resultType="com.bonus.purchase.vo.PurchaseAcceptVo">
|
||||
select task_id as id,
|
||||
status as status
|
||||
from bpm_purchase_info bp
|
||||
from bpm_purchase_info
|
||||
where id in
|
||||
<foreach collection="array" item="taskId" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -675,7 +675,7 @@
|
|||
SELECT
|
||||
bp.id,
|
||||
mt1.`name` AS materialName,
|
||||
mt.`name` AS specificationCode,
|
||||
mt.`name` AS materialModel,
|
||||
sda.dict_label AS unitName,
|
||||
bp.purchase_price AS purchasePrice,
|
||||
bp.notax_price AS notaxPrice,
|
||||
|
|
@ -696,4 +696,103 @@
|
|||
bp.is_active = '1'
|
||||
AND bp.task_id = #{taskId,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<!--by syruan on 2024-08-22-->
|
||||
<update id="updateStatusByTaskId">
|
||||
update bpm_purchase_info
|
||||
set `status`=#{updatedStatus,jdbcType=TINYINT}
|
||||
where task_id=#{taskId,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<!--by syruan on 2024-08-22-->
|
||||
<update id="updateStatusByTaskIdIn">
|
||||
update bpm_purchase_info
|
||||
set `status`=#{updatedStatus,jdbcType=TINYINT}
|
||||
where task_id in
|
||||
<foreach item="item" index="index" collection="taskIdCollection" open="(" separator="," close=")">
|
||||
#{item,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!--by syruan on 2024-08-22-->
|
||||
<update id="updateIsActiveById">
|
||||
update bpm_purchase_info
|
||||
set is_active = 0
|
||||
where id=#{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<select id="selectMangerListInId" resultType="com.bonus.purchase.vo.PurchaseVo">
|
||||
SELECT
|
||||
bt.id AS id,
|
||||
bt.arrival_time AS arrivalTime,
|
||||
bt.`code` AS purchaseCode,
|
||||
GROUP_CONCAT( mt.`name` ) AS purchaseMaterial,
|
||||
SUM( bp.purchase_num ) AS purchaseNum,
|
||||
SUM( bp.purchase_price ) AS purchasePrice,
|
||||
SUM( bp.notax_price ) AS notaxPrice,
|
||||
'10' AS taxRate,
|
||||
bt.creator AS createBy,
|
||||
bt.create_time AS createTime,
|
||||
bt.`status` AS STATUS,
|
||||
sda.dict_label AS statusName,
|
||||
bt.remark AS remark
|
||||
FROM
|
||||
bpm_purchase_info bp
|
||||
LEFT JOIN bpm_task bt ON bp.task_id = bt.id
|
||||
LEFT JOIN ma_type mt ON bp.type_id = mt.id
|
||||
LEFT JOIN sys_dict_data sda ON sda.dict_code = bt.`status`
|
||||
WHERE
|
||||
bt.is_active = '1'
|
||||
AND bp.task_id IN
|
||||
<foreach item="item" index="index" collection="idCollection" open="(" separator="," close=")">
|
||||
#{item,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
GROUP BY
|
||||
bp.task_id
|
||||
</select>
|
||||
|
||||
<select id="getDetailsListInId" resultType="com.bonus.purchase.vo.PurchaseAcceptVo">
|
||||
SELECT
|
||||
bp.id,
|
||||
mt1.`name` AS materialName,
|
||||
mt.`name` AS materialModel,
|
||||
sda.dict_label AS unitName,
|
||||
bp.purchase_price AS purchasePrice,
|
||||
bp.notax_price AS notaxPrice,
|
||||
bp.purchase_num AS purchaseNum,
|
||||
bs.`name` AS supplierName,
|
||||
bp.product_date AS productDate,
|
||||
bp.`status` AS STATUS,
|
||||
sda1.dict_label AS statusName
|
||||
FROM
|
||||
bpm_purchase_info bp
|
||||
LEFT JOIN bpm_task bt ON bp.task_id = bt.id
|
||||
LEFT JOIN ma_type mt ON bp.type_id = mt.id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.id
|
||||
LEFT JOIN sys_dict_data sda ON mt.unit_id = sda.dict_code
|
||||
LEFT JOIN bm_supplier bs ON bp.supplier_id = bs.id
|
||||
LEFT JOIN sys_dict_data sda1 ON sda1.dict_code = bp.`status`
|
||||
WHERE
|
||||
bp.is_active = '1'
|
||||
AND bp.id IN
|
||||
<foreach item="item" index="index" collection="idCollection" open="(" separator="," close=")">
|
||||
#{item,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--by syruan on 2024-08-22-->
|
||||
<update id="updateStatusByIdIn">
|
||||
update bpm_purchase_info
|
||||
set `status`=#{updatedStatus,jdbcType=TINYINT}
|
||||
where id in
|
||||
<foreach item="item" index="index" collection="idCollection"
|
||||
open="(" separator="," close=")">
|
||||
#{item,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateStatusById">
|
||||
update bpm_purchase_info
|
||||
set `status`=#{updatedStatus,jdbcType=TINYINT}
|
||||
where id=#{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -1,6 +1,14 @@
|
|||
<?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.BpmPurchaseStorageMapper">
|
||||
<insert id="insertWarehouse" parameterType="com.bonus.purchase.domain.PurchaseStorageDto">
|
||||
INSERT INTO bpm_input_record(
|
||||
id,task_id,type_id,ma_id,manage_type,creator,create_time,status,input_num,input_type
|
||||
)VALUES
|
||||
(
|
||||
#{id},#{taskId},#{typeId},#{maId},#{manageType},#{creator},#{createTime},#{status},#{inputNum},#{inputType}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="selectAll" resultType="com.bonus.purchase.vo.PurchaseVo">
|
||||
|
|
@ -12,7 +20,6 @@
|
|||
SUM( bp.purchase_num ) AS purchaseNum,
|
||||
SUM( bp.purchase_price ) AS purchasePrice,
|
||||
SUM( bp.notax_price ) AS notaxPrice,
|
||||
bp.tax_rate AS taxRate,
|
||||
bt.creator AS createBy,
|
||||
bt.create_time AS createTime,
|
||||
bt.`status` AS STATUS,
|
||||
|
|
@ -24,7 +31,7 @@
|
|||
LEFT JOIN ma_type mt ON bp.type_id = mt.id
|
||||
LEFT JOIN sys_dict_data sda ON sda.dict_code = bt.`status`
|
||||
WHERE
|
||||
bp.is_acvtive = '1'
|
||||
bp.is_active = '1'
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
AND bt.arrival_time BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
|
|
@ -50,7 +57,7 @@
|
|||
SELECT
|
||||
bp.id AS id,
|
||||
mt1.`name` AS materialName,
|
||||
mt.`name` AS specificationCode,
|
||||
mt.`name` AS materialModel,
|
||||
sda.dict_label AS unitName,
|
||||
bp.purchase_price AS purchasePrice,
|
||||
bp.notax_price AS notaxPrice,
|
||||
|
|
@ -82,4 +89,13 @@
|
|||
AND bp.product_date = #{productDate}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" resultType="com.bonus.purchase.domain.PurchaseStorageDto"
|
||||
parameterType="java.lang.Integer" >
|
||||
select
|
||||
id, task_id, type_id, purchase_num, check_num, purchase_price, notax_price, tax_rate,
|
||||
supplier_id, product_date, `status`, bind_num, input_num, updater, update_time, auditor,
|
||||
audit_time, is_active, remark, file_url
|
||||
from bpm_purchase_info
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -405,4 +405,13 @@
|
|||
where id=#{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<!--by syruan on 2024-08-22-->
|
||||
<update id="updateStatusByIdIn">
|
||||
update bpm_task
|
||||
set `status`=#{updatedStatus,jdbcType=INTEGER}
|
||||
where id in
|
||||
<foreach item="item" index="index" collection="idCollection" open="(" separator="," close=")">
|
||||
#{item,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue