Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 3 months ago
parent
commit
93d4ab764e
  1. 13
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  2. 38
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/vo/ErpMaterialPurchaseHistoryVo.java
  3. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java
  4. 41
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  5. 5
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java
  6. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java
  7. 8
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml
  8. 4
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml
  9. 133
      ruoyi-admin/src/main/resources/templates/erp/material/detail.html

13
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java

@ -10,6 +10,7 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.erp.domain.ErpMaterial;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.domain.vo.ErpMaterialPurchaseHistoryVo;
import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo;
import com.ruoyi.erp.mapper.ErpMaterialMapper;
import com.ruoyi.erp.service.IErpMaterialService;
@ -484,4 +485,16 @@ public class ErpMaterialController extends BaseController
return getDataTable(list);
}
/**
* 物料采购价格历史
* */
@PostMapping ("/getMaterialPurchaseHistoryList")
@ResponseBody
public TableDataInfo getMaterialPurchaseHistoryList(@RequestParam String materialNo){
startPage();
List<ErpMaterialPurchaseHistoryVo> list = erpMaterialService.selectErpMaterialPurchaseHistoryList(materialNo);
return getDataTable(list);
}
}

38
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/vo/ErpMaterialPurchaseHistoryVo.java

@ -0,0 +1,38 @@
package com.ruoyi.erp.domain.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
//物料采购价历史
@Data
public class ErpMaterialPurchaseHistoryVo {
//销售时间
private Date purchaseTime;
//物料数量
private BigDecimal materialNum;
//含税价格
private BigDecimal taxPrice;
//不含税价格
private BigDecimal noTaxPrice;
//含税总价
private BigDecimal taxSum;
//不含税总价
private BigDecimal noTaxSum;
//采购员
private String purchaseUser;
//关联销采购订单号
private String purchaseOrderCode;
}

6
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java

@ -2,6 +2,7 @@ package com.ruoyi.erp.service;
import com.ruoyi.erp.domain.ErpMaterial;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.domain.vo.ErpMaterialPurchaseHistoryVo;
import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.transaction.annotation.Transactional;
@ -145,4 +146,9 @@ public interface IErpMaterialService
* 查询物料销售价历史
* */
List<ErpMaterialSalesHistoryVo> selectErpMaterialSalesHistoryList(String materialNo);
/**
* 查询物料采购价历史
* */
List<ErpMaterialPurchaseHistoryVo> selectErpMaterialPurchaseHistoryList(String materialNo);
}

