MrShi
2025-01-13 a09708582ca65d621d14a8c6a3a22222dd7db0d9
Merge branch '2.0.1' of http://139.186.142.91:10010/r/productDev/funingyunwei into 2.0.1
已添加16个文件
已删除1个文件
已修改22个文件
2234 ■■■■■ 文件已修改
admin/src/views/finance/account.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/finance/company.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/finance/payments.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/operation/device.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/statistics/platformRecord.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/statistics/platformStatic.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/asset.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/assetList.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/check.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/AssetSel.vue 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/InDetail.vue 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/InEdit.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/OutDetail.vue 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/components/OutEdit.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/in.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/out.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/query.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/stock/record.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/system/publicMsg.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/system/smsMessage.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/db/business.yw_temp_config.permissions.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/core/utils/Constants.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwContractBillCloudController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwTempConfigCloudController.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/ExcelTestDemo.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/core/excel/ExcelReplaceCommon.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwTempConfigMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/dto/YwSmsEmailBillCallDTO.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwTempConfig.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/vo/YwCallTempDataVO.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/vo/YwContractBillCallDataVO.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/SmsEmailService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwContractBillService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwTempConfigService.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java 391 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwTempConfigServiceImpl.java 191 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/third/EmailService.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/finance/account.vue
@@ -9,7 +9,7 @@
      <el-table-column prop="title" label="收支条目" min-width="100" show-overflow-tooltip />
      <el-table-column prop="companyName" label="收款公司" min-width="100" show-overflow-tooltip />
      <el-table-column label="账户类型" min-width="100" show-overflow-tooltip>
        <template v-slot="{row}">
        <template v-slot="{ row }">
          <span v-if="row.type == 0">对公</span>
          <span v-if="row.type == 1">个人</span>
        </template>
@@ -19,7 +19,8 @@
      <el-table-column prop="bankNo" label="银行账号" min-width="100" show-overflow-tooltip />
      <el-table-column prop="status" label="状态" min-width="100" show-overflow-tooltip>
        <template v-slot="scope">
          <el-switch v-model="scope.row.status" @change="e =>changeStatus(scope.row)" :active-value="0" :inactive-value="1">
          <el-switch v-model="scope.row.status" @change="e => changeStatus(scope.row)" :active-value="0"
            :inactive-value="1">
          </el-switch>
        </template>
      </el-table-column>
