Browse Source

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

dev
王晓迪 3 months ago
parent
commit
23108a6844
  1. 5
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java
  2. 8
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java
  3. 9
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  4. 4
      ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesEstimateController.java
  5. 7
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java
  6. 25
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java
  7. 8
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java
  8. 14
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java
  9. 9
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml
  10. 7
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml
  11. 37
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml
  12. 71
      ruoyi-admin/src/main/resources/templates/sales/estimate/add.html
  13. 1
      ruoyi-admin/src/main/resources/templates/sales/estimate/estimateMaterialSelect.html
  14. 6
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html

5
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java

@ -117,4 +117,9 @@ public interface ErpMaterialMapper
//根据料号前缀查询匹配物料
List<ErpMaterialVo> searchMaterialsByPrefix(String prefix);
/**
* 通过materialVo查询物料信息
* */
List<ErpMaterialVo> selectAllErpMaterialListByMaterialVo(ErpMaterialVo erpMaterialVo);
}

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

@ -127,4 +127,12 @@ public interface IErpMaterialService
public ProcessInstance submitApply(ErpMaterial erpMaterial);
Integer addStockMaterial(ErpMaterialVo erpMaterialVo);
/**
* 通过materialVo查询物料信息
* */
List<ErpMaterialVo> selectAllErpMaterialListByMaterialVo(ErpMaterialVo erpMaterialVo);
}

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

@ -465,4 +465,13 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
warehouseInventoryInquiry.setUpdateTime(DateUtils.getNowDate());
return inventoryInquiryMapper.insertWarehouseInventoryInquiry(warehouseInventoryInquiry);
}
/**
* 通过materialVo查询物料信息
* */
@Override
public List<ErpMaterialVo> selectAllErpMaterialListByMaterialVo(ErpMaterialVo erpMaterialVo) {
return erpMaterialMapper.selectAllErpMaterialListByMaterialVo(erpMaterialVo);
}
}

4
ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesEstimateController.java

@ -387,10 +387,10 @@ public class SalesEstimateController extends BaseController
*/
@ResponseBody
@PostMapping("/getEstimateMaterialList")
public TableDataInfo getEstimateMaterialList( )
public TableDataInfo getEstimateMaterialList(ErpMaterialVo erpMaterialVo)
{
startPage();
List<ErpMaterialVo> erpMaterialVos = materialService.selectAllErpMaterialList();
List<ErpMaterialVo> erpMaterialVos = materialService.selectAllErpMaterialListByMaterialVo(erpMaterialVo);
return getDataTable(erpMaterialVos);
}

7
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java