41
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -11,11 +11,17 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.erp.domain.ErpMaterial;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.domain.vo.ErpMaterialPurchaseHistoryVo;
import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo;
import com.ruoyi.erp.mapper.ErpMaterialMapper;
import com.ruoyi.erp.service.IErpMaterialService;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.purchase.domain.PurchaseOrder;
import com.ruoyi.purchase.domain.PurchaseOrderChild;
import com.ruoyi.purchase.mapper.PurchaseOrderChildMapper;
import com.ruoyi.purchase.mapper.PurchaseOrderMapper;
import com.ruoyi.purchase.mapper.PurchasePlanChildMapper;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.Vo.ExportCustomerQuoteChildVo;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
@ -79,13 +85,20 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
@Autowired
private ISysRoleService roleService;
@Autowired
private SysSalesOrderChildMapper sysSalesOrderChildMapper;
@Autowired
private SysSalesOrderMapper sysSalesOrderMapper;
@Autowired
private PurchaseOrderMapper purchaseOrderMapper;
@Autowired
private PurchaseOrderChildMapper purchaseOrderChildMapper;
private final static String RMB = "1"; //RMB
/**
@ -547,6 +560,32 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
return erpMaterialSalesHistoryVos;
}
/**
* 查询物料采购价历史
* */
@Override
public List<ErpMaterialPurchaseHistoryVo> selectErpMaterialPurchaseHistoryList(String materialNo) {
List<ErpMaterialPurchaseHistoryVo> erpMaterialPurchaseHistoryVos = new ArrayList<>();
List<PurchaseOrderChild> purchaseOrderChildList = purchaseOrderChildMapper.selectOrderChildListByMaterialNo(materialNo);
for (PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList) {
ErpMaterialPurchaseHistoryVo erpMaterialPurchaseHistoryVo = new ErpMaterialPurchaseHistoryVo();
String purchaseOrderCode = purchaseOrderChild.getPurchaseOrderCode();
PurchaseOrder purchaseOrder = purchaseOrderMapper.selectPurchaseOrderByOrderCode(purchaseOrderCode);
erpMaterialPurchaseHistoryVo.setMaterialNum(purchaseOrderChild.getMaterialNum());
erpMaterialPurchaseHistoryVo.setPurchaseUser(purchaseOrder.getPurchaseBuyer());
erpMaterialPurchaseHistoryVo.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
erpMaterialPurchaseHistoryVo.setPurchaseTime(purchaseOrderChild.getCreateTime());
erpMaterialPurchaseHistoryVo.setTaxPrice(purchaseOrderChild.getMaterialRmb());
erpMaterialPurchaseHistoryVo.setNoTaxPrice(purchaseOrderChild.getMaterialNoRmb());
erpMaterialPurchaseHistoryVo.setTaxSum(purchaseOrderChild.getMaterialRmbSum());
erpMaterialPurchaseHistoryVo.setNoTaxSum(purchaseOrderChild.getMaterialNoRmbSum());
erpMaterialPurchaseHistoryVos.add(erpMaterialPurchaseHistoryVo);
}
return erpMaterialPurchaseHistoryVos;
}
//区分不同币种的金额
private void setMaterialPrice(ErpMaterialSalesHistoryVo vo, SysSalesOrderVo sysSalesOrderVo, SysSalesOrderChild child) {
if (RMB.equals(sysSalesOrderVo.getCommonCurrency())) {

5
ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java

@ -110,4 +110,9 @@ public interface PurchaseOrderChildMapper
List<PurchaseOrderChild> selectChildListBySupplierCodeAndOrderCode(PurchaseOrderChild purchaseOrderChild);
/**
* 通过料号查询采购订单子表列表
* */
List<PurchaseOrderChild> selectOrderChildListByMaterialNo(String materialCode);
}

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java

@ -185,6 +185,10 @@ public class SysCustomerServiceImpl implements ISysCustomerService
if(currency.contains("2")){
sysCustomer.setUsdFlag("1");
}
//默认为仅报价
sysCustomer.setCustomerSign("1");
//添加联系人
// sysContacts.setCustomerName(sysCustomer.getCustomerContact());
// sysContacts.setCellPhone(sysCustomer.getContactNumber());

8
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml

@ -116,6 +116,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectOrderChildListByMaterialNo" parameterType="String" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/>
where material_code = #{materialCode}
</select>
<insert id="insertPurchaseOrderChild" parameterType="PurchaseOrderChild" useGeneratedKeys="true" keyProperty="purchaseOrderChildId">
insert into purchase_order_child
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -300,4 +306,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM purchase_order_child where purchase_order_code = #{purchaseOrderCode}
GROUP BY purchase_order_code,material_code
</select>
</mapper>

4
ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml

@ -223,6 +223,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="rmbFlag != null">rmb_flag,</if>
<if test="usdFlag != null">usd_flag</if>
<if test="cancelRemark != null">cancel_remark,</if>
<if test="customerSign != null">customer_sign,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseCode!=null and enterpriseCode != ''">#{enterpriseCode},</if>
@ -278,6 +279,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="rmbFlag != null"> #{rmbFlag},</if>
<if test="usdFlag != null"> #{usdFlag} </if>
<if test="cancelRemark != null">#{cancelRemark},</if>
<if test="customerSign != null">#{customerSign}</if>
</trim>
</insert>
@ -325,7 +327,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useStatus!=null" >use_status = #{useStatus},</if>
<if test="identifyingPeople!=null">identifying_people = #{identifyingPeople},</if>
<if test="customerRemarks!=null">customer_remarks = #{customerRemarks},</if>
<if test="customerSign!=null">customer_sign = #{customer_sign},</if>
<if test="customerSign!=null">customer_sign = #{customerSign},</if>
<if test="updateBy!=null">update_by = #{updateBy},</if>
<if test="updateTime!=null">update_time = #{updateTime},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if>

133
ruoyi-admin/src/main/resources/templates/erp/material/detail.html

@ -106,13 +106,13 @@
<div class="addressList sh">
<div class="col-sm-12 select-table table-striped">
<div class="details" style="padding: 8px 0;font-size: 18px">销售价历史</div>
<table id="xiaoshou-table"></table>
<table id="sales-table"></table>
</div>
</div>
<div class="addressList sh">
<div class="col-sm-12 select-table table-striped">
<div class="details" style="padding: 8px 0;font-size: 18px">采购价历史</div>
<table id="purser-table"></table>
<table id="purchase-table"></table>
</div>
</div>
<div class="addressList sh">
@ -332,9 +332,9 @@
};
$.table.init(option1);
// 销售价历史
$('#xiaoshou-table').bootstrapTable('destroy');
$('#sales-table').bootstrapTable('destroy');
var option2 ={
id: "xiaoshou-table",
id: "sales-table",
url: prefix + "/getMaterialSalesHistoryList",
showSearch: false,
showRefresh: false,
@ -429,18 +429,6 @@
field: 'salesOrderCode',
title: '关联单号'
},
// {
// field: 'total',
// title: '合计',
// footerFormatter: function() {
// //统计总分数
// var count = 0;
// $.each(data.rows, function (index, item) {
// count += item.materialNum;
// });
// return count;
// }
// }
]
};
$.table.init(option2);
@ -449,9 +437,10 @@
//采购价历史
$('#purser-table').bootstrapTable('destroy');
$('#purchase-table').bootstrapTable('destroy');
var option3 = {
id: 'purser-table',
id: 'purchase-table',
url: prefix + "/getMaterialPurchaseHistoryList",
showSearch: false,
showRefresh: false,
showToggle: false,
@ -459,81 +448,95 @@
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
pageNumber:5,
showFooter: true,
queryParams: function (params) {
//console.log("123");
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
materialCode: materialNo
materialNo: materialNo
};
return curParams
},
columns: [{
checkbox: true
},
{
field: 'purchaseOrderId',
title: '采购订单id'
},
{
field: 'purchaseOrderNumber',
title: '订购单号'
},
{
field: 'supplierCode',
title: '供应商代码'
},
{
field: 'supplierName',
title: '供应商名称'
},
columns: [
{
field: 'rawSubsidiaryCode',
title: '原辅料代码'
field: 'index',
title: '索引',
visible: false
},
{
field: 'rawSubsidiaryName',
title: '原辅料名称'
field: 'purchaseTime',
title: '采购时间'
},
{
field: 'specificationModel',
title: '规格型号'
field: 'materialNum',
title: '数量',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].materialNum);
}
return sum;
}
},
{
field: 'commonCurrency',
title: '币别',
formatter: function(value, row, index) {
return $.table.selectDictLabel(commonCurrencyDatas, value);
field: 'taxPrice',
title: '含税价格',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].taxPrice);
}
return sum;
}
},
{
field: 'purchasingUnit',
title: '采购单位'
field: 'noTaxPrice',
title: '不含税价格',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].noTaxPrice);
}
return sum;
}
},
{
field: 'purchasePrice',
title: '采购单价'
field: 'taxSum',
title: '含税总价',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].taxSum);
}
return sum;
}
},
{
field: 'materialQuantity',
title: '数量'
field: 'noTaxSum',
title: '不含税总价',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].noTaxSum);
}
return sum;
}
},
{
field: 'amountMoney',
title: '金额'
field: 'purchaseUser',
title: '采购员',
},
{
field: 'deliveryTime',
title: '交期'
field: 'purchaseOrderCode',
title: '关联单号'
},
{
field: 'purchaseExplain',
title: '说明'
}
]
};
$.table.init(option3);
//操作历史
$('#oper-table').bootstrapTable('destroy');
var option4 = {

Loading…
Cancel
Save