Browse Source

相关修改

huangjn 2 years ago
parent
commit
13408b76d4

+ 16 - 16
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/ConstructionLedgerVO.java

@@ -1,25 +1,11 @@
-/*
- *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are met:
- *
- *  Redistributions of source code must retain the above copyright notice,
- *  this list of conditions and the following disclaimer.
- *  Redistributions in binary form must reproduce the above copyright
- *  notice, this list of conditions and the following disclaimer in the
- *  documentation and/or other materials provided with the distribution.
- *  Neither the name of the dreamlu.net developer nor the names of its
- *  contributors may be used to endorse or promote products derived from
- *  this software without specific prior written permission.
- *  Author: Chill 庄骞 (smallchill@163.com)
- */
 package org.springblade.business.vo;
 
 import org.springblade.business.entity.ConstructionLedger;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.List;
+
 /**
  * 视图实体类
  *
@@ -31,4 +17,18 @@ import lombok.EqualsAndHashCode;
 public class ConstructionLedgerVO extends ConstructionLedger {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 施工开始时间
+	 */
+	private String siteStartTimeStr;
+	/**
+	 * 施工结束时间
+	 */
+	private String siteEndTimeStr;
+
+	/**
+	 * 节点ID集合,多用于点击上级节点时查询其下级节点
+	 */
+	private List<String> wbsIds;
+
 }

+ 10 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/ImageClassificationConfigVO.java

@@ -31,4 +31,14 @@ import lombok.EqualsAndHashCode;
 public class ImageClassificationConfigVO extends ImageClassificationConfig {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * image_classification_show表 is_show
+	 */
+	private Integer isShow;
+
+	/**
+	 * image_classification_show表 ID
+	 */
+	private Long showId;
+
 }

+ 38 - 48
blade-service/blade-business/src/main/java/org/springblade/business/controller/ConstructionLedgerController.java

@@ -1,19 +1,3 @@
-/*
- *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are met:
- *
- *  Redistributions of source code must retain the above copyright notice,
- *  this list of conditions and the following disclaimer.
- *  Redistributions in binary form must reproduce the above copyright
- *  notice, this list of conditions and the following disclaimer in the
- *  documentation and/or other materials provided with the distribution.
- *  Neither the name of the dreamlu.net developer nor the names of its
- *  contributors may be used to endorse or promote products derived from
- *  this software without specific prior written permission.
- *  Author: Chill 庄骞 (smallchill@163.com)
- */
 package org.springblade.business.controller;
 
 import io.swagger.annotations.Api;
@@ -22,9 +6,10 @@ import io.swagger.annotations.ApiParam;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
 import javax.validation.Valid;
-
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springframework.web.bind.annotation.*;
@@ -36,16 +21,18 @@ import org.springblade.business.wrapper.ConstructionLedgerWrapper;
 import org.springblade.business.service.IConstructionLedgerService;
 import org.springblade.core.boot.ctrl.BladeController;
 
+import java.util.Date;
+
 /**
- *  控制器
+ *  施工台账控制器
  *
  * @author BladeX
  * @since 2022-05-23
  */
 @RestController
 @AllArgsConstructor
-@RequestMapping("/constructionledger")
-@Api(value = "", tags = "接口")
+@RequestMapping("/constructionLedger")
+@Api(tags = "施工台账接口")
 public class ConstructionLedgerController extends BladeController {
 
 	private final IConstructionLedgerService constructionLedgerService;
@@ -55,9 +42,9 @@ public class ConstructionLedgerController extends BladeController {
 	 */
 	@GetMapping("/detail")
 	@ApiOperationSupport(order = 1)
-	@ApiOperation(value = "详情", notes = "传入constructionLedger")
-	public R<ConstructionLedgerVO> detail(ConstructionLedger constructionLedger) {
-		ConstructionLedger detail = constructionLedgerService.getOne(Condition.getQueryWrapper(constructionLedger));
+	@ApiOperation(value = "详情", notes = "传入id")
+	public R<ConstructionLedgerVO> detail(@RequestParam String id) {
+		ConstructionLedger detail = this.constructionLedgerService.getById(id);
 		return R.data(ConstructionLedgerWrapper.build().entityVO(detail));
 	}
 
@@ -66,21 +53,20 @@ public class ConstructionLedgerController extends BladeController {
 	 */
 	@GetMapping("/list")
 	@ApiOperationSupport(order = 2)
-	@ApiOperation(value = "分页", notes = "传入constructionLedger")
+	@ApiOperation(value = "分页(不建议)", notes = "传入constructionLedger")
 	public R<IPage<ConstructionLedgerVO>> list(ConstructionLedger constructionLedger, Query query) {
-		IPage<ConstructionLedger> pages = constructionLedgerService.page(Condition.getPage(query), Condition.getQueryWrapper(constructionLedger));
+		IPage<ConstructionLedger> pages = this.constructionLedgerService.page(Condition.getPage(query), Condition.getQueryWrapper(constructionLedger));
 		return R.data(ConstructionLedgerWrapper.build().pageVO(pages));
 	}
 
-
 	/**
 	 * 自定义分页 
 	 */
 	@GetMapping("/page")
 	@ApiOperationSupport(order = 3)
-	@ApiOperation(value = "分页", notes = "传入constructionLedger")
+	@ApiOperation(value = "分页(建议)", notes = "传入constructionLedger")
 	public R<IPage<ConstructionLedgerVO>> page(ConstructionLedgerVO constructionLedger, Query query) {
-		IPage<ConstructionLedgerVO> pages = constructionLedgerService.selectConstructionLedgerPage(Condition.getPage(query), constructionLedger);
+		IPage<ConstructionLedgerVO> pages = this.constructionLedgerService.selectConstructionLedgerPage(Condition.getPage(query), constructionLedger);
 		return R.data(pages);
 	}
 
@@ -89,9 +75,10 @@ public class ConstructionLedgerController extends BladeController {
 	 */
 	@PostMapping("/save")
 	@ApiOperationSupport(order = 4)
-	@ApiOperation(value = "新增", notes = "传入constructionLedger")
-	public R save(@Valid @RequestBody ConstructionLedger constructionLedger) {
-		return R.status(constructionLedgerService.save(constructionLedger));
+	@ApiOperation(value = "新增(不需要)", notes = "传入constructionLedger")
+	public R<Boolean> save(@Valid @RequestBody ConstructionLedger constructionLedger) {
+		setUserData(constructionLedger, true);
+		return R.status(this.constructionLedgerService.save(constructionLedger));
 	}
 
 	/**
@@ -100,30 +87,33 @@ public class ConstructionLedgerController extends BladeController {
 	@PostMapping("/update")
 	@ApiOperationSupport(order = 5)
 	@ApiOperation(value = "修改", notes = "传入constructionLedger")
-	public R update(@Valid @RequestBody ConstructionLedger constructionLedger) {
-		return R.status(constructionLedgerService.updateById(constructionLedger));
-	}
-
-	/**
-	 * 新增或修改 
-	 */
-	@PostMapping("/submit")
-	@ApiOperationSupport(order = 6)
-	@ApiOperation(value = "新增或修改", notes = "传入constructionLedger")
-	public R submit(@Valid @RequestBody ConstructionLedger constructionLedger) {
-		return R.status(constructionLedgerService.saveOrUpdate(constructionLedger));
+	public R<Boolean> update(@Valid @RequestBody ConstructionLedger constructionLedger) {
+		setUserData(constructionLedger, false);
+		return R.status(this.constructionLedgerService.updateById(constructionLedger));
 	}
 
-	
 	/**
 	 * 删除 
 	 */
 	@PostMapping("/remove")
-	@ApiOperationSupport(order = 7)
+	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "逻辑删除", notes = "传入ids")
-	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(constructionLedgerService.deleteLogic(Func.toLongList(ids)));
+	public R<Boolean> remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(this.constructionLedgerService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	//设置登录用户信息
+	private void setUserData(ConstructionLedger constructionLedger, boolean isCreate){
+		//获取当前登录人
+		BladeUser user = AuthUtil.getUser();
+		//记录操作人信息
+		if(isCreate){
+			constructionLedger.setCreateUser(user.getUserId());
+			constructionLedger.setCreateDept(Long.parseLong(user.getDeptId()));
+		} else {
+			constructionLedger.setUpdateUser(user.getUserId());
+			constructionLedger.setUpdateTime(new Date());
+		}
 	}
 
-	
 }

+ 7 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/WeatherController.java

@@ -32,10 +32,10 @@ import java.util.Map;
 @RestController
 @AllArgsConstructor
 @RequestMapping(value = "weather")
-@Api(value = "", tags = "天气台账接口")
+@Api(tags = "天气台账接口")
 public class WeatherController {
 
-    private WeatherInfoService weatherInfoService;
+    private final WeatherInfoService weatherInfoService;
 
     /**
      * 单个或批量删除天气台账
@@ -82,6 +82,11 @@ public class WeatherController {
     @ApiOperation(value = "天气台账列表分页", notes = "传入WeatherInfo")
     public R<IPage<WeatherInfo>> queryWeatherPage(WeatherInfoVo vo,Query query){
         Map<String,Object> weatherMap = new HashMap<>();
+
+        //todo 目前缺少合同段所在区域的地图编号及ID,所以暂时写死区域数据ID,之后修改为接口获取
+        weatherMap.put("contractAreaId", "12332112345678");
+        //todo ==================================================
+
         if(StringUtils.isNotEmpty(vo.getRecordTime())){
             weatherMap.put("recordTime", vo.getRecordTime());
         }

+ 13 - 4
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ConstructionLedgerMapper.java

@@ -21,6 +21,7 @@ import org.springblade.business.vo.ConstructionLedgerVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import java.util.List;
+import org.apache.ibatis.annotations.Param;
 
 /**
  *  Mapper 接口
@@ -33,10 +34,18 @@ public interface ConstructionLedgerMapper extends BaseMapper<ConstructionLedger>
 	/**
 	 * 自定义分页
 	 *
-	 * @param page
-	 * @param constructionLedger
-	 * @return
+	 * @param current 分页信息
+	 * @param size 分页信息
+	 * @param constructionLedger 参数
+	 * @return 结果
 	 */
-	List<ConstructionLedgerVO> selectConstructionLedgerPage(IPage page, ConstructionLedgerVO constructionLedger);
+	List<ConstructionLedgerVO> selectConstructionLedgerPage(@Param("current") long current,@Param("size") long size, @Param("param") ConstructionLedgerVO constructionLedger);
+
+	/**
+	 * 根据ID修改部分信息
+	 * @param constructionLedger 参数
+	 * @return 修改结果
+	 */
+	Integer updateByIdNotAll(@Param("param") ConstructionLedger constructionLedger);
 
 }

+ 48 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ConstructionLedgerMapper.xml

@@ -27,7 +27,54 @@
 
 
     <select id="selectConstructionLedgerPage" resultMap="constructionLedgerResultMap">
-        select * from u_construction_ledger where is_deleted = 0
+        select
+            id,
+            station,
+            site,
+            site_start_time,
+            site_end_time,
+            detection_start_time,
+            detection_end_time,
+            design_volume,
+            actual_volume,
+            is_beton
+        from u_construction_ledger
+        where
+            is_deleted = 0
+        <if test="param.wbsIds != null and param.wbsIds.size > 0">
+            and wbs_id in
+            <foreach collection="param.wbsIds" item="wbsId" open="(" separator="," close=")">#{wbsId}</foreach>
+        </if>
+        <if test="param.siteStartTimeStr != null and param.siteEndTimeStr">
+            and site_start_time between #{param.siteStartTimeStr} and #{param.siteEndTimeStr}
+        </if>
+        limit ${current},${size}
     </select>
 
+    <update id="updateByIdNotAll">
+        update u_construction_ledger set is_deleted = 0
+        <if test="param.siteStartTime != null">
+            ,site_start_time = #{param.siteStartTime}
+        </if>
+        <if test="param.siteEndTime != null">
+            ,site_end_time = #{param.siteEndTime}
+        </if>
+        <if test="param.detectionStartTime != null">
+            ,detection_start_time = #{param.detectionStartTime}
+        </if>
+        <if test="param.detectionEndTime != null">
+            ,detection_end_time = #{param.detectionEndTime}
+        </if>
+        <if test="param.designVolume != null and param.designVolume != ''">
+            ,design_volume = #{param.designVolume}
+        </if>
+        <if test="param.actualVolume != null and param.actualVolume != ''">
+            ,actual_volume = #{param.actualVolume}
+        </if>
+        <if test="param.updateUser != null and param.updateUser != null">
+            ,update_user = #{param.updateUser},update_time = #{param.updateTime}
+        </if>
+        where id = #{param.id}
+    </update>
+
 </mapper>

+ 10 - 19
blade-service/blade-business/src/main/java/org/springblade/business/service/IConstructionLedgerService.java

@@ -1,19 +1,3 @@
-/*
- *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are met:
- *
- *  Redistributions of source code must retain the above copyright notice,
- *  this list of conditions and the following disclaimer.
- *  Redistributions in binary form must reproduce the above copyright
- *  notice, this list of conditions and the following disclaimer in the
- *  documentation and/or other materials provided with the distribution.
- *  Neither the name of the dreamlu.net developer nor the names of its
- *  contributors may be used to endorse or promote products derived from
- *  this software without specific prior written permission.
- *  Author: Chill 庄骞 (smallchill@163.com)
- */
 package org.springblade.business.service;
 
 import org.springblade.business.entity.ConstructionLedger;
@@ -32,10 +16,17 @@ public interface IConstructionLedgerService extends BaseService<ConstructionLedg
 	/**
 	 * 自定义分页
 	 *
-	 * @param page
-	 * @param constructionLedger
-	 * @return
+	 * @param page 分页信息
+	 * @param constructionLedger 查询参数
+	 * @return 结果集合
 	 */
 	IPage<ConstructionLedgerVO> selectConstructionLedgerPage(IPage<ConstructionLedgerVO> page, ConstructionLedgerVO constructionLedger);
 
+	/**
+	 * 根据ID修改信息
+	 * @param constructionLedger 参数
+	 * @return 修改结果
+	 */
+	boolean updateById(ConstructionLedger constructionLedger);
+
 }

+ 13 - 17
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ConstructionLedgerServiceImpl.java

@@ -1,19 +1,3 @@
-/*
- *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
- *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are met:
- *
- *  Redistributions of source code must retain the above copyright notice,
- *  this list of conditions and the following disclaimer.
- *  Redistributions in binary form must reproduce the above copyright
- *  notice, this list of conditions and the following disclaimer in the
- *  documentation and/or other materials provided with the distribution.
- *  Neither the name of the dreamlu.net developer nor the names of its
- *  contributors may be used to endorse or promote products derived from
- *  this software without specific prior written permission.
- *  Author: Chill 庄骞 (smallchill@163.com)
- */
 package org.springblade.business.service.impl;
 
 import org.springblade.business.entity.ConstructionLedger;
@@ -35,7 +19,19 @@ public class ConstructionLedgerServiceImpl extends BaseServiceImpl<ConstructionL
 
 	@Override
 	public IPage<ConstructionLedgerVO> selectConstructionLedgerPage(IPage<ConstructionLedgerVO> page, ConstructionLedgerVO constructionLedger) {
-		return page.setRecords(baseMapper.selectConstructionLedgerPage(page, constructionLedger));
+		//当前页面数据
+		long current = (page.getCurrent() - 1L) * page.getSize();
+		return page.setRecords(this.baseMapper.selectConstructionLedgerPage(current, page.getSize(), constructionLedger));
+	}
+
+	/**
+	 * 根据ID修改信息(部分)
+	 * @param constructionLedger 参数
+	 * @return 修改结果
+	 */
+	public boolean updateById(ConstructionLedger constructionLedger){
+		Integer result = this.baseMapper.updateByIdNotAll(constructionLedger);
+		return result != null && result > 0;
 	}
 
 }

+ 2 - 2
blade-service/blade-business/src/main/java/sql/u_construction_ledger.sql

@@ -23,8 +23,8 @@ SET FOREIGN_KEY_CHECKS = 0;
 DROP TABLE IF EXISTS `u_construction_ledger`;
 CREATE TABLE `u_construction_ledger`  (
   `id` bigint(64) NOT NULL COMMENT '主键',
-  `station` varchar(0) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '施工桩号',
-  `site` varchar(0) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '施工部位',
+  `station` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '施工桩号',
+  `site` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '施工部位',
   `site_start_time` datetime NULL DEFAULT NULL COMMENT '施工开始时间',
   `site_end_time` datetime NULL DEFAULT NULL COMMENT '施工结束时间',
   `detection_start_time` datetime NULL DEFAULT NULL COMMENT '检测开始时间',