备件申领单加单价总价

master
A0010407 1 year ago
parent 52f2be01fd
commit 1225206e73

@ -114,6 +114,28 @@ public class EquSpareApply extends BaseEntity {
@Excel(name = "物料描述")
private String materialDesc;
/** 单价 */
@Excel(name = "单价")
private BigDecimal unitPrice;
/** 总价 */
@Excel(name = "总价")
private BigDecimal totalPrice;
public void setUnitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice;
}
public BigDecimal getUnitPrice() {
return unitPrice;
}
public void setTotalPrice(BigDecimal totalPrice) {
this.totalPrice = totalPrice;
}
public BigDecimal getTotalPrice() {
return totalPrice;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}

@ -782,6 +782,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String key = "#header.poolName";
//工厂号
//备件费用?????
equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_", ""));
equSpareApplyMapper.insertEquSpareApply(equSpareApply);
@ -832,9 +833,9 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
EquRepairWorkOrder example = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId());
// 费用
BigDecimal sparePartsCost = equSpareApplyMapper.getSparePartsCost(equRepairWorkOrder.getOrderCode());
BigDecimal orderCost = BigDecimal.valueOf(Double.valueOf(equRepairWorkOrder.getWorkCost()));
equRepairWorkOrder.setWorkCost(String.valueOf(sparePartsCost.add(orderCost)));
// BigDecimal sparePartsCost = equSpareApplyMapper.getSparePartsCost(equRepairWorkOrder.getOrderCode());
// BigDecimal orderCost = BigDecimal.valueOf(Double.valueOf(equRepairWorkOrder.getWorkCost()));
// equRepairWorkOrder.setWorkCost(String.valueOf(sparePartsCost.add(orderCost)));
//修改设备状态 由维修中改为正常运行
EquEquipment equEquipment = new EquEquipment();

@ -95,6 +95,8 @@ public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
String code = applyList.getWorkCode();
applyList.setApplyCode("AW" + code.substring(2) + serialNum);
}
//总价
// applyList.setTotalPrice(applyList.getAmount().multiply(applyList.getUnitPrice()));
//领用时间
applyList.setApplyTime(DateUtils.getNowDate());
//申领人

@ -28,10 +28,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
<result property="unitPrice" column="unit_price" />
<result property="totalPrice" column="total_price" />
</resultMap>
<sql id="selectEquSpareApplyVo">
select apply_id, apply_code, work_code,parent_code,apply_type,spare_code, spare_name, spare_model, spare_quantity, spare_group_line, spare_use_equipment, apply_time, apply_people, apply_approve_people, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_spare_apply
select apply_id, apply_code, work_code,parent_code,apply_type,spare_code, spare_name, spare_model, spare_quantity, spare_group_line, spare_use_equipment, apply_time, apply_people, apply_approve_people, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code , unit_price , total_price from equ_spare_apply
</sql>
<select id="selectEquSpareApplyList" parameterType="EquSpareApply" resultMap="EquSpareApplyResult">
@ -55,6 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="unitPrice != null and unitPrice != ''"> and unit_price = #{unitPrice}</if>
<if test="totalPrice != null and totalPrice != ''"> and total_price = #{totalPrice}</if>
and del_flag = '0'
ORDER BY apply_time DESC
</where>
@ -92,6 +96,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="unitPrice != null">unit_price,</if>
<if test="totalPrice != null">total_price,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="applyId != null">#{applyId},</if>
@ -117,6 +123,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="unitPrice != null">#{unitPrice},</if>
<if test="totalPrice != null">#{totalPrice},</if>
</trim>
</insert>
@ -145,6 +153,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
<if test="totalPrice != null">total_price = #{totalPrice},</if>
</trim>
where apply_id = #{applyId}
</update>
@ -210,7 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getSparePartsCost" resultType="java.math.BigDecimal">
select SUM(a.spare_quantity * w.unit_price)
from equ_spare_apply a
left join wms_ods_mate_storage_news_attached w on a.spare_code = w.primary_code
left join wms_ods_mate_storage_news_attached w on a.spare_code = w.primary_code
where a.work_code = #{orderCode}
</select>

Loading…
Cancel
Save