@@ -117,13 +118,13 @@
        this.getList()
      })
    },
    getCompany(){
    getCompany() {
      companyGetList({
        model: {type: 2},
        model: { type: 2 },
        capacity: 9999,
        page: 1
      }).then(res => {
       this.queryFormConfig.formItems[1].options = res.records || []
        this.queryFormConfig.formItems[1].options = res.records || []
      })
    },
    handleEdit(row) {
@@ -156,6 +157,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
admin/src/views/finance/company.vue
@@ -13,7 +13,8 @@
      <el-table-column prop="accountNum" label="收支账户数量" min-width="100" show-overflow-tooltip />
      <el-table-column prop="status" label="状态" min-width="100" show-overflow-tooltip>
        <template v-slot="scope">
          <el-switch v-model="scope.row.status" @change="e => changeStatus(scope.row)" :active-value="0" :inactive-value="1">
          <el-switch v-model="scope.row.status" @change="e => changeStatus(scope.row)" :active-value="0"
            :inactive-value="1">
          </el-switch>
        </template>
      </el-table-column>
@@ -132,6 +133,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
admin/src/views/finance/payments.vue
@@ -2,7 +2,7 @@
  <div class="main_app">
    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
    <div class="mt20">
<!--      <el-button v-permissions="['business:ywpatrolline:create']">导出</el-button>-->
      <!--      <el-button v-permissions="['business:ywpatrolline:create']">导出</el-button>-->
    </div>
    <el-table v-loading="loading" :data="list" stripe>
      <el-table-column prop="customerName" label="客户名称" min-width="100" show-overflow-tooltip />
@@ -10,7 +10,7 @@
      <el-table-column label="房号" min-width="100" show-overflow-tooltip>
        <template slot-scope="{row}">
          <div style="display: flex; flex-direction: column;" v-if="row.roomPathName">
            <span v-for="(item, index) in row.roomPathName.split(';')" :key="index">{{item}}</span>
            <span v-for="(item, index) in row.roomPathName.split(';')" :key="index">{{ item }}</span>
          </div>
        </template>
      </el-table-column>
@@ -123,7 +123,7 @@
    this.getList()
  },
  methods: {
    isShow (status, contractStatus) {
    isShow(status, contractStatus) {
      if (status === 1) return false
      if (contractStatus === '3' || contractStatus === '4') return false
      return true
@@ -150,7 +150,7 @@
        this.loading = false
      })
    },
    closeDW (id) {
    closeDW(id) {
      this.$confirm('确认关闭此流水吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
@@ -161,8 +161,8 @@
            this.getList()
          })
      }).catch(() => {
      });
      })
    },
    handleDel(row) {
      let message = `确认删除该记录吗?`
@@ -185,6 +185,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
admin/src/views/operation/device.vue
@@ -21,7 +21,8 @@
      </el-table-column>
      <el-table-column label="操作" min-width="130" fixed="right">
        <template slot-scope="{row}">
          <el-button type="text" @click="handleDetail(row)" v-permissions="['business:category:update']">查看详情</el-button>
          <el-button type="text" @click="handleDetail(row)"
            v-permissions="['business:category:update']">查看详情</el-button>
          <el-button type="text" @click="handleEdit(row)" icon="el-icon-edit"
            v-permissions="['business:category:update']">编辑</el-button>
          <el-button type="text" @click="handleDel(row)" icon="el-icon-delete"
@@ -146,6 +147,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
admin/src/views/statistics/platformRecord.vue
@@ -9,8 +9,7 @@
      <el-table-column prop="param1" label="作业开始" min-width="100" show-overflow-tooltip />
      <el-table-column prop="param2" label="作业结束" min-width="100" show-overflow-tooltip />
      <el-table-column prop="workTime" label="作业时长" min-width="100" show-overflow-tooltip />
      <el-table-column prop="name"
        label="运输单号/合同号" min-width="100" show-overflow-tooltip>
      <el-table-column prop="name" label="运输单号/合同号" min-width="100" show-overflow-tooltip>
        <template v-slot="scope">
          <span>{{ scope.row.billCode || scope.row.contractNum }}</span>
        </template>
@@ -131,6 +130,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
admin/src/views/statistics/platformStatic.vue
@@ -130,6 +130,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
admin/src/views/stock/asset.vue
@@ -12,7 +12,7 @@
      <el-table-column prop="param1" label="备注" min-width="120" show-overflow-tooltip />
      <el-table-column prop="param2" label="状态" min-width="90" show-overflow-tooltip />
      <el-table-column prop="workTime" label="操作" min-width="100" show-overflow-tooltip>
        <template v-slot="{row}">
        <template v-slot="{ row }">
          <span class="primaryColor pointer">查看详情</span>
          <span class="red pointer">删除</span>
        </template>
@@ -52,7 +52,7 @@
      total: 0,
      queryFormConfig: {
        formItems: [
        {
          {
            filed: 'carCodeFront',
            type: 'input',
            label: '仓库名称',
@@ -126,11 +126,10 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
</script>
<style>
</style>
<style></style>
admin/src/views/stock/assetList.vue
@@ -137,6 +137,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
admin/src/views/stock/check.vue
@@ -13,7 +13,7 @@
      <el-table-column prop="param2" label="创建时间" min-width="140" show-overflow-tooltip />
      <el-table-column prop="workTime" label="盘点状态" min-width="80" show-overflow-tooltip />
      <el-table-column prop="workTime" label="操作" min-width="140" show-overflow-tooltip>
        <template v-slot="{row}">
        <template v-slot="{ row }">
          <span class="primaryColor pointer">查看详情</span>
          <span class="primaryColor pointer">取消</span>
          <span class="primaryColor pointer">删除</span>
@@ -51,7 +51,7 @@
      total: 0,
      queryFormConfig: {
        formItems: [
        {
          {
            filed: 'carCodeFront',
            type: 'input',
            label: '盘点单',
@@ -125,11 +125,10 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
</script>
<style>
</style>
<style></style>
admin/src/views/stock/components/AssetSel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,125 @@
<template>
  <GlobalWindow title="选择物料" :visible.sync="isShowModal" :confirm-working="isLoading" width="900px" @close="close"
    @confirm="confirm">
    <el-form ref="searchForm" :model="searchForm" label-width="100px" inline>
      <el-form-item prop="areaType" label="物料信息">
        <el-input v-model="searchForm.aaa" placeholder="请输入物料编码/名称" @keypress.enter.native="search"></el-input>
      </el-form-item>
      <el-form-item prop="areaIds" label="物料分类">
        <el-cascader v-model="searchForm.areaIds" @change="changeSel" placeholder="请选择物料分类" clearable
          :options="cateList" :props="{
            label: 'name',
            value: 'id',
            children: 'childCategoryList'
          }"></el-cascader>
      </el-form-item>
      <span>
        <el-button type="primary" @click="getList">搜索</el-button>
        <el-button @click="reset">重置</el-button>
      </span>
    </el-form>
    <!--  -->
    <el-table @selection-change="handleSelectionChange" :data="list" stripe>
      <el-table-column type="selection"  width="55" />
      <el-table-column prop="categoryName" label="物料编码" min-width="100px"></el-table-column>
      <el-table-column prop="creatorName" label="物料名称" min-width="80px"></el-table-column>
      <el-table-column prop="createDate" label="条码" min-width="100px"></el-table-column>
      <el-table-column prop="dealUserName" label="品牌" min-width="80px"></el-table-column>
      <el-table-column prop="dealUserName" label="规格型号" min-width="80px"></el-table-column>
      <el-table-column prop="dealUserName" label="单位" min-width="80px"></el-table-column>
      <el-table-column prop="dealUserName" label="库存" min-width="80px"></el-table-column>
    </el-table>
    <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination">
    </Pagination>
  </GlobalWindow>
</template>
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import Pagination from '@/components/common/Pagination'
import { fetchList as getCateList } from '@/api/business/category.js'
export default {
  name: 'OperaCategoryWindow',
  components: { GlobalWindow, Pagination },
  data() {
    return {
      // è¡¨å•数据
      searchForm: {},
      pagination: {
        pageSize: 10,
        page: 1,
        total: 0
      },
      list: [],
      selList: [],
      cateList: [],
      isShowModal: false,
      isLoading: false,
      // éªŒè¯è§„则
      rules: {
        name: [{ required: true, message: '请输入二级分类名称', trigger: 'blur' }],
      },
      dataList: []
    }
  },
  created() {
    this.initData()
  },
  methods: {
    confirm() {
      this.$emit('change', this.selList)
      this.close()
    },
    handleSelectionChange(val) {
      this.selList = val
    },
    getList(page) {
      const { pagination, searchForm } = this
      this.listLoading = true
      if(page){pagination.page = page}
      fetchList({
        capacity: pagination.pageSize,
        page: pagination.page,
        model: {...searchForm}
      }).then((res) => {
        this.listLoading = false
        this.list = res.records
        this.pagination.total = res.total || 0
      }, () => {
        this.listLoading = false
      })
    },
    initData() {
      getCateList({
        model: { type: 3 },
        capacity: 1000,
        page: 1,
      }).then(res => {
        this.cateList = res.records || []
      })
    },
    changeSel(e) {
      if (e && e.length == 2) {
        this.$set(this.searchForm, 'cateId', e[1])
      } else {
        this.$set(this.searchForm, 'cateId', '')
      }
    },
    reset() {
      this.searchForm = {}
      this.pagination.pageSize = 10
      this.pagination.page = 1
      this.getList()
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    },
    close() {
      this.isShowModal = false
      this.$emit('close')
    },
  }
}
</script>
admin/src/views/stock/components/InDetail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,164 @@
<template>
  <GlobalWindow width="960px" title="出库单详情" :visible.sync="visible" :confirm-working="isWorking" @close="close"
    @confirm="confirm">
    <div class="main">
      <div class="title">
        <span>工单详情</span>
      </div>
      <div class="main_content">
        <div class="list">
          <div class="item">
            <div class="la">出库仓库</div>
            <div class="val">{{ info.projectName }}</div>
          </div>
          <div class="item">
            <div class="la">出库日期</div>
            <div class="val">{{ info.categoryName }}</div>
          </div>
          <div class="item">
            <div class="la">出库类型</div>
            <div class="val">{{ info.creatorName }}{{ info.creatorCompany ? "-" + info.creatorCompany : '' }}</div>
          </div>
          <div class="item">
            <div class="la">处理人</div>
            <div class="val">{{ info.creatorPhone || info.creatorMobile }}</div>
          </div>
          <div class="item">
            <div class="la">备注</div>
            <div class="val">{{ info.createDate }}</div>
          </div>
        </div>
      </div>
      <div class="title">物料信息</div>
      <el-table :data="list" stripe>
        <el-table-column align="center" type="index" width="55" />
        <el-table-column prop="creatorName" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="categoryName" label="物料编码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="createDate" label="条形码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="dealUserName" label="品牌" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="dealUserName" label="单位" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="dealUserName" label="出库数量" show-overflow-tooltip min-width="80px"></el-table-column>
      </el-table>
    </div>
  </GlobalWindow>
</template>
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import BaseOpera from '@/components/base/BaseOpera'
import { detailById, dispatchOrder, dealOrder } from '@/api/workorder/ywWorkorder'
import { getUserList } from '@/api/system/user'
import { Message, Loading } from 'element-ui'
import dayjs from 'dayjs'
export default {
  components: {
    GlobalWindow
  },
  extends: BaseOpera,
  data() {
    return {
      id: '',
      visible: false,
      info: {},
      list: []
    }
  },
  created() {
    // this.getDetail()
  },
  methods: {
    getDetail() {
      const { id } = this
      detailById(id).then(res => {
        this.info = res
      })
    },
    close() {
      this.visible = false
      this.$emit('close')
    }
  }
}
</script>
<style lang="scss" scoped>
@import '@/assets/style/variables.scss';
.main {
  padding-top: 20px;
  .title {
    font-weight: 500;
    font-size: 18px;
    color: $primary-color;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    .status {
      padding: 0 12px;
      height: 24px;
      line-height: 24px;
      border-radius: 2px;
      border: 1px solid #00BA92;
      color: #00BA92;
      font-weight: 400;
      font-size: 12px;
      margin-left: 10px;
    }
    .primaryColor {
      border: 1px solid rgba(63, 126, 239, .2);
      background-color: rgba(63, 126, 239, .2);
    }
    .green {
      background-color: rgba(83, 183, 148, .2);
      border: 1px solid rgba(83, 183, 148, .2);
    }
    .gray {
      color: #333333;
      background-color: rgba(128, 128, 128, .2);
      border: 1px solid rgba(128, 128, 128, .2);
    }
  }
  .list {
    display: flex;
    flex-wrap: wrap;
    /* background: #F7F7F7; */
    border-radius: 2px;
    padding: 15px 20px;
    margin-bottom: 16px;
    .item {
      width: 33.3%;
      margin-bottom: 14px;
      .la {
        color: #7f7f7f;
        margin-bottom: 6px;
      }
    }
    .item2 {
      width: 100%;
      display: flex;
      align-items: center;
      .la {
        margin-bottom: 0;
        width: 72px;
      }
    }
    .max {
      width: 100%;
    }
  }
}
</style>
admin/src/views/stock/components/InEdit.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,138 @@
<template>
  <GlobalWindow title="新建出库单" :visible.sync="isShowModal" :confirm-working="isLoading" width="900px" @close="close"
    @confirm="confirm">
    <el-form :model="param" ref="form" :rules="rules">
      <div class="df_ac">
        <el-form-item class="w3" label="出库仓库" prop="parentId">
          <el-select :disabled="param.id" v-model="param.parentId" placeholder="不填为则一级分类">
            <el-option v-for="op in dataList" :key="op.id" :label="op.name" :value="op.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="w3" label="出库日期">
          <el-date-picker type="date" v-model="param.getDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
            placeholder="请选择出库日期"></el-date-picker>
        </el-form-item>
        <el-form-item class="w3" label="出库类型" prop="parentId">
          <el-select :disabled="param.id" v-model="param.parentId" placeholder="不填为则一级分类">
            <el-option v-for="op in dataList" :key="op.id" :label="op.name" :value="op.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="w3" label="处理人" prop="name">
          <el-input v-model="param.name" v-trim />
        </el-form-item>
        <el-form-item class="w6" label="备注" prop="name">
          <el-input v-model="param.name" placeholder="请输入" v-trim />
        </el-form-item>
      </div>
    </el-form>
    <!--  -->
    <el-tabs v-model="activeName">
      <el-tab-pane label="物料信息" name="first"></el-tab-pane>
    </el-tabs>
    <el-button type="primary" @click="handleOpenMaterial">选择物料</el-button>
    <el-table :data="list" stripe>
      <el-table-column align="center" label="序号" type="index" width="50" />
      <el-table-column prop="creatorName" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column prop="categoryName" label="物料编码" show-overflow-tooltip min-width="90px"></el-table-column>
      <el-table-column prop="createDate" label="条形码" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="品牌" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="单位" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="出库数量" min-width="90px">
        <template v-slot="{row}">
          <el-input oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 11)" v-model="row.aa" class="w100"></el-input>
        </template>
      </el-table-column>
      <el-table-column prop="dealUserName" label="库存数量" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column prop="dealUserName" label="操作" min-width="60px">
        <template v-slot="scope">
          <span @click="handleDel(scope)" class="red pointer">删除</span>
        </template>
      </el-table-column>
    </el-table>
    <!--  -->
    <AssetSel v-if="isShowSel" ref="AssetSelRef" @change="changeSel" @close="isShowSel = false" />
  </GlobalWindow>
</template>
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import AssetSel from './AssetSel'
import { create, fetchCateList, getInfoById } from '@/api/business/category.js'
export default {
  name: 'OperaCategoryWindow',
  components: { GlobalWindow, AssetSel },
  data() {
    return {
      // è¡¨å•数据
      param: {},
      activeName: 'first',
      isShowModal: false,
      isShowSel: false,
      isLoading: false,
      // éªŒè¯è§„则
      rules: {
        name: [{ required: true, message: '请输入二级分类名称', trigger: 'blur' }],
      },
      list: [{}],
      dataList: [],
    }
  },
  created() {
  },
  methods: {
    confirm() {
    },
    getList() {
      fetchCateList({ type: 5 }).then(res => {
        this.dataList = res || []
      })
    },
    changeSel() {
    },
    handleDel(val) {
      const index = val.$index
      this.list.splice(index, 1)
    },
    handleOpenMaterial() {
      this.isShowSel = true
      this.$nextTick(() => {
        this.$refs.AssetSelRef.isShowModal = true
      })
    },
    close() {
      this.isShowModal = false
      this.$emit('close')
    },
    getDetail(id) {
      getInfoById(id).then(res => {
        this.param = res
      })
    },
  }
}
</script>
<style lang="scss" scoped>
.df_ac {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  .w3 {
    width: 33.3%;
    padding: 0 10px;
    box-sizing: border-box;
  }
  .w6 {
    width: 66.6%;
    padding: 0 10px;
    box-sizing: border-box;
  }
}
</style>
admin/src/views/stock/components/OutDetail.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,164 @@
<template>
  <GlobalWindow width="960px" title="出库单详情" :visible.sync="visible" :confirm-working="isWorking" @close="close"
    @confirm="confirm">
    <div class="main">
      <div class="title">
        <span>工单详情</span>
      </div>
      <div class="main_content">
        <div class="list">
          <div class="item">
            <div class="la">出库仓库</div>
            <div class="val">{{ info.projectName }}</div>
          </div>
          <div class="item">
            <div class="la">出库日期</div>
            <div class="val">{{ info.categoryName }}</div>
          </div>
          <div class="item">
            <div class="la">出库类型</div>
            <div class="val">{{ info.creatorName }}{{ info.creatorCompany ? "-" + info.creatorCompany : '' }}</div>
          </div>
          <div class="item">
            <div class="la">处理人</div>
            <div class="val">{{ info.creatorPhone || info.creatorMobile }}</div>
          </div>
          <div class="item">
            <div class="la">备注</div>
            <div class="val">{{ info.createDate }}</div>
          </div>
        </div>
      </div>
      <div class="title">物料信息</div>
      <el-table :data="list" stripe>
        <el-table-column align="center" type="index" width="55" />
        <el-table-column prop="creatorName" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="categoryName" label="物料编码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="createDate" label="条形码" show-overflow-tooltip min-width="100px"></el-table-column>
        <el-table-column prop="dealUserName" label="品牌" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="dealUserName" label="单位" show-overflow-tooltip min-width="80px"></el-table-column>
        <el-table-column prop="dealUserName" label="出库数量" show-overflow-tooltip min-width="80px"></el-table-column>
      </el-table>
    </div>
  </GlobalWindow>
</template>
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import BaseOpera from '@/components/base/BaseOpera'
import { detailById, dispatchOrder, dealOrder } from '@/api/workorder/ywWorkorder'
import { getUserList } from '@/api/system/user'
import { Message, Loading } from 'element-ui'
import dayjs from 'dayjs'
export default {
  components: {
    GlobalWindow
  },
  extends: BaseOpera,
  data() {
    return {
      id: '',
      visible: false,
      info: {},
      list: []
    }
  },
  created() {
    // this.getDetail()
  },
  methods: {
    getDetail() {
      const { id } = this
      detailById(id).then(res => {
        this.info = res
      })
    },
    close() {
      this.visible = false
      this.$emit('close')
    }
  }
}
</script>
<style lang="scss" scoped>
@import '@/assets/style/variables.scss';
.main {
  padding-top: 20px;
  .title {
    font-weight: 500;
    font-size: 18px;
    color: $primary-color;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    .status {
      padding: 0 12px;
      height: 24px;
      line-height: 24px;
      border-radius: 2px;
      border: 1px solid #00BA92;
      color: #00BA92;
      font-weight: 400;
      font-size: 12px;
      margin-left: 10px;
    }
    .primaryColor {
      border: 1px solid rgba(63, 126, 239, .2);
      background-color: rgba(63, 126, 239, .2);
    }
    .green {
      background-color: rgba(83, 183, 148, .2);
      border: 1px solid rgba(83, 183, 148, .2);
    }
    .gray {
      color: #333333;
      background-color: rgba(128, 128, 128, .2);
      border: 1px solid rgba(128, 128, 128, .2);
    }
  }
  .list {
    display: flex;
    flex-wrap: wrap;
    /* background: #F7F7F7; */
    border-radius: 2px;
    padding: 15px 20px;
    margin-bottom: 16px;
    .item {
      width: 33.3%;
      margin-bottom: 14px;
      .la {
        color: #7f7f7f;
        margin-bottom: 6px;
      }
    }
    .item2 {
      width: 100%;
      display: flex;
      align-items: center;
      .la {
        margin-bottom: 0;
        width: 72px;
      }
    }
    .max {
      width: 100%;
    }
  }
}
</style>
admin/src/views/stock/components/OutEdit.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,138 @@
<template>
  <GlobalWindow title="新建出库单" :visible.sync="isShowModal" :confirm-working="isLoading" width="900px" @close="close"
    @confirm="confirm">
    <el-form :model="param" ref="form" :rules="rules">
      <div class="df_ac">
        <el-form-item class="w3" label="出库仓库" prop="parentId">
          <el-select :disabled="param.id" v-model="param.parentId" placeholder="不填为则一级分类">
            <el-option v-for="op in dataList" :key="op.id" :label="op.name" :value="op.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="w3" label="出库日期">
          <el-date-picker type="date" v-model="param.getDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
            placeholder="请选择出库日期"></el-date-picker>
        </el-form-item>
        <el-form-item class="w3" label="出库类型" prop="parentId">
          <el-select :disabled="param.id" v-model="param.parentId" placeholder="不填为则一级分类">
            <el-option v-for="op in dataList" :key="op.id" :label="op.name" :value="op.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item class="w3" label="处理人" prop="name">
          <el-input v-model="param.name" v-trim />
        </el-form-item>
        <el-form-item class="w6" label="备注" prop="name">
          <el-input v-model="param.name" placeholder="请输入" v-trim />
        </el-form-item>
      </div>
    </el-form>
    <!--  -->
    <el-tabs v-model="activeName">
      <el-tab-pane label="物料信息" name="first"></el-tab-pane>
    </el-tabs>
    <el-button type="primary" @click="handleOpenMaterial">选择物料</el-button>
    <el-table :data="list" stripe>
      <el-table-column align="center" label="序号" type="index" width="50" />
      <el-table-column prop="creatorName" label="物料名称" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column prop="categoryName" label="物料编码" show-overflow-tooltip min-width="90px"></el-table-column>
      <el-table-column prop="createDate" label="条形码" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="品牌" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="单位" show-overflow-tooltip min-width="70px"></el-table-column>
      <el-table-column prop="dealUserName" label="出库数量" min-width="90px">
        <template v-slot="{row}">
          <el-input oninput="value=value.replace(/^(0+)|[^\d]+/g, '').slice(0, 11)" v-model="row.aa" class="w100"></el-input>
        </template>
      </el-table-column>
      <el-table-column prop="dealUserName" label="库存数量" show-overflow-tooltip min-width="80px"></el-table-column>
      <el-table-column prop="dealUserName" label="操作" min-width="60px">
        <template v-slot="scope">
          <span @click="handleDel(scope)" class="red pointer">删除</span>
        </template>
      </el-table-column>
    </el-table>
    <!--  -->
    <AssetSel v-if="isShowSel" ref="AssetSelRef" @change="changeSel" @close="isShowSel = false" />
  </GlobalWindow>
</template>
<script>
import GlobalWindow from '@/components/common/GlobalWindow'
import AssetSel from './AssetSel'
import { create, fetchCateList, getInfoById } from '@/api/business/category.js'
export default {
  name: 'OperaCategoryWindow',
  components: { GlobalWindow, AssetSel },
  data() {
    return {
      // è¡¨å•数据
      param: {},
      activeName: 'first',
      isShowModal: false,
      isShowSel: false,
      isLoading: false,
      // éªŒè¯è§„则
      rules: {
        name: [{ required: true, message: '请输入二级分类名称', trigger: 'blur' }],
      },
      list: [{}],
      dataList: [],
    }
  },
  created() {
  },
  methods: {
    confirm() {
    },
    getList() {
      fetchCateList({ type: 5 }).then(res => {
        this.dataList = res || []
      })
    },
    changeSel() {
    },
    handleDel(val) {
      const index = val.$index
      this.list.splice(index, 1)
    },
    handleOpenMaterial() {
      this.isShowSel = true
      this.$nextTick(() => {
        this.$refs.AssetSelRef.isShowModal = true
      })
    },
    close() {
      this.isShowModal = false
      this.$emit('close')
    },
    getDetail(id) {
      getInfoById(id).then(res => {
        this.param = res
      })
    },
  }
}
</script>
<style lang="scss" scoped>
.df_ac {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  .w3 {
    width: 33.3%;
    padding: 0 10px;
    box-sizing: border-box;
  }
  .w6 {
    width: 66.6%;
    padding: 0 10px;
    box-sizing: border-box;
  }
}
</style>
admin/src/views/stock/in.vue
@@ -2,7 +2,8 @@
  <div class="main_app">
    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
    <div class="mt20">
      <el-button type="primary" @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</el-button>
      <el-button type="primary" @click="handleEdit()" v-permissions="['business:ywpatrolline:create']">新建出库单</el-button>
      <el-button @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</el-button>
    </div>
    <el-table v-loading="loading" :data="list" stripe>
      <el-table-column prop="platformName" label="出库单号" min-width="120" show-overflow-tooltip />
@@ -13,20 +14,25 @@
      <el-table-column prop="param2" label="操作人" min-width="90" show-overflow-tooltip />
      <el-table-column prop="workTime" label="操作时间" min-width="140" show-overflow-tooltip />
      <el-table-column prop="workTime" label="操作" min-width="80" show-overflow-tooltip>
        <template v-slot="{row}">
          <span class="primaryColor pointer">查看详情</span>
        <template v-slot="{ row }">
          <span @click="handleDetail(row)" class="primaryColor pointer">查看详情</span>
        </template>
      </el-table-column>
    </el-table>
    <div class="mt20">
      <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
    </div>
    <!--  -->
    <InEdit v-if="isShowEdit" @close="isShowEdit = false" @success="getList" ref="InEditRef" />
    <InDetail v-if="isShowDetail" ref="InDetailRef" />
  </div>
</template>
<script>
import Pagination from '@/components/common/Pagination'
import QueryForm from '@/components/common/QueryForm'
import InEdit from './components/InEdit'
import InDetail from './components/InDetail'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration)
@@ -34,22 +40,26 @@
export default {
  components: {
    Pagination,
    QueryForm
    QueryForm,
    InEdit,
    InDetail
  },
  data() {
    return {
      loading: false,
      isShowEdit: false,
      isShowDetail: false,
      pagination: {
        pageSize: 10,
        page: 1,
        total: 0
      },
      filters: {},
      list: [],
      list: [{}],
      total: 0,
      queryFormConfig: {
        formItems: [
        {
          {
            filed: 'carCodeFront',
            type: 'input',
            label: '出库单号',
@@ -82,6 +92,18 @@
        }
      })
    },
    handleEdit() {
      this.isShowEdit = true
      this.$nextTick(() => {
        this.$refs.InEditRef.isShowModal = true
      })
    },
    handleDetail() {
      this.isShowDetail = true
      this.$nextTick(() => {
        this.$refs.InDetailRef.visible = true
      })
    },
    handleEx() { },
    getGroupList() {
      getPlatformGroupList({ queryData: 0, queryType: 0 }).then(res => {
@@ -97,6 +119,7 @@
    getList(page) {
      const { pagination, filters } = this
      this.loading = true
      if(page){pagination.page = page}
      platformLogPage({
        model: {
          ...filters,
@@ -106,7 +129,7 @@
        },
        sorts: [{ direction: 'DESC', property: 'param1' }],
        capacity: pagination.pageSize,
        page: page || pagination.page,
        page: page,
      }).then(res => {
        this.loading = false
        this.list = res.records || []
@@ -128,11 +151,10 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
</script>
<style>
</style>
<style></style>
admin/src/views/stock/out.vue
@@ -2,7 +2,8 @@
  <div class="main_app">
    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
    <div class="mt20">
      <el-button type="primary" @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</el-button>
      <el-button type="primary" @click="handleEdit()" v-permissions="['business:ywpatrolline:create']">新建出库单</el-button>
      <el-button @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</el-button>
    </div>
    <el-table v-loading="loading" :data="list" stripe>
      <el-table-column prop="platformName" label="出库单号" min-width="120" show-overflow-tooltip />
@@ -13,20 +14,25 @@
      <el-table-column prop="param2" label="操作人" min-width="90" show-overflow-tooltip />
      <el-table-column prop="workTime" label="操作时间" min-width="140" show-overflow-tooltip />
      <el-table-column prop="workTime" label="操作" min-width="80" show-overflow-tooltip>
        <template v-slot="{row}">
          <span class="primaryColor pointer">查看详情</span>
        <template v-slot="{ row }">
          <span @click="handleDetail(row)" class="primaryColor pointer">查看详情</span>
        </template>
      </el-table-column>
    </el-table>
    <div class="mt20">
      <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
    </div>
    <!--  -->
    <OutEdit v-if="isShowEdit" @close="isShowEdit = false" @success="getList" ref="OutEditRef" />
    <OutDetail v-if="isShowDetail" ref="OutDetailRef" />
  </div>
</template>
<script>
import Pagination from '@/components/common/Pagination'
import QueryForm from '@/components/common/QueryForm'
import OutEdit from './components/OutEdit'
import OutDetail from './components/OutDetail'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration)
@@ -34,22 +40,26 @@
export default {
  components: {
    Pagination,
    QueryForm
    QueryForm,
    OutEdit,
    OutDetail
  },
  data() {
    return {
      loading: false,
      isShowEdit: false,
      isShowDetail: false,
      pagination: {
        pageSize: 10,
        page: 1,
        total: 0
      },
      filters: {},
      list: [],
      list: [{}],
      total: 0,
      queryFormConfig: {
        formItems: [
        {
          {
            filed: 'carCodeFront',
            type: 'input',
            label: '出库单号',
@@ -82,6 +92,18 @@
        }
      })
    },
    handleEdit() {
      this.isShowEdit = true
      this.$nextTick(() => {
        this.$refs.OutEditRef.isShowModal = true
      })
    },
    handleDetail() {
      this.isShowDetail = true
      this.$nextTick(() => {
        this.$refs.OutDetailRef.visible = true
      })
    },
    handleEx() { },
    getGroupList() {
      getPlatformGroupList({ queryData: 0, queryType: 0 }).then(res => {
@@ -97,6 +119,7 @@
    getList(page) {
      const { pagination, filters } = this
      this.loading = true
      if(page){pagination.page = page}
      platformLogPage({
        model: {
          ...filters,
@@ -106,7 +129,7 @@
        },
        sorts: [{ direction: 'DESC', property: 'param1' }],
        capacity: pagination.pageSize,
        page: page || pagination.page,
        page: page,
      }).then(res => {
        this.loading = false
        this.list = res.records || []
@@ -128,11 +151,10 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
</script>
<style>
</style>
<style></style>
admin/src/views/stock/query.vue
@@ -2,7 +2,7 @@
  <div class="main_app">
    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" />
    <div class="mt20">
      <el-button type="primary" @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</el-button>
      <el-button @click="handleEx()" v-permissions="['business:ywpatrolline:create']">导出</el-button>
    </div>
    <el-table v-loading="loading" :data="list" stripe>
      <el-table-column prop="platformName" label="资产编码" min-width="100" show-overflow-tooltip />
@@ -124,6 +124,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
admin/src/views/stock/record.vue
@@ -142,6 +142,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
admin/src/views/system/publicMsg.vue
@@ -145,6 +145,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
admin/src/views/system/smsMessage.vue
@@ -3,8 +3,7 @@
    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear">
    </QueryForm>
    <div class="pt16 mb10">
      <el-button type="primary" @click="batchStatus(0)"
        v-permissions="['business:platformjob:update']">批量启用</el-button>
      <el-button type="primary" @click="batchStatus(0)" v-permissions="['business:platformjob:update']">批量启用</el-button>
      <el-button @click="batchStatus(1)" v-permissions="['business:platformjob:update']">批量禁用</el-button>
    </div>
    <el-table @selection-change="handleSelectionChange" class="mb20" v-loading="loading" :data="list" stripe>
@@ -15,7 +14,8 @@
      <el-table-column prop="content" label="消息模板" min-width="300" show-overflow-tooltip />
      <el-table-column label="状态" width="120" align="center" fixed="right">
        <template v-slot="scope">
          <el-switch v-permissions="['business:platformjob:update']" v-model="scope.row.status" @change="changeStatus(scope.row)" :active-value="0" :inactive-value="1">
          <el-switch v-permissions="['business:platformjob:update']" v-model="scope.row.status"
            @change="changeStatus(scope.row)" :active-value="0" :inactive-value="1">
          </el-switch>
        </template>
      </el-table-column>
@@ -145,6 +145,7 @@
    },
    handleSizeChange(capacity) {
      this.pagination.pageSize = capacity
      this.getList()
    }
  }
}
server/db/business.yw_temp_config.permissions.sql
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywtempconfig:create', '新建催缴信息配置', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywtempconfig:delete', '删除催缴信息配置', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywtempconfig:update', '修改催缴信息配置', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywtempconfig:query', '查询催缴信息配置', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywtempconfig:exportExcel', '导出催缴信息配置(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -1,7 +1,10 @@
package com.doumee.core.utils;
import cn.hutool.core.io.IoUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -9,10 +12,16 @@
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import io.swagger.models.auth.In;
import org.apache.batik.util.Platform;
import org.apache.commons.compress.archivers.zip.Zip64Mode;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
@@ -1528,4 +1537,41 @@
        }
    }
    public static void packFilesToZip(List<File> files, OutputStream os) throws IOException {
        try {
            ZipArchiveOutputStream zipOutputStream = new ZipArchiveOutputStream(os);
            zipOutputStream.setUseZip64(Zip64Mode.AsNeeded);
            for (File file : files) {
                if(!file.exists()){
                    System.out.println("===文件不存在======="+file.getPath());
                    continue;
                }else{
                    System.out.println("===文件存在======="+file.getPath());
                }
                ZipArchiveEntry entry = new ZipArchiveEntry(file.getName());
                zipOutputStream.putArchiveEntry(entry);
                FileInputStream fileInputStream = new FileInputStream(file);
                byte[] buffer = new byte[1024];
                int length;
                while ((length = fileInputStream.read(buffer)) > 0) {
                    zipOutputStream.write(buffer, 0, length);
                }
                zipOutputStream.closeArchiveEntry();
                zipOutputStream.flush();
                IoUtil.close(fileInputStream);
                file.delete();
            }
        }catch (Exception e){
            throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR.getCode(),"对不起,下载压缩文件失败");
        }finally {
            if (os != null) {
                try {
                    os.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwContractBillCloudController.java
@@ -10,6 +10,7 @@
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.model.YwContractBill;
import com.doumee.dao.business.vo.YwContractBillCallDataVO;
import com.doumee.dao.business.vo.YwContractBillDataVO;
import com.doumee.service.business.YwContractBillService;
import io.swagger.annotations.Api;
@@ -80,6 +81,16 @@
        return ApiResponse.success(ywContractBillService.findPage(pageWrap));
    }
    @ApiOperation("逾期账单")
    @PostMapping("/findPageForOverdue")
    @CloudRequiredPermission("business:ywcontractbill:query")
    public ApiResponse<PageData<YwContractBill>> findPageForOverdue (@RequestBody PageWrap<YwContractBill> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
        pageWrap.getModel().setLoginUserInfo(this.getLoginUser(token));
        return ApiResponse.success(ywContractBillService.findPageForOverdue(pageWrap));
    }
    @ApiOperation("可退款账单")
    @PostMapping("/getCanBackBill")
    @CloudRequiredPermission("business:ywcontractbill:query")
@@ -120,4 +131,12 @@
        return ApiResponse.success(ywContractBillService.getWaitDealList(contractId));
    }
    @ApiOperation("获取批量催缴数据")
    @PostMapping("/getNoticeCustomerData")
    @CloudRequiredPermission("business:ywcontractbill:query")
    public ApiResponse<List<YwContractBillCallDataVO>> getNoticeCustomerData(@RequestBody List<Integer> billIds,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
        return ApiResponse.success(ywContractBillService.getNoticeCustomerData(billIds));
    }
}
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwTempConfigCloudController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,103 @@
package com.doumee.cloud.admin;
import com.doumee.api.BaseController;
import com.doumee.core.annotation.excel.ExcelExporter;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageWrap;
import com.doumee.core.model.PageData;
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.model.YwTempConfig;
import com.doumee.dao.business.vo.YwCallTempDataVO;
import com.doumee.service.business.YwTempConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2025/01/10 09:43
 */
@Api(tags = "催缴信息配置")
@RestController
@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywTempConfig")
public class YwTempConfigCloudController extends BaseController {
    @Autowired
    private YwTempConfigService ywTempConfigService;
    @PreventRepeat
    @ApiOperation("新建")
    @PostMapping("/create")
    @RequiresPermissions("business:ywtempconfig:create")
    public ApiResponse create(@RequestBody YwTempConfig ywTempConfig) {
        return ApiResponse.success(ywTempConfigService.create(ywTempConfig));
    }
    @ApiOperation("根据ID删除")
    @GetMapping("/delete/{id}")
    @RequiresPermissions("business:ywtempconfig:delete")
    public ApiResponse deleteById(@PathVariable Integer id) {
        ywTempConfigService.deleteById(id);
        return ApiResponse.success(null);
    }
    @ApiOperation("批量删除")
    @GetMapping("/delete/batch")
    @RequiresPermissions("business:ywtempconfig:delete")
    public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
        String [] idArray = ids.split(",");
        List<Integer> idList = new ArrayList<>();
        for (String id : idArray) {
            idList.add(Integer.valueOf(id));
        }
        ywTempConfigService.deleteByIdInBatch(idList);
        return ApiResponse.success(null);
    }
    @ApiOperation("根据ID修改")
    @PostMapping("/updateById")
    @RequiresPermissions("business:ywtempconfig:update")
    public ApiResponse updateById(@RequestBody YwTempConfig ywTempConfig) {
        ywTempConfigService.updateById(ywTempConfig);
        return ApiResponse.success(null);
    }
    @ApiOperation("分页查询")
    @PostMapping("/page")
    @RequiresPermissions("business:ywtempconfig:query")
    public ApiResponse<PageData<YwTempConfig>> findPage (@RequestBody PageWrap<YwTempConfig> pageWrap) {
        return ApiResponse.success(ywTempConfigService.findPage(pageWrap));
    }
    @ApiOperation("导出Excel")
    @PostMapping("/exportExcel")
    @RequiresPermissions("business:ywtempconfig:exportExcel")
    public void exportExcel (@RequestBody PageWrap<YwTempConfig> pageWrap, HttpServletResponse response) {
        ExcelExporter.build(YwTempConfig.class).export(ywTempConfigService.findPage(pageWrap).getRecords(), "催缴信息配置", response);
    }
    @ApiOperation("根据ID查询")
    @GetMapping("/{id}")
    @RequiresPermissions("business:ywtempconfig:query")
    public ApiResponse findById(@PathVariable Integer id) {
        return ApiResponse.success(ywTempConfigService.findById(id));
    }
    @ApiOperation("根据ID查询")
    @GetMapping("/getCallTemp")
    @RequiresPermissions("business:ywtempconfig:query")
    public ApiResponse<YwCallTempDataVO> getCallTemp() {
        return ApiResponse.success(ywTempConfigService.getCallTemp());
    }
}
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/ExcelTestDemo.java
ÎļþÒÑɾ³ý
server/visits/dmvisit_service/src/main/java/com/doumee/core/excel/ExcelReplaceCommon.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,90 @@
package com.doumee.core.excel;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.model.YwTempConfig;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2025/1/3 9:11
 */
public class ExcelReplaceCommon {
//    public static void main(String[] args) {
//        modifyWordTemplate("https://bdreport.oss-cn-beijing.aliyuncs.com/xczl/20250110/temp/BE9C167EE35C40E78029C68BABBD0EAB.docx", "d://output.docx", "张三", "Java课程");
//    }
    public static String modifyWordTemplate(String templatePath, List<YwTempConfig> ywTempConfigList,String fileName) {
        try (
             XWPFDocument document = new XWPFDocument(getFileInputStream(templatePath))) {
            // æ­¤å¤„连接到后续替换步骤
            // éåŽ†æ®µè½
            for (XWPFParagraph paragraph : document.getParagraphs()) {
                for (XWPFRun run : paragraph.getRuns()) {
                    // æ›¿æ¢å ä½ç¬¦
                    String text = run.getText(0);
                    if (text != null) {
                        for (YwTempConfig ywTempConfig:ywTempConfigList
                             ) {
                            text = text.replace(ywTempConfig.getTitle(), ywTempConfig.getUrl());
                        }
                        run.setText(text, 0); // é‡æ–°è®¾ç½®æ–‡æœ¬
                    }
                }
            }
            String path = "d://"+fileName;
            try (FileOutputStream fos = new FileOutputStream(path)) {
                document.write(fos); // å°†ä¿®æ”¹åŽçš„æ–‡æ¡£å†™å…¥è¾“出流
            }
            return path;
            /*//二进制OutputStream
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            document.write(baos);//文档写入流
            //OutputStream写入InputStream二进制流
            ByteArrayInputStream in = new ByteArrayInputStream(baos.toByteArray()); */
        } catch (IOException e) {
            e.printStackTrace();
        }
        throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"文件转换异常!");
    }
    /*读取网络文件*/
    public static InputStream getFileInputStream(String path) {
        URL url = null;
        try {
            url = new URL(path);
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            //设置超时间为3秒
            conn.setConnectTimeout(3*1000);
            //防止屏蔽程序抓取而返回403错误
            conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
            //得到输入流
            return conn.getInputStream();
        } catch (Exception e) {
        }
        return null;
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwTempConfigMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
package com.doumee.dao.business;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.doumee.dao.business.model.YwTempConfig;
import com.github.yulichang.base.MPJBaseMapper;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2025/01/10 09:43
 */
public interface YwTempConfigMapper extends MPJBaseMapper<YwTempConfig> {
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/dto/YwSmsEmailBillCallDTO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.doumee.dao.business.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
 * @author Eva.Caesar Liu
 * @date 2023/02/14 11:14
 */
@Data
public class YwSmsEmailBillCallDTO implements Serializable {
    @ApiModelProperty(value = "接收人主键" )
    private Integer userId;
    @ApiModelProperty(value = "账单主键", example = "1")
    private Integer billId;
    @ApiModelProperty(value = "是否发送短息 0=否;1=是", example = "1")
    private Integer sendSms;
    @ApiModelProperty(value = "是否发送邮件 0=否;1=是", example = "1")
    private Integer sendEmail;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwContractBill.java
@@ -148,6 +148,15 @@
    @TableField(exist = false)
    private String customerName;
    @ApiModelProperty(value = "客户默认联系人", example = "1")
    @TableField(exist = false)
    private Integer customerUserId;
    @ApiModelProperty(value = "客户主键", example = "1")
    @TableField(exist = false)
    private Integer customerId;
    @ApiModelProperty(value = "公司名称", example = "1")
    @TableField(exist = false)
    private String companyName;
@@ -200,6 +209,18 @@
    @ExcelColumn(name="是否逾期",index = 9,width = 6,valueMapping = "0=未逾期;1=已逾期")
    private Integer isOverdue;
    @ApiModelProperty(value = "合同单价(元)", example = "1")
    @TableField(exist = false)
    private BigDecimal price;
    @ApiModelProperty(value = "付款周期类型 0=元每平米天;1=元每平米月;2=元每平米年;3=元每天;4=元每月;5=元每年;6=元每场;", example = "1")
    @TableField(exist = false)
    private Integer circleType;
    @ApiModelProperty(value = "条款类型 0租赁条款 1物业条款", example = "1")
    @TableField(exist = false)
    private Integer detailType;
    @ApiModelProperty(value = "附件信息", example = "1")
    @TableField(exist = false)
    private List<Multifile> multifileList;
@@ -212,4 +233,17 @@
    @TableField(exist = false)
    private List<YwContractRevenue> ywContractRevenueList;
    @ApiModelProperty(value = "租赁总面积", example = "1")
    @TableField(exist = false)
    private BigDecimal totalArea;
    @ApiModelProperty(value = "租赁支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付", example = "1")
    @TableField(exist = false)
    private Integer zlPayType;
    @ApiModelProperty(value = "物业支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付", example = "1")
    @TableField(exist = false)
    private Integer wyPayType;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwTempConfig.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,68 @@
package com.doumee.dao.business.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.doumee.core.annotation.excel.ExcelColumn;
import com.doumee.core.model.LoginUserModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
 * å‚¬ç¼´ä¿¡æ¯é…ç½®
 * @author æ±Ÿè¹„蹄
 * @date 2025/01/10 09:43
 */
@Data
@ApiModel("催缴信息配置")
@TableName("`yw_temp_config`")
public class YwTempConfig extends LoginUserModel {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键", example = "1")
    @ExcelColumn(name="主键")
    private Integer id;
    @ApiModelProperty(value = "创建人编码", example = "1")
    @ExcelColumn(name="创建人编码")
    private Integer creator;
    @ApiModelProperty(value = "创建时间")
    @ExcelColumn(name="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createDate;
    @ApiModelProperty(value = "更新人编码", example = "1")
    @ExcelColumn(name="更新人编码")
    private Integer editor;
    @ApiModelProperty(value = "更新时间")
    @ExcelColumn(name="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date editDate;
    @ApiModelProperty(value = "是否删除0否 1是", example = "1")
    @ExcelColumn(name="是否删除0否 1是")
    private Integer isdeleted;
    @ApiModelProperty(value = "备注")
    @ExcelColumn(name="备注")
    private String remark;
    @ApiModelProperty(value = "类型:0=短息模板;1=邮件模板;2=租赁通知附件;3=其他通知附件;4=账单关键字;5=合同关键字;6=其他信息;", example = "1")
    @ExcelColumn(name="类型:0=短息模板;1=邮件模板;2=租赁通知附件;3=其他通知附件;4=账单关键字;5=合同关键字;6=其他信息;")
    private Integer type;
    @ApiModelProperty(value = "标题")
    @ExcelColumn(name="标题")
    private String title;
    @ApiModelProperty(value = "文件地址 type = 2/3使用")
    @ExcelColumn(name="文件地址 type = 2/3使用")
    private String url;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/vo/YwCallTempDataVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
package com.doumee.dao.business.vo;
import com.doumee.dao.business.model.YwTempConfig;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2025/1/8 15:32
 */
@Data
public class YwCallTempDataVO {
    @ApiModelProperty(value = "短息模板", example = "1")
    private YwTempConfig smsTemp;
    @ApiModelProperty(value = "邮件信息模板", example = "1")
    private YwTempConfig emailTemp;
    @ApiModelProperty(value = "租赁通知单模板", example = "1")
    private YwTempConfig leaseTemp;
    @ApiModelProperty(value = "其他通知单模板", example = "1")
    private YwTempConfig otherTemp;
    @ApiModelProperty(value = "模板关键字 - è´¦å•", example = "1")
    private List<YwTempConfig> billTempList;
    @ApiModelProperty(value = "模板关键字 - åˆåŒ", example = "1")
    private List<YwTempConfig> contractTempList;
    @ApiModelProperty(value = "模板关键字 - å…¶ä»–", example = "1")
    private List<YwTempConfig> otherTempList;
}
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/vo/YwContractBillCallDataVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package com.doumee.dao.business.vo;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.model.YwContractBill;
import com.doumee.dao.business.model.YwCustomer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2025/1/8 15:32
 */
@Data
public class YwContractBillCallDataVO {
    @ApiModelProperty(value = "账单主键", example = "1")
    private Integer billId;
    @ApiModelProperty(value = "客户名称", example = "1")
    private String customerName;
    @ApiModelProperty(value = "默认联系人主键", example = "1")
    private Integer userId;
    @ApiModelProperty(value = "联系人列表", example = "1")
    private List<Member> memberList;
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/SmsEmailService.java
@@ -98,4 +98,10 @@
    long count(SmsEmail smsEmail);
    void sendWaitingSmsNotice();
    Integer sendBillSms(String content,String mobile,Integer billId);
    Integer sendEmail(String email,String content,Integer billId);
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwContractBillService.java
@@ -4,8 +4,10 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.YwContractBill;
import com.doumee.dao.business.vo.YwContractBillCallDataVO;
import com.doumee.dao.business.vo.YwContractBillDataVO;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@@ -91,6 +93,13 @@
    PageData<YwContractBill> findPage(PageWrap<YwContractBill> pageWrap);
    /**
     * é€¾æœŸè´¦å•分页
     * @param pageWrap
     * @return
     */
    PageData<YwContractBill> findPageForOverdue(PageWrap<YwContractBill> pageWrap);
    /**
     * æ¡ä»¶ç»Ÿè®¡
     *
     * @param ywContractBill å®žä½“对象
@@ -107,6 +116,12 @@
    List<YwContractBill> getCanBackBill(YwContractBill model);
    YwContractBillDataVO getWaitDealList(Integer contractId);
    List<YwContractBillCallDataVO> getNoticeCustomerData(List<Integer> billIds);
    void downloadCallFeeDoc(List<Integer> billIds, LoginUserInfo loginUserInfo, HttpServletResponse response);
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwTempConfigService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,101 @@
package com.doumee.service.business;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.model.YwTempConfig;
import com.doumee.dao.business.vo.YwCallTempDataVO;
import java.util.List;
/**
 * å‚¬ç¼´ä¿¡æ¯é…ç½®Service定义
 * @author æ±Ÿè¹„蹄
 * @date 2025/01/10 09:43
 */
public interface YwTempConfigService {
    /**
     * åˆ›å»º
     *
     * @param ywTempConfig å®žä½“对象
     * @return Integer
     */
    Integer create(YwTempConfig ywTempConfig);
    /**
     * ä¸»é”®åˆ é™¤
     *
     * @param id ä¸»é”®
     */
    void deleteById(Integer id);
    /**
     * åˆ é™¤
     *
     * @param ywTempConfig å®žä½“对象
     */
    void delete(YwTempConfig ywTempConfig);
    /**
     * æ‰¹é‡ä¸»é”®åˆ é™¤
     *
     * @param ids ä¸»é”®é›†
     */
    void deleteByIdInBatch(List<Integer> ids);
    /**
     * ä¸»é”®æ›´æ–°
     *
     * @param ywTempConfig å®žä½“对象
     */
    void updateById(YwTempConfig ywTempConfig);
    /**
     * æ‰¹é‡ä¸»é”®æ›´æ–°
     *
     * @param ywTempConfigs å®žä½“集
     */
    void updateByIdInBatch(List<YwTempConfig> ywTempConfigs);
    /**
     * ä¸»é”®æŸ¥è¯¢
     *
     * @param id ä¸»é”®
     * @return YwTempConfig
     */
    YwTempConfig findById(Integer id);
    /**
     * æ¡ä»¶æŸ¥è¯¢å•条记录
     *
     * @param ywTempConfig å®žä½“对象
     * @return YwTempConfig
     */
    YwTempConfig findOne(YwTempConfig ywTempConfig);
    /**
     * æ¡ä»¶æŸ¥è¯¢
     *
     * @param ywTempConfig å®žä½“对象
     * @return List<YwTempConfig>
     */
    List<YwTempConfig> findList(YwTempConfig ywTempConfig);
    /**
     * åˆ†é¡µæŸ¥è¯¢
     *
     * @param pageWrap åˆ†é¡µå¯¹è±¡
     * @return PageData<YwTempConfig>
     */
    PageData<YwTempConfig> findPage(PageWrap<YwTempConfig> pageWrap);
    /**
     * æ¡ä»¶ç»Ÿè®¡
     *
     * @param ywTempConfig å®žä½“对象
     * @return long
     */
    long count(YwTempConfig ywTempConfig);
    YwCallTempDataVO getCallTemp();
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/SmsEmailServiceImpl.java
@@ -18,6 +18,7 @@
import com.doumee.dao.system.SystemUserMapper;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.SmsEmailService;
import com.doumee.service.business.third.EmailService;
import com.doumee.service.business.third.EmayService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -579,4 +580,52 @@
        }
    }
    @Override
    public Integer sendBillSms(String content,String mobile,Integer billId) {
        if(StringUtils.isBlank(mobile)){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        boolean result=   emayService.sendSingleSms(mobile,content);
        if(!result){
            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,短信发送失败,请稍后重试!");
        }
        SmsEmail smsEmail = new SmsEmail();
        smsEmail.setIsdeleted(Constants.ZERO);
        smsEmail.setCreateDate(new Date());
        smsEmail.setStatus(Constants.ZERO);
        smsEmail.setType(Constants.ZERO);
        smsEmail.setTitle("账单催费");
        smsEmail.setObjId(billId);
        smsEmail.setObjType(Constants.ZERO+"");
        smsEmail.setContent(content);
        smsEmailMapper.insert(smsEmail);
        return smsEmail.getId();
    }
    @Autowired
    private EmailService emailService;
    @Override
    public Integer sendEmail(String email,String content,Integer billId) {
        if(StringUtils.isBlank(email)){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        boolean result=   emailService.sendEmail(email,"账单催费",content,null);
        SmsEmail smsEmail = new SmsEmail();
        smsEmail.setRemark("邮件发生成功");
        if(!result){
            smsEmail.setRemark("邮件发生失败");
        }
        smsEmail.setIsdeleted(Constants.ZERO);
        smsEmail.setCreateDate(new Date());
        smsEmail.setStatus(Constants.ONE);
        smsEmail.setType(Constants.TWO);
        smsEmail.setObjId(billId);
        smsEmail.setObjType(Constants.ONE+"");
        smsEmail.setContent(content);
        smsEmailMapper.insert(smsEmail);
        return smsEmail.getId();
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractBillServiceImpl.java
@@ -2,14 +2,18 @@
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.excel.ExcelReplaceCommon;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.*;
import com.doumee.dao.business.dto.YwSmsEmailBillCallDTO;
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.vo.YwContractBillCallDataVO;
import com.doumee.dao.business.vo.YwContractBillDataVO;
import com.doumee.dao.system.MultifileMapper;
import com.doumee.dao.system.model.Multifile;
@@ -20,13 +24,18 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.extern.java.Log;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.util.*;
import java.util.stream.Collectors;
@@ -56,6 +65,11 @@
    @Autowired
    private YwContractMapper ywContractMapper;
    @Autowired
    private MemberMapper memberMapper;
    @Autowired
    private YwTempConfigMapper ywTempConfigMapper;
    @Override
@@ -300,6 +314,10 @@
                            YwContractBill::getPayStatus,model.getPayStatus())
                    .eq(Objects.nonNull(model)&&Objects.nonNull(model.getType()),
                            YwContractBill::getType,model.getType())
                    .le(Objects.nonNull(model)&&Objects.nonNull(model.getIsOverdue())&&Constants.equalsInteger(model.getIsOverdue(),Constants.ONE),
                            YwContractBill::getPlanPayDate, DateUtil.getCurrDateTime())
                    .eq(Objects.nonNull(model)&&Objects.nonNull(model.getIsOverdue())&&Constants.equalsInteger(model.getIsOverdue(),Constants.ONE),
                            YwContractBill::getStatus, Constants.ZERO)
                    .eq(Objects.nonNull(model)&&Objects.nonNull(model.getContractId()),
                            YwContractBill::getContractId,model.getContractId())
                    .like(Objects.nonNull(model)&&StringUtils.isNotBlank(model.getContractCode()),
@@ -325,6 +343,78 @@
            }else{
                ywContractBill.setIsOverdue(Constants.ZERO);
            }
            //楼宇名称
            List<YwContractRoom> ywContractRoomList = ywContractBill.getYwContractRoomList();
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractRoomList)){
                StringBuilder roomPathName = new StringBuilder();
                for (YwContractRoom ywContractRoom:ywContractRoomList) {
                    if(StringUtils.isNotBlank(ywContractRoom.getProjectName())){
                        roomPathName.append(ywContractRoom.getProjectName()+"/");
                    }
                    if(StringUtils.isNotBlank(ywContractRoom.getBuildingName())){
                        roomPathName.append(ywContractRoom.getBuildingName()+"/");
                    }
                    if(StringUtils.isNotBlank(ywContractRoom.getFloorName())){
                        roomPathName.append(ywContractRoom.getFloorName()+"/");
                    }
                    if(StringUtils.isNotBlank(ywContractRoom.getRoomName())){
                        roomPathName.append(ywContractRoom.getRoomName());
                    }
                    if(StringUtils.isNotBlank(roomPathName)){
                        roomPathName.append(";");
                    }
                }
                ywContractBill.setRoomPathName(roomPathName.toString());
            }
        }
        return PageData.from(iPage);
    }
    /**
     * é€¾æœŸè´¦å•
     * @param pageWrap
     * @return
     */
    @Override
    public PageData<YwContractBill> findPageForOverdue(PageWrap<YwContractBill> pageWrap) {
        IPage<YwContractBill> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        MPJLambdaWrapper<YwContractBill> queryWrapper = new MPJLambdaWrapper<>();
        Utils.MP.blankToNull(pageWrap.getModel());
        YwContractBill model = pageWrap.getModel();
        IPage<YwContractBill> iPage = ywContractBillMapper.selectJoinPage(page,YwContractBill.class,
                queryWrapper.selectAll(YwContractBill.class)
                        .select(" ( select ifnull( sum( CASE WHEN t.bill_type = 0 and yw.REVENUE_TYPE = 0 THEN yw.ACT_RECEIVABLE_FEE when  t.bill_type = 0 and yw.REVENUE_TYPE = 1 then -yw.ACT_RECEIVABLE_FEE  when t.bill_type = 1 and yw.REVENUE_TYPE = 0 then -yw.ACT_RECEIVABLE_FEE else  yw.ACT_RECEIVABLE_FEE END),0) from  yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as  actReceivableFee  ")
                        .selectAs(YwContract::getCode,YwContractBill::getContractCode)
                        .selectAs(YwCustomer::getName,YwContractBill::getCustomerName)
                        .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
                        .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
                        .eq(YwContractBill::getIsdeleted,Constants.ZERO)
                        .like(Objects.nonNull(model)&&StringUtils.isNotBlank(model.getCustomerName()),
                                YwCustomer::getName,model.getCustomerName())
                        .eq(Objects.nonNull(model)&&Objects.nonNull(model.getStatus()),
                                YwContractBill::getStatus,model.getStatus())
                        .eq(Objects.nonNull(model)&&Objects.nonNull(model.getBillType()),
                                YwContractBill::getBillType,model.getBillType())
                        .eq(Objects.nonNull(model)&&Objects.nonNull(model.getPayStatus()),
                                YwContractBill::getPayStatus,model.getPayStatus())
                        .in(Objects.nonNull(model)&&Objects.nonNull(model.getPayStatus()),
                                YwContractBill::getPayStatus,Constants.ZERO,Constants.THREE,Constants.TWO,Constants.FOUR)
                        .eq(Objects.nonNull(model)&&Objects.nonNull(model.getType()),
                                YwContractBill::getType,model.getType())
                        .le(Objects.nonNull(model)&&Objects.nonNull(model.getIsOverdue())&&Constants.equalsInteger(model.getIsOverdue(),Constants.ONE),
                                YwContractBill::getPlanPayDate, DateUtil.getCurrDateTime())
                        .eq(Objects.nonNull(model)&&Objects.nonNull(model.getIsOverdue())&&Constants.equalsInteger(model.getIsOverdue(),Constants.ONE),
                                YwContractBill::getStatus, Constants.ZERO)
                        .ge(Objects.nonNull(model)&&Objects.nonNull(model.getPlanPayDateStart()),YwContractBill::getPlanPayDate, Utils.Date.getStart(model.getPlanPayDateStart()))
                        .le(Objects.nonNull(model)&&Objects.nonNull(model.getPlanPayDateEnd()),YwContractBill::getPlanPayDate, Utils.Date.getEnd(model.getPlanPayDateEnd()))
                        .orderByDesc(YwContractBill::getId));
        this.dealRoomDetail(iPage.getRecords());
        for (YwContractBill ywContractBill:iPage.getRecords()) {
            //需收金额
            ywContractBill.setNeedReceivableFee(
                    ywContractBill.getReceivableFee().subtract(ywContractBill.getActReceivableFee())
            );
            //楼宇名称
            List<YwContractRoom> ywContractRoomList = ywContractBill.getYwContractRoomList();
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractRoomList)){
@@ -542,4 +632,305 @@
    }
    @Override
    public List<YwContractBillCallDataVO> getNoticeCustomerData(List<Integer> billIds){
        List<YwContractBillCallDataVO> ywContractBillCallDataVOList = new ArrayList<>();
        List<YwContractBill> ywContractBillList = ywContractBillMapper.selectJoinList(YwContractBill.class,new MPJLambdaWrapper<YwContractBill>()
                .selectAll(YwContractBill.class)
                .selectAs(YwCustomer::getName,YwContractBill::getCustomerName)
                .selectAs(YwCustomer::getUserId,YwContractBill::getCustomerUserId)
                .selectAs(YwCustomer::getId,YwContractBill::getCustomerId)
                .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
                .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
                .in(YwContractBill::getId,billIds)
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywContractBillList) ||
            !Constants.equalsInteger(billIds.size(),ywContractBillList.size())
        ){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"账单数据错误,请刷新重试");
        }
        this.dealRoomDetail(ywContractBillList);
        for (YwContractBill ywContractBill:ywContractBillList) {
            YwContractBillCallDataVO ywContractBillCallDataVO = new YwContractBillCallDataVO();
            ywContractBillCallDataVO.setBillId(ywContractBill.getId());
            ywContractBillCallDataVO.setCustomerName(ywContractBill.getCustomerName());
            ywContractBillCallDataVO.setUserId(ywContractBill.getCustomerUserId());
            //查询客户下的所有人员
            ywContractBillCallDataVO.setMemberList(
                memberMapper.selectList(new QueryWrapper<Member>().lambda().eq(Member::getCustomerId,ywContractBill.getCustomerId())
                        .eq(Member::getIsdeleted,Constants.ZERO))
            );
            ywContractBillCallDataVOList.add(ywContractBillCallDataVO);
        }
        return ywContractBillCallDataVOList;
    }
    @Override
    public void downloadCallFeeDoc(List<Integer> billIds, LoginUserInfo loginUserInfo,HttpServletResponse response){
        try {
            List<YwContractBill> ywContractBillList = ywContractBillMapper.selectJoinList(YwContractBill.class,new MPJLambdaWrapper<YwContractBill>()
                    .selectAll(YwContractBill.class)
                    .selectAs(YwCustomer::getName,YwContractBill::getCustomerName)
                    .selectAs(YwCustomer::getUserId,YwContractBill::getCustomerUserId)
                    .selectAs(YwCustomer::getId,YwContractBill::getCustomerId)
                    .selectAs(YwContractDetail::getPrice,YwContractBill::getPrice)
                    .selectAs(YwContract::getCompanyId,YwContractBill::getCompanyId)
                    .selectAs(YwContractDetail::getCircleType,YwContractBill::getCircleType)
                    .selectAs(YwContractDetail::getType,YwContractBill::getDetailType)
                    .selectAs(YwContract::getZlPayType,YwContractBill::getZlPayType)
                    .selectAs(YwContract::getWyPayType,YwContractBill::getWyPayType)
                    .select(" ( select ifnull(sum(r.rent_area),0) from yw_room y left join yw_contract_room yr on y.id = yr.room_id where yr.contract_id = t.contract_id and y.IS_INVESTMENT = 0 and yr.type = 0 )  " , YwContractBill::getTotalArea)
                    .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
                    .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
                    .leftJoin(YwContractDetail.class,YwContractDetail::getId,YwContractBill::getDetailId)
                    .in(YwContractBill::getId,billIds)
            );
            List<YwTempConfig> ywTempConfigList = ywTempConfigMapper.selectList(new QueryWrapper<YwTempConfig>().lambda().eq(YwTempConfig::getIsdeleted,Constants.ZERO));
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywTempConfigList)){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到模板配置项,请联系管理员");
            }
            List<YwTempConfig> tempList = ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FOUR)||
                    Constants.equalsInteger(i.getType(),Constants.FIVE)||
                    Constants.equalsInteger(i.getType(),Constants.SIX)).collect(Collectors.toList());
            if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(tempList)){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到模板配置项,请联系管理员");
            }
            List<File> fileList = new ArrayList<>();
            for (YwContractBill ywContractBill:ywContractBillList) {
                this.dealTempData(tempList,ywContractBill,loginUserInfo);
                String fileName =  "催费通知单_" +ywContractBill.getCode() +"_" + System.currentTimeMillis()+".docx";
                YwTempConfig ywTempConfig = new YwTempConfig();
                if(Constants.equalsInteger(ywContractBill.getType(),Constants.ZERO)){
                    Optional<YwTempConfig> optional = ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO)).findAny();
                    if (optional.isPresent()) {
                        ywTempConfig = optional.get();
                    }
                }else{
                    Optional<YwTempConfig> optional = ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)).findAny();
                    if (optional.isPresent()) {
                        ywTempConfig = optional.get();
                    }
                }
                if(Objects.isNull(ywTempConfig)){
                    throw  new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"模板信息异常,请联系管理员");
                }
                String path = ExcelReplaceCommon.modifyWordTemplate(ywTempConfig.getUrl(),tempList,fileName);
                File f = new File(path);
                if(f !=null && f.isFile()){
                    fileList.add(f);
                }
                if(fileList == null || fileList.size() == 0){
                    throw  new BusinessException(ResponseStatus.DATA_EMPTY);
                }
            }
            String fileName =  "催费通知单-" +System.currentTimeMillis();
            String encodeFileName = URLEncoder.encode(fileName, Charset.forName("UTF-8").toString())+".zip";
            response.setHeader("Content-Disposition","attachment;filename=" + encodeFileName);
            response.setContentType("application/octet-stream");
            response.setHeader("eva-opera-type", "download");
            response.setHeader("eva-download-filename", encodeFileName);
            Constants.packFilesToZip(fileList,response.getOutputStream());
        } catch (Exception e) {
            throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR, e);
        }
    }
    public void dealTempData(List<YwTempConfig> ywTempConfigList , YwContractBill ywContractBill, LoginUserInfo loginUserInfo){
        //查询收支账号数据
        for (YwTempConfig y:ywTempConfigList) {
            if(y.getTitle().equals("${费用名称}")&&Objects.nonNull(ywContractBill.getCostType())){
                //费用类型:0=租赁费;1=物业费;2=租赁押金;3=物业押金;4=水电费;5=杂项费;6=其他; 7=保证金
                if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.ZERO)){
                    y.setUrl("租赁费");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.ONE)){
                    y.setUrl("物业费");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.TWO)){
                    y.setUrl("租赁押金");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.THREE)){
                    y.setUrl("物业押金");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.FOUR)){
                    y.setUrl("水电费");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.FIVE)){
                    y.setUrl("杂项费");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.SIX)){
                    y.setUrl("其他");
                }else if(Constants.equalsInteger(ywContractBill.getCostType(),Constants.SEVEN)){
                    y.setUrl("保证金");
                }
            }else if(y.getTitle().equals("${计费周期}")&&Objects.nonNull(ywContractBill.getDetailType())){
                if(Constants.equalsInteger(ywContractBill.getDetailType(),Constants.ZERO)){
                    //租赁支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付
                    if(Objects.nonNull(ywContractBill.getZlPayType())){
                        if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.ZERO)){
                            y.setUrl("一次性付款");
                        }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.ONE)){
                            y.setUrl("每三个月一付");
                        }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.TWO)){
                            y.setUrl("六个月一付");
                        }else if(Constants.equalsInteger(ywContractBill.getZlPayType(),Constants.THREE)){
                            y.setUrl("一年一付");
                        }
                    }
                }else{
                    //物业支付方式 0=一次性付款;1=每三个月一付;2=六个月一付;3=一年一付
                    if(Objects.nonNull(ywContractBill.getWyPayType())){
                        if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.ZERO)){
                            y.setUrl("一次性付款");
                        }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.ONE)){
                            y.setUrl("每三个月一付");
                        }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.TWO)){
                            y.setUrl("六个月一付");
                        }else if(Constants.equalsInteger(ywContractBill.getWyPayType(),Constants.THREE)){
                            y.setUrl("一年一付");
                        }
                    }
                }
            }else if(y.getTitle().equals("${单价}")&&Objects.nonNull(ywContractBill.getPrice())){
                y.setUrl(ywContractBill.getPrice().toString());
            }else if(y.getTitle().equals("${单位}")&&Objects.nonNull(ywContractBill.getCircleType())){
                //付款周期类型 0=元每平米天;1=元每平米月;2=元每平米年;3=元每天;4=元每月;5=元每年;6=元每场;
                if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ZERO)){
                    y.setUrl("元每平米天");
                }else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){
                    y.setUrl("元每平米月");
                }else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){
                    y.setUrl("元每平米年");
                } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){
                    y.setUrl("元每天");
                } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){
                    y.setUrl("元每月");
                } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){
                    y.setUrl("元每年");
                } else if(Constants.equalsInteger(ywContractBill.getCircleType(),Constants.ONE)){
                    y.setUrl("元每场");
                }
            }else if(y.getTitle().equals("${应收日期}")&&Objects.nonNull(ywContractBill.getPlanPayDate())){
                y.setUrl(DateUtil.formatDate(ywContractBill.getPlanPayDate(),"yyyy-MM-dd"));
            }else if(y.getTitle().equals("${应收金额}")&&Objects.nonNull(ywContractBill.getReceivableFee())){
                y.setUrl(ywContractBill.getReceivableFee().toString());
            }else if(y.getTitle().equals("${账单备注}")){
                if(StringUtils.isNotBlank(ywContractBill.getRemark())){
                    y.setUrl(ywContractBill.getRemark());
                }else{
                    y.setUrl("");
                }
            }else if(y.getTitle().equals("${租客名称}")&&StringUtils.isNotBlank(ywContractBill.getCustomerName())){
                y.setUrl(ywContractBill.getCustomerName());
            }else if(y.getTitle().equals("${楼宇/楼层/房源}")){
                if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractBill.getYwContractRoomList())){
                    StringBuilder roomPathName = new StringBuilder();
                    for (YwContractRoom ywContractRoom:ywContractBill.getYwContractRoomList()) {
                        if(StringUtils.isNotBlank(ywContractRoom.getProjectName())){
                            roomPathName.append(ywContractRoom.getProjectName()+"/");
                        }
                        if(StringUtils.isNotBlank(ywContractRoom.getBuildingName())){
                            roomPathName.append(ywContractRoom.getBuildingName()+"/");
                        }
                        if(StringUtils.isNotBlank(ywContractRoom.getFloorName())){
                            roomPathName.append(ywContractRoom.getFloorName()+"/");
                        }
                        if(StringUtils.isNotBlank(ywContractRoom.getRoomName())){
                            roomPathName.append(ywContractRoom.getRoomName());
                        }
                        if(StringUtils.isNotBlank(roomPathName)){
                            roomPathName.append(";");
                        }
                    }
                    y.setUrl(roomPathName.toString());
                }
            }else if(y.getTitle().equals("${租赁面积}")&&Objects.nonNull(ywContractBill.getTotalArea())){
                y.setUrl(ywContractBill.getTotalArea().toString());
            }else if(y.getTitle().equals("${所属公司账户名称}")){
                y.setUrl("所属公司账户名称");
            }else if(y.getTitle().equals("${所属公司银行账号}")){
                y.setUrl("所属公司银行账号");
            }else if(y.getTitle().equals("${所属公司开户银行}")){
                y.setUrl("所属公司开户银行");
            }else if(y.getTitle().equals("${通知单生成日期}")){
                y.setUrl(DateUtil.formatDate(new Date(),"yyyy-MM-dd"));
            }else if(y.getTitle().equals("${当前用户姓名}")){
                y.setUrl(loginUserInfo.getRealname());
            }
        }
    }
    public void sendSmsEmail(List<YwSmsEmailBillCallDTO> ywSmsEmailBillCallDTOList,LoginUserInfo loginUserInfo){
        if(CollectionUtils.isEmpty(ywSmsEmailBillCallDTOList)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        List<YwTempConfig> ywTempConfigList = ywTempConfigMapper.selectList(new QueryWrapper<YwTempConfig>().lambda().eq(YwTempConfig::getIsdeleted,Constants.ZERO));
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywTempConfigList)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到模板配置项,请联系管理员");
        }
        List<YwTempConfig> tempList = ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FOUR)||
                Constants.equalsInteger(i.getType(),Constants.FIVE)||
                Constants.equalsInteger(i.getType(),Constants.SIX)).collect(Collectors.toList());
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(tempList)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到模板配置项,请联系管理员");
        }
        for (YwSmsEmailBillCallDTO ywSmsEmailBillCallDTO:ywSmsEmailBillCallDTOList) {
            if(Objects.isNull(ywSmsEmailBillCallDTO)
            || Objects.isNull(ywSmsEmailBillCallDTO.getBillId())
                    || Objects.isNull(ywSmsEmailBillCallDTO.getUserId())
            ||Objects.isNull(ywSmsEmailBillCallDTO.getSendEmail())
                    || Objects.isNull(ywSmsEmailBillCallDTO.getSendSms())){
                throw new BusinessException(ResponseStatus.BAD_REQUEST);
            }
            YwContractBill ywContractBill = ywContractBillMapper.selectJoinOne(YwContractBill.class,new MPJLambdaWrapper<YwContractBill>()
                    .selectAll(YwContractBill.class)
                    .selectAs(YwCustomer::getName,YwContractBill::getCustomerName)
                    .selectAs(YwCustomer::getUserId,YwContractBill::getCustomerUserId)
                    .selectAs(YwCustomer::getId,YwContractBill::getCustomerId)
                    .selectAs(YwContractDetail::getPrice,YwContractBill::getPrice)
                    .selectAs(YwContract::getCompanyId,YwContractBill::getCompanyId)
                    .selectAs(YwContractDetail::getCircleType,YwContractBill::getCircleType)
                    .selectAs(YwContractDetail::getType,YwContractBill::getDetailType)
                    .selectAs(YwContract::getZlPayType,YwContractBill::getZlPayType)
                    .selectAs(YwContract::getWyPayType,YwContractBill::getWyPayType)
                    .select(" ( select ifnull(sum(r.rent_area),0) from yw_room y left join yw_contract_room yr on y.id = yr.room_id where yr.contract_id = t.contract_id and y.IS_INVESTMENT = 0 and yr.type = 0 )  " , YwContractBill::getTotalArea)
                    .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId)
                    .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId)
                    .leftJoin(YwContractDetail.class,YwContractDetail::getId,YwContractBill::getDetailId)
                    .eq(YwContractBill::getId,ywSmsEmailBillCallDTO.getBillId())
                    .last( "limit 1" )
            );
            this.dealTempData(tempList,ywContractBill,loginUserInfo);
            Member member = memberMapper.selectById(ywSmsEmailBillCallDTO.getUserId());
            if(Objects.isNull(member)){
                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"存在未查询到的人员信息");
            }
        }
        for (YwSmsEmailBillCallDTO ywSmsEmailBillCallDTO:ywSmsEmailBillCallDTOList) {
        }
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwTempConfigServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,191 @@
package com.doumee.service.business.impl;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.YwTempConfigMapper;
import com.doumee.dao.business.model.YwTempConfig;
import com.doumee.dao.business.vo.YwCallTempDataVO;
import com.doumee.service.business.YwTempConfigService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
 * å‚¬ç¼´ä¿¡æ¯é…ç½®Service实现
 * @author æ±Ÿè¹„蹄
 * @date 2025/01/10 09:43
 */
