| @@ -1,49 +1,26 @@ | |||
| package com.iformall.controller.market; | |||
| import com.aliyun.openservices.shade.com.alibaba.fastjson.JSON; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.dto.FinanceSetOffDTO; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceFinish; | |||
| import com.iformall.domain.po.WxFinancePrintData; | |||
| import com.iformall.domain.po.WxFinancePrintTemplate; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxFinanceReceiveSetoff; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.FinanceBillSetoffSum; | |||
| import com.iformall.domain.vo.WxFinanceReceiveVo; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumFinanceFinishStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.WxEnergyService; | |||
| import com.iformall.enums.EnumFinancePrintDataType; | |||
| import com.iformall.service.WxFinancePrintService; | |||
| import com.iformall.service.WxFinanceService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import java.math.BigDecimal; | |||
| import java.util.ArrayList; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestBody; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| @@ -60,6 +37,22 @@ public class WxFinancePrintController extends BaseController { | |||
| @Autowired | |||
| private WxFinancePrintService wxFinancePrintService; | |||
| /** | |||
| * 账单类型(非能源) | |||
| * @return | |||
| */ | |||
| @GetMapping("types") | |||
| public ResultData types() { | |||
| List<Map> list = new ArrayList<Map>(); | |||
| for (EnumFinancePrintDataType t : EnumFinancePrintDataType.values()) { | |||
| Map m = new HashMap(); | |||
| m.put("id", t.getCode()); | |||
| m.put("name", t.getMessage()); | |||
| list.add(m); | |||
| } | |||
| return new ResultData(list); | |||
| } | |||
| @ApiOperation("打印项列表") | |||
| @GetMapping("printDatas") | |||
| @TenantIgnore | |||
| @@ -144,29 +144,6 @@ ALTER TABLE wx_rent_contract ADD COLUMN revenue_jumps_remark varchar(1000) COMME | |||
| ALTER TABLE wx_rent_contract ADD COLUMN free_period_remark varchar(1000) COMMENT '免租期设置说明'; | |||
| ALTER TABLE wx_rent_contract DROP COLUMN bus_discount_ratio; | |||
| CREATE TABLE `wx_finance_print_data` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '数据项名称', | |||
| `is_del` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL, | |||
| `remark` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', | |||
| `type` int(1) NOT NULL COMMENT '类型', | |||
| `sort` int(1) NOT NULL DEFAULT '0' COMMENT '排序', | |||
| PRIMARY KEY (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='租赁合同'; | |||
| CREATE TABLE `wx_finance_print_template` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||
| `update_time` datetime DEFAULT NULL COMMENT '更新时间', | |||
| `create_time` datetime DEFAULT NULL COMMENT '创建时间', | |||
| `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '模板名称', | |||
| `is_del` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL, | |||
| `content` text COLLATE utf8mb4_unicode_ci COMMENT '内容', | |||
| `type` int(1) NOT NULL COMMENT '类型', | |||
| PRIMARY KEY (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='租赁合同'; | |||
| alter table wx_finance_receive_0 CHANGE `type` receive_type INT(1); | |||
| alter table wx_finance_receive_1 CHANGE `type` receive_type INT(1); | |||
| alter table wx_finance_receive_2 CHANGE `type` receive_type INT(1); | |||
| @@ -794,4 +771,30 @@ CREATE TABLE `wx_finance_finish` ( | |||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='能耗表'; | |||
| CREATE TABLE `wx_finance_print_data` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '数据项名称', | |||
| `is_del` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL, | |||
| `remark` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', | |||
| `type` int(1) NOT NULL COMMENT '类型', | |||
| `sort` int(1) NOT NULL DEFAULT '0' COMMENT '排序', | |||
| `print_data_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '打印的字段类型', | |||
| `print_data_json` json DEFAULT NULL COMMENT '配置项', | |||
| `is_edit` int(1) NOT NULL DEFAULT '0' COMMENT '是否可编辑', | |||
| PRIMARY KEY (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='租赁合同'; | |||
| CREATE TABLE `wx_finance_print_template` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||
| `update_time` datetime DEFAULT NULL COMMENT '更新时间', | |||
| `create_time` datetime DEFAULT NULL COMMENT '创建时间', | |||
| `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '模板名称', | |||
| `is_del` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL, | |||
| `content` text COLLATE utf8mb4_unicode_ci COMMENT '内容', | |||
| `type` int(1) NOT NULL COMMENT '类型', | |||
| PRIMARY KEY (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='租赁合同'; | |||
| @@ -27,4 +27,10 @@ public class WxFinancePrintData extends BaseEntity { | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="排序",name="sort") | |||
| private Integer sort; | |||
| @io.swagger.annotations.ApiModelProperty(value="printDataType",name="printDataType") | |||
| private String printDataType; | |||
| @io.swagger.annotations.ApiModelProperty(value="排序",name="sort") | |||
| private String printDataJson; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否可编辑",name="isEdit") | |||
| private Integer isEdit; | |||
| } | |||
| @@ -4,14 +4,35 @@ import lombok.Data; | |||
| import java.io.Serializable; | |||
| import java.util.List; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.domain.po.WxFinancePrintData; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.print.entity.PrintDataBraidTable; | |||
| import com.iformall.print.entity.PrintDataBraidTableColumns; | |||
| import com.iformall.print.entity.PrintDataBraidTxt; | |||
| @Data | |||
| public class PrintDataHandler implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| // public static Object parseComponent() { | |||
| // | |||
| // public static Object parseComponent(WxFinancePrintData data) { | |||
| // JSONObject dataJson = JSON.parseObject(data.getPrintDataJson()); | |||
| // if("braid-txt".equals(data.getPrintDataType())) { | |||
| // PrintDataBraidTxt txt = new PrintDataBraidTxt(); | |||
| // txt.setTitle(data.getName()); | |||
| // txt.setIsEdit(data.getIsEdit()); | |||
| // txt.setName(dataJson.getString("fieldName")); | |||
| // txt.setValue("{"+data.getName()+"}"); | |||
| // }else if ("braid-table".equals(data.getPrintDataType())) { | |||
| // PrintDataBraidTable table = new PrintDataBraidTable(); | |||
| // table.setTitle(data.getName()); | |||
| // table.setIsEdit(data.getIsEdit()); | |||
| // | |||
| // | |||
| // | |||
| // | |||
| // } | |||
| // } | |||
| } | |||
| @@ -8,10 +8,13 @@ | |||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="sort" jdbcType="INTEGER" property="sort"/> | |||
| <result column="print_data_type" jdbcType="VARCHAR" property="printDataType"/> | |||
| <result column="print_data_json" jdbcType="VARCHAR" property="printDataJson"/> | |||
| <result column="is_edit" jdbcType="INTEGER" property="isEdit"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`name`,`is_del`,`remark`,`type` | |||
| `id`,`name`,`is_del`,`remark`,`type`,`sort`,`print_data_type`,`print_data_json`,`is_edit` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -36,6 +39,10 @@ | |||
| <if test=" null != sort "> | |||
| and `sort` = #{sort} | |||
| </if> | |||
| <if test=" null != isEdit "> | |||
| and `is_edit` = #{isEdit} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||