| fzzy-igdss-core/src/main/java/com/fzzy/igds/mapper/PledgeContractMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| fzzy-igdss-core/src/main/java/com/fzzy/igds/service/PledgeContractService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContract.view.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| fzzy-igdss-view/src/main/java/com/fzzy/igds/PledgeContractPR.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| fzzy-igdss-view/src/main/java/models/core.model.xml | ●●●●● 补丁 | 查看 | 原始文档 | 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">
 /**
 * æ¥è¯¢
 */
 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> 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("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>