Browse Source

[feat]修改采购计划子表方法mapper层SQL方法名

dev
zhangsiqi 6 months ago
parent
commit
69877822d7
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteController.java
  2. 10
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteChildMapper.java
  3. 10
      ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanChildMapper.xml
  4. 26
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml
  5. 70
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteMapper.xml
  6. 12
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteChild/purchaseQuoteChild.html

6
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteController.java

@ -89,10 +89,10 @@ public class PurchaseQuoteController extends BaseController
/**
* 修改采购报价单
*/
@GetMapping("/edit/{purchaseQuoteId}")
public String edit(@PathVariable("purchaseQuoteId") Long purchaseQuoteId, ModelMap mmap)
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
PurchaseQuote purchaseQuote = purchaseQuoteService.selectPurchaseQuoteById(purchaseQuoteId);
PurchaseQuote purchaseQuote = purchaseQuoteService.selectPurchaseQuoteById(id);
mmap.put("purchaseQuote", purchaseQuote);
return prefix + "/edit";
}

10
ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteChildMapper.java

@ -25,23 +25,23 @@ public interface PurchaseQuoteChildMapper
* @param sysPurchaseQuoteChild 采购报价单物料信息
* @return 采购报价单物料信息集合
*/
public List<PurchaseQuoteChild> selectPurchaseQuoteChildList(PurchaseQuoteChild sysPurchaseQuoteChild);
public List<PurchaseQuoteChild> selectPurchaseQuoteChildList(PurchaseQuoteChild purchaseQuoteChild);
/**
* 新增采购报价单物料信息
*
* @param sysPurchaseQuoteChild 采购报价单物料信息
* @param purchaseQuoteChild 采购报价单物料信息
* @return 结果
*/
public int insertPurchaseQuoteChild(PurchaseQuoteChild sysPurchaseQuoteChild);
public int insertPurchaseQuoteChild(PurchaseQuoteChild purchaseQuoteChild);
/**
* 修改采购报价单物料信息
*
* @param sysPurchaseQuoteChild 采购报价单物料信息
* @param purchaseQuoteChild 采购报价单物料信息
* @return 结果
*/
public int updatePurchaseQuoteChild(PurchaseQuoteChild sysPurchaseQuoteChild);
public int updatePurchaseQuoteChild(PurchaseQuoteChild purchaseQuoteChild);
/**
* 删除采购报价单物料信息

10
ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanChildMapper.xml

@ -30,7 +30,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectPurchasePlanChildVo">
select purchase_plan_child_id, purchase_plan_code, material_id, material_code, material_name, material_type, process_method, brand, photoUrl, describe, material_num, material_sole, material_rmb, material_noRmb, create_by, create_time, update_by, update_time, remark, use_status, audit_status, del_flag from purchase_plan_child
select purchase_plan_child_id, purchase_plan_code, material_id,
material_code, material_name, material_type, process_method, brand,
photoUrl, `describe`, material_num, material_sole, material_rmb,
material_noRmb, create_by, create_time, update_by, update_time, remark,
use_status, audit_status, del_flag from purchase_plan_child
</sql>
<select id="selectPurchasePlanChildList" parameterType="PurchasePlanChild" resultMap="PurchasePlanChildResult">
@ -65,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="processMethod != null">process_method,</if>
<if test="brand != null">brand,</if>
<if test="photoUrl != null">photoUrl,</if>
<if test="describe != null">describe,</if>
<if test="describe != null">`describe`,</if>
<if test="materialNum != null">material_num,</if>
<if test="materialSole != null">material_sole,</if>
<if test="materialRmb != null">material_rmb,</if>
@ -115,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="processMethod != null">process_method = #{processMethod},</if>
<if test="brand != null">brand = #{brand},</if>
<if test="photoUrl != null">photoUrl = #{photoUrl},</if>
<if test="describe != null">describe = #{describe},</if>
<if test="describe != null">`describe` = #{describe},</if>
<if test="materialNum != null">material_num = #{materialNum},</if>
<if test="materialSole != null">material_sole = #{materialSole},</if>
<if test="materialRmb != null">material_rmb = #{materialRmb},</if>

26
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.purchase.mapper.PurchaseQuoteChildMapper">
<resultMap type="PurchaseQuoteChild" id="PurchaseQuoteChildResult">
<resultMap type="PurchaseQuoteChild" id="PurchaseQuoteChildResult">
<result property="purchaseQuoteChildId" column="purchase_quote_child_id" />
<result property="purchaseQuoteCode" column="purchase_quote_code" />
<result property="materialId" column="material_id" />
@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectSysPurchaseQuoteChildVo">
<sql id="selectPurchaseQuoteChildVo">
select purchase_quote_child_id, purchase_quote_code, material_id, material_code,
material_name, material_type, processMethod, brand, photoUrl, `describe`, tax_rate, usd_rate,
material_num, material_sole, material_rmb, material_noRmb,
@ -38,8 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
del_flag from purchase_quote_child
</sql>
<select id="selectSysPurchaseQuoteChildList" parameterType="PurchaseQuoteChild" resultMap="PurchaseQuoteChildResult">
<include refid="selectSysPurchaseQuoteChildVo"/>
<select id="selectPurchaseQuoteChildList" parameterType="PurchaseQuoteChild" resultMap="PurchaseQuoteChildResult">
<include refid="selectPurchaseQuoteChildVo"/>
<where>
<if test="purchaseQuoteCode != null and purchaseQuoteCode != ''"> and purchase_quote_code = #{purchaseQuoteCode}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
@ -59,12 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectSysPurchaseQuoteChildById" parameterType="Long" resultMap="PurchaseQuoteChildResult">
<include refid="selectSysPurchaseQuoteChildVo"/>
<select id="selectPurchaseQuoteChildById" parameterType="Long" resultMap="PurchaseQuoteChildResult">
<include refid="selectPurchaseQuoteChildVo"/>
where purchase_quote_child_id = #{purchaseQuoteChildId}
</select>
<insert id="insertSysPurchaseQuoteChild" parameterType="PurchaseQuoteChild" useGeneratedKeys="true" keyProperty="purchaseQuoteChildId">
<insert id="insertPurchaseQuoteChild" parameterType="PurchaseQuoteChild" useGeneratedKeys="true" keyProperty="purchaseQuoteChildId">
insert into purchase_quote_child
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseQuoteCode != null">purchase_quote_code,</if>
@ -118,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update id="updateSysPurchaseQuoteChild" parameterType="PurchaseQuoteChild">
<update id="updatePurchaseQuoteChild" parameterType="PurchaseQuoteChild">
update purchase_quote_child
<trim prefix="SET" suffixOverrides=",">
<if test="purchaseQuoteCode != null">purchase_quote_code = #{purchaseQuoteCode},</if>
@ -148,22 +148,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where purchase_quote_child_id = #{purchaseQuoteChildId}
</update>
<delete id="deleteSysPurchaseQuoteChildById" parameterType="Long">
<delete id="deletePurchaseQuoteChildById" parameterType="Long">
delete from purchase_quote_child where purchase_quote_child_id = #{purchaseQuoteChildId}
</delete>
<delete id="deleteSysPurchaseQuoteChildByIds" parameterType="String">
<delete id="deletePurchaseQuoteChildByIds" parameterType="String">
delete from purchase_quote_child where purchase_quote_child_id in
<foreach item="purchaseQuoteChildId" collection="array" open="(" separator="," close=")">
#{purchaseQuoteChildId}
</foreach>
</delete>
<update id="cancelSysPurchaseQuoteChildById" parameterType="Long">
<update id="cancelPurchaseQuoteChildById" parameterType="Long">
update purchase_quote_child set del_flag = '1' where purchase_quote_child_id = #{purchaseQuoteChildId}
</update>
<update id="restoreSysPurchaseQuoteChildById" parameterType="Long">
<update id="restorePurchaseQuoteChildById" parameterType="Long">
update purchase_quote_child set del_flag = '0' where purchase_quote_child_id = #{purchaseQuoteChildId}
</update>

70
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteMapper.xml

@ -24,34 +24,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="auditStatus" column="audit_status" />
<result property="useStatus" column="use_status" />
<result property="remark" column="remark" />
<result property="photoAttachId" column="photo_attach_id" />
<result property="photoUrl" column="photo_url" />
</resultMap>
<sql id="selectPurchaseQuoteVo">
select purchase_quote_id, purchase_quote_code, purchaseBuyer, supplier_quote_code, supplier_name, tax_rate, material_amount, pricingDate, material_no, first_add_time, update_info_time, material_name, create_by, create_time, update_by, update_time, audit_status, use_status, remark from purchase_quote
select purchase_quote_id, purchase_quote_code, purchaseBuyer,
supplier_quote_code, supplier_name, tax_rate, material_amount,
pricingDate, material_no, first_add_time, update_info_time,
material_name, create_by, create_time, update_by, update_time,
audit_status, use_status, remark from purchase_quote
</sql>
<select id="selectPurchaseQuoteList" parameterType="PurchaseQuote" resultMap="PurchaseQuoteResult">
<include refid="selectPurchaseQuoteVo"/>
select purchase.purchase_quote_id, purchase.purchase_quote_code, purchase.purchaseBuyer,
purchase.supplier_quote_code, purchase.supplier_name, purchase.tax_rate, purchase.material_amount,
purchase.pricingDate, purchase.material_no, purchase.first_add_time, purchase.update_info_time,
purchase.material_name, purchase.create_by, purchase.create_time, purchase.update_by, purchase.update_time,
purchase.audit_status, purchase.use_status, purchase.remark,file.url as photo_url from purchase_quote as purchase
left join (
select
att.rel_id
,file.url
,min(file.create_time) as create_time
from sys_attach as att
left join sys_attach_file as file
on att.id = file.attach_id
where att.source_type = 'purchaseQuote' and att.source_sub_type = 'photo'
group by att.rel_id
)file
on purchase.purchase_quote_id = file.rel_id
<where>
<if test="purchaseQuoteCode != null and purchaseQuoteCode != ''"> and purchase_quote_code = #{purchaseQuoteCode}</if>
<if test="purchaseBuyer != null and purchaseBuyer != ''"> and purchaseBuyer = #{purchaseBuyer}</if>
<if test="supplierQuoteCode != null and supplierQuoteCode != ''"> and supplier_quote_code = #{supplierQuoteCode}</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="materialAmount != null and materialAmount != ''"> and material_amount = #{materialAmount}</if>
<if test="params.beginPricingDate != null and params.beginPricingDate != '' and params.endPricingDate != null and params.endPricingDate != ''"> and pricingDate between #{params.beginPricingDate} and #{params.endPricingDate}</if>
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if>
<if test="params.beginFirstAddTime != null and params.beginFirstAddTime != '' and params.endFirstAddTime != null and params.endFirstAddTime != ''"> and first_add_time between #{params.beginFirstAddTime} and #{params.endFirstAddTime}</if>
<if test="updateInfoTime != null and updateInfoTime != ''"> and update_info_time = #{updateInfoTime}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
<if test="purchaseQuoteCode != null and purchaseQuoteCode != ''"> and purchase.purchase_quote_code = #{purchaseQuoteCode}</if>
<if test="purchaseBuyer != null and purchaseBuyer != ''"> and purchase.purchaseBuyer = #{purchaseBuyer}</if>
<if test="supplierQuoteCode != null and supplierQuoteCode != ''"> and purchase.supplier_quote_code = #{supplierQuoteCode}</if>
<if test="supplierName != null and supplierName != ''"> and purchase.supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="materialAmount != null and materialAmount != ''"> and purchase.material_amount = #{materialAmount}</if>
<if test="params.beginPricingDate != null and params.beginPricingDate != '' and params.endPricingDate != null and params.endPricingDate != ''"> and purchase.pricingDate between #{params.beginPricingDate} and #{params.endPricingDate}</if>
<if test="materialNo != null and materialNo != ''"> and purchase.material_no = #{materialNo}</if>
<if test="params.beginFirstAddTime != null and params.beginFirstAddTime != '' and params.endFirstAddTime != null and params.endFirstAddTime != ''"> and purchase.first_add_time between #{params.beginFirstAddTime} and #{params.endFirstAddTime}</if>
<if test="updateInfoTime != null and updateInfoTime != ''"> and purchase.update_info_time = #{updateInfoTime}</if>
<if test="materialName != null and materialName != ''"> and purchase.material_name like concat('%', #{materialName}, '%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and purchase.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<if test="auditStatus != null and auditStatus != ''"> and purchase.audit_status = #{auditStatus}</if>
<if test="useStatus != null and useStatus != ''"> and purchase.use_status = #{useStatus}</if>
</where>
</select>
<select id="selectPurchaseQuoteById" parameterType="Long" resultMap="PurchaseQuoteResult">
<include refid="selectPurchaseQuoteVo"/>
where purchase_quote_id = #{purchaseQuoteId}
select purchase.purchase_quote_id, purchase.purchase_quote_code, purchase.purchaseBuyer,
purchase.supplier_quote_code, purchase.supplier_name, purchase.tax_rate, purchase.material_amount,
purchase.pricingDate, purchase.material_no, purchase.first_add_time, purchase.update_info_time,
purchase.material_name, purchase.create_by, purchase.create_time, purchase.update_by, purchase.update_time,
purchase.audit_status, purchase.use_status, purchase.remark,file.url as photo_url from purchase_quote as purchase
left join (
select att.rel_id,file.url,min(file.create_time) as create_time
from sys_attach as att
left join sys_attach_file as file
on att.id = file.attach_id
where att.source_type = 'purchaseQuote' and att.source_sub_type = 'photo'
group by att.rel_id
)file
on purchase.purchase_quote_id = file.rel_id
where purchase.purchase_quote_id = #{purchaseQuoteId}
</select>
<insert id="insertPurchaseQuote" parameterType="PurchaseQuote" useGeneratedKeys="true" keyProperty="purchaseQuoteId">

12
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteChild/purchaseQuoteChild.html

@ -28,13 +28,17 @@
</li>
<li>
<label>物料的类型:</label>
<select name="materialType">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}">
<optgroup>
<option value="">请选择</option>
</optgroup>
<optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option>
</optgroup>
</select>
</li>
<li>
<label>物料的加工方式:</label>
<label>物料的半成品类型</label>
<input type="text" name="processMethod"/>
</li>
<li>

Loading…
Cancel
Save