| @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Map; | |||
| /** | |||
| @@ -65,9 +65,9 @@ public class BillDailyAsyncTask { | |||
| public void importExcelData(File file, MallUserInfo user, String importKey, String tenantId) { | |||
| ImportParams params = new ImportParams(); | |||
| // 需要验证 | |||
| params.setImportFields(new String[]{"商铺号*", "费用类型*", "实际应收金额(元)*", "实收金额(元)*", "缴款截止日期*"}); | |||
| params.setImportFields(new String[]{"商铺号*", "费用类型*", "实际应收金额(元)*", "实收金额(元)*", "缴款截止日期*", "租赁商铺类型*"}); | |||
| IExcelDataHandler<WxBillDailyVo> handler = new BillDailyAsyncTask.BillDailyExcelHandler(); | |||
| handler.setNeedHandlerFields(new String[]{"商铺号*", "费用类型*", "实际应收金额(元)*", "实收金额(元)*", "缴款截止日期*"}); | |||
| handler.setNeedHandlerFields(new String[]{"商铺号*", "费用类型*", "实际应收金额(元)*", "实收金额(元)*", "缴款截止日期*", "租赁商铺类型*"}); | |||
| params.setNeedVerify(true); | |||
| ExcelImportResult<WxBillDailyVo> datalist = null; | |||
| @@ -101,6 +101,7 @@ public class BillDailyAsyncTask { | |||
| WxShop shop = new WxShop(); | |||
| shop.setShopNumber(vo.getShopNumber()); | |||
| shop.setTenantId(tenantId); | |||
| shop.setType(vo.getRentShopType()); | |||
| shop.setStatus(EnumShopStatus.RENT.getCode()); | |||
| shop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| WxShop wxShop = wxShopMapper.selectOne(shop); | |||
| @@ -111,27 +112,25 @@ public class BillDailyAsyncTask { | |||
| } | |||
| String receivePayStr = vo.getReceivePayStr(); | |||
| double receivePayD = new BigDecimal(receivePayStr).doubleValue(); | |||
| if (receivePayD <= 0) { | |||
| long receivePay = new BigDecimal(receivePayStr).multiply(new BigDecimal(100)).longValue(); | |||
| if (receivePay <= 0) { | |||
| logger.error("实际应收金额小于等于0", vo.toString()); | |||
| fail++; | |||
| continue; | |||
| } | |||
| String payStr = vo.getPayStr(); | |||
| double payD = new BigDecimal(payStr).doubleValue(); | |||
| if (payD < 0) { | |||
| long pay = new BigDecimal(payStr).multiply(new BigDecimal(100)).longValue(); | |||
| if (pay < 0) { | |||
| logger.error("实收金额小于0", vo.toString()); | |||
| fail++; | |||
| continue; | |||
| } | |||
| if (receivePayD < payD) { | |||
| if (receivePay < pay) { | |||
| logger.error("实际应收金额小于实收金额", vo.toString()); | |||
| fail++; | |||
| continue; | |||
| } | |||
| long receivePay = new BigDecimal(receivePayD).multiply(new BigDecimal(100)).longValue(); | |||
| vo.setReceivePay(receivePay); | |||
| long pay = new BigDecimal(payD).multiply(new BigDecimal(100)).longValue(); | |||
| vo.setPay(pay); | |||
| vo.setTenantId(tenantId); | |||
| vo.setShopId(wxShop.getId()); | |||
| @@ -0,0 +1 @@ | |||
| update wx_merchant set cover_picture=json_array(img_url) where img_url is not null and (cover_picture is null or cover_picture=''); | |||
| @@ -0,0 +1,3 @@ | |||
| UPDATE `mall_permission` SET icon = 'icon-zhangdan4' WHERE id = 401; | |||
| UPDATE `mall_permission` SET icon = 'icon-zhangdanmingxi' WHERE id = 412; | |||
| UPDATE `mall_permission` SET icon = 'icon-zhangdan5' WHERE id = 402; | |||
| @@ -3,50 +3,51 @@ CREATE TABLE `sys_monitor` ( | |||
| `id` bigint(20) NOT NULL, | |||
| `name` varchar(50) NOT NULL COMMENT '网址名称', | |||
| `url` varchar(255) NOT NULL COMMENT '网址url', | |||
| `type` tinyint(20) DEFAULT '1' COMMENT '1=网址监控', | |||
| `deploy` tinyint(20) DEFAULT '1' COMMENT '1=dev 2=test 3=release', | |||
| `type` tinyint(2) DEFAULT '1' COMMENT '1=网址监控', | |||
| `deploy` tinyint(2) DEFAULT '1' COMMENT '1=dev 2=test 3=release', | |||
| `enable` tinyint(2) DEFAULT '0' COMMENT '0:enable 1:disable', | |||
| `err_msg` varchar(50) DEFAULT NULL COMMENT '错误信息', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE `id_UNIQUE` USING BTREE (`id`) comment '' | |||
| ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='网络监控' CHECKSUM=0 DELAY_KEY_WRITE=0; | |||
| INSERT INTO `sys_monitor` (`id`,`name`,`url`,`type`,`deploy`,`err_msg`) VALUES | |||
| (1, "dev-管理端","https://mall.youlane.cn/api/version", 1, 1, "{url}不响应"), | |||
| (2, "dev-C端","https://ciformall.youlane.cn/C/api/mall/version", 1, 1, "{name}: {url} 不响应"), | |||
| (3, "dev-B端","https://biformall.youlane.cn/B/api/mall/version", 1, 1, "{name}: {url}不响应"), | |||
| (4, "dev-Schedule","http://202.165.179.86:5000/S/version", 1, 1, "{name}: {url}不响应"), | |||
| (5, "dev-消息服务器","http://202.165.179.86:5001/mq/version", 1, 1, "{name}: {url}不响应"), | |||
| (6, "dev-websocket服务器","http://202.165.179.86:7100/W/version", 1, 1, "{name}: {url}不响应"), | |||
| (7, "dev-微信第三方开放平台","https://open.youlane.cn/O/version", 1, 1, "{name}: {url}不响应"), | |||
| (8, "dev-移动端数据塔台","https://mobile.youlane.cn/#/", 1, 1, "{name}: {url}不响应"), | |||
| (9, "dev-幸运卡牌","https://game.youlane.cn/luckCard/index.html", 1, 1, "{name}: {url}不响应"), | |||
| (10, "dev-幸运砸金蛋","https://game.youlane.cn/goldEgg/index.html", 1, 1, "{name}: {url}不响应"), | |||
| (11, "dev-幸运刮刮乐","https://game.youlane.cn/guaguale/index.html", 1, 1, "{name}: {url}不响应"), | |||
| (12, "dev-callback","http://202.165.179.86:9100/version", 1, 1, "{name}: {url}不响应"), | |||
| INSERT INTO `sys_monitor` (`id`,`name`,`url`,`type`,`deploy`,`enable`,`err_msg`) VALUES | |||
| (1, "dev-管理端","https://mall.youlane.cn/api/version", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (2, "dev-C端","https://ciformall.youlane.cn/C/api/mall/version", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (3, "dev-B端","https://biformall.youlane.cn/B/api/mall/version", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (4, "dev-Schedule","http://202.165.179.86:5000/S/version", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (5, "dev-消息服务器","http://202.165.179.86:5001/mq/version", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (6, "dev-websocket服务器","http://202.165.179.86:7100/W/version", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (7, "dev-微信第三方开放平台","https://open.youlane.cn/O/version", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (8, "dev-移动端数据塔台","https://mobile.youlane.cn/#/", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (9, "dev-幸运卡牌","https://game.youlane.cn/luckCard/index.html", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (10, "dev-幸运砸金蛋","https://game.youlane.cn/goldEgg/index.html", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (11, "dev-幸运刮刮乐","https://game.youlane.cn/guaguale/index.html", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (12, "dev-callback","http://202.165.179.86:9100/version", 1, 1, 1, "{name}: {url} 不响应"), | |||
| (101, "test-管理端","https://admintest.malls.iformall.com/api/version", 1, 2, "{name}: {url}不响应"), | |||
| (102, "test-C端","https://ctest.malls.iformall.com/C/api/mall/version", 1, 2, "{name}: {url} 不响应"), | |||
| (103, "test-B端","https://btest.malls.iformall.com/B/api/mall/version", 1, 2, "{name}: {url}不响应"), | |||
| (104, "test-Schedule","https://stest.malls.iformall.com/S/version", 1, 2, "{name}: {url}不响应"), | |||
| (105, "test-消息服务器","https://stest.malls.iformall.com/mq/version", 1, 2, "{name}: {url}不响应"), | |||
| (106, "test-websocket服务器","https://stest.malls.iformall.com/W/version", 1, 2, "{name}: {url}不响应"), | |||
| (107, "test-微信第三方开放平台","https://opentest.malls.iformall.com/O/version", 1, 2, "{name}: {url}不响应"), | |||
| (108, "test-移动端数据塔台","https://mobiletest.malls.iformall.com/#/", 1, 2, "{name}: {url}不响应"), | |||
| (109, "test-幸运卡牌","https://gametest.malls.iformall.com/game/luckCard/index.html", 1, 2, "{name}: {url}不响应"), | |||
| (110, "test-幸运砸金蛋","https://gametest.malls.iformall.com/game/goldEgg/index.html", 1, 2, "{name}: {url}不响应"), | |||
| (111, "test-幸运刮刮乐","https://gametest.malls.iformall.com/game/guaguale/index.html", 1, 2, "{name}: {url}不响应"), | |||
| (112, "test-callback","https://callbacktest.malls.iformall.com/api/version", 1, 2, "{name}: {url}不响应"), | |||
| (101, "test-管理端","https://admintest.malls.iformall.com/api/version", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (102, "test-C端","https://ctest.malls.iformall.com/C/api/mall/version", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (103, "test-B端","https://btest.malls.iformall.com/B/api/mall/version", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (104, "test-Schedule","https://stest.malls.iformall.com/S/version", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (105, "test-消息服务器","https://stest.malls.iformall.com/mq/version", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (106, "test-websocket服务器","https://stest.malls.iformall.com/W/version", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (107, "test-微信第三方开放平台","https://opentest.malls.iformall.com/O/version", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (108, "test-移动端数据塔台","https://mobiletest.malls.iformall.com/#/", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (109, "test-幸运卡牌","https://gametest.malls.iformall.com/game/luckCard/index.html", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (110, "test-幸运砸金蛋","https://gametest.malls.iformall.com/game/goldEgg/index.html", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (111, "test-幸运刮刮乐","https://gametest.malls.iformall.com/game/guaguale/index.html", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (112, "test-callback","https://callbacktest.malls.iformall.com/api/version", 1, 2, 0, "{name}: {url} 不响应"), | |||
| (201, "生产环境-管理端","https://admin.malls.iformall.com/api/version", 1, 3, "{name}: {url}不响应"), | |||
| (202, "生产环境-C端","https://c.malls.iformall.com/C/api/mall/version", 1, 3, "{name}: {url} 不响应"), | |||
| (203, "生产环境-B端","https://b.malls.iformall.com/B/api/mall/version", 1, 3, "{name}: {url}不响应"), | |||
| (204, "生产环境-Schedule","https://s.malls.iformall.com/S/version", 1, 3, "{name}: {url}不响应"), | |||
| (205, "生产环境-消息服务器","https://s.malls.iformall.com/mq/version", 1, 3, "{name}: {url}不响应"), | |||
| (206, "生产环境-websocket服务器","https://s.malls.iformall.com/W/version", 1, 3, "{name}: {url}不响应"), | |||
| (207, "生产环境-微信第三方开放平台","https://open.malls.iformall.com/O/version", 1, 3, "{name}: {url}不响应"), | |||
| (208, "生产环境-移动端数据塔台","https://mobile.malls.iformall.com/#/", 1, 3, "{name}: {url}不响应"), | |||
| (209, "生产环境-幸运卡牌","https://game.malls.iformall.com/game/luckCard/index.html", 1, 3, "{name}: {url}不响应"), | |||
| (210, "生产环境-幸运砸金蛋","https://game.malls.iformall.com/game/goldEgg/index.html", 1, 3, "{name}: {url}不响应"), | |||
| (211, "生产环境-幸运刮刮乐","https://game.malls.iformall.com/game/guaguale/index.html", 1, 3, "{name}: {url}不响应"), | |||
| (212, "生产环境-callback","https://callback.malls.iformall.com/api/version", 1, 3, "{name}: {url}不响应") | |||
| (201, "生产环境-管理端","https://admin.malls.iformall.com/api/version", 1, 3, 0, "{name}: {url}不响应"), | |||
| (202, "生产环境-C端","https://c.malls.iformall.com/C/api/mall/version", 1, 3, 0, "{name}: {url} 不响应"), | |||
| (203, "生产环境-B端","https://b.malls.iformall.com/B/api/mall/version", 1, 3, 0, "{name}: {url}不响应"), | |||
| (204, "生产环境-Schedule","https://s.malls.iformall.com/S/version", 1, 3, 0, "{name}: {url}不响应"), | |||
| (205, "生产环境-消息服务器","https://s.malls.iformall.com/mq/version", 1, 3, 0, "{name}: {url}不响应"), | |||
| (206, "生产环境-websocket服务器","https://s.malls.iformall.com/W/version", 1, 3, 0, "{name}: {url}不响应"), | |||
| (207, "生产环境-微信第三方开放平台","https://open.malls.iformall.com/O/version", 1, 3, 0, "{name}: {url}不响应"), | |||
| (208, "生产环境-移动端数据塔台","https://mobile.malls.iformall.com/#/", 1, 3, 0, "{name}: {url}不响应"), | |||
| (209, "生产环境-幸运卡牌","https://game.malls.iformall.com/game/luckCard/index.html", 1, 3, 0, "{name}: {url}不响应"), | |||
| (210, "生产环境-幸运砸金蛋","https://game.malls.iformall.com/game/goldEgg/index.html", 1, 3, 0, "{name}: {url}不响应"), | |||
| (211, "生产环境-幸运刮刮乐","https://game.malls.iformall.com/game/guaguale/index.html", 1, 3, 0, "{name}: {url}不响应"), | |||
| (212, "生产环境-callback","https://callback.malls.iformall.com/api/version", 1, 3, 0, "{name}: {url}不响应") | |||
| ; | |||
| @@ -0,0 +1,2 @@ | |||
| ALTER TABLE `wx_property_contract` | |||
| ADD COLUMN `subject_name` varchar(200) DEFAULT NULL COMMENT '主体名称'; | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.schedule; | |||
| import com.iformall.domain.po.SysMonitor; | |||
| import com.iformall.enums.EnumSysMonitorStatus; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.MailService; | |||
| import com.iformall.utils.HttpUtil; | |||
| @@ -34,6 +35,7 @@ public class SysMonitorSchedule { | |||
| public void checkUrls() { | |||
| if(isFmMonitor) { | |||
| SysMonitor q = new SysMonitor(); | |||
| q.setEnable(EnumSysMonitorStatus.ENABLE.getCode()); | |||
| List<SysMonitor> sysMonitors = sysMonitorMapper.findList(q); | |||
| for (SysMonitor sysMonitor : sysMonitors) { | |||
| @@ -28,6 +28,8 @@ public class SysMonitor implements Serializable { | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="1=dev 2=test 3=release",name="deploy") | |||
| private Integer deploy; | |||
| @io.swagger.annotations.ApiModelProperty(value="0:enable 1:disable",name="enable") | |||
| private Integer enable; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="errMsg") | |||
| private String errMsg; | |||
| @@ -40,6 +42,7 @@ public class SysMonitor implements Serializable { | |||
| ,Url_ASC("`url` ASC"),Url_DESC("`url` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,Deploy_ASC("`deploy` ASC"),Deploy_DESC("`deploy` DESC") | |||
| ,Enable_ASC("`enable` ASC"),Enable_DESC("`enable` DESC") | |||
| ,ErrMsg_ASC("`err_msg` ASC"),ErrMsg_DESC("`err_msg` DESC") | |||
| ; | |||
| private String value; | |||
| @@ -82,8 +82,9 @@ public class WxBillDaily extends BaseEntity{ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| @Excel(name = "租赁商铺类型*", orderNum = "6", width = 20, replace = {"店铺_1", "多经点位_2"}) | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "支付方式:见枚举EnumBillPayWay", name = "payWay") | |||
| private Integer payWay; | |||
| @@ -173,6 +173,9 @@ public class WxPropertyContract extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "多径租赁单价(其他放rentInfo)", name = "priceUnit") | |||
| private String rentPrice; | |||
| @io.swagger.annotations.ApiModelProperty(value = "主体名称", name = "subjectName") | |||
| private String subjectName; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -0,0 +1,36 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by Stormeye on 2019/13/54. | |||
| */ | |||
| public enum EnumSysMonitorStatus { | |||
| ENABLE(0, "启用"), | |||
| DISABLE(1, "停用"), | |||
| ; | |||
| public static EnumSysMonitorStatus getEnum(Integer code) { | |||
| for (EnumSysMonitorStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumSysMonitorStatus(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -227,6 +227,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| v1.setPayStr("0"); | |||
| v1.setReceiveDate(new Date()); | |||
| v1.setExpiredDay(0L); | |||
| v1.setRentShopType(1); | |||
| list.add(v1); | |||
| v2.setShopNumber("A0002"); | |||
| @@ -235,6 +236,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| v2.setPayStr("0"); | |||
| v2.setReceiveDate(new Date()); | |||
| v2.setExpiredDay(0L); | |||
| v2.setRentShopType(2); | |||
| list.add(v2); | |||
| excelService.exportExcel(list, null, "水电费模板", WxBillDailyVo.class, "水电费模板.xlsx", response, true); | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.service.impl; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| @@ -363,9 +364,23 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| wxMerchant.setId(merchantId); | |||
| Date date = new Date(); | |||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | |||
| if(wxMerchant.getIsAdmin() == null) { | |||
| wxMerchant.setIsAdmin(EnumYesOrNo.NO.getCode()); | |||
| } | |||
| wxMerchant.setUpdateDate(date); | |||
| wxMerchant.setCreateDate(date); | |||
| if (StringUtils.isNotBlank(wxMerchant.getCoverPicture())) { | |||
| List<String> coverPicture = JSONArray.parseArray(wxMerchant.getCoverPicture(), String.class); | |||
| if (!coverPicture.isEmpty()) { | |||
| wxMerchant.setImgUrl(coverPicture.get(0)); | |||
| } | |||
| } else { | |||
| if (StringUtils.isNotBlank(wxMerchant.getImgUrl())) { | |||
| List<String> strList = new ArrayList<String>(); | |||
| strList.add(wxMerchant.getImgUrl()); | |||
| wxMerchant.setCoverPicture(JSONArray.toJSONString(strList)); | |||
| } | |||
| } | |||
| wxMerchantMapper.insertSelective(wxMerchant); | |||
| //关联合同 | |||
| @@ -258,27 +258,11 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| if (count > 0) { | |||
| return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); | |||
| } | |||
| int dayType = record.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; | |||
| //保存物业合同信息 | |||
| String message; | |||
| if (record.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| // //计租开始时间 | |||
| // Calendar instance = Calendar.getInstance(); | |||
| // instance.setTime(record.getRentalStartDate()); | |||
| // instance.add(dayType, record.getLease()); | |||
| // instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| // record.setRentalEndDate(instance.getTime()); | |||
| // //起租结束时间 | |||
| // if(!record.getStartDate().equals(record.getRentalStartDate())){ | |||
| // instance.clear(); | |||
| // instance.setTime(record.getRentalStartDate()); | |||
| // instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| // record.setEndDate(instance.getTime()); | |||
| // }else{ | |||
| // record.setEndDate(record.getStartDate()); | |||
| // } | |||
| record.setRentalStartDate(wxRentContract.getRentalStartDate()); | |||
| record.setRentalEndDate(wxRentContract.getRentalEndDate()); | |||
| record.setStartDate(wxRentContract.getStartDate()); | |||
| @@ -307,20 +291,6 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| if (wxPropertyContract == null) { | |||
| return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND); | |||
| } | |||
| // Calendar instance = Calendar.getInstance(); | |||
| // instance.setTime(record.getRentalStartDate()); | |||
| // instance.add(dayType, record.getLease()); | |||
| // instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| // record.setRentalEndDate(instance.getTime()); | |||
| // //起租结束时间 | |||
| // if(!record.getStartDate().equals(record.getRentalStartDate())){ | |||
| // instance.clear(); | |||
| // instance.setTime(record.getRentalStartDate()); | |||
| // instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| // record.setEndDate(instance.getTime()); | |||
| // }else{ | |||
| // record.setEndDate(record.getStartDate()); | |||
| // } | |||
| record.setRentalStartDate(wxRentContract.getRentalStartDate()); | |||
| record.setRentalEndDate(wxRentContract.getRentalEndDate()); | |||
| record.setStartDate(wxRentContract.getStartDate()); | |||
| @@ -493,12 +463,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| double priceD = price; | |||
| for (int i = 1; i < size; i++) { | |||
| priceD = priceD + priceD * integers.get(i) / 10000.0; | |||
| //年 需要除12 | |||
| if(EnumPriceUnit.Y.getCode().equals(wxPropertyContract.getPriceUnit())){ | |||
| priceArr[i] = new BigDecimal(priceD).divide(new BigDecimal(12),2, BigDecimal.ROUND_HALF_DOWN).setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||
| }else{ | |||
| priceArr[i] = new BigDecimal(priceD).setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||
| } | |||
| priceArr[i] = new BigDecimal(priceD).setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||
| } | |||
| int month = 12; | |||
| int divide = lease / month; | |||
| @@ -554,6 +519,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| List<BillTimeVo> billTimeVoList = WxRentContractServiceImpl.initBillTimeList(wxPropertyContract.getRentalStartDate(),wxPropertyContract.getRentalEndDate(),wxPropertyContract.getAdjustPeriod(),dayType,receivePeriod); | |||
| int index = 0; | |||
| for (BillTimeVo billTimeVo : billTimeVoList){ | |||
| if(sd.format(billTimeVo.getStartDate()).equals("2020-05-29")){ | |||
| System.out.println(); | |||
| } | |||
| if(yearList.size() > 1) { | |||
| if (endDate!=null && (sd.format(billTimeVo.getStartDate()).equals(sd.format(endDate)) || billTimeVo.getStartDate().after(endDate))) { | |||
| logger.info("=====billTimeVo.getStartDate():"+sd.format(billTimeVo.getStartDate())+" endDate:"+sd.format(endDate)); | |||
| @@ -98,6 +98,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| @Autowired | |||
| WxMerchantShopMapper wxMerchantShopMapper; | |||
| @Autowired | |||
| WxFlowRecordMapper wxFlowRecordMapper; | |||
| @Override | |||
| public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { | |||
| Object rentContractStatusInfo = getRentContractStatusInfo(record); | |||
| @@ -671,6 +674,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| rentContract.setApplyStatus(EnumRentContractAppStatus.CANCLE.getCode()); | |||
| updateApplyStatus(rentContract); | |||
| //修改flowRecord | |||
| WxFlowRecord fr = new WxFlowRecord(); | |||
| fr.setBusinessId(id); | |||
| wxFlowRecordMapper.updateCurrStatus(fr); | |||
| logger.info("合同id:{},开始停止...", id); | |||
| //结束审批流 by luozukai | |||
| List<Task> tasks = taskService.createTaskQuery().processDefinitionKey(WxFlowServiceImpl.getFlowKeyByType(1)) | |||
| @@ -751,13 +759,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| long[] priceArr = new long[arraySize]; | |||
| for (int i = 0; i < arraySize; i++) { | |||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); | |||
| //年 需要除12 | |||
| if(EnumPriceUnit.Y.getCode().equals(priceUnit)){ | |||
| BigDecimal yprice = new BigDecimal(rentInfoObject.getString("price")).divide(new BigDecimal(12),2, BigDecimal.ROUND_HALF_DOWN); | |||
| priceArr[i] = yprice.multiply(new BigDecimal(100)).longValue(); | |||
| }else{ | |||
| priceArr[i] = new BigDecimal(rentInfoObject.getString("price")).multiply(new BigDecimal(100)).longValue(); | |||
| } | |||
| priceArr[i] = new BigDecimal(rentInfoObject.getString("price")).multiply(new BigDecimal(100)).longValue(); | |||
| } | |||
| priceList.add(priceArr); | |||
| //大于一年 | |||
| @@ -1372,6 +1374,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| result.put("receivePeriod", receivePeriod); | |||
| result.put("payAccount", wxRentContract.getPayAccount().equals("") ? " " : wxRentContract.getPayAccount()); | |||
| result.put("signDate", DateUtils.date2String(wxRentContract.getSignDate(), "yyyy-MM-dd")); | |||
| //主体名称-乙方 | |||
| if (StringUtils.isNotEmpty(wxRentContract.getSubjectName())) { | |||
| result.put("corpPapersPerson", wxRentContract.getSubjectName()); | |||
| } else { | |||
| result.put("corpPapersPerson", " "); | |||
| } | |||
| //品牌 | |||
| Long brandId = wxRentContract.getBrand(); | |||
| String brand = " "; | |||
| @@ -1398,8 +1407,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| result.put("unitPriceRentUpper", PriceUtil.digitUppercase(unitPrice)); | |||
| } else { | |||
| result.put("unitPriceRent", 0); | |||
| result.put("priceRentUpper", "0"); | |||
| result.put("unitPriceRentUpper", "0"); | |||
| result.put("priceRentUpper", PriceUtil.digitUppercase(0)); | |||
| result.put("unitPriceRentUpper", PriceUtil.digitUppercase(0)); | |||
| } | |||
| //租赁保证金 | |||
| @@ -1451,12 +1460,19 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| double priceProperty = new BigDecimal(wxPropertyContract.get("price").toString()) | |||
| .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); | |||
| result.put("priceProperty", priceProperty); | |||
| double unitPriceProperty = new BigDecimal(wxPropertyContract.get("price").toString()) | |||
| .divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN) | |||
| .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); | |||
| result.put("unitPriceProperty", unitPriceProperty); | |||
| result.put("pricePropertyUpper", PriceUtil.digitUppercase(priceProperty)); | |||
| result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(unitPriceProperty)); | |||
| if (!wxRentContract.getRentArea().equals("0")) { | |||
| double unitPriceProperty = new BigDecimal(wxPropertyContract.get("price").toString()) | |||
| .divide(new BigDecimal(wxRentContract.getRentArea()), 2, RoundingMode.HALF_EVEN) | |||
| .divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); | |||
| result.put("unitPriceProperty", unitPriceProperty); | |||
| result.put("pricePropertyUpper", PriceUtil.digitUppercase(priceProperty)); | |||
| result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(unitPriceProperty)); | |||
| } else { | |||
| result.put("unitPriceProperty", 0); | |||
| result.put("pricePropertyUpper", PriceUtil.digitUppercase(0)); | |||
| result.put("unitPricePropertyUpper", PriceUtil.digitUppercase(0)); | |||
| } | |||
| //首期物业费 | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(wxRentContract.getRentalStartDate()); | |||
| @@ -1816,8 +1832,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| public static void main(String[] args) throws Exception{ | |||
| long tprice = 100; | |||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | |||
| Date start = sd.parse("2019-05-13"); | |||
| Date end = sd.parse("2019-07-05"); | |||
| Date start = sd.parse("2020-05-29"); | |||
| Date end = sd.parse("2020-07-28"); | |||
| System.out.println("===="+new WxRentContractServiceImpl().getNeedPay(tprice,0,start,end));; | |||
| } | |||
| @@ -7,11 +7,12 @@ | |||
| <result column="url" jdbcType="VARCHAR" property="url" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="deploy" jdbcType="INTEGER" property="deploy" /> | |||
| <result column="enable" jdbcType="INTEGER" property="enable" /> | |||
| <result column="err_msg" jdbcType="VARCHAR" property="errMsg" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`name`,`url`,`type`,`deploy`,`err_msg` | |||
| `id`,`name`,`url`,`type`,`deploy`,`enable`,`err_msg` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -31,6 +32,9 @@ | |||
| <if test=" null != deploy "> | |||
| and `deploy` = #{deploy} | |||
| </if> | |||
| <if test=" null != enable "> | |||
| and `enable` = #{enable} | |||
| </if> | |||
| <if test=" null != errMsg "> | |||
| and `err_msg` like concat('%', #{errMsg},'%') | |||
| </if> | |||
| @@ -30,6 +30,9 @@ | |||
| <result column="pay_way" jdbcType="INTEGER" property="payWay"/> | |||
| <result column="late_pay_status" jdbcType="INTEGER" property="latePayStatus"/> | |||
| <result column="comments" jdbcType="VARCHAR" property="comments"/> | |||
| <result column="starttime" property="starttime"/> | |||
| <result column="endtime" property="endtime"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| @@ -37,7 +40,7 @@ | |||
| `createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`, | |||
| `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`, | |||
| `revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`,`shop_info`, | |||
| `pay_way`,`late_pay_status`,`comments` | |||
| `pay_way`,`late_pay_status`,`comments`,starttime,endtime | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -40,7 +40,7 @@ | |||
| `createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`, | |||
| `merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`, | |||
| `revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`,`shop_info`, | |||
| `pay_way`,`late_pay_status`,`comments` | |||
| `pay_way`,`late_pay_status`,`comments`,starttime,endtime | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -72,8 +72,12 @@ | |||
| </select> | |||
| <update id="updateCurrStatus" parameterType="com.iformall.domain.po.WxFlowRecord"> | |||
| update wx_flow_record set curr_status=#{currStatus} where process_instance_id=#{processInstanceId} | |||
| and status = 1 | |||
| update wx_flow_record set curr_status=#{currStatus} | |||
| <where> | |||
| and status = 1 | |||
| <if test=" null != processInstanceId ">and process_instance_id=#{processInstanceId}</if> | |||
| <if test=" null != businessId ">and business_id = #{businessId}</if> | |||
| </where> | |||
| </update> | |||
| </mapper> | |||
| @@ -40,6 +40,7 @@ | |||
| <result column="file_names" jdbcType="VARCHAR" property="fileNames"/> | |||
| <result column="price_unit" property="priceUnit"/> | |||
| <result column="rent_price" property="rentPrice"/> | |||
| <result column="subject_name" property="subjectName"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| @@ -48,7 +49,8 @@ | |||
| `deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`, | |||
| `shop_type`,`shop_id`,`updatetime`,`createtime`,`rent_area`, | |||
| `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`, | |||
| `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`, `file_names`,price_unit,rent_price | |||
| `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`, | |||
| `file_names`,price_unit,rent_price,subject_name | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -108,7 +110,8 @@ | |||
| rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate, | |||
| start_date startDate,end_date endDate,rc.rent_contract_id rentContractId,br.`name` brandName, | |||
| s.addr,rc.apply_status applyStatus,rc.adjust_period adjustPeriod,rc.business_type businessType, | |||
| rc.adjust_ratio adjustRatio,rc.rent_info rentInfo, rc.file_names fileNames,rc.price_unit | |||
| rc.adjust_ratio adjustRatio,rc.rent_info rentInfo, rc.file_names fileNames,rc.price_unit,rc.subject_name | |||
| subjectName | |||
| from wx_property_contract rc | |||
| left join wx_shop s on rc.shop_id=s.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||