parent
5e7340b2db
commit
73a04deb02
@ -0,0 +1,120 @@
|
||||
package com.hw.mes.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.common.security.annotation.RequiresPermissions;
|
||||
import com.hw.mes.domain.MesPurchaseApply;
|
||||
import com.hw.mes.service.IMesPurchaseApplyService;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 采购申请单Controller
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-10-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/purchaseApply")
|
||||
public class MesPurchaseApplyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMesPurchaseApplyService mesPurchaseApplyService;
|
||||
|
||||
/**
|
||||
* 查询采购申请单列表
|
||||
*/
|
||||
@RequiresPermissions("mes:purchaseApply:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesPurchaseApply mesPurchaseApply)
|
||||
{
|
||||
startPage();
|
||||
List<MesPurchaseApply> list = mesPurchaseApplyService.selectMesPurchaseApplyList(mesPurchaseApply);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出采购申请单列表
|
||||
*/
|
||||
@RequiresPermissions("mes:purchaseApply:export")
|
||||
@Log(title = "采购申请单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MesPurchaseApply mesPurchaseApply)
|
||||
{
|
||||
List<MesPurchaseApply> list = mesPurchaseApplyService.selectMesPurchaseApplyList(mesPurchaseApply);
|
||||
ExcelUtil<MesPurchaseApply> util = new ExcelUtil<MesPurchaseApply>(MesPurchaseApply.class);
|
||||
util.exportExcel(response, list, "采购申请单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取采购申请单详细信息
|
||||
*/
|
||||
@RequiresPermissions("mes:purchaseApply:query")
|
||||
@GetMapping(value = "/{purchaseApplyId}")
|
||||
public AjaxResult getInfo(@PathVariable("purchaseApplyId") Long purchaseApplyId)
|
||||
{
|
||||
return success(mesPurchaseApplyService.selectMesPurchaseApplyByPurchaseApplyId(purchaseApplyId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增采购申请单
|
||||
*/
|
||||
@RequiresPermissions("mes:purchaseApply:add")
|
||||
@Log(title = "采购申请单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesPurchaseApply mesPurchaseApply)
|
||||
{
|
||||
return toAjax(mesPurchaseApplyService.insertMesPurchaseApply(mesPurchaseApply));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改采购申请单
|
||||
*/
|
||||
@RequiresPermissions("mes:purchaseApply:edit")
|
||||
@Log(title = "采购申请单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesPurchaseApply mesPurchaseApply)
|
||||
{
|
||||
return toAjax(mesPurchaseApplyService.updateMesPurchaseApply(mesPurchaseApply));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除采购申请单
|
||||
*/
|
||||
@RequiresPermissions("mes:purchaseApply:remove")
|
||||
@Log(title = "采购申请单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{purchaseApplyIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] purchaseApplyIds)
|
||||
{
|
||||
return toAjax(mesPurchaseApplyService.deleteMesPurchaseApplyByPurchaseApplyIds(purchaseApplyIds));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 同步采购申请单
|
||||
*/
|
||||
@RequiresPermissions("mes:purchaseApply:sync")
|
||||
@Log(title = "采购申请单", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/syncPurchaseApply")
|
||||
public AjaxResult syncPurchaseApply(@RequestBody MesPurchaseApply mesPurchaseApply)
|
||||
{
|
||||
return toAjax(mesPurchaseApplyService.syncMesPurchaseApply(mesPurchaseApply));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
package com.hw.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hw.common.core.exception.ServiceException;
|
||||
import com.hw.mes.domain.MesPurchaseApply;
|
||||
import com.hw.mes.domain.MesPurchaseRequisitionTemplate;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 采购申请单Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-10-21
|
||||
*/
|
||||
public interface IMesPurchaseApplyService
|
||||
{
|
||||
/**
|
||||
* 查询采购申请单
|
||||
*
|
||||
* @param purchaseApplyId 采购申请单主键
|
||||
* @return 采购申请单
|
||||
*/
|
||||
public MesPurchaseApply selectMesPurchaseApplyByPurchaseApplyId(Long purchaseApplyId);
|
||||
|
||||
/**
|
||||
* 查询采购申请单列表
|
||||
*
|
||||
* @param mesPurchaseApply 采购申请单
|
||||
* @return 采购申请单集合
|
||||
*/
|
||||
public List<MesPurchaseApply> selectMesPurchaseApplyList(MesPurchaseApply mesPurchaseApply);
|
||||
|
||||
/**
|
||||
* 新增采购申请单
|
||||
*
|
||||
* @param mesPurchaseApply 采购申请单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesPurchaseApply(MesPurchaseApply mesPurchaseApply);
|
||||
|
||||
/**
|
||||
* 修改采购申请单
|
||||
*
|
||||
* @param mesPurchaseApply 采购申请单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesPurchaseApply(MesPurchaseApply mesPurchaseApply);
|
||||
|
||||
/**
|
||||
* 批量删除采购申请单
|
||||
*
|
||||
* @param purchaseApplyIds 需要删除的采购申请单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesPurchaseApplyByPurchaseApplyIds(Long[] purchaseApplyIds);
|
||||
|
||||
/**
|
||||
* 删除采购申请单信息
|
||||
*
|
||||
* @param purchaseApplyId 采购申请单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesPurchaseApplyByPurchaseApplyId(Long purchaseApplyId);
|
||||
|
||||
|
||||
/**
|
||||
* 导入采购申请单
|
||||
* @param purchaseRequisitionTemplateList
|
||||
* @return
|
||||
*/
|
||||
public Long importPurchaseApply(List<MesPurchaseRequisitionTemplate> purchaseRequisitionTemplateList);
|
||||
|
||||
|
||||
/**
|
||||
* 同步采购申请单
|
||||
*
|
||||
* @param mesPurchaseApply 采购申请单
|
||||
* @return 结果
|
||||
*/
|
||||
public int syncMesPurchaseApply(MesPurchaseApply mesPurchaseApply);
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
<?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.hw.mes.mapper.MesPurchaseApplyDetailMapper">
|
||||
|
||||
<resultMap type="MesPurchaseApplyDetail" id="MesPurchaseApplyDetailResult">
|
||||
<result property="purchaseApplyDetailId" column="purchase_apply_detail_id" />
|
||||
<result property="purchaseApplyId" column="purchase_apply_id" />
|
||||
<result property="erpMaterialId" column="erp_material_id" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="materialSpec" column="material_spec" />
|
||||
<result property="unitCode" column="unit_code" />
|
||||
<result property="priceUnitCode" column="price_unit_code" />
|
||||
<result property="reqQty" column="req_qty" />
|
||||
<result property="produceSupplier" column="produce_supplier" />
|
||||
<result property="taxPrice" column="tax_price" />
|
||||
<result property="taxTotalPrice" column="tax_total_price" />
|
||||
<result property="oriReqQty" column="ori_req_qty" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesPurchaseApplyDetailVo">
|
||||
select purchase_apply_detail_id, purchase_apply_id, erp_material_id, material_id, material_code, material_name, material_spec, unit_code, price_unit_code, req_qty, produce_supplier, tax_price, tax_total_price, ori_req_qty from mes_purchase_apply_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectMesPurchaseApplyDetailList" parameterType="MesPurchaseApplyDetail" resultMap="MesPurchaseApplyDetailResult">
|
||||
<include refid="selectMesPurchaseApplyDetailVo"/>
|
||||
<where>
|
||||
<if test="purchaseApplyId != null "> and purchase_apply_id = #{purchaseApplyId}</if>
|
||||
<if test="erpMaterialId != null "> and erp_material_id = #{erpMaterialId}</if>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="materialSpec != null and materialSpec != ''"> and material_spec = #{materialSpec}</if>
|
||||
<if test="unitCode != null and unitCode != ''"> and unit_code = #{unitCode}</if>
|
||||
<if test="priceUnitCode != null and priceUnitCode != ''"> and price_unit_code = #{priceUnitCode}</if>
|
||||
<if test="reqQty != null "> and req_qty = #{reqQty}</if>
|
||||
<if test="produceSupplier != null and produceSupplier != ''"> and produce_supplier = #{produceSupplier}</if>
|
||||
<if test="taxPrice != null "> and tax_price = #{taxPrice}</if>
|
||||
<if test="taxTotalPrice != null "> and tax_total_price = #{taxTotalPrice}</if>
|
||||
<if test="oriReqQty != null "> and ori_req_qty = #{oriReqQty}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesPurchaseApplyDetailByPurchaseApplyDetailId" parameterType="Long" resultMap="MesPurchaseApplyDetailResult">
|
||||
<include refid="selectMesPurchaseApplyDetailVo"/>
|
||||
where purchase_apply_detail_id = #{purchaseApplyDetailId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesPurchaseApplyDetail" parameterType="MesPurchaseApplyDetail" useGeneratedKeys="true" keyProperty="purchaseApplyDetailId">
|
||||
insert into mes_purchase_apply_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="purchaseApplyId != null">purchase_apply_id,</if>
|
||||
<if test="erpMaterialId != null">erp_material_id,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="materialSpec != null and materialSpec != ''">material_spec,</if>
|
||||
<if test="unitCode != null and unitCode != ''">unit_code,</if>
|
||||
<if test="priceUnitCode != null">price_unit_code,</if>
|
||||
<if test="reqQty != null">req_qty,</if>
|
||||
<if test="produceSupplier != null">produce_supplier,</if>
|
||||
<if test="taxPrice != null">tax_price,</if>
|
||||
<if test="taxTotalPrice != null">tax_total_price,</if>
|
||||
<if test="oriReqQty != null">ori_req_qty,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="purchaseApplyId != null">#{purchaseApplyId},</if>
|
||||
<if test="erpMaterialId != null">#{erpMaterialId},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
||||
<if test="materialName != null">#{materialName},</if>
|
||||
<if test="materialSpec != null and materialSpec != ''">#{materialSpec},</if>
|
||||
<if test="unitCode != null and unitCode != ''">#{unitCode},</if>
|
||||
<if test="priceUnitCode != null">#{priceUnitCode},</if>
|
||||
<if test="reqQty != null">#{reqQty},</if>
|
||||
<if test="produceSupplier != null">#{produceSupplier},</if>
|
||||
<if test="taxPrice != null">#{taxPrice},</if>
|
||||
<if test="taxTotalPrice != null">#{taxTotalPrice},</if>
|
||||
<if test="oriReqQty != null">#{oriReqQty},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesPurchaseApplyDetail" parameterType="MesPurchaseApplyDetail">
|
||||
update mes_purchase_apply_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="purchaseApplyId != null">purchase_apply_id = #{purchaseApplyId},</if>
|
||||
<if test="erpMaterialId != null">erp_material_id = #{erpMaterialId},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="materialSpec != null and materialSpec != ''">material_spec = #{materialSpec},</if>
|
||||
<if test="unitCode != null and unitCode != ''">unit_code = #{unitCode},</if>
|
||||
<if test="priceUnitCode != null">price_unit_code = #{priceUnitCode},</if>
|
||||
<if test="reqQty != null">req_qty = #{reqQty},</if>
|
||||
<if test="produceSupplier != null">produce_supplier = #{produceSupplier},</if>
|
||||
<if test="taxPrice != null">tax_price = #{taxPrice},</if>
|
||||
<if test="taxTotalPrice != null">tax_total_price = #{taxTotalPrice},</if>
|
||||
<if test="oriReqQty != null">ori_req_qty = #{oriReqQty},</if>
|
||||
</trim>
|
||||
where purchase_apply_detail_id = #{purchaseApplyDetailId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesPurchaseApplyDetailByPurchaseApplyDetailId" parameterType="Long">
|
||||
delete from mes_purchase_apply_detail where purchase_apply_detail_id = #{purchaseApplyDetailId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesPurchaseApplyDetailByPurchaseApplyDetailIds" parameterType="String">
|
||||
delete from mes_purchase_apply_detail where purchase_apply_detail_id in
|
||||
<foreach item="purchaseApplyDetailId" collection="array" open="(" separator="," close=")">
|
||||
#{purchaseApplyDetailId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,145 @@
|
||||
<?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.hw.mes.mapper.MesPurchaseApplyMapper">
|
||||
|
||||
<resultMap type="MesPurchaseApply" id="MesPurchaseApplyResult">
|
||||
<result property="purchaseApplyId" column="purchase_apply_id" />
|
||||
<result property="taskCode" column="task_code" />
|
||||
<result property="tondBase" column="tond_base" />
|
||||
<result property="syncStatus" column="sync_status" />
|
||||
<result property="syncTime" column="sync_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="MesPurchaseApplyMesPurchaseApplyDetailResult" type="MesPurchaseApply" extends="MesPurchaseApplyResult">
|
||||
<collection property="mesPurchaseApplyDetailList" notNullColumn="sub_purchase_apply_detail_id" javaType="java.util.List" resultMap="MesPurchaseApplyDetailResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="MesPurchaseApplyDetail" id="MesPurchaseApplyDetailResult">
|
||||
<result property="purchaseApplyDetailId" column="sub_purchase_apply_detail_id" />
|
||||
<result property="purchaseApplyId" column="sub_purchase_apply_id" />
|
||||
<result property="erpMaterialId" column="sub_erp_material_id" />
|
||||
<result property="materialId" column="sub_material_id" />
|
||||
<result property="materialCode" column="sub_material_code" />
|
||||
<result property="materialName" column="sub_material_name" />
|
||||
<result property="materialSpec" column="sub_material_spec" />
|
||||
<result property="unitCode" column="sub_unit_code" />
|
||||
<result property="unitName" column="sub_unit_name" />
|
||||
<result property="priceUnitCode" column="sub_price_unit_code" />
|
||||
<result property="reqQty" column="sub_req_qty" />
|
||||
<result property="produceSupplier" column="sub_produce_supplier" />
|
||||
<result property="taxPrice" column="sub_tax_price" />
|
||||
<result property="taxTotalPrice" column="sub_tax_total_price" />
|
||||
<result property="oriReqQty" column="sub_ori_req_qty" />
|
||||
<result property="tondBase" column="sub_tond_base" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesPurchaseApplyVo">
|
||||
select purchase_apply_id, task_code, tond_base, sync_status, sync_time, remark, create_by, create_time, update_by, update_time from mes_purchase_apply
|
||||
</sql>
|
||||
|
||||
<select id="selectMesPurchaseApplyList" parameterType="MesPurchaseApply" resultMap="MesPurchaseApplyResult">
|
||||
<include refid="selectMesPurchaseApplyVo"/>
|
||||
<where>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code like concat('%', #{taskCode},'%')</if>
|
||||
<if test="tondBase != null and tondBase != ''"> and tond_base = #{tondBase}</if>
|
||||
<if test="syncStatus != null and syncStatus != ''"> and sync_status = #{syncStatus}</if>
|
||||
<if test="syncTime != null "> and sync_time = #{syncTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesPurchaseApplyByPurchaseApplyId" parameterType="Long" resultMap="MesPurchaseApplyMesPurchaseApplyDetailResult">
|
||||
select a.purchase_apply_id, a.task_code, a.tond_base, a.sync_status, a.sync_time, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,
|
||||
b.purchase_apply_detail_id as sub_purchase_apply_detail_id, b.purchase_apply_id as sub_purchase_apply_id, b.erp_material_id as sub_erp_material_id, b.material_id as sub_material_id, b.material_code as sub_material_code, b.material_name as sub_material_name, b.material_spec as sub_material_spec, b.unit_code as sub_unit_code,b.unit_name as sub_unit_name, b.price_unit_code as sub_price_unit_code, b.req_qty as sub_req_qty, b.produce_supplier as sub_produce_supplier, b.tax_price as sub_tax_price, b.tax_total_price as sub_tax_total_price, b.ori_req_qty as sub_ori_req_qty,b.tond_base as sub_tond_base
|
||||
from mes_purchase_apply a
|
||||
left join mes_purchase_apply_detail b on b.purchase_apply_id = a.purchase_apply_id
|
||||
where a.purchase_apply_id = #{purchaseApplyId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesPurchaseApply" parameterType="MesPurchaseApply" useGeneratedKeys="true" keyProperty="purchaseApplyId">
|
||||
insert into mes_purchase_apply
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskCode != null and taskCode != ''">task_code,</if>
|
||||
<if test="tondBase != null">tond_base,</if>
|
||||
<if test="syncStatus != null and syncStatus != ''">sync_status,</if>
|
||||
<if test="syncTime != null">sync_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskCode != null and taskCode != ''">#{taskCode},</if>
|
||||
<if test="tondBase != null">#{tondBase},</if>
|
||||
<if test="syncStatus != null and syncStatus != ''">#{syncStatus},</if>
|
||||
<if test="syncTime != null">#{syncTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesPurchaseApply" parameterType="MesPurchaseApply">
|
||||
update mes_purchase_apply
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskCode != null and taskCode != ''">task_code = #{taskCode},</if>
|
||||
<if test="tondBase != null">tond_base = #{tondBase},</if>
|
||||
<if test="syncStatus != null and syncStatus != ''">sync_status = #{syncStatus},</if>
|
||||
<if test="syncTime != null">sync_time = #{syncTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where purchase_apply_id = #{purchaseApplyId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesPurchaseApplyByPurchaseApplyId" parameterType="Long">
|
||||
delete from mes_purchase_apply where purchase_apply_id = #{purchaseApplyId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesPurchaseApplyByPurchaseApplyIds" parameterType="String">
|
||||
delete from mes_purchase_apply where purchase_apply_id in
|
||||
<foreach item="purchaseApplyId" collection="array" open="(" separator="," close=")">
|
||||
#{purchaseApplyId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesPurchaseApplyDetailByPurchaseApplyIds" parameterType="String">
|
||||
delete from mes_purchase_apply_detail where purchase_apply_id in
|
||||
<foreach item="purchaseApplyId" collection="array" open="(" separator="," close=")">
|
||||
#{purchaseApplyId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesPurchaseApplyDetailByPurchaseApplyId" parameterType="Long">
|
||||
delete from mes_purchase_apply_detail where purchase_apply_id = #{purchaseApplyId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchMesPurchaseApplyDetail">
|
||||
insert into mes_purchase_apply_detail( purchase_apply_detail_id, purchase_apply_id,tond_base, erp_material_id, material_id, material_code, material_name, material_spec, unit_name,unit_code, price_unit_code, req_qty, produce_supplier, tax_price, tax_total_price, ori_req_qty) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.purchaseApplyDetailId}, #{item.purchaseApplyId},#{item.tondBase}, #{item.erpMaterialId}, #{item.materialId}, #{item.materialCode}, #{item.materialName}, #{item.materialSpec}, #{item.unitName}, #{item.unitCode}, #{item.priceUnitCode}, #{item.reqQty}, #{item.produceSupplier}, #{item.taxPrice}, #{item.taxTotalPrice}, #{item.oriReqQty})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectOnlyMesPurchaseApplyByPurchaseApplyId" parameterType="Long" resultMap="MesPurchaseApplyResult">
|
||||
select a.purchase_apply_id, a.task_code, a.tond_base, a.sync_status, a.sync_time
|
||||
from mes_purchase_apply a
|
||||
where a.purchase_apply_id = #{purchaseApplyId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,56 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询采购申请单列表
|
||||
export function listPurchaseApply(query) {
|
||||
return request({
|
||||
url: '/mes/purchaseApply/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询采购申请单详细
|
||||
export function getPurchaseApply(purchaseApplyId) {
|
||||
return request({
|
||||
url: '/mes/purchaseApply/' + purchaseApplyId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增采购申请单
|
||||
export function addPurchaseApply(data) {
|
||||
return request({
|
||||
url: '/mes/purchaseApply',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改采购申请单
|
||||
export function updatePurchaseApply(data) {
|
||||
return request({
|
||||
url: '/mes/purchaseApply',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除采购申请单
|
||||
export function delPurchaseApply(purchaseApplyId) {
|
||||
return request({
|
||||
url: '/mes/purchaseApply/' + purchaseApplyId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 同步采购申请单
|
||||
export function syncPurchaseApply(data) {
|
||||
return request({
|
||||
url: '/mes/purchaseApply/syncPurchaseApply',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue