sgj
2025-12-03 e38338d0d65bf09a5c14c4034b207e0305a6d457
添加质押合同管理
已添加4个文件
已修改1个文件
518 ■■■■■ 文件已修改
fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/PledgeContractMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/PledgeContractService.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContract.view.xml 259 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContractPR.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/models/core.model.xml 115 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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> {
}
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("删除失败");
    }
}
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">&#xD;
/**&#xD;
* æŸ¥è¯¢&#xD;
*/&#xD;
query = function(){&#xD;
    view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
}&#xD;</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(&quot;#dsParam.data&quot;);&#xD;
console.log(&quot;param&quot;,param);&#xD;
view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,param).flushAsync();&#xD;
</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(&quot;#dsParam&quot;).set(&quot;data&quot;,{});</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">&#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;);
view.get(&quot;#dialogMain&quot;).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(&quot;#dgMain&quot;).get(&quot;selection&quot;)
if(!data){
    $alert(&quot;请选择数据&quot;);
    }else{
    view.get(&quot;#ajaxDelData&quot;).set(&quot;parameter&quot;, data).execute(function(result){
        if(&quot;200&quot;!=result.code){
            $alert(&quot;异常信息:&quot;+result.message);
        }else{
            $notify(&quot;执行成功&quot;);
            query();&#xD;
        }
    })
}</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="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(&quot;#saveAction&quot;).execute(function(){&#xD;
    self.get(&quot;parent&quot;).hide();&#xD;
});</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(&quot;#dsMain.data:#&quot;).cancel();&#xD;
            self.get(&quot;parent&quot;).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>
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();
    }
}
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(&quot;depotPR#getAllCache&quot;).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(&quot;dicPR#sysDictData&quot;).getResult(&quot;FOOD_VARIETY_&quot;)}</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(&quot;bankPR#listAll&quot;).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(&quot;companyPR#getData&quot;).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(&quot;deptPR#getAllData&quot;).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>