@Service
public class YwTempConfigServiceImpl implements YwTempConfigService {
    @Autowired
    private YwTempConfigMapper ywTempConfigMapper;
    @Override
    public Integer create(YwTempConfig ywTempConfig) {
        ywTempConfigMapper.insert(ywTempConfig);
        return ywTempConfig.getId();
    }
    @Override
    public void deleteById(Integer id) {
        ywTempConfigMapper.deleteById(id);
    }
    @Override
    public void delete(YwTempConfig ywTempConfig) {
        UpdateWrapper<YwTempConfig> deleteWrapper = new UpdateWrapper<>(ywTempConfig);
        ywTempConfigMapper.delete(deleteWrapper);
    }
    @Override
    public void deleteByIdInBatch(List<Integer> ids) {
        if (CollectionUtils.isEmpty(ids)) {
            return;
        }
        ywTempConfigMapper.deleteBatchIds(ids);
    }
    @Override
    public void updateById(YwTempConfig ywTempConfig) {
        ywTempConfigMapper.updateById(ywTempConfig);
    }
    @Override
    public void updateByIdInBatch(List<YwTempConfig> ywTempConfigs) {
        if (CollectionUtils.isEmpty(ywTempConfigs)) {
            return;
        }
        for (YwTempConfig ywTempConfig: ywTempConfigs) {
            this.updateById(ywTempConfig);
        }
    }
    @Override
    public YwTempConfig findById(Integer id) {
        return ywTempConfigMapper.selectById(id);
    }
    @Override
    public YwTempConfig findOne(YwTempConfig ywTempConfig) {
        QueryWrapper<YwTempConfig> wrapper = new QueryWrapper<>(ywTempConfig);
        return ywTempConfigMapper.selectOne(wrapper);
    }
    @Override
    public List<YwTempConfig> findList(YwTempConfig ywTempConfig) {
        QueryWrapper<YwTempConfig> wrapper = new QueryWrapper<>(ywTempConfig);
        return ywTempConfigMapper.selectList(wrapper);
    }
    @Override
    public PageData<YwTempConfig> findPage(PageWrap<YwTempConfig> pageWrap) {
        IPage<YwTempConfig> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        QueryWrapper<YwTempConfig> queryWrapper = new QueryWrapper<>();
        Utils.MP.blankToNull(pageWrap.getModel());
        if (pageWrap.getModel().getId() != null) {
            queryWrapper.lambda().eq(YwTempConfig::getId, pageWrap.getModel().getId());
        }
        if (pageWrap.getModel().getCreator() != null) {
            queryWrapper.lambda().eq(YwTempConfig::getCreator, pageWrap.getModel().getCreator());
        }
        if (pageWrap.getModel().getCreateDate() != null) {
            queryWrapper.lambda().ge(YwTempConfig::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
            queryWrapper.lambda().le(YwTempConfig::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
        }
        if (pageWrap.getModel().getEditor() != null) {
            queryWrapper.lambda().eq(YwTempConfig::getEditor, pageWrap.getModel().getEditor());
        }
        if (pageWrap.getModel().getEditDate() != null) {
            queryWrapper.lambda().ge(YwTempConfig::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate()));
            queryWrapper.lambda().le(YwTempConfig::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate()));
        }
        if (pageWrap.getModel().getIsdeleted() != null) {
            queryWrapper.lambda().eq(YwTempConfig::getIsdeleted, pageWrap.getModel().getIsdeleted());
        }
        if (pageWrap.getModel().getRemark() != null) {
            queryWrapper.lambda().eq(YwTempConfig::getRemark, pageWrap.getModel().getRemark());
        }
        if (pageWrap.getModel().getType() != null) {
            queryWrapper.lambda().eq(YwTempConfig::getType, pageWrap.getModel().getType());
        }
        if (pageWrap.getModel().getTitle() != null) {
            queryWrapper.lambda().eq(YwTempConfig::getTitle, pageWrap.getModel().getTitle());
        }
        if (pageWrap.getModel().getUrl() != null) {
            queryWrapper.lambda().eq(YwTempConfig::getUrl, pageWrap.getModel().getUrl());
        }
        for(PageWrap.SortData sortData: pageWrap.getSorts()) {
            if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
                queryWrapper.orderByDesc(sortData.getProperty());
            } else {
                queryWrapper.orderByAsc(sortData.getProperty());
            }
        }
        return PageData.from(ywTempConfigMapper.selectPage(page, queryWrapper));
    }
    @Override
    public long count(YwTempConfig ywTempConfig) {
        QueryWrapper<YwTempConfig> wrapper = new QueryWrapper<>(ywTempConfig);
        return ywTempConfigMapper.selectCount(wrapper);
    }
    @Override
    public YwCallTempDataVO getCallTemp(){
        YwCallTempDataVO ywCallTempDataVO = new YwCallTempDataVO();
        List<YwTempConfig> ywTempConfigList = ywTempConfigMapper.selectList(new QueryWrapper<YwTempConfig>().lambda()
                .eq(YwTempConfig::getIsdeleted, Constants.ZERO));
        Optional<YwTempConfig> smsOptional = ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),
                Constants.ZERO)).findAny();
        if (smsOptional.isPresent()) {
            ywCallTempDataVO.setSmsTemp(smsOptional.get());
        }
        Optional<YwTempConfig> emailOptional = ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),
                Constants.ONE)).findAny();
        if (emailOptional.isPresent()) {
            ywCallTempDataVO.setEmailTemp(emailOptional.get());
        }
        Optional<YwTempConfig> leaseOptional = ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),
                Constants.TWO)).findAny();
        if (leaseOptional.isPresent()) {
            ywCallTempDataVO.setLeaseTemp(leaseOptional.get());
        }
        Optional<YwTempConfig> otherOptional = ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),
                Constants.THREE)).findAny();
        if (otherOptional.isPresent()) {
            ywCallTempDataVO.setOtherTemp(otherOptional.get());
        }
        ywCallTempDataVO.setContractTempList(
                ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FIVE)).collect(Collectors.toList())
        );
        ywCallTempDataVO.setBillTempList(
                ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FOUR)).collect(Collectors.toList())
        );
        ywCallTempDataVO.setOtherTempList(
                ywTempConfigList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.SIX)).collect(Collectors.toList())
        );
        return ywCallTempDataVO;
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/third/EmailService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,47 @@
package com.doumee.service.business.third;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.io.FileSystemResource;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Service;
import javax.mail.internet.MimeMessage;
import java.io.File;
import java.util.List;
import java.util.Map;
@Service
public class EmailService {
    @Autowired
    private JavaMailSender javaMailSender;//注入JavaMailSender
    @Value("${spring.mail.username}")
    private String fromEmail;
    public boolean sendEmail(String toEmail, String title, String content, List<Map<String,Object>> fileList) {
        try {
                AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
                context.refresh();
                MimeMessage message = javaMailSender.createMimeMessage();
                MimeMessageHelper helper = new MimeMessageHelper(message, true);
                helper.setTo(toEmail);
                helper.setFrom(fromEmail);
                helper.setSubject(title);
                helper.setText(content);
                if(fileList!=null){
                    for (Map<String,Object> f : fileList){
                        // è®¾ç½®é™„ä»¶
                        helper.addAttachment((String) f.get("name"),new FileSystemResource((File) f.get("file")));
                    }
                }
            javaMailSender.send(message);
                    System.out.println("邮件发送成功!");
                    return true;
            } catch (Exception e) {
            e.printStackTrace();
                    return false;
                }
            }
    }