@ -144,6 +144,9 @@ public class SysSalesOrderController extends BaseController
if (roleKeys.contains("ywyRole")) {
sysSalesOrderVo.setApplyUser(loginName);
}
//通过用户名找到业务登录名,重新给业务员赋值
String tempLoginName = sysSalesOrderService.convertName(sysSalesOrderVo);
sysSalesOrderVo.setBusinessMembers(tempLoginName);
List<SysSalesOrderVo> list = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo);
return getDataTable(list);
}
@ -158,6 +161,10 @@ public class SysSalesOrderController extends BaseController
@ResponseBody
public AjaxResult exportAll(SysSalesOrderVo sysSalesOrder)
{
//通过用户名找到业务登录名,重新给业务员赋值
String tempLoginName = sysSalesOrderService.convertName(sysSalesOrder);
sysSalesOrder.setBusinessMembers(tempLoginName);
List<SysSalesOrderVo> list = sysSalesOrderService.selectSysSalesOrderAllList(sysSalesOrder);
ExcelUtil<SysSalesOrderVo> util = new ExcelUtil<SysSalesOrderVo>(SysSalesOrderVo.class);
return util.exportExcel(list, "销售订单数据");

25
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java

@ -207,6 +207,15 @@ public class SysSalesOrder extends BaseEntity {
private List<SelectAftersalesNoticeVO> selectAftersalesNoticeVOList;
//销售子表物料号
private String materialCode;
//销售子表物料名称
private String materialName;
public Long getSalesOrderId() {
return salesOrderId;
}
@ -744,6 +753,22 @@ public class SysSalesOrder extends BaseEntity {
this.deliveryAddressBillto = deliveryAddressBillto;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
@Override
public String toString() {
return Objects.toStringHelper(this)

8
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java

@ -1,5 +1,6 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.SysCustomerQuoteVo;
import com.ruoyi.system.domain.SysSalesOrderVo;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderVo;
@ -125,4 +126,11 @@ public interface ISysSalesOrderService
* 查询所有可使用的销售订单
* */
List<SysSalesOrderVo> selectSysSalesOrderAllList(SysSalesOrderVo sysSalesOrder);
/**
* 通过用户名找到业务登录名重新给业务员赋值
* */
String convertName(SysSalesOrderVo sysSalesOrder);
}

14
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java

@ -223,6 +223,20 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
return sysSalesOrderMapper.selectSysSalesOrderAllList(sysSalesOrder);
}
/**
* 通过用户名找到业务登录名重新给业务员赋值
* */
@Override
public String convertName(SysSalesOrderVo sysSalesOrder) {
String businessMembers = sysSalesOrder.getBusinessMembers();
if (StringUtils.isNotEmpty(businessMembers)){
String loginName = userMapper.selectLoginNameByUserName(businessMembers);
return loginName;
}
return businessMembers;
}
/**
* 新增销售订单
*

9
ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

@ -185,6 +185,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and erp.del_flag = '0' and erp.audit_status = '1'
</select>
<select id="selectAllErpMaterialListByMaterialVo" parameterType="ErpMaterial" resultMap="ErpMaterialResult">
<include refid="selectErpMaterialVo"/>
<where>
<if test="materialNo != null and materialNo != ''"> and material_no like concat(#{materialNo}, '%')</if>
</where>
</select>
<insert id="insertErpMaterial" parameterType="ErpMaterial" useGeneratedKeys="true" keyProperty="id">
insert into erp_material
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -342,4 +350,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and erp.del_flag = '0' and erp.audit_status = '1'
and material_no like concat(#{prefix}, '%') escape '\\'
</select>
</mapper>

7
ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml

@ -101,12 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and c.materialName like concat('%',#{materialName},'%')
</if>
</where>
group by s.id, s.supplierCode, s.customerCode, s.customerName, s.pricingDate, s.enterprise, s.enterpriseSum, s.common_currency,
s.confirm_tax, s.rmbTax, s.usdTax, s.noRmb, s.noRmbSum, s.rmb, s.rmbSum, s.noUsd, s.noUsdSum, s.usd, s.usdSum, s.business_members,
s.degin_flag, s.del_flag, s.create_by, s.create_time, s.update_by, s.update_time, s.remark,
s.audit_status, s.use_status, s.instance_id, s.instance_type,
s.submit_instance_id, s.cancel_instance_id, s.restore_instance_id, s.apply_time, s.apply_user, s.apply_title,
p.dict_value
group by s.id
order by s.audit_status asc, s.create_time desc
</select>

37
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml

@ -72,6 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="applyTitle" column="apply_title" />
<result property="applyUser" column="apply_user" />
<result property="applyTime" column="apply_time" />
<result property="materialCode" column="materialCode" />
<result property="materialName" column="materialName" />
</resultMap>
<sql id="selectSysSalesOrderVo">
@ -108,8 +111,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where dict_type = 'processType'
) as p
on s.instance_type = p.dict_value
left join sys_sales_order_child as c on s.sales_order_code = c.quoteId
<where>
<if test="createBy != null and createBy !=''"> and s.create_by = #{createBy}</if>
<if test="salesOrderCode != null and salesOrderCode != ''"> and s.sales_order_code like concat('%', #{salesOrderCode}, '%')</if>
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and s.sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and s.enterprise_code like concat('%', #{enterpriseCode}, '%')</if>
@ -124,18 +127,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deliveryStatus != null and deliveryStatus != ''"> and s.delivery_status = #{deliveryStatus}</if>
<if test="closeStatus != null and closeStatus != ''"> and s.close_status = #{closeStatus}</if>
<if test="invoice != null and invoice != ''"> and s.invoice = #{invoice}</if>
<if test="instanceType != null and instanceType != ''"> and s.instance_type = #{instanceType}</if>
<if test="instanceId != null and instanceId != ''"> and s.instance_id = #{instanceId}</if>
<if test="applyUser != null and applyUser != ''"> and s.apply_user = #{applyUser}</if>
<if test="applyTime != null and applyTime != ''"> and s.apply_time = #{applyTime}</if>
<if test="applyTitle != null and applyTitle != ''"> and s.apply_title = #{applyTitle}</if>
<if test="applyUsers != null and applyUsers != ''"> and s.apply_user in
<foreach item="user" index="index" collection="applyUsers" open="(" separator="," close=")">
#{user}
</foreach>
<if test="materialCode != null and materialCode != ''"> and c.materialCode like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''">
and c.materialName like concat('%',#{materialName},'%')
</if>
</where>
order by s.audit_status,s.create_time desc
group by s.sales_order_id
order by s.audit_status asc,s.create_time desc
</select>
<select id="selectSysSalesOrderById" parameterType="Long" resultMap="SysSalesOrderResult">
<include refid="selectSysSalesOrderVo"/>
@ -173,8 +171,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where dict_type = 'processType'
) as p
on s.instance_type = p.dict_value
left join sys_sales_order_child as c on s.sales_order_code = c.quoteId
<where>
<if test="createBy != null and createBy !=''"> and s.create_by = #{createBy}</if>
<if test="salesOrderCode != null and salesOrderCode != ''"> and s.sales_order_code like concat('%', #{salesOrderCode}, '%')</if>
<if test="salesOrderNumber != null and salesOrderNumber != ''"> and s.sales_order_number like concat('%', #{salesOrderNumber}, '%')</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and s.enterprise_code like concat('%', #{enterpriseCode}, '%')</if>
@ -189,18 +187,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deliveryStatus != null and deliveryStatus != ''"> and s.delivery_status = #{deliveryStatus}</if>
<if test="closeStatus != null and closeStatus != ''"> and s.close_status = #{closeStatus}</if>
<if test="invoice != null and invoice != ''"> and s.invoice = #{invoice}</if>
<if test="instanceType != null and instanceType != ''"> and s.instance_type = #{instanceType}</if>
<if test="instanceId != null and instanceId != ''"> and s.instance_id = #{instanceId}</if>
<if test="applyUser != null and applyUser != ''"> and s.apply_user = #{applyUser}</if>
<if test="applyTime != null and applyTime != ''"> and s.apply_time = #{applyTime}</if>
<if test="applyTitle != null and applyTitle != ''"> and s.apply_title = #{applyTitle}</if>
<if test="applyUsers != null and applyUsers != ''"> and s.apply_user in
<foreach item="user" index="index" collection="applyUsers" open="(" separator="," close=")">
#{user}
</foreach>
<if test="materialCode != null and materialCode != ''"> and c.materialCode like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''">
and c.materialName like concat('%',#{materialName},'%')
</if>
</where>
order by s.audit_status,s.create_time desc
group by s.sales_order_id
order by s.audit_status asc,s.create_time desc
</select>

71
ruoyi-admin/src/main/resources/templates/sales/estimate/add.html

@ -356,39 +356,62 @@
$.table.init(options);
});
function estimateDoSubmit(index, layero,uniqueId){
//逻辑新增一行物料数据
function estimateDoSubmit(index, layero, uniqueId) {
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-estimateMaterialSelect-table').bootstrapTable('getSelections')[0];
var selectedRows = iframeWin.$('#bootstrap-estimateMaterialSelect-table').bootstrapTable('getSelections');
if (selectedRows.length === 0) {
$.modal.alertError("请选择至少一条物料信息");
return;
}
var existingData = $("#bootstrap-table").bootstrapTable('getData');
//判断是否重复
var rows = $("#bootstrap-table").bootstrapTable('getData').length;
for(var i=0;i<rows;i++){
var data = $("#bootstrap-table").bootstrapTable('getData')[i];
// 存储要插入的新行
var newRows = [];
// 遍历选中的每一行物料信息
for (var i = 0; i < selectedRows.length; i++) {
var rowData = selectedRows[i];
// 检查是否已经存在相同的物料
var isDuplicate = false;
for (var j = 0; j < existingData.length; j++) {
if (existingData[j].materialNo === rowData.materialNo) {
isDuplicate = true;
break;
}
}
if(data.materialNo == rowData.materialNo){
if (!isDuplicate) {
// 如果不存在,则准备插入新行
newRows.push({
materialNo: rowData.materialNo,
materialPhotourl: rowData.photoUrl,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialDescribe: rowData.describe,
materialBrand: rowData.brand,
materialUnit: rowData.unit,
materialProcessMethod: rowData.processMethod,
materialDeptType: rowData.warehouseDept,
materialNum: 0
});
} else {
$.modal.alertError("不能选择已添加过的相同物料");
return;
}
}
console.log("rowData: "+rowData);
$("#bootstrap-table").bootstrapTable('insertRow', {
index:1,
row: {
materialNo:rowData.materialNo,
materialPhotourl:rowData.photoUrl,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialDescribe: rowData.describe,
materialBrand: rowData.brand,
materialUnit: rowData.unit,
materialProcessMethod: rowData.processMethod,
materialDeptType: rowData.warehouseDept,
materialNum: 0
// 批量插入新行
if (newRows.length > 0) {
$("#bootstrap-table").bootstrapTable('insertRow', { index: 1, row: newRows[0] });
for (var k = 1; k < newRows.length; k++) {
$("#bootstrap-table").bootstrapTable('insertRow', { index: 1, row: newRows[k] });
}
})
}
getTotalAmount();
layer.close(index);
}

1
ruoyi-admin/src/main/resources/templates/sales/estimate/estimateMaterialSelect.html

@ -42,7 +42,6 @@
showRefresh: false,
showToggle: false,
clickToSelect: true, // 点击选中行
singleSelect: true, // 单选
url: prefix + "/getEstimateMaterialList",
modalName: "物料信息",
columns: [{

6
ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html

@ -133,7 +133,7 @@
</li>
<li>
<label>生产状态:</label>
<select name="makeStatus" th:with="type=${@dict.getType('sys_make_status')}">
<select name="makeStatus" th:with="type=${@dict.getType('sys_erp_makeStatus')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
@ -461,7 +461,7 @@
var salesOrderCodeData = [];
var selections = $("#bootstrap-table").bootstrapTable("getSelections");
if(selections.length === 0){
$.modal.confirm("确定导出所有出货通知吗?", function() {
$.modal.confirm("确定导出所有销售订单吗?", function() {
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
var params = $("#bootstrap-table").bootstrapTable('getOptions');
var dataParam = $("#" + currentId).serializeArray();
@ -480,7 +480,7 @@
});
});
}else {
$.modal.confirm("确定导出选中的所有出货通知吗?", function () {
$.modal.confirm("确定导出选中的所有销售订单吗?", function () {
//·拼接单号
for(let i=0;i<selections.length;i++){
salesOrderCodeData.push(selections[i].salesOrderCode);

Loading…
Cancel
Save