新购验收入库 入库 入库驳回
This commit is contained in:
parent
29fc0b28b7
commit
7de7a3049a
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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,25 +1,22 @@
|
|||
package com.bonus.purchase.service.impl;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
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;
|
||||
|
|
@ -44,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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,4 +114,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</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>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue