| | |
| | | import org.apache.ibatis.annotations.Mapper |
| | | |
| | | @Mapper |
| | | interface UserSettingMapper : MyMapper<UserSetting?> |
| | | interface UserSettingMapper : MyMapper<UserSetting?> { |
| | | |
| | | /** |
| | | * 查询行政区划最适配的配置信息 |
| | | */ |
| | | fun selectBestConfig(setting: UserSetting): UserSetting? |
| | | } |
| | |
| | | districtName = baseInfo?.biDistrictName ?: userInfo.extension1 |
| | | sceneTypeId = userInfo.extension2?.toInt() |
| | | } |
| | | val res = userSettingMapper.select(userSetting) |
| | | val res = userSettingMapper.selectBestConfig(userSetting) |
| | | |
| | | return if (res.isNotEmpty()) res[0] else null |
| | | // return if (res.isNotEmpty()) res[0] else null |
| | | return res |
| | | } |
| | | } |
| | |
| | | sceneType = it.getlScenetype(), |
| | | iconUrl = it.getlIconurl(), |
| | | realTime = it.getlRealTime(), |
| | | copy = it.getlAutoCopy() ?: false, |
| | | description = it.getlDescription(), |
| | | notRelated = it.getlNotRelatedSwitch() ?: true, |
| | | multigroup = it.getlMultiGroup() ?: false |
| | |
| | | ledgerType = type?.get(0)?.getlTypename() |
| | | ledgerFinished = true |
| | | isUpLoad = true |
| | | this.year = it.lrYear |
| | | this.month = it.lrMonth |
| | | this.day = it.lrDay |
| | | updateDate = it.lrSubmitdate |
| | | updateType = it.lrUpdatetype |
| | | fileType = it.lrEasubmitkind.toInt() |
| | |
| | | ledgerType = type?.get(0)?.getlTypename() |
| | | ledgerFinished = true |
| | | isUpLoad = true |
| | | this.year = it.lrYear |
| | | this.month = it.lrMonth |
| | | this.day = it.lrDay |
| | | updateDate = it.lrSubmitdate |
| | | updateType = it.lrUpdatetype |
| | | fileType = it.lrEasubmitkind.toInt() |
| | |
| | | } |
| | | |
| | | override fun copyLedger(userId: String, time: String, copyLedgerList: List<CopyLedgerVo>): BaseResponse<String> { |
| | | val year = time.split("-")[0] |
| | | val month = time.split("-")[1] |
| | | val year = time.split("-")[0].toIntOrNull() ?: return BaseResponse(false, "年份格式错误") |
| | | val month = time.split("-")[1].toIntOrNull() ?: return BaseResponse(false, "月份格式错误") |
| | | val date = DateUtil.StringToDate(time, DateUtil.DateStyle.YYYY_MM) |
| | | copyLedgerList.forEach { |
| | | //去重判断 |
| | |
| | | return@forEach |
| | | } |
| | | |
| | | val y = it.time?.split("-")?.get(0) ?: return@forEach |
| | | val m = it.time?.split("-")?.get(1) ?: return@forEach |
| | | val y = it.time?.split("-")?.get(0) |
| | | val m = it.time?.split("-")?.get(1) |
| | | ledgerRecordMapper.selectByExample(Example(LedgerRecord::class.java).apply { |
| | | createCriteria().andEqualTo("lrSubmitid", userId) |
| | | .andEqualTo("lsSubtypeid", it.subTypeId) |
| | | .andEqualTo("lrYear", y) |
| | | .andEqualTo("lrMonth", m) |
| | | }).forEach record@{ lr -> |
| | | orderBy("lrYear").desc() |
| | | .orderBy("lrMonth").desc() |
| | | .orderBy("lrSubmitdate").desc() |
| | | }).takeIf { list-> list.isNotEmpty() }?.get(0)?.let record@{ lr -> |
| | | //获取记录对应的文件信息 |
| | | val fileList = ledgerMediaFileMapper.selectByExample(Example(LedgerMediaFile::class.java).apply { |
| | | createCriteria().andEqualTo("lrGuid", lr.lrGuid) |
| | |
| | | sceneType = it.getlScenetype(), |
| | | iconUrl = it.getlIconurl(), |
| | | realTime = it.getlRealTime(), |
| | | copy = it.getlAutoCopy() ?: false, |
| | | description = it.getlDescription(), |
| | | notRelated = it.getlNotRelatedSwitch() ?: true, |
| | | multigroup = it.getlMultiGroup() ?: false |
| | |
| | | ledgerType = type?.get(0)?.getlTypename() |
| | | ledgerFinished = true |
| | | isUpLoad = true |
| | | this.year = it.srYear |
| | | this.month = it.srMonth |
| | | this.day = it.srDay |
| | | updateDate = it.srSubmitdate |
| | | updateType = it.srUpdatetype |
| | | fileType = it.srEasubmitkind.toInt() |
| | |
| | | ledgerType = type.getlTypename() |
| | | ledgerFinished = it != null |
| | | isUpLoad = it != null |
| | | this.year = it?.srYear |
| | | this.month = it?.srMonth |
| | | this.day = it?.srDay |
| | | updateDate = it?.srSubmitdate |
| | | updateType = it?.srUpdatetype |
| | | fileType = it?.srEasubmitkind?.toInt() |
| | |
| | | var ledgerType: String? = null, |
| | | //台账完成状态 |
| | | var ledgerFinished: Boolean = false, |
| | | //台账是否上传 |
| | | //台账是否上传(必填或选填) |
| | | var upLoad: Boolean = false, |
| | | //台账是否需要上传 |
| | | var needUpdate: Boolean = true, |
| | |
| | | var iconUrl: String? = null, |
| | | //台账是否有实时性要求,没有实时性要求的台账才可以复制 |
| | | var realTime: Boolean = false, |
| | | //台账是否可以延续历史记录复制 |
| | | var copy: Boolean = false, |
| | | //台账说明 |
| | | var description: String? = null, |
| | | //台账是否开启不涉及选项(默认开启) |
| | |
| | | //台账是否上传 |
| | | var isUpLoad: Boolean = false, |
| | | //台账更新日期 |
| | | var year: Int? = null, |
| | | var month: Byte? = null, |
| | | var day: Byte? = null, |
| | | var updateDate: Date? = null, |
| | | //台账更新类型(0部分更新(部分缺失、遗失)、1已更新、2无更新等) |
| | | var updateType: Byte? = null, |
| | |
| | | @ApiOperation("复制场景的台账") |
| | | @PostMapping("/copy") |
| | | fun copyLedger( |
| | | @RequestParam("userId") userId: String, |
| | | @RequestParam("time") time: String, |
| | | @RequestBody copyLedgerList: List<CopyLedgerVo> |
| | | @ApiParam("用户id") @RequestParam("userId") userId: String, |
| | | @ApiParam("复制的目标月份") @RequestParam("time") time: String, |
| | | @ApiParam("需要复制的源台账") @RequestBody copyLedgerList: List<CopyLedgerVo> |
| | | ) = ledgerService.copyLedger(userId, time, copyLedgerList) |
| | | |
| | | @ApiOperation("审核台账") |
| | |
| | | --> |
| | | sp_promise_content |
| | | </sql> |
| | | |
| | | <!-- 行政区划最匹配查询条件 --> |
| | | <select id="selectBestConfig" resultMap="ResultMapWithBLOBs"> |
| | | select |
| | | <include refid="Base_Column_List" />, <include refid="Blob_Column_List" /> |
| | | FROM sm_t_setting |
| | | <where> |
| | | <if test="userTypeId != null"> |
| | | AND User_Type_Id = #{userTypeId} |
| | | </if> |
| | | <if test="sceneTypeId != null"> |
| | | AND (scene_type_id = #{sceneTypeId} OR scene_type_id IS NULL) |
| | | </if> |
| | | <if test="provinceName != null"> |
| | | AND (Province_Name = #{provinceName} OR Province_Name IS NULL) |
| | | </if> |
| | | <if test="cityName != null"> |
| | | AND (City_Name = #{cityName} OR City_Name IS NULL) |
| | | </if> |
| | | <if test="districtName != null"> |
| | | AND (District_Name = #{districtName} OR District_Name IS NULL) |
| | | </if> |
| | | <if test="townName != null"> |
| | | AND (Town_Name = #{townName} OR Town_Name IS NULL) |
| | | </if> |
| | | <if test="area != null"> |
| | | AND (Area = #{area} OR Area IS NULL) |
| | | </if> |
| | | <if test="managementCompany != null"> |
| | | AND (Management_Company = #{managementCompany} OR Management_Company IS NULL) |
| | | </if> |
| | | </where> |
| | | ORDER BY |
| | | CASE |
| | | WHEN Province_Name = #{provinceName} AND City_Name = #{cityName} |
| | | AND District_Name = #{districtName} AND Town_Name = #{townName} THEN 1 |
| | | WHEN Province_Name = #{provinceName} AND City_Name = #{cityName} |
| | | AND District_Name = #{districtName} AND Town_Name IS NULL THEN 2 |
| | | WHEN Province_Name = #{provinceName} AND City_Name = #{cityName} |
| | | AND District_Name IS NULL AND Town_Name IS NULL THEN 3 |
| | | WHEN Province_Name = #{provinceName} AND City_Name IS NULL |
| | | AND District_Name IS NULL AND Town_Name IS NULL THEN 4 |
| | | END, |
| | | CASE |
| | | WHEN Area = #{area} THEN 1 |
| | | WHEN Area IS NULL THEN 2 |
| | | END, |
| | | CASE |
| | | WHEN Management_Company = #{managementCompany} THEN 1 |
| | | WHEN Management_Company IS NULL THEN 2 |
| | | END, |
| | | CASE |
| | | WHEN scene_type_id = #{sceneTypeId} THEN 1 |
| | | WHEN scene_type_id IS NULL THEN 2 |
| | | END |
| | | LIMIT 1; |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | @Test |
| | | fun foo11(){ |
| | | val s = DateUtil.getStartMonthByPeriod(5, 12) |
| | | val s = "02".toInt() |
| | | println(s) |
| | | } |
| | | } |