admin/package-lock.json
@@ -6,7 +6,7 @@ "dependencies": { "@amap/amap-jsapi-loader": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz", "resolved": "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz", "integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw==" }, "@babel/code-frame": { @@ -2917,7 +2917,7 @@ }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "optional": true, @@ -2927,7 +2927,7 @@ }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "optional": true, @@ -2938,7 +2938,7 @@ }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "optional": true, @@ -2948,21 +2948,21 @@ }, "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "optional": true }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "optional": true }, "loader-utils": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz", "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", "dev": true, "optional": true, @@ -2983,7 +2983,7 @@ }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "optional": true, @@ -2993,7 +2993,7 @@ }, "vue-loader-v16": { "version": "npm:vue-loader@16.8.3", "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz", "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz", "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", "dev": true, "optional": true, admin/src/components/business/OperaInternalCompanyWindow.vue
@@ -17,7 +17,7 @@ </el-form-item> <el-form-item label="组织类型" prop="type"> <el-radio-group v-model="form.type" :disabled="form.parentType == 0"> <el-radio :label="0">相关方组织</el-radio> <!-- <el-radio :label="0">相关方组织</el-radio>--> <el-radio :label="1">内部组织</el-radio> </el-radio-group> </el-form-item> @@ -74,7 +74,7 @@ console.log(target) this.form= { id: null, type: 0, type: 1, name: '', parentId: null, disable: false, admin/src/views/business/areas.vue
@@ -80,13 +80,17 @@ this.tableData.list = this.dataAddBool(data) }) .catch(e => { this.$message.error(e) console.log(e) this.$tip.error('操作失败') }) .finally(() => { this.isWorking.search = false }) }, dataAddBool(array) { if(array==null){ return [] } array.forEach(item => { item.hasChildren = item.type != 2 // item.childList = item.childList && this.dataAddBool(item.childList) @@ -97,10 +101,11 @@ this.treeMaps.set(tree.id, { tree, treeNode, resolve }) listByParentId({ parentId: tree.id, type: tree.type + 1 }) .then(data => { resolve(this.dataAddBool(data||[])) resolve(this.dataAddBool(data || [])) }) .catch(e => { this.$message.error(e) console.log(e) this.$tip.error('操作失败') }) .finally(() => { this.isWorking.search = false @@ -133,11 +138,12 @@ this.isWorking.delete = true this.api.deleteById(row[this.configData['field.id']]) .then(() => { this.$message.success('删除成功') this.$tip.apiSuccess('删除成功') this.refreshLoadTree(row.parentId) }) .catch(e => { this.$message.error(e) console.log(e) this.$tip.error('操作失败') }) .finally(() => { this.isWorking.delete = false admin/src/views/business/internalCompany.vue
@@ -17,8 +17,8 @@ <!-- 表格和分页 --> <template v-slot:table-wrap> <ul class="toolbar" v-permissions="['business:company:create', 'business:company:sync']"> <li><el-button type="primary" v-permissions="['business:company:create']" @click="$refs.OperaInternalCompanyWindow.open('新建企业',null,null)">新建</el-button></li> <li><el-button @click="sort('top')" :loading="sorting" icon="el-icon-sort-up" v-permissions="['business:company:sort']">上移</el-button></li> <li><el-button type="primary" v-permissions="['business:company:create']" @click="$refs.OperaInternalCompanyWindow.open('新建组织',null,null)">新建</el-button></li> <li><el-button @click="sort('top')" :loaing="sorting" icon="el-icon-sort-up" v-permissions="['business:company:sort']">上移</el-button></li> <li><el-button @click="sort('bottom')" :loading="sorting" icon="el-icon-sort-down" v-permissions="['business:company:sort']">下移</el-button></li> <li><el-button type="primary" v-permissions="['business:company:sync']" :loading="loading" @click="synchronous()">同步</el-button></li> </ul> @@ -29,8 +29,7 @@ :tree-props="{children: 'childList',hasChildren: 'hasChildren'}" row-key="id" @selection-change="handleSelectionChange" default-expand-all > default-expand-all> <el-table-column type="selection" width="55"></el-table-column> <el-table-column prop="name" label="组织名称" min-width="100px"></el-table-column> <el-table-column prop="name" label="组织类型" min-width="80px"> @@ -45,10 +44,9 @@ <el-table-column label="操作" width="230" fixed="right" > fixed="right"> <template slot-scope="{row}"> <el-button type="text" @click="$refs.OperaInternalCompanyWindow.open('编辑企业信息',{ id: row.parentId,name:row.parentName,type:row.parentType, companyPath:row.parentCompanyPath}, row)" icon="el-icon-edit" v-permissions="['business:company:update']">编辑</el-button> <el-button type="text" @click="$refs.OperaInternalCompanyWindow.open('编辑组织信息',{ id: row.parentId,name:row.parentName,type:row.parentType, companyPath:row.parentCompanyPath}, row)" icon="el-icon-edit" v-permissions="['business:company:update']">编辑</el-button> <el-button type="text" @click="$refs.OperaInternalCompanyWindow.open('新建子级', row,null)" icon="el-icon-plus">新建子级</el-button> <el-button type="text" @click="deleteById(row)" style="color: red" icon="el-icon-delete" v-permissions="['business:company:delete']">删除</el-button> </template> @@ -83,7 +81,7 @@ }, created () { this.config({ module: '企业信息表', module: '组织信息表', api: '/business/company', 'field.id': 'id', 'field.main': 'id' admin/src/views/business/internalMember.vue
@@ -53,7 +53,7 @@ <!-- 表格和分页 --> <template v-slot:table-wrap> <ul class="toolbar" v-permissions="['business:member:delete', 'business:member:create,business:empower:create']"> <li><el-button type="primary" @click="$refs.OperaMemberWindow.open('新建员工', null, department, searchForm.companyType)" icon="el-icon-plus" v-permissions="['business:member:create']">新建员工</el-button></li> @@ -118,7 +118,7 @@ </el-switch> </template> </el-table-column> <el-table-column label="是否可拜访"> <!-- <el-table-column label="是否可拜访"> <template slot-scope="{row}"> <el-switch @change="changeCanvisit($event, row)" v-model="row.canVisit" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0"> @@ -162,7 +162,7 @@ <el-button @click="$refs.cardOpeningRecord.open('开卡记录', row.id)" type="text">{{ row.memberCardCount || '0'}}</el-button> </template> </el-table-column> </el-table-column>--> <el-table-column prop="editorName" label="操作人" min-width="100px"></el-table-column> <el-table-column prop="editDate" label="最后操作时间" min-width="150px"></el-table-column> <el-table-column @@ -171,8 +171,8 @@ <template slot-scope="{row}"> <el-button type="text" icon="el-icon-edit" @click="$refs.OperaMemberWindow.open('编辑员工信息', row, department)" v-permissions="['business:empower:update']">编辑</el-button> <el-button type="text" icon="el-icon-plus" @click="empower(row.id)" v-permissions="['business:empower:create']">重新授权</el-button> <!-- <el-button type="text" icon="el-icon-plus" @click="empower(row.id)" v-permissions="['business:empower:create']">重新授权</el-button>--> <el-button type="text" :loading="heading" style="color: red" icon="el-icon-delete" @click="updateHead(row, 0)" v-if="row.headStatus == 1" v-permissions="['business:member:head']">取消主管</el-button> server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -184,6 +184,45 @@ public static final String TIMEOUT_WARNING = "TIMEOUT_WARNING"; // FTP文件服务器资源访问地址 /** * 付款周期类型 0=元每平米天;1=元每平米月;2=元每平米年;3=元每天;4=元每月;5=元每年;6=元每场; * @param circleType * @return */ public static String getUnitTypeByNum(Integer circleType) { int zlPayType = Constants.formatIntegerNum(circleType); if(zlPayType == 1){ return "元/㎡·月"; }else if(zlPayType == 2){ return "元/㎡·天"; }else if(zlPayType == 3){ return "元/天"; }else if(zlPayType == 4){ return "元/月"; }else if(zlPayType == 5){ return "元/年"; }else if(zlPayType == 6){ return "元/场"; } return "元/㎡·天"; } /** * 周期支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付 * @param zlPayType * @return */ public static String getPayTypeByNum(Integer zlPayType) { if(zlPayType == 1){ return "3个月一付"; }else if(zlPayType == 2){ return "6个月一付"; }else if(zlPayType == 3){ return "1年一付"; } return "一次性付款"; } public static String getRandom6Num( ) { Random random = new Random(); server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/AreasCloudController.java
@@ -1,6 +1,7 @@ package com.doumee.cloud.admin; import com.doumee.api.BaseController; import com.doumee.config.annotation.CloudRequiredPermission; import com.doumee.core.annotation.excel.ExcelExporter; import com.doumee.core.annotation.pr.PreventRepeat; import com.doumee.core.model.ApiResponse; @@ -12,7 +13,6 @@ import com.doumee.service.business.AreasService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -36,7 +36,7 @@ @PreventRepeat @ApiOperation("新建") @PostMapping("/create") @RequiresPermissions("business:areas:create") @CloudRequiredPermission("business:areas:create") public ApiResponse create(@RequestBody Areas areas,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { areas.setLoginUserInfo(getLoginUser(token)); return ApiResponse.success(areasService.create(areas)); @@ -44,7 +44,7 @@ @ApiOperation("根据ID删除") @GetMapping("/delete/{id}") @RequiresPermissions("business:areas:delete") @CloudRequiredPermission("business:areas:delete") public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { areasService.deleteById(id); return ApiResponse.success(null); @@ -52,7 +52,7 @@ @ApiOperation("批量删除") @GetMapping("/delete/batch") @RequiresPermissions("business:areas:delete") @CloudRequiredPermission("business:areas:delete") public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { String [] idArray = ids.split(","); List<Integer> idList = new ArrayList<>(); @@ -65,7 +65,7 @@ @ApiOperation("根据ID修改") @PostMapping("/updateById") @RequiresPermissions("business:areas:update") @CloudRequiredPermission("business:areas:update") public ApiResponse updateById(@RequestBody Areas areas,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { areas.setLoginUserInfo(getLoginUser(token)); areasService.updateById(areas); @@ -74,14 +74,14 @@ @ApiOperation("分页查询") @PostMapping("/page") // @RequiresPermissions("business:areas:query") // @CloudRequiredPermission("business:areas:query") public ApiResponse<PageData<Areas>> findPage (@RequestBody PageWrap<Areas> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { return ApiResponse.success(areasService.findPage(pageWrap)); } @ApiOperation("全部树形查询") @PostMapping("/treeList") // @RequiresPermissions("business:areas:query") // @CloudRequiredPermission("business:areas:query") public ApiResponse<List<Areas>> treeList (@RequestBody AreasDto pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { Areas a = new Areas(); BeanUtils.copyProperties(pageWrap,a); @@ -89,7 +89,7 @@ } @ApiOperation("根据父节点查下") @PostMapping("/listByParentId") // @RequiresPermissions("business:areas:query") // @CloudRequiredPermission("business:areas:query") public ApiResponse<List<Areas>> listByParentId (@RequestBody AreasDto pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { Areas a = new Areas(); BeanUtils.copyProperties(pageWrap,a); @@ -101,14 +101,14 @@ } @ApiOperation("导出Excel") @PostMapping("/exportExcel") @RequiresPermissions("business:areas:exportExcel") @CloudRequiredPermission("business:areas:exportExcel") public void exportExcel (@RequestBody PageWrap<Areas> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { ExcelExporter.build(Areas.class).export(areasService.findPage(pageWrap).getRecords(), "省市区信息表", response); } @ApiOperation("根据ID查询") @GetMapping("/{id}") @RequiresPermissions("business:areas:query") @CloudRequiredPermission("business:areas:query") public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { return ApiResponse.success(areasService.findById(id)); } server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwContractCloudController.java
@@ -9,6 +9,7 @@ import com.doumee.core.model.PageWrap; import com.doumee.core.utils.Constants; import com.doumee.dao.business.model.YwContract; import com.doumee.dao.business.model.YwContractBill; import com.doumee.service.business.YwContractService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -41,6 +42,14 @@ return ApiResponse.success(ywContractService.create(ywContract)); } @PreventRepeat @ApiOperation("根据参数预生成账单信息") @PostMapping("/getBillList") @CloudRequiredPermission("business:ywcontract:create") public ApiResponse< List<YwContractBill> > getBillList(@RequestBody YwContract ywContract, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { ywContract.setLoginUserInfo(this.getLoginUser(token)); return ApiResponse.success(ywContractService.getBillList(ywContract)); } @PreventRepeat @ApiOperation("退租") @PostMapping("/backRent") @CloudRequiredPermission("business:ywcontract:update") server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContract.java
@@ -142,6 +142,18 @@ @ApiModelProperty(value = "租赁条款押金(元)", example = "1") @ExcelColumn(name="租赁条款押金(元)") private BigDecimal zlDeposit; @ApiModelProperty(value = "首期租赁条款单价(元)", example = "1") @ExcelColumn(name="首期租赁条款单价(元)") private BigDecimal zlFirstPrice; @ApiModelProperty(value = "首期租赁条款价格单位", example = "1") @ExcelColumn(name="首期租赁条款价格单位") private Integer zlFirstCircle; @ApiModelProperty(value = "物业租赁条款单价(元)", example = "1") @ExcelColumn(name="物业租赁条款单价(元)") private BigDecimal wyFirstPrice; @ApiModelProperty(value = "物业租赁条款价格单位", example = "1") @ExcelColumn(name="物业租赁条款价格单位") private Integer wyFirstCircle; @ApiModelProperty(value = "租赁支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付", example = "1") @ExcelColumn(name="租赁支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付") @@ -232,7 +244,16 @@ @ApiModelProperty(value = "退款未结清账单数") @TableField(exist = false) private int btWaitBill; @ApiModelProperty(value = "生成账单类型 0租赁账单 1物业账单") @TableField(exist = false) private int billType; @ApiModelProperty(value = "租赁租赁条款价格单位,概念名称", example = "1") @TableField(exist = false) private String zlFirstCircleStr; @ApiModelProperty(value = "物业租赁条款价格单位,概念名称", example = "1") @TableField(exist = false) private String wyFirstCircleStr; @ApiModelProperty(value = "退租时新增的收付款账单") @TableField(exist = false) private List<YwContractBill> addBillList; server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwContractService.java
@@ -4,6 +4,8 @@ import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.dao.business.model.YwContract; import com.doumee.dao.business.model.YwContractBill; import java.util.List; /** @@ -20,7 +22,7 @@ * @return Integer */ Integer create(YwContract ywContract); List<YwContractBill> getBillList(YwContract ywContract); /** * 主键删除 * @@ -97,4 +99,6 @@ long count(YwContract ywContract); Integer backRent(YwContract ywContract); } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/AreasServiceImpl.java
@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import javax.annotation.PostConstruct; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -316,6 +317,7 @@ return result; } @Override @PostConstruct public void cacheData() { Areas a = new Areas(); a.setIsdeleted(Constants.ZERO); server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -340,7 +340,7 @@ .setSql("hk_company_path=REPLACE(hk_company_path,'"+ model.getCompanyNamePath()+"','"+newName+"')") .likeRight(Company::getCompanyPath,model.getCompanyPath())); //下发海康安防平台 if(StringUtils.isNotBlank(model.getHkId())){ /* if(StringUtils.isNotBlank(model.getHkId())){ if(!editHkOrg(company)){ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,组织同步下发失败,请稍后重试"); } @@ -348,7 +348,7 @@ if(!addHkOrg(company)){ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,组织同步下发失败,请稍后重试"); } } }*/ } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InitServiceImpl.java
@@ -26,7 +26,7 @@ @Autowired private InterfaceLogService interfaceLogService; @PostConstruct // @PostConstruct public int initHkConfig(){ ArtemisConfig.host = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HOST).getCode(); ArtemisConfig.appKey = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPKEY).getCode(); server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractServiceImpl.java
@@ -85,6 +85,124 @@ dealLogBiz(model,Constants.YwLogType.CONTRACT_CREATE,null,null);//记录新建日志 return model.getId(); } @Override public List<YwContractBill> getBillList(YwContract model){ isParamValidForBill(model); model.setCreateDate(new Date()); model.setEditDate(model.getCreateDate()); dealDetailListBiz(model);//处理条款信息 return model.getBillList(); } private void isParamValidForBill(YwContract model) { if(model.getStartDate() == null ||model.getEndDate() == null ||model.getProjectId() == null ||model.getCompanyId() == null ||model.getRoundedUp() == null ||model.getRoomIds() == null ||model.getRoomIds().size() == 0 ){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请按页面要求填写合同信息"); } if(model.getEndDate().getTime()<= model.getStartDate().getTime()){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,合同有效期结束时间不得早于开始时间!"); } if(model.getBillType() ==0 ){ //如果生成租赁条款 if( model.getZlDeposit() == null ||model.getZlPayType() == null || model.getZlPayType()>3 || model.getZlPayType()<0 ||model.getZlDetailList()==null ||model.getZlDetailList().size() ==0){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请按页面要求填写租赁条款信息"); } if(!(model.getZlFreeEndDate()==null && model.getZlFreeStartDate()==null) && ( (model.getZlFreeEndDate()!=null && model.getZlFreeStartDate()==null) ||(model.getZlFreeEndDate()==null && model.getZlFreeStartDate()!=null) ||model.getZlFreeEndDate().getTime()<= model.getZlFreeStartDate().getTime()) ){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请选择正确的租赁条款免租期信息!"); } for(YwContractDetail d :model.getZlDetailList()){ if( d.getStartDate() == null ||d.getEndDate() == null ||d.getPrice() == null ||d.getCircleType() == null || d.getCircleType()>6 || d.getCircleType()<0 ){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请按页面要求填写租赁条款信息!"); } if(d.getEndDate().getTime()<= d.getStartDate().getTime()){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,租赁条款有效期结束时间不得早于开始时间!"); } if(!Constants.equalsInteger(model.getWyPayType(),Constants.ZERO) && Constants.equalsInteger(d.getCircleType(),Constants.SIX)){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,租赁条款只有选择一次性付款时,才能选择该按每场收费;"); } } } if(model.getBillType() == 1 ){ //如果生成物业条款 if( model.getWyDeposit() == null ||model.getWyPayType() == null || model.getWyPayType()>3 || model.getWyPayType()<0 ||model.getWyDetailList()==null ||model.getWyDetailList().size() ==0 ){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请按页面要求填写物业条款信息"); } if(!(model.getWyFreeEndDate()==null && model.getWyFreeStartDate()==null) && ( (model.getWyFreeEndDate()!=null && model.getWyFreeStartDate()==null) ||(model.getWyFreeEndDate()==null && model.getWyFreeStartDate()!=null) ||model.getWyFreeEndDate().getTime()<= model.getWyFreeStartDate().getTime())){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请选择正确的物业条款免租期信息!"); } for(YwContractDetail d :model.getWyDetailList()){ if( d.getStartDate() == null ||d.getEditDate() == null ||d.getPrice() == null ||d.getCircleType() == null || d.getCircleType()>6 || d.getCircleType()<0 ){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请按页面要求填写物业条款信息!"); } if(d.getEndDate().getTime()<= d.getStartDate().getTime()){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,物业条款有效期结束时间不得早于开始时间!"); } if(!Constants.equalsInteger(model.getWyPayType(),Constants.ZERO) && Constants.equalsInteger(d.getCircleType(),Constants.SIX)){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,物业条款只有选择一次性付款时,才能选择该按每场收费;"); } } } YwProject project = projectMapper.selectById(model.getCompanyId()); if(project ==null || Constants.equalsInteger(project.getIsdeleted(),Constants.ONE)){ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,请选择正确的项目信息!"); } List<YwRoom> rooms = roomMapper.selectList(new QueryWrapper<YwRoom>().lambda() .eq(YwRoom::getIsdeleted,Constants.ZERO) .in(YwRoom::getId,model.getRoomIds()) .eq(YwRoom::getProjectId,model.getProjectId()) ); if(rooms ==null || rooms.size()==0){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请选择对应项目下正确的房源信息"); } if(rooms.size() != rooms.size()){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,存在无效的房源信息!"); } model.setTotalArea(new BigDecimal(0)); for(YwRoom r : rooms){ model.setTotalArea(model.getTotalArea().add(Constants.formatBigdecimal(r.getArea()))); } } private String getRemarlByParam(YwContract model) { @@ -106,12 +224,12 @@ } str = str.replace("{param1}",DateUtil.getDateLongSlash(model.getStartDate())) .replace("{param2}",model.getTotalArea().intValue()+"") .replace("{param3}",getPayTypeByNum(model.getZlPayType())) .replace("{param3}",Constants.getPayTypeByNum(model.getZlPayType())) .replace("{param4}",zl!=null&&zl.getPrice()!=null?(zl.getPrice().intValue()+""):"0") .replace("{param5}",getPayTypeByNum(model.getWyPayType())) .replace("{param6}",getUnitTypeByNum(zl)) .replace("{param5}",Constants.getPayTypeByNum(model.getWyPayType())) .replace("{param6}",Constants.getUnitTypeByNum(zl!=null?zl.getCircleType():null)) .replace("{param7}",zl!=null&&yw.getPrice()!=null?(zl.getPrice().intValue()+""):"0") .replace("{param8}",getUnitTypeByNum(yw)); .replace("{param8}",Constants.getUnitTypeByNum(yw!=null?yw.getCircleType():null)); return str; } private String getbackRentRemarkByParam(YwContract model) { @@ -126,39 +244,6 @@ return str; } private CharSequence getUnitTypeByNum(YwContractDetail zl) { if(zl==null){ return ""; } // 付款周期类型 0=元每平米天;1=元每平米月;2=元每平米年;3=元每天;4=元每月;5=元每年;6=元每场; int zlPayType = Constants.formatIntegerNum(zl.getCircleType()); if(zlPayType == 1){ return "元/㎡·月"; }else if(zlPayType == 2){ return "元/㎡·天"; }else if(zlPayType == 3){ return "元/天"; }else if(zlPayType == 4){ return "元/月"; }else if(zlPayType == 5){ return "元/年"; }else if(zlPayType == 6){ return "元/场"; } return "元/㎡·天"; } private CharSequence getPayTypeByNum(Integer zlPayType) { //租赁支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付 if(zlPayType == 1){ return "3个月一付"; }else if(zlPayType == 2){ return "6个月一付"; }else if(zlPayType == 3){ return "1年一付"; } return "一次性付款"; } /** @@ -399,7 +484,9 @@ details.add(d); } } ywContractDetailMapper.insert(details);//批量插入条款信息信息 if(model.getId()!=null){ ywContractDetailMapper.insert(details);//批量插入条款信息信息 } //处理账单信息 dealBillListBiz(model,details); } @@ -410,26 +497,27 @@ * @param details */ private void dealBillListBiz(YwContract model, List<YwContractDetail> details) { List<YwContractBill> billList = new ArrayList<>(); List<YwContractBill> billList1 = new ArrayList<>(); List<YwContractBill> billList2 = new ArrayList<>(); if(Constants.equalsInteger(model.getType(),Constants.ZERO ) || Constants.equalsInteger(model.getType(),Constants.ONE)){ //如果有租赁条款 if(Constants.formatBigdecimal(model.getZlDeposit()).compareTo(new BigDecimal(0))>0){ //如果有租赁押金 billList.add(initDepoistBill(Constants.THREE,model)); billList1.add(initDepoistBill(Constants.THREE,model)); } if(Constants.equalsInteger(model.getZlPayType(), Constants.ZERO)){ //如果是一次性付清 billList.addAll(getBillsByParamOnce(model,details,model.getZlFreeStartDate(),model.getZlFreeEndDate())); billList1.addAll(getBillsByParamOnce(model,details,model.getZlFreeStartDate(),model.getZlFreeEndDate())); }else if(Constants.equalsInteger(model.getZlPayType(), Constants.ONE)){ //如果每三个月一付 billList.addAll(getBillsByParam3Months(model,details,model.getZlFreeStartDate(),model.getZlFreeEndDate())); billList1.addAll(getBillsByParam3Months(model,details,model.getZlFreeStartDate(),model.getZlFreeEndDate())); }else if(Constants.equalsInteger(model.getZlPayType(), Constants.TWO)){ //如果六个月一付 billList.addAll(getBillsByParam6Months(model,details,model.getZlFreeStartDate(),model.getZlFreeEndDate())); billList1.addAll(getBillsByParam6Months(model,details,model.getZlFreeStartDate(),model.getZlFreeEndDate())); }else if(Constants.equalsInteger(model.getZlPayType(), Constants.THREE)){ //如果一年一付 billList.addAll(getBillsByParam1Year(model,details,model.getZlFreeStartDate(),model.getZlFreeEndDate())); billList1.addAll(getBillsByParam1Year(model,details,model.getZlFreeStartDate(),model.getZlFreeEndDate())); } } if(Constants.equalsInteger(model.getType(),Constants.ZERO ) @@ -437,27 +525,38 @@ //如果物业条款 if(Constants.formatBigdecimal(model.getWyDeposit()).compareTo(new BigDecimal(0))>0){ //如果有租赁押金 billList.add(initDepoistBill(Constants.FOUR,model)); billList2.add(initDepoistBill(Constants.FOUR,model)); } if(Constants.equalsInteger(model.getWyPayType(), Constants.ZERO)){ //如果是一次性付清 billList.addAll(getBillsByParamOnce(model,details,model.getWyFreeStartDate(),model.getWyFreeEndDate())); billList2.addAll(getBillsByParamOnce(model,details,model.getWyFreeStartDate(),model.getWyFreeEndDate())); }else if(Constants.equalsInteger(model.getWyPayType(), Constants.ONE)){ //如果每三个月一付 billList.addAll(getBillsByParam3Months(model,details,model.getWyFreeStartDate(),model.getWyFreeEndDate())); billList2.addAll(getBillsByParam3Months(model,details,model.getWyFreeStartDate(),model.getWyFreeEndDate())); }else if(Constants.equalsInteger(model.getWyPayType(), Constants.TWO)){ //如果六个月一付 billList.addAll(getBillsByParam6Months(model,details,model.getWyFreeStartDate(),model.getWyFreeEndDate())); billList2.addAll(getBillsByParam6Months(model,details,model.getWyFreeStartDate(),model.getWyFreeEndDate())); }else if(Constants.equalsInteger(model.getWyPayType(), Constants.THREE)){ //如果一年一付 billList.addAll(getBillsByParam1Year(model,details,model.getWyFreeStartDate(),model.getWyFreeEndDate())); billList2.addAll(getBillsByParam1Year(model,details,model.getWyFreeStartDate(),model.getWyFreeEndDate())); } } for(int i=0;i<billList.size();i++){ billList.get(i).setSortnum(i+1); } ywContractBillMapper.insert(billList); if(model.getBillType() == 0){ model.setBillList(billList1); }else if(model.getBillType() == 0){ model.setBillList(billList2); } if(model.getId()!=null){ for(int i=0;i<billList1.size();i++){ billList1.get(i).setSortnum(i+1); } for(int i=0;i<billList2.size();i++){ billList2.get(i).setSortnum(i+1); } ywContractBillMapper.insert(billList1); ywContractBillMapper.insert(billList2); } } private YwContractBill initDepoistBill(int type, YwContract model) { @@ -787,12 +886,15 @@ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,请按页面要求填写租赁条款信息!"); } if(d.getEndDate().getTime()<= d.getStartDate().getTime()){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,租赁条款有效期结束时间不得早于开始时间!"); } if(!Constants.equalsInteger(model.getWyPayType(),Constants.ZERO) && Constants.equalsInteger(d.getCircleType(),Constants.SIX)){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,租赁条款只有选择一次性付款时,才能选择该按每场收费;"); } if(model.getZlFirstCircle() == null){//首期信息 model.setZlFirstPrice(d.getPrice()); model.setZlFirstCircle(d.getCircleType()); } } } @@ -829,6 +931,11 @@ if(!Constants.equalsInteger(model.getWyPayType(),Constants.ZERO) && Constants.equalsInteger(d.getCircleType(),Constants.SIX)){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,物业条款只有选择一次性付款时,才能选择该按每场收费;"); } if(model.getWyFirstCircle() == null){ //首期信息 model.setWyFirstPrice(d.getPrice()); model.setWyFirstCircle(d.getCircleType()); } } } @@ -952,7 +1059,8 @@ .eq(YwRoom::getIsdeleted,Constants.ZERO) .exists("(select a.id from yw_contract_room a where a.isdeleted=1 and a.room_id=t.id and a.contract_id="+model.getId()+")"); model.setRoomList(roomMapper.selectJoinList(YwRoom.class,rw)); model.setWyFirstCircleStr(Constants.getUnitTypeByNum(model.getWyFirstCircle())); model.setZlFirstCircleStr(Constants.getUnitTypeByNum(model.getZlFirstCircle())); //查询租賃条款信息 MPJLambdaWrapper<YwContractDetail> dw = new MPJLambdaWrapper<>(); dw.selectAll(YwContractDetail.class ) @@ -1144,7 +1252,14 @@ queryWrapper.ge(Objects.nonNull(pageWrap.getModel().getQueryStartTime()), YwContract::getStartDate, pageWrap.getModel().getQueryStartTime()) .le(Objects.nonNull(pageWrap.getModel().getQueryEndTime()), YwContract::getEndDate, pageWrap.getModel().getQueryEndTime()); queryWrapper.orderByDesc(YwContract::getCreateDate ); return PageData.from(ywContractMapper.selectJoinPage(page, YwContract.class,queryWrapper)); PageData<YwContract> data = PageData.from(ywContractMapper.selectJoinPage(page, YwContract.class,queryWrapper)); if(data!=null && data.getRecords()!=null){ for(YwContract model : data.getRecords()){ model.setWyFirstCircleStr(Constants.getUnitTypeByNum(model.getWyFirstCircle())); model.setZlFirstCircleStr(Constants.getUnitTypeByNum(model.getZlFirstCircle())); } } return data; } @Override