From e38338d0d65bf09a5c14c4034b207e0305a6d457 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期三, 03 十二月 2025 09:56:25 +0800
Subject: [PATCH] 添加质押合同管理
---
fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/PledgeContractMapper.java | 10 +
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/PledgeContractService.java | 58 ++++++
fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContractPR.java | 76 ++++++++
fzzy-igdss-view/src/main/java/models/core.model.xml | 115 +++++++++++-
fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContract.view.xml | 259 ++++++++++++++++++++++++++++
5 files changed, 505 insertions(+), 13 deletions(-)
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/PledgeContractMapper.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/PledgeContractMapper.java
new file mode 100644
index 0000000..2fe5282
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/PledgeContractMapper.java
@@ -0,0 +1,10 @@
+package com.fzzy.igds.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fzzy.igds.domain.PledgeContract;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface PledgeContractMapper extends BaseMapper<PledgeContract> {
+
+}
diff --git a/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/PledgeContractService.java b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/PledgeContractService.java
new file mode 100644
index 0000000..0d2b9c4
--- /dev/null
+++ b/fzzy-igdss-core/src/main/java/com/fzzy/igds/service/PledgeContractService.java
@@ -0,0 +1,58 @@
+package com.fzzy.igds.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.fzzy.igds.data.BaseResp;
+import com.fzzy.igds.data.IgdsBaseParam;
+import com.fzzy.igds.domain.PledgeContract;
+import com.fzzy.igds.mapper.PledgeContractMapper;
+import com.fzzy.igds.utils.ContextUtil;
+import com.ruoyi.common.utils.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+@Slf4j
+@Service
+public class PledgeContractService {
+
+ @Resource
+ private PledgeContractMapper pledgeContractMapper;
+
+ public List<PledgeContract> listAll(IgdsBaseParam param) {
+
+ if (null == param)
+ return pledgeContractMapper.selectList(null);
+
+ QueryWrapper<PledgeContract> queryWrapper = new QueryWrapper<>();
+ if (StringUtils.isNotEmpty(param.getName())) {
+ queryWrapper.like("name", param.getName());
+ }
+ return pledgeContractMapper.selectList(queryWrapper);
+ }
+
+ public BaseResp addData(PledgeContract pledgeContract) {
+ if(StringUtils.isEmpty(pledgeContract.getId())){
+ pledgeContract.setId(ContextUtil.generateOrderId("PC"));
+ }
+ pledgeContract.setCompanyId(ContextUtil.getCompanyId());
+ pledgeContract.setUpdateBy(ContextUtil.getLoginUserName());
+ pledgeContract.setUpdateTime(new Date());
+ pledgeContract.setCreateBy(ContextUtil.getLoginUserName());
+ pledgeContract.setCreateTime(new Date());
+ return pledgeContractMapper.insert(pledgeContract) > 0 ? BaseResp.success() : BaseResp.error("娣诲姞澶辫触");
+ }
+
+ public BaseResp updateData(PledgeContract pledgeContract) {
+ pledgeContract.setUpdateBy(ContextUtil.getLoginUserName());
+ pledgeContract.setUpdateTime(new Date());
+ return pledgeContractMapper.updateById(pledgeContract) > 0 ? BaseResp.success() : BaseResp.error("鏇存柊澶辫触");
+ }
+
+ public BaseResp deleteData(PledgeContract pledgeContract) {
+ return pledgeContractMapper.deleteById(pledgeContract) > 0 ? BaseResp.success() : BaseResp.error("鍒犻櫎澶辫触");
+ }
+
+}
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContract.view.xml b/fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContract.view.xml
new file mode 100644
index 0000000..8af7c6e
--- /dev/null
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContract.view.xml
@@ -0,0 +1,259 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ViewConfig>
+ <Arguments/>
+ <Context/>
+ <Model/>
+ <View layout="padding:10">
+ <ClientEvent name="onClick">
+/**
+* 鏌ヨ
+*/
+query = function(){
+ view.get("#dsMain").flushAsync();
+}
</ClientEvent>
+ <Property name="packages">font-awesome,css-common</Property>
+ <DataSet id="dsMain">
+ <Property name="loadMode">lazy</Property>
+ <Property name="dataType">[dtPledgeContract]</Property>
+ <Property name="dataProvider">pledgeContractPR#listAll</Property>
+ </DataSet>
+ <DataSet id="dsParam">
+ <ClientEvent name="onReady">self.insert({});</ClientEvent>
+ <Property name="dataType">dtBaseParam</Property>
+ </DataSet>
+ <Container>
+ <Property name="className">c-param</Property>
+ <AutoForm>
+ <Property name="cols">*,90,90,*,*</Property>
+ <Property name="dataSet">dsParam</Property>
+ <Property name="labelAlign">right</Property>
+ <AutoFormElement>
+ <Property name="name">name</Property>
+ <Property name="property">name</Property>
+ <Property name="label">璐ㄦ娂鍚嶇О</Property>
+ <Property name="labelWidth">90</Property>
+ <Editor/>
+ </AutoFormElement>
+ <Button>
+ <ClientEvent name="onClick">var param = view.get("#dsParam.data");
+console.log("param",param);
+view.get("#dsMain").set("parameter",param).flushAsync();
+</ClientEvent>
+ <Property name="caption">鎼滅储</Property>
+ <Property name="iconClass">fa fa-search</Property>
+ <Property name="exClassName">btn-q1</Property>
+ </Button>
+ <Button>
+ <ClientEvent name="onClick">view.get("#dsParam").set("data",{});</ClientEvent>
+ <Property name="caption">閲嶇疆</Property>
+ <Property name="exClassName">btn-q2</Property>
+ <Property name="iconClass">fa fa-refresh</Property>
+ </Button>
+ </AutoForm>
+ </Container>
+ <Container>
+ <Property name="className">c-data</Property>
+ <ToolBar>
+ <ToolBarButton>
+ <ClientEvent name="onClick">
+view.get("#ajaxInitAdd").execute(function(data){
+ view.get("#dsMain").insert(data);
+ view.get("#dialogMain").show();
+ });</ClientEvent>
+ <Property name="caption">鏂板</Property>
+ <Property name="exClassName">btn1</Property>
+ <Property name="width">100</Property>
+ <Property name="iconClass">fa fa-plus</Property>
+ </ToolBarButton>
+ <ToolBarButton>
+ <ClientEvent name="onClick">var data = view.get("#dgMain").get("selection");
+view.get("#dialogMain").show();
+ </ClientEvent>
+ <Property name="id">btnUpdate</Property>
+ <Property name="caption">淇敼</Property>
+ <Property name="exClassName">btn2</Property>
+ <Property name="width">100</Property>
+ <Property name="iconClass">fa fa-pencil-square-o</Property>
+ </ToolBarButton>
+ <ToolBarButton>
+ <ClientEvent name="onClick">var data = view.get("#dgMain").get("selection")
+if(!data){
+ $alert("璇烽�夋嫨鏁版嵁");
+ }else{
+ view.get("#ajaxDelData").set("parameter", data).execute(function(result){
+ if("200"!=result.code){
+ $alert("寮傚父淇℃伅锛�"+result.message);
+ }else{
+ $notify("鎵ц鎴愬姛");
+ query();
+ }
+ })
+}</ClientEvent>
+ <Property name="caption">鍒犻櫎</Property>
+ <Property name="exClassName">btn3</Property>
+ <Property name="width">100</Property>
+ <Property name="iconClass">fa fa-times</Property>
+ </ToolBarButton>
+ </ToolBar>
+ <DataGrid id="dgMain" layoutConstraint="padding:8" selectionMode="singleRow">
+ <ClientEvent name="onDataRowClick">self.set("selection", arg.data)</ClientEvent>
+ <Property name="dataSet">dsMain</Property>
+ <Property name="readOnly">true</Property>
+ <RowSelectorColumn/>
+ <RowNumColumn/>
+ <DataColumn name="name">
+ <Property name="property">name</Property>
+ <Property name="width">400</Property>
+ </DataColumn>
+ <DataColumn name="status">
+ <Property name="property">status</Property>
+ <Property name="align">center</Property>
+ <Property name="width">150</Property>
+ </DataColumn>
+ <DataColumn name="remark">
+ <Property name="property">remark</Property>
+ </DataColumn>
+ <DataColumn name="updateBy">
+ <Property name="property">updateBy</Property>
+ <Property name="align">center</Property>
+ <Property name="width">160</Property>
+ </DataColumn>
+ <DataColumn name="updateTime">
+ <Property name="property">updateTime</Property>
+ <Property name="align">center</Property>
+ <Property name="width">200</Property>
+ </DataColumn>
+ </DataGrid>
+ </Container>
+ <Dialog id="dialogMain" layout="regionPadding:8">
+ <Property name="closeable">false</Property>
+ <Property name="caption">璐ㄦ娂鍚堝悓</Property>
+ <Property name="width">1200</Property>
+ <Property name="iconClass">fa fa-tasks</Property>
+ <Buttons>
+ <Button id="btnOk">
+ <ClientEvent name="onClick">view.get("#saveAction").execute(function(){
+ self.get("parent").hide();
+});</ClientEvent>
+ <Property name="caption">淇濆瓨</Property>
+ <Property name="iconClass">fa fa-check-circle</Property>
+ <Property name="exClassName">btn1</Property>
+ <Property name="width">120</Property>
+ </Button>
+ <Button>
+ <ClientEvent name="onClick">view.get("#dsMain.data:#").cancel();
+ self.get("parent").hide();</ClientEvent>
+ <Property name="caption">鍙栨秷</Property>
+ <Property name="exClassName">btn3</Property>
+ <Property name="iconClass">fa fa-times-circle</Property>
+ <Property name="width">120</Property>
+ </Button>
+ </Buttons>
+ <Children>
+ <Container>
+ <AutoForm layoutConstraint="top ">
+ <Property name="dataSet">dsMain</Property>
+ <Property name="showHint">false</Property>
+ <Property name="cols">210,*,210</Property>
+ <Control/>
+ <Label>
+ <Property name="exClassName">f-title</Property>
+ <Property name="text">璐ㄦ娂鍚堝悓鍗�</Property>
+ </Label>
+ <AutoFormElement>
+ <Property name="name">id</Property>
+ <Property name="property">id</Property>
+ <Property name="editorType">Label</Property>
+ <Property name="showHint">false</Property>
+ <Property name="labelAlign">right</Property>
+ <Property name="showLabel">false</Property>
+ <Editor/>
+ </AutoFormElement>
+ </AutoForm>
+ <AutoForm>
+ <Property name="dataSet">dsMain</Property>
+ <Property name="cols">*,*,*</Property>
+ <Property name="labelAlign">right</Property>
+ <Property name="labelSeparator">锛�</Property>
+ <Property name="labelWidth">120</Property>
+ <AutoFormElement>
+ <Property name="name">contractNo</Property>
+ <Property name="property">contractNo</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">contractName</Property>
+ <Property name="property">contractName</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">contractAmount</Property>
+ <Property name="property">contractAmount</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">pledgeBank</Property>
+ <Property name="property">pledgeBank</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">pledgeCompany</Property>
+ <Property name="property">pledgeCompany</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">name</Property>
+ <Property name="property">name</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">status</Property>
+ <Property name="property">status</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">signTime</Property>
+ <Property name="property">signTime</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">pledgeStart</Property>
+ <Property name="property">pledgeStart</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">pledgeEnd</Property>
+ <Property name="property">pledgeEnd</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">pledgeDept</Property>
+ <Property name="property">pledgeDept</Property>
+ <Editor/>
+ </AutoFormElement>
+ <AutoFormElement>
+ <Property name="name">remark</Property>
+ <Property name="property">remark</Property>
+ <Editor/>
+ </AutoFormElement>
+ </AutoForm>
+ </Container>
+ </Children>
+ <Tools/>
+ </Dialog>
+ <UpdateAction id="saveAction">
+ <Property name="dataResolver">pledgeContractPR#saveUpdate</Property>
+ <UpdateItem>
+ <Property name="dataSet">dsMain</Property>
+ <Property name="dataPath">[#current]</Property>
+ </UpdateItem>
+ </UpdateAction>
+ <AjaxAction id="ajaxDelData">
+ <Property name="confirmMessage">纭畾瑕佸垹闄ゆ暟鎹箞锛�</Property>
+ <Property name="service">pledgeContractPR#delete</Property>
+ </AjaxAction>
+ <AjaxAction id="ajaxInitAdd">
+ <Property name="service">pledgeContractPR#initAdd</Property>
+ </AjaxAction>
+ </View>
+</ViewConfig>
diff --git a/fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContractPR.java b/fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContractPR.java
new file mode 100644
index 0000000..15e2aad
--- /dev/null
+++ b/fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContractPR.java
@@ -0,0 +1,76 @@
+package com.fzzy.igds;
+
+import com.bstek.dorado.annotation.DataProvider;
+import com.bstek.dorado.annotation.DataResolver;
+import com.bstek.dorado.annotation.Expose;
+import com.fzzy.igds.data.BaseResp;
+import com.fzzy.igds.data.IgdsBaseParam;
+import com.fzzy.igds.domain.PledgeContract;
+import com.fzzy.igds.service.PledgeContractService;
+import com.fzzy.igds.utils.ContextUtil;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Component
+public class PledgeContractPR {
+
+ @Resource
+ private PledgeContractService pledgeContractService;
+
+ /**
+ * pledgeContractPR#initAdd
+ * 鏂板鍒濆鍖栨暟鎹�
+ */
+ @Expose
+ public PledgeContract initAdd() {
+ SysUser user = ContextUtil.getLoginUser();
+ PledgeContract data = new PledgeContract();
+ data.setId(ContextUtil.generateOrderId("PC"));
+ data.setCompanyId(user.getCompanyId());
+ return data;
+ }
+
+
+ /**
+ * pledgeContractPR#listAll
+ * 璐ㄦ娂鍒楄〃
+ */
+ @DataProvider
+ public List<PledgeContract> listAll(IgdsBaseParam param) {
+ return pledgeContractService.listAll(param);
+ }
+
+ /**
+ * 淇濆瓨/鏇存柊
+ *
+ * @param pledgeContract
+ * @return
+ */
+ @Transactional
+ @DataResolver
+ public BaseResp saveUpdate(PledgeContract pledgeContract) {
+ if (null == pledgeContract.getCreateTime()) {
+ return pledgeContractService.addData(pledgeContract);
+ } else {
+ return pledgeContractService.updateData(pledgeContract);
+ }
+ }
+
+
+ /**
+ * 鍒犻櫎
+ *
+ * @param pledgeContract
+ * @return
+ */
+ @Expose
+ public BaseResp delete(PledgeContract pledgeContract) {
+ if (StringUtils.isNotEmpty(pledgeContract.getId())) return pledgeContractService.deleteData(pledgeContract);
+ return BaseResp.success();
+ }
+}
diff --git a/fzzy-igdss-view/src/main/java/models/core.model.xml b/fzzy-igdss-view/src/main/java/models/core.model.xml
index 707e70a..ea12e79 100644
--- a/fzzy-igdss-view/src/main/java/models/core.model.xml
+++ b/fzzy-igdss-view/src/main/java/models/core.model.xml
@@ -914,16 +914,16 @@
<DataType name="dtNoticeParam">
<Property name="matchType">com.fzzy.igds.data.NoticeParam</Property>
<PropertyDef name="id">
- <Property/>
+ <Property></Property>
</PropertyDef>
<PropertyDef name="companyId">
- <Property/>
+ <Property></Property>
</PropertyDef>
<PropertyDef name="deptId">
- <Property/>
+ <Property></Property>
</PropertyDef>
<PropertyDef name="depotId">
- <Property/>
+ <Property></Property>
<Property name="label">瑁呭嵏浠撳簱</Property>
<Property name="mapping">
<Property name="mapValues">${dorado.getDataProvider("depotPR#getAllCache").getResult()}</Property>
@@ -932,11 +932,11 @@
</Property>
</PropertyDef>
<PropertyDef name="customerName">
- <Property/>
+ <Property></Property>
<Property name="label">瀹㈡埛鍚嶇О</Property>
</PropertyDef>
<PropertyDef name="foodVariety">
- <Property/>
+ <Property></Property>
<Property name="label">绮鍝佺</Property>
<Property name="mapping">
<Property name="mapValues">${dorado.getDataProvider("dicPR#sysDictData").getResult("FOOD_VARIETY_")}</Property>
@@ -945,19 +945,19 @@
</Property>
</PropertyDef>
<PropertyDef name="contractId">
- <Property/>
+ <Property></Property>
</PropertyDef>
<PropertyDef name="planId">
- <Property/>
+ <Property></Property>
</PropertyDef>
<PropertyDef name="foodType">
- <Property/>
+ <Property></Property>
</PropertyDef>
<PropertyDef name="year">
- <Property/>
+ <Property></Property>
</PropertyDef>
<PropertyDef name="type">
- <Property/>
+ <Property></Property>
</PropertyDef>
<PropertyDef name="weight">
<Property name="dataType">Double</Property>
@@ -966,7 +966,7 @@
<Property name="dataType">Double</Property>
</PropertyDef>
<PropertyDef name="completeStatus">
- <Property/>
+ <Property></Property>
<Property name="label">瀹屾垚鐘舵��</Property>
<Property name="mapping">
<Property name="mapValues">
@@ -995,7 +995,96 @@
<Property name="dataType">Date</Property>
</PropertyDef>
<PropertyDef name="createUser">
- <Property/>
+ <Property></Property>
+ </PropertyDef>
+ </DataType>
+ <DataType name="dtPledgeContract">
+ <Property name="creationType">com.fzzy.igds.domain.PledgeContract</Property>
+ <PropertyDef name="id">
+ <Property></Property>
+ </PropertyDef>
+ <PropertyDef name="contractNo">
+ <Property></Property>
+ <Property name="label">鍚堝悓缂栧彿</Property>
+ </PropertyDef>
+ <PropertyDef name="contractName">
+ <Property></Property>
+ <Property name="label">鍚堝悓鍚嶇О</Property>
+ </PropertyDef>
+ <PropertyDef name="contractAmount">
+ <Property name="dataType">Double</Property>
+ <Property name="label">鍚堝悓閲戦</Property>
+ </PropertyDef>
+ <PropertyDef name="pledgeBank">
+ <Property></Property>
+ <Property name="label">璐ㄦ娂閾惰</Property>
+ <Property name="mapping">
+ <Property name="mapValues">${dorado.getDataProvider("bankPR#listAll").getResult()}</Property>
+ <Property name="keyProperty">id</Property>
+ <Property name="valueProperty">name</Property>
+ </Property>
+ </PropertyDef>
+ <PropertyDef name="pledgeCompany">
+ <Property></Property>
+ <Property name="label">璐ㄦ娂鍏徃</Property>
+ <Property name="mapping">
+ <Property name="mapValues">${dorado.getDataProvider("companyPR#getData").getResult()}</Property>
+ <Property name="keyProperty">id</Property>
+ <Property name="valueProperty">dwmc</Property>
+ </Property>
+ </PropertyDef>
+ <PropertyDef name="name">
+ <Property></Property>
+ <Property name="label">璐ㄦ娂鍚嶇О</Property>
+ </PropertyDef>
+ <PropertyDef name="status">
+ <Property></Property>
+ <Property name="label">璐ㄦ娂鐘舵��</Property>
+ </PropertyDef>
+ <PropertyDef name="signTime">
+ <Property name="dataType">Date</Property>
+ <Property name="label">绛捐鏃堕棿</Property>
+ </PropertyDef>
+ <PropertyDef name="pledgeStart">
+ <Property name="dataType">Date</Property>
+ <Property name="label">寮�濮嬫椂闂�</Property>
+ </PropertyDef>
+ <PropertyDef name="pledgeEnd">
+ <Property name="dataType">Date</Property>
+ <Property name="label">缁撴潫鏃堕棿</Property>
+ </PropertyDef>
+ <PropertyDef name="pledgeDept">
+ <Property></Property>
+ <Property name="label">璐ㄦ娂搴撳尯</Property>
+ <Property name="mapping">
+ <Property name="keyProperty">id</Property>
+ <Property name="mapValues">${dorado.getDataProvider("deptPR#getAllData").getResult()}</Property>
+ <Property name="valueProperty">kqmc</Property>
+ </Property>
+ </PropertyDef>
+ <PropertyDef name="remark">
+ <Property></Property>
+ <Property name="label">澶囨敞璇存槑</Property>
+ </PropertyDef>
+ <PropertyDef name="companyId">
+ <Property></Property>
+ <Property name="label">缁勭粐缂栫爜</Property>
+ </PropertyDef>
+ <PropertyDef name="createBy">
+ <Property></Property>
+ <Property name="label">鍒涘缓浜�</Property>
+ </PropertyDef>
+ <PropertyDef name="createTime">
+ <Property name="dataType">Date</Property>
+ <Property name="label">鍒涘缓鏃堕棿</Property>
+ </PropertyDef>
+ <PropertyDef name="updateBy">
+ <Property></Property>
+ <Property name="label">鏇存柊浜�</Property>
+ </PropertyDef>
+ <PropertyDef name="updateTime">
+ <Property name="dataType">Date</Property>
+ <Property name="label">鏇存柊鏃堕棿</Property>
</PropertyDef>
</DataType>
</Model>
--
Gitblit v1.9.3