sgj
2026-03-20 58f63e3a124680d0b1f571f5d0a1e3ed308d43be
质押合同页面重构
已修改4个文件
已添加3个文件
779 ■■■■ 文件已修改
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/PledgeContract.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/PledgeContractDepot.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/PledgeContractDepotMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/PledgeContractDepotService.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContract.view.xml 474 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContractPR.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/models/core.model.xml 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/PledgeContract.java
@@ -7,12 +7,10 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * è´¨æŠ¼åˆåŒ
@@ -48,7 +46,7 @@
    //合同金额
    @Column(name = "contract_amount", columnDefinition = "decimal(20,2) COMMENT '合同金额'")
    @TableField("contract_amount")
    private Double contractAmount=0.0;
    private Double contractAmount = 0.0;
    @Column(name = "repaid_amount", columnDefinition = "decimal(20,2) COMMENT '已还金额'")
    @TableField("repaid_amount")
@@ -105,4 +103,8 @@
    @TableField("remark")
    private String remark;
    //质押仓库
    @Transient
    @TableField(exist = false)
    private List<PledgeContractDepot> depotData;
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/PledgeContractDepot.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,50 @@
package com.fzzy.igds.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
@Data
@Entity
@Table(name = "d_pledge_contract_depot")
@TableName("d_pledge_contract_depot")
@EqualsAndHashCode(callSuper = false)
public class PledgeContractDepot extends BizBaseEntity implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "id", columnDefinition = "varchar(40) COMMENT 'ID'")
    @TableField("id")
    private String id;
    @Column(name = "pledge_id", columnDefinition = "varchar(40) COMMENT '质押合同ID'")
    @TableField("pledge_id")
    private String pledgeId;
    @Column(name = "pledge_dept", columnDefinition = "varchar(40) COMMENT '质押库区ID'")
    @TableField("pledge_dept")
    private String pledgeDept;
    @Column(name = "pledge_depot", columnDefinition = "varchar(40) COMMENT '质押仓库ID'")
    @TableField("pledge_depot")
    private String pledgeDepot;
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/PledgeContractDepotMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,10 @@
package com.fzzy.igds.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fzzy.igds.domain.PledgeContractDepot;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PledgeContractDepotMapper extends BaseMapper<PledgeContractDepot> {
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/PledgeContractDepotService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,95 @@
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.PledgeContractDepot;
import com.fzzy.igds.mapper.PledgeContractDepotMapper;
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 PledgeContractDepotService {
    @Resource
    private PledgeContractDepotMapper pledgeContractDepotMapper;
    /**
     * æŸ¥è¯¢è´¨æŠ¼åˆåŒä¸‹å¾—质押仓库
     *
     * @param param
     * @author sgj
     * @since 2026/03/20
     */
    public List<PledgeContractDepot> listAll(IgdsBaseParam param) {
        if (null == param) param = new IgdsBaseParam();
        if (StringUtils.isEmpty(param.getCompanyId())) {
            param.setCompanyId(ContextUtil.getCompanyId());
        }
        QueryWrapper<PledgeContractDepot> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("company_id", param.getCompanyId());
        if (StringUtils.isNotEmpty(param.getParentId())) {
            queryWrapper.like("pledge_id", param.getParentId());
        }
        queryWrapper.orderByDesc("update_time");
        return pledgeContractDepotMapper.selectList(queryWrapper);
    }
    /**
     * æ‰¹é‡æ–°å¢žè´¨æŠ¼ä»“库
     *
     * @param pledgeContractList
     * @author sgj
     * @since 2026/03/20
     */
    public BaseResp addDataByList(List<PledgeContractDepot> pledgeContractList) {
        if (pledgeContractList.isEmpty()) {
            return BaseResp.success();
        }
        boolean PledgeIdflag = true;
        for (PledgeContractDepot pledgeContractDepot : pledgeContractList) {
            pledgeContractDepot.setCompanyId(ContextUtil.getCompanyId());
            pledgeContractDepot.setUpdateBy(ContextUtil.getLoginUserName());
            pledgeContractDepot.setUpdateTime(new Date());
            pledgeContractDepot.setCreateBy(ContextUtil.getLoginUserName());
            pledgeContractDepot.setCreateTime(new Date());
            if (StringUtils.isEmpty(pledgeContractDepot.getPledgeId())) {
                PledgeIdflag = false;
                break;
            }
            if (StringUtils.isEmpty(pledgeContractDepot.getId())) {
                pledgeContractDepot.setId(ContextUtil.generateId());
                pledgeContractDepotMapper.insert(pledgeContractDepot);
            }
        }
        if (!PledgeIdflag) {
            return BaseResp.error("添加失败——质押合同Id不能为空");
        }
        return BaseResp.success();
    }
    /**
     * åˆ é™¤è´¨æŠ¼ä»“库
     *
     * @param pledgeContractDepot
     * @author sgj
     * @since 2026/03/20
     */
    public BaseResp deleteData(PledgeContractDepot pledgeContractDepot) {
        return pledgeContractDepotMapper.deleteById(pledgeContractDepot) > 0 ? BaseResp.success() : BaseResp.error("删除失败");
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContract.view.xml
@@ -10,7 +10,19 @@
*/&#xD;
query = function(){&#xD;
    view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
}&#xD;</ClientEvent>
}&#xD;&#xD;
&#xD;
queryDepot= function(){&#xD;
    var entity = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
    if(entity){&#xD;
        var code = entity.get(&quot;id&quot;);&#xD;
        view.get(&quot;#dsPledgeContractDepot&quot;).set(&quot;parameter&quot;,{PledgeId:code}).flush();&#xD;
    }else{&#xD;
        $notify(&quot;请先选择质押合同信息!&quot;);&#xD;
    }&#xD;
&#xD;
}&#xD;
</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="loadMode">lazy</Property>
@@ -21,17 +33,10 @@
      <ClientEvent name="onReady">self.insert({});</ClientEvent>
      <Property name="dataType">dtBaseParam</Property>
    </DataSet>
    <DataSet id="dsDeptList">
      <Property name="dataProvider">deptPR#getData</Property>
      <Property name="userData">库区列表下拉框</Property>
    <DataSet id="dsPledgeContractDepot">
      <Property name="dataProvider">pledgeContractPR#listAllData</Property>
      <Property name="dataType">[dtPledgeContractDepot]</Property>
      <Property name="loadMode">manual</Property>
      <Property name="dataType">[dtDept]</Property>
    </DataSet>
    <DataSet id="dsDepotList">
      <Property name="dataProvider">depotPR#getData</Property>
      <Property name="userData">仓库列表下拉框</Property>
      <Property name="loadMode">manual</Property>
      <Property name="dataType">[dtDepot]</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
@@ -65,35 +70,40 @@
    </Container>
    <Container>
      <Property name="className">c-data</Property>
      <ToolBar>
        <ToolBarButton>
          <ClientEvent name="onClick">&#xD;
      <SplitPanel>
        <Property name="direction">right</Property>
        <Property name="position">350</Property>
        <MainControl>
          <Container>
            <ToolBar>
              <ToolBarButton>
                <ClientEvent name="onClick">&#xD;
view.get(&quot;#ajaxInitAdd&quot;).execute(function(data){&#xD;
        view.get(&quot;#dsMain&quot;).insert(data);&#xD;
        view.get(&quot;#dialogMain&quot;).show();&#xD;
    });</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(&quot;#dgMain&quot;).get(&quot;selection&quot;);
                <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(&quot;#dgMain&quot;).get(&quot;selection&quot;);
if(data){&#xD;
    view.get(&quot;#dialogMain&quot;).show();
}else{&#xD;
    $notify(&quot;请选择需要修改的信息……&quot;);&#xD;
}&#xD;</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(&quot;#dgMain&quot;).get(&quot;selection&quot;)
                <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(&quot;#dgMain&quot;).get(&quot;selection&quot;)
if(!data){
    $alert(&quot;请选择需要删除的信息……&quot;);
    $alert(&quot;请选择需要删除的质押合同信息……&quot;);
}else{
    view.get(&quot;#ajaxDelData&quot;).set(&quot;parameter&quot;, data).execute(function(result){
        if(&quot;200&quot;!=result.code){
@@ -104,56 +114,131 @@
        }
    })
}</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(&quot;selection&quot;, arg.data)</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn name="pledgeBank">
          <Property name="property">pledgeBank</Property>
        </DataColumn>
        <DataColumn name="pledgeCompany">
          <Property name="property">pledgeCompany</Property>
        </DataColumn>
        <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>
        <DataColumn name="signTime">
          <Property name="property">signTime</Property>
        </DataColumn>
        <DataColumn name="pledgeStart">
          <Property name="property">pledgeStart</Property>
        </DataColumn>
        <DataColumn name="pledgeEnd">
          <Property name="property">pledgeEnd</Property>
        </DataColumn>
      </DataGrid>
                <Property name="caption">删除</Property>
                <Property name="exClassName">btn3</Property>
                <Property name="width">100</Property>
                <Property name="iconClass">fa fa-times</Property>
              </ToolBarButton>
              <ToolBarButton>
                <ClientEvent name="onClick">//var cur = view.get(&quot;#dsMain.data:#&quot;);&#xD;
var cur = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(cur){&#xD;
    var entity = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
    var Id = entity.get(&quot;id&quot;);&#xD;
    var code = entity.get(&quot;pledgeCompany&quot;);&#xD;
    view.get(&quot;#dsDepotSelect&quot;).set(&quot;parameter&quot;,{parentId:code,PledgeId:Id}).flush();&#xD;
    view.get(&quot;#dialogDepot&quot;).show();&#xD;
}else{&#xD;
    $notify(&quot;请先选择质押合同信息!&quot;);&#xD;
}</ClientEvent>
                <Property name="caption">配置仓库</Property>
                <Property name="exClassName">btn1</Property>
                <Property name="width">100</Property>
                <Property name="iconClass">fa fa-plus</Property>
              </ToolBarButton>
            </ToolBar>
            <DataGrid id="dgMain" layoutConstraint="padding:8" selectionMode="singleRow">
              <ClientEvent name="onDataRowClick">self.set(&quot;selection&quot;, arg.data);&#xD;
var entity = view.get(&quot;#dsMain.data:#&quot;);&#xD;
var code = entity.get(&quot;id&quot;);&#xD;
view.get(&quot;#dsPledgeContractDepot&quot;).set(&quot;parameter&quot;,{PledgeId:code}).flush();</ClientEvent>
              <Property name="dataSet">dsMain</Property>
              <Property name="readOnly">true</Property>
              <Property name="fixedColumnCount">3</Property>
              <RowSelectorColumn/>
              <RowNumColumn/>
              <DataColumn name="pledgeCompany">
                <Property name="property">pledgeCompany</Property>
                <Property name="width">200</Property>
                <Property name="align">center</Property>
              </DataColumn>
              <DataColumn name="pledgeBank">
                <Property name="property">pledgeBank</Property>
                <Property name="width">200</Property>
                <Property name="align">center</Property>
              </DataColumn>
              <DataColumn name="name">
                <Property name="property">name</Property>
                <Property name="width">400</Property>
                <Property name="align">center</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>
                <Property name="width">300</Property>
                <Property name="align">center</Property>
              </DataColumn>
              <DataColumn name="updateBy">
                <Property name="property">updateBy</Property>
                <Property name="align">center</Property>
                <Property name="width">300</Property>
              </DataColumn>
              <DataColumn name="updateTime">
                <Property name="property">updateTime</Property>
                <Property name="align">center</Property>
                <Property name="width">150</Property>
              </DataColumn>
              <DataColumn name="signTime">
                <Property name="property">signTime</Property>
                <Property name="width">150</Property>
                <Property name="align">center</Property>
              </DataColumn>
              <DataColumn name="pledgeStart">
                <Property name="property">pledgeStart</Property>
                <Property name="width">150</Property>
                <Property name="align">center</Property>
              </DataColumn>
              <DataColumn name="pledgeEnd">
                <Property name="property">pledgeEnd</Property>
                <Property name="width">150</Property>
                <Property name="align">center</Property>
              </DataColumn>
            </DataGrid>
          </Container>
        </MainControl>
        <SideControl>
          <Container>
            <ToolBar>
              <ToolBarButton>
                <ClientEvent name="onClick">var data = view.get(&quot;#dgMainItem&quot;).get(&quot;selection&quot;)
if(!data){
    $alert(&quot;请选择需要删除的质押仓库信息……&quot;);
}else{
    view.get(&quot;#ajaxDelDepotData&quot;).set(&quot;parameter&quot;, data).execute(function(result){
        if(&quot;200&quot;!=result.code){
            $alert(&quot;异常信息:&quot;+result.message);
        }else{
            $notify(&quot;执行成功&quot;);
            queryDepot();
        }
    })
}</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="dgMainItem" layoutConstraint="padding:8" selectionMode="singleRow">
              <ClientEvent name="onDataRowClick">self.set(&quot;selection&quot;, arg.data)</ClientEvent>
              <Property name="dataSet">dsPledgeContractDepot</Property>
              <Property name="readOnly">true</Property>
              <RowSelectorColumn/>
              <RowNumColumn/>
              <DataColumn name="pledgeDept">
                <Property name="property">pledgeDept</Property>
              </DataColumn>
              <DataColumn name="pledgeDepot">
                <Property name="property">pledgeDepot</Property>
              </DataColumn>
            </DataGrid>
          </Container>
        </SideControl>
      </SplitPanel>
    </Container>
    <Dialog id="dialogMain" layout="regionPadding:8">
      <Property name="closeable">false</Property>
@@ -225,15 +310,23 @@
              <Editor/>
            </AutoFormElement>
            <AutoFormElement>
              <Property name="name">pledgeDept</Property>
              <Property name="property">pledgeDept</Property>
              <Property name="trigger">dsDeptDropDown</Property>
              <Property name="name">contractAmount</Property>
              <Property name="property">contractAmount</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement>
              <Property name="name">depotNames</Property>
              <Property name="property">depotNames</Property>
              <Property name="trigger">CDDDept</Property>
              <Property name="name">repaidAmount</Property>
              <Property name="property">repaidAmount</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement layoutConstraint="colSpan:2">
              <Property name="name">contractName</Property>
              <Property name="property">contractName</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement>
              <Property name="name">contractNo</Property>
              <Property name="property">contractNo</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement>
@@ -251,35 +344,9 @@
              <Property name="property">pledgeEnd</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement layoutConstraint="colSpan:2">
              <Property name="name">contractName</Property>
              <Property name="property">contractName</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement>
              <Property name="name">contractNo</Property>
              <Property name="property">contractNo</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement>
              <Property name="name">contractAmount</Property>
              <Property name="property">contractAmount</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement>
              <Property name="name">repaidAmount</Property>
              <Property name="property">repaidAmount</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement>
              <Property name="name">status</Property>
              <Property name="property">status</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement layoutConstraint="colSpan:3">
              <Property name="name">remark</Property>
              <Property name="property">remark</Property>
              <Property name="editorType">TextArea</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement>
@@ -292,6 +359,12 @@
              <Property name="name">createTime</Property>
              <Property name="property">createTime</Property>
              <Property name="readOnly">true</Property>
              <Editor/>
            </AutoFormElement>
            <AutoFormElement layoutConstraint="colSpan:3">
              <Property name="name">remark</Property>
              <Property name="property">remark</Property>
              <Property name="editorType">TextArea</Property>
              <Editor/>
            </AutoFormElement>
            <HtmlContainer layoutConstraint="colSpan:3">
@@ -314,108 +387,93 @@
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxDelData">
      <Property name="confirmMessage">确定要删除数据么?</Property>
      <Property name="confirmMessage">确定要删除该质押合同数据吗?</Property>
      <Property name="service">pledgeContractPR#delete</Property>
    </AjaxAction>
    <AjaxAction id="ajaxDelDepotData">
      <Property name="confirmMessage">确定要删除该质押仓库数据么吗?</Property>
      <Property name="service">pledgeContractPR#deleteDepot</Property>
    </AjaxAction>
    <AjaxAction id="ajaxInitAdd">
      <Property name="service">pledgeContractPR#initAdd</Property>
    </AjaxAction>
    <DataSetDropDown id="dsDeptDropDown">
      <ClientEvent name="onOpen">&#xD;
var entity = view.get(&quot;#dsMain.data:#&quot;);&#xD;
if(!entity){&#xD;
    $alert(&quot;请先选择质押公司&quot;);&#xD;
}else{&#xD;
    var pledgeCompany = entity.get(&quot;pledgeCompany&quot;);&#xD;
    if(!pledgeCompany){&#xD;
        $alert(&quot;请先选择质押公司&quot;);&#xD;
    }else{&#xD;
        view.get(&quot;#dsDeptList&quot;).set(&quot;parameter&quot;,entity.get(&quot;pledgeCompany&quot;)).flushAsync();&#xD;
    }
}</ClientEvent>
      <Property name="dataSet">dsDeptList</Property>
      <Property name="height">450</Property>
      <Property name="autoOpen">true</Property>
      <Property name="assignmentMap">pledgeDept=id</Property>
      <Property name="width">400</Property>
      <DataColumn>
        <Property name="align">center</Property>
        <Property name="name">kqmc</Property>
        <Property name="property">kqmc</Property>
        <Editor/>
      </DataColumn>
    </DataSetDropDown>
    <CustomDropDown id="CDDDept">
      <ClientEvent name="onOpen">&#xD;
var entity = view.get(&quot;#dsMain.data:#&quot;);&#xD;
if(!entity){&#xD;
    $alert(&quot;请先选择质押库区&quot;);&#xD;
}else{&#xD;
    var pledgeDept = entity.get(&quot;pledgeDept&quot;);&#xD;
    if(!pledgeDept){&#xD;
        $alert(&quot;请先选择质押库区&quot;);&#xD;
    }else{&#xD;
        view.get(&quot;#dsDeptSelect&quot;).set(&quot;parameter&quot;,entity.get(&quot;pledgeDept&quot;)).flushAsync();&#xD;
    }
}</ClientEvent>
      <Property name="minWidth">400</Property>
      <Property name="minHeight">400</Property>
      <Property name="assignmentMap">depotIds=depotIds,depotNames=depotNames</Property>
      <Panel>
        <Property name="showCaptionBar">false</Property>
        <Buttons>
          <Button>
            <ClientEvent name="onClick">var selection = view.get(&quot;#dgDepotSelect&quot;).get(&quot;selection&quot;);&#xD;
if(!selection || selection.length == 0){&#xD;
    $alert(&quot;请选择仓库&quot;);&#xD;
    return;&#xD;
}&#xD;
    <Dialog id="dialogDepot">
      <ClientEvent name="onReady">var entity = view.get(&quot;#dsMain.data:#&quot;);&#xD;
var code = entity.get(&quot;pledgeCompany&quot;);&#xD;
view.get(&quot;#dsDepotSelect&quot;).set(&quot;parameter&quot;,{parentId:code}).flush();</ClientEvent>
      <Property name="width">50%</Property>
      <Property name="height">80%</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var selection = view.get(&quot;#dialogDepotSelect&quot;).get(&quot;selection&quot;);&#xD;
var cur = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
var ua = view.get(&quot;#saveAction&quot;);&#xD;
if(selection.length == 0) return;&#xD;
&#xD;
var depotIds = &quot;&quot;,depotNames=&quot;&quot;;&#xD;
selection.each(function(item){&#xD;
    depotIds += item.get(&quot;id&quot;)+&quot;,&quot;;&#xD;
    depotNames+=item.get(&quot;name&quot;)+&quot;,&quot;;&#xD;
var items = cur.get(&quot;depotData&quot;);&#xD;
var tag = true;&#xD;
selection.each(function(entity){&#xD;
    tag = true;&#xD;
    items.each(function(data){&#xD;
        if(data.get(&quot;pledgeDepot&quot;) == entity.get(&quot;id&quot;)) tag = false;&#xD;
    });&#xD;
    if(tag){&#xD;
        items.insert({&#xD;
            pledgeDepot:entity.get(&quot;id&quot;),&#xD;
            pledgeDept:entity.get(&quot;deptId&quot;),&#xD;
            pledgeId:cur.get(&quot;id&quot;),&#xD;
            companyId:cur.get(&quot;companyId&quot;)&#xD;
        });&#xD;
    }&#xD;
});    &#xD;
ua.execute(function(){&#xD;
    self.get(&quot;parent&quot;).hide();&#xD;
    view.get(&quot;#dialogDepotSelect&quot;).set(&quot;selection&quot;,null);&#xD;
    queryDepot();&#xD;
});&#xD;
&#xD;
view.get(&quot;#CDDDept&quot;).close({depotIds:depotIds,depotNames:depotNames});</ClientEvent>
            <Property name="caption">确认选择</Property>
          </Button>
          <Button>
            <ClientEvent name="onClick">view.get(&quot;#CDDDept&quot;).close({});&#xD;
                view.get(&quot;#dgDepotSelect&quot;).set(&quot;selection&quot;,null);</ClientEvent>
            <Property name="caption">取消操作</Property>
          </Button>
        </Buttons>
        <Children>
          <DataSet id="dsDeptSelect">
            <Property name="dataType">[dtDepot]</Property>
            <Property name="dataProvider">depotPR#getData</Property>
            <Property name="userData">库区列表下拉框</Property>
            <Property name="loadMode">manual</Property>
          </DataSet>
          <DataGrid id="dgDepotSelect">
            <Property name="dataSet">dsDeptSelect</Property>
            <Property name="selectionMode">multiRows</Property>
            <RowSelectorColumn>
              <Property name="caption">选择</Property>
              <Property name="width">50</Property>
            </RowSelectorColumn>
            <DataColumn name="name">
              <Property name="property">name</Property>
              <Property name="readOnly">true</Property>
            </DataColumn>
            <DataColumn name="id">
              <Property name="property">id</Property>
              <Property name="readOnly">true</Property>
            </DataColumn>
            <DataColumn name="depotType">
              <Property name="property">depotType</Property>
              <Property name="readOnly">true</Property>
            </DataColumn>
          </DataGrid>
        </Children>
        <Tools/>
      </Panel>
    </CustomDropDown>
</ClientEvent>
          <Property name="caption">确认选择</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">self.get(&quot;parent&quot;).hide();&#xD;
view.get(&quot;#dialogDepotSelect&quot;).set(&quot;selection&quot;,null);</ClientEvent>
          <Property name="caption">取消操作</Property>
        </Button>
      </Buttons>
      <Children>
        <DataSet id="dsDepotSelect">
          <Property name="dataType">[dtDepot]</Property>
          <Property name="dataProvider">pledgeContractPR#getUnplacedDepotData</Property>
          <Property name="userData">库区列表下拉框</Property>
          <Property name="loadMode">manual</Property>
        </DataSet>
        <DataGrid id="dialogDepotSelect">
          <Property name="dataSet">dsDepotSelect</Property>
          <Property name="selectionMode">multiRows</Property>
          <RowSelectorColumn>
            <Property name="caption">选择</Property>
            <Property name="width">50</Property>
          </RowSelectorColumn>
          <DataColumn>
            <Property name="property">deptId</Property>
            <Property name="readOnly">true</Property>
            <Property name="name">deptId</Property>
          </DataColumn>
          <DataColumn name="name">
            <Property name="property">name</Property>
            <Property name="readOnly">true</Property>
          </DataColumn>
          <DataColumn name="id">
            <Property name="property">id</Property>
            <Property name="readOnly">true</Property>
          </DataColumn>
          <DataColumn name="depotType">
            <Property name="property">depotType</Property>
            <Property name="readOnly">true</Property>
          </DataColumn>
        </DataGrid>
      </Children>
      <Tools/>
    </Dialog>
  </View>
</ViewConfig>
fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContractPR.java
@@ -7,8 +7,11 @@
import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.data.BaseResp;
import com.fzzy.igds.data.IgdsBaseParam;
import com.fzzy.igds.domain.InoutNoticeIn;
import com.fzzy.igds.domain.Depot;
import com.fzzy.igds.domain.PledgeContract;
import com.fzzy.igds.domain.PledgeContractDepot;
import com.fzzy.igds.service.DepotService;
import com.fzzy.igds.service.PledgeContractDepotService;
import com.fzzy.igds.service.PledgeContractService;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.annotation.Log;
@@ -28,6 +31,13 @@
    @Resource
    private PledgeContractService pledgeContractService;
    @Resource
    private PledgeContractDepotService pledgeContractDepotService;
    @Resource
    private DepotService depotService;
    /**
     * pledgeContractPR#initAdd
@@ -73,6 +83,10 @@
    @Transactional
    @DataResolver
    public BaseResp saveUpdate(PledgeContract pledgeContract) {
        List<PledgeContractDepot> depotData = pledgeContract.getDepotData();
        if (depotData != null && !depotData.isEmpty()) {
            pledgeContractDepotService.addDataByList(depotData);
        }
        if (null == pledgeContract.getCreateTime()) {
            return pledgeContractService.addData(pledgeContract);
        } else {
@@ -83,17 +97,18 @@
    /**
     * åˆ é™¤
     * pledgeContractPR#delete
     *
     * @param pledgeContract
     * @return
     */
    @Log( title = "质押合同", businessType = BusinessType.DELETE,bizType = BizTypeEnum.SUPERVISION)
    @Log(title = "质押合同", businessType = BusinessType.DELETE, bizType = BizTypeEnum.SUPERVISION)
    @Expose
    public BaseResp delete(PledgeContract pledgeContract) {
        if (StringUtils.isNotEmpty(pledgeContract.getId())) return pledgeContractService.deleteData(pledgeContract);
        return BaseResp.success();
    }
    /**
     * è´¨æŠ¼çŠ¶æ€
     * ${dorado.getDataProvider("pledgeContractPR#status").getResult()}
@@ -102,9 +117,73 @@
     */
    @DataProvider
    public List<SysDictData> status() {
        List<SysDictData> result =  new ArrayList<>();
        List<SysDictData> result = new ArrayList<>();
        result.add(new SysDictData("未解押", Constant.YN_N));
        result.add(new SysDictData("已解押", Constant.YN_Y));
        return result;
    }
    /**
     * åˆ é™¤è´¨æŠ¼ä»“库
     * pledgeContractPR#deleteDepot
     *
     * @param pledgeContractDepot
     * @return
     */
    @Log(title = "质押合同", businessType = BusinessType.DELETE, bizType = BizTypeEnum.SUPERVISION)
    @Expose
    public BaseResp deleteDepot(PledgeContractDepot pledgeContractDepot) {
        if (StringUtils.isNotEmpty(pledgeContractDepot.getId()))
            return pledgeContractDepotService.deleteData(pledgeContractDepot);
        return BaseResp.success();
    }
    /**
     * pledgeContractPR#listAllData
     * è´¨æŠ¼ä»“库列表
     */
    @DataProvider
    public List<PledgeContractDepot> listAllData(String PledgeId) {
        IgdsBaseParam param = new IgdsBaseParam();
        param.setCompanyId(ContextUtil.getCompanyId());
        param.setParentId(PledgeId);
        return pledgeContractDepotService.listAll(param);
    }
    /**
     * pledgeContractPR#getUnplacedDepotData
     *
     * @return
     */
    @DataProvider
    public List<Depot> getUnplacedDepotData(String parentId, String PledgeId) {
        List<Depot> result = new ArrayList<>();
        if (com.ruoyi.common.utils.StringUtils.isBlank(PledgeId) || com.ruoyi.common.utils.StringUtils.isBlank(parentId)) {
            return result;
        }
        //获取收储公司下所有仓库
        List<Depot> data = depotService.getData(null, parentId, false);
        //获取已配置仓库
        IgdsBaseParam param = new IgdsBaseParam();
        param.setCompanyId(ContextUtil.getCompanyId());
        param.setParentId(PledgeId);
        List<PledgeContractDepot> pledgeContractDepots = pledgeContractDepotService.listAll(param);
        //遍历找出所有未配置仓库
        for (Depot depot : data) {
            boolean flag = true;
            for (PledgeContractDepot pledgeContractDepot : pledgeContractDepots) {
                if (depot.getId().equals(pledgeContractDepot.getPledgeDepot())) {
                    flag = false;
                    break;
                }
            }
            if (flag) {
                result.add(depot);
            }
        }
        return result;
    }
}
fzzy-igdss-view/src/main/java/models/core.model.xml
@@ -1128,7 +1128,7 @@
        <Property name="mapValues">${dorado.getDataProvider(&quot;deptPR#getAllData&quot;).getResult()}</Property>
        <Property name="valueProperty">kqmc</Property>
      </Property>
      <Property name="required">true</Property>
      <Property name="required">false</Property>
    </PropertyDef>
    <PropertyDef name="signTime">
      <Property name="dataType">Date</Property>
@@ -1170,6 +1170,55 @@
      <Property name="dataType">Date</Property>
      <Property name="label">更新时间</Property>
    </PropertyDef>
    <Reference name="depotData">
      <Property name="parameter">$${this.id}</Property>
      <Property name="dataProvider">pledgeContractPR#listAllData</Property>
      <Property name="dataType">[dtPledgeContractDepot]</Property>
    </Reference>
  </DataType>
  <DataType name="dtPledgeContractDepot">
    <Property name="creationType">com.fzzy.igds.domain.PledgeContractDepot</Property>
    <PropertyDef name="companyId">
      <Property></Property>
      <Property name="label">组织编码</Property>
    </PropertyDef>
    <PropertyDef name="createBy">
      <Property></Property>
    </PropertyDef>
    <PropertyDef name="createTime">
      <Property name="dataType">Date</Property>
    </PropertyDef>
    <PropertyDef name="updateBy">
      <Property></Property>
    </PropertyDef>
    <PropertyDef name="updateTime">
      <Property name="dataType">Date</Property>
    </PropertyDef>
    <PropertyDef name="id">
      <Property></Property>
    </PropertyDef>
    <PropertyDef name="pledgeId">
      <Property></Property>
      <Property name="label">质押合同Id</Property>
    </PropertyDef>
    <PropertyDef name="pledgeDept">
      <Property></Property>
      <Property name="label">质押库区</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;deptPR#getAllData&quot;).getResult()}</Property>
        <Property name="keyProperty">id</Property>
        <Property name="valueProperty">kqmc</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="pledgeDepot">
      <Property></Property>
      <Property name="label">质押仓库</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getData&quot;).getResult()}</Property>
        <Property name="keyProperty">id</Property>
        <Property name="valueProperty">name</Property>
      </Property>
    </PropertyDef>
  </DataType>
  <DataType name="dtSnapRecord">
    <Property name="creationType">com.fzzy.igds.domain.SnapRecord</Property>