Browse Source

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

dev
zhangsiqi 3 months ago
parent
commit
0b16e975a0
  1. 28
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java
  4. 8
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java
  5. 8
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml
  6. 59
      ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html

28
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java

@ -11,6 +11,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.remind.service.RemindService; import com.ruoyi.remind.service.RemindService;
@ -215,16 +216,7 @@ public class SysCustomerQuoteController extends BaseController
return list; return list;
} }
@RequiresPermissions("system:customerQuote:export")
@Log(title = "客户报价信息", businessType = BusinessType.EXPORT)
@RequestMapping("/exportCustomerInfo")
@ResponseBody
public void exportCustomerInfo(@RequestBody String selectData, HttpServletResponse response) throws IOException {
//数据处理
JSONObject jsonObject = (JSONObject) JSONObject.parse(selectData);
JSONArray jsonArray = jsonObject.getJSONArray("selectData");
List<SysCustomerDto> selectDataList = JSONObject.parseArray(String.valueOf(jsonArray), SysCustomerDto.class);
}
/** /**
* 获取客户报价编号 * 获取客户报价编号
*/ */
@ -335,6 +327,22 @@ public class SysCustomerQuoteController extends BaseController
} }
/**
* 导出客户报价列表
*/
@RequiresPermissions("system:customerQuote:export")
@Log(title = "客户报价信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(@RequestBody String[] supplierCodes)
{
List<SysCustomerQuote> list = sysCustomerQuoteService.selectCustomerQuoteOneBySupplierCodes(supplierCodes);
ExcelUtil<SysCustomerQuote> util = new ExcelUtil<SysCustomerQuote>(SysCustomerQuote.class);
return util.exportExcel(list, "销售客户报价数据");
}
/** /**
* 导出客户报价模板1 * 导出客户报价模板1
* */ * */

5
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java

@ -105,4 +105,9 @@ public interface SysCustomerQuoteMapper
public int restoreSysCustomerQuoteById(Long id); public int restoreSysCustomerQuoteById(Long id);
int insertSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote); int insertSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote);
/**
* 根据供应商编码数组查询客户报价信息集合
* */
List<SysCustomerQuote> selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes);
} }

5
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java

@ -107,4 +107,9 @@ public interface ISysCustomerQuoteService
* 导出客户报价模板4 * 导出客户报价模板4
* */ * */
void exportCustomerQuoteFour(String supplierCode, HttpServletResponse response); void exportCustomerQuoteFour(String supplierCode, HttpServletResponse response);
/**
* 根据供应商编码数组查询客户报价信息集合
* */
List<SysCustomerQuote> selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes);
} }

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

@ -92,6 +92,14 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
return null; return null;
} }
/**
* 根据供应商编码数组查询客户报价信息集合
* */
@Override
public List<SysCustomerQuote> selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes) {
List<SysCustomerQuote> list = sysCustomerQuoteMapper.selectCustomerQuoteOneBySupplierCodes(supplierCodes);
return list;
}
@Override @Override
public List<SysCustomerQuoteVo> selectSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuoteVo) public List<SysCustomerQuoteVo> selectSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuoteVo)

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

@ -115,6 +115,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where customerCode = #{cusotomerCode} where customerCode = #{cusotomerCode}
</select> </select>
<select id="selectCustomerQuoteOneBySupplierCodes" parameterType="String" resultMap="SysCustomerQuoteResult">
<include refid="selectSysCustomerQuoteVo"/>
where supplierCode in
<foreach item="item" index="index" collection="array" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<insert id="insertSysCustomerQuote" parameterType="SysCustomerQuote" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSysCustomerQuote" parameterType="SysCustomerQuote" useGeneratedKeys="true" keyProperty="id">
insert into sys_customer_quote insert into sys_customer_quote

59
ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html

@ -67,7 +67,7 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:customerQuote:add"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:customerQuote:add">
<i class="fa fa-plus"></i> 添加 <i class="fa fa-plus"></i> 添加
</a> </a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:customerQuote:export"> <a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="system:customerQuote:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
<a class="btn btn-warning" onclick="exportCustomerQuoteOne()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteOne"> <a class="btn btn-warning" onclick="exportCustomerQuoteOne()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteOne">
@ -83,7 +83,6 @@
<a class="btn btn-warning" onclick="exportCustomerQuoteFour()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteFour"> <a class="btn btn-warning" onclick="exportCustomerQuoteFour()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteFour">
<i class="fa fa-download"></i> 导出客户报价4 <i class="fa fa-download"></i> 导出客户报价4
</a> </a>
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space:nowrap"></table> <table id="bootstrap-table" style="white-space:nowrap"></table>
@ -131,7 +130,6 @@
restoreUrl: prefix + "/restore/{id}", restoreUrl: prefix + "/restore/{id}",
detailUrl: prefix + "/detail/{id}", detailUrl: prefix + "/detail/{id}",
exportUrl: prefix + "/export", exportUrl: prefix + "/export",
pageList: [5, 10, 25, 50],
modalName: "客户报价表", modalName: "客户报价表",
fixedColumns:true, fixedColumns:true,
fixedRightNumber:1, fixedRightNumber:1,
@ -223,6 +221,61 @@
// 导出
function exportExcel(formId) {
// $.table.set();
var supplierCodeData = [];
var selections = $("#bootstrap-table").bootstrapTable("getSelections");
if(selections.length === 0){
$.modal.confirm("确定导出所有的客户报价吗?", function() {
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
var params = $("#bootstrap-table").bootstrapTable('getOptions');
var dataParam = $("#" + currentId).serializeArray();
dataParam.push({ "name": "orderByColumn", "value": params.sortName });
dataParam.push({ "name": "isAsc", "value": params.sortOrder });
$.modal.loading("正在导出数据,请稍后...");
$.post(prefix + '/exportAll', dataParam, function(result) {
if (result.code == web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}else {
$.modal.confirm("确定导出选中的所有客户报价吗?", function () {
//·拼接单号
for(let i=0;i<selections.length;i++){
supplierCodeData.push(selections[i].supplierCode);
}
var supplierCodes = JSON.stringify(supplierCodeData);
// console.log(bomNos);
$.modal.loading("正在导出数据,请稍后...");
var config = {
url: prefix + '/export',
type: "post",
dataType: "json",
contentType: "application/json;charset=utf-8",
data: supplierCodes,
success: function(result) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
$.modal.alertSuccess("导出成功!")
$.modal.closeLoading();
},
error: function (result){
$.modal.alertError(result.msg);
}
};
$.ajax(config)
});
}
};
// 导出客户报价模板1 // 导出客户报价模板1
function exportCustomerQuoteOne(){ function exportCustomerQuoteOne(){

Loading…
Cancel
Save