From b6d1acb0c319e60fc4c03ed2fdd19be16440e2de Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 24 May 2024 09:29:17 +0800
Subject: [PATCH] E呼即办优化

---
 src/main/java/org/springblade/modules/eCallEventTwo/service/IECallEventTwoService.java          |    2 ++
 src/main/java/org/springblade/modules/eCallEventTwo/entity/ECallEventTwoEntity.java             |   20 +++++++++++++++-----
 src/main/java/org/springblade/modules/eCallEventTwo/mapper/EcCallEventTwoMapper.xml             |    1 +
 src/main/java/org/springblade/modules/eCallEventTwo/controller/ECallEventTwoController.java     |   10 ++++++----
 src/main/java/org/springblade/modules/eCallEventTwo/vo/ECallEventTwoVO.java                     |    4 ++++
 src/main/java/org/springblade/modules/eCallEventTwo/service/impl/EcCallEventTwoServiceImpl.java |   14 +++++++++++++-
 6 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/springblade/modules/eCallEventTwo/controller/ECallEventTwoController.java b/src/main/java/org/springblade/modules/eCallEventTwo/controller/ECallEventTwoController.java
index cd8635f..1acfadd 100644
--- a/src/main/java/org/springblade/modules/eCallEventTwo/controller/ECallEventTwoController.java
+++ b/src/main/java/org/springblade/modules/eCallEventTwo/controller/ECallEventTwoController.java
@@ -26,6 +26,7 @@
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+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.*;
@@ -88,8 +89,9 @@
 	@PostMapping("/save")
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增", notes = "传入eCallEventTwo")
-	public R save(@Valid @RequestBody ECallEventTwoEntity eCallEventTwo) {
-		return R.status(eCallEventTwoService.save(eCallEventTwo));
+	public R save(@Valid @RequestBody ECallEventTwoVO eCallEventTwo) {
+		eCallEventTwo.setCreateUserId(AuthUtil.getUserId());
+		return R.status(eCallEventTwoService.saveTwo(eCallEventTwo));
 	}
 
 	/**
@@ -108,8 +110,8 @@
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入eCallEventTwo")
-	public R submit(@Valid @RequestBody ECallEventTwoEntity eCallEventTwo) {
-		return R.status(eCallEventTwoService.saveOrUpdate(eCallEventTwo));
+	public R submit(@Valid @RequestBody ECallEventTwoVO eCallEventTwo) {
+		return R.status(eCallEventTwoService.saveTwo(eCallEventTwo));
 	}
 
 	/**
diff --git a/src/main/java/org/springblade/modules/eCallEventTwo/entity/ECallEventTwoEntity.java b/src/main/java/org/springblade/modules/eCallEventTwo/entity/ECallEventTwoEntity.java
index b50ff3d..bb5f8f3 100644
--- a/src/main/java/org/springblade/modules/eCallEventTwo/entity/ECallEventTwoEntity.java
+++ b/src/main/java/org/springblade/modules/eCallEventTwo/entity/ECallEventTwoEntity.java
@@ -16,16 +16,14 @@
  */
 package org.springblade.modules.eCallEventTwo.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.EqualsAndHashCode;
 import org.springblade.core.tenant.mp.TenantEntity;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -44,7 +42,7 @@
 
 	/** 工单ID */
 	@ApiModelProperty(value = "主键ID", example = "")
-	@TableId(value = "order_id", type = IdType.AUTO)
+	@TableId(value = "order_id", type = IdType.ASSIGN_ID)
 	private Long orderId;
 
 	/** 工单号/话务单号 */
@@ -263,4 +261,16 @@
 	@TableField("tag_redo")
 	private String tagRedo;
 
+	@ApiModelProperty(value = "创建人", example = "")
+	@TableField("create_user_id")
+	private Long createUserId;
+
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	@TableField(value = "create_time",fill = FieldFill.INSERT)
+	private Date createTime;
+
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	@TableField(value = "update_time",fill = FieldFill.UPDATE)
+	private Date updateTime;
+
 }
diff --git a/src/main/java/org/springblade/modules/eCallEventTwo/mapper/EcCallEventTwoMapper.xml b/src/main/java/org/springblade/modules/eCallEventTwo/mapper/EcCallEventTwoMapper.xml
index 6a976e1..1236bf0 100644
--- a/src/main/java/org/springblade/modules/eCallEventTwo/mapper/EcCallEventTwoMapper.xml
+++ b/src/main/java/org/springblade/modules/eCallEventTwo/mapper/EcCallEventTwoMapper.xml
@@ -55,6 +55,7 @@
             <if test="eCallEventTwo.tagChkTel != null  and eCallEventTwo.tagChkTel != ''"> and tag_chk_tel = #{eCallEventTwo.tagChkTel}</if>
             <if test="eCallEventTwo.tagRedo != null  and eCallEventTwo.tagRedo != ''"> and tag_redo = #{eCallEventTwo.tagRedo}</if>
         </where>
+        order by order_id desc
     </select>
 
 
diff --git a/src/main/java/org/springblade/modules/eCallEventTwo/service/IECallEventTwoService.java b/src/main/java/org/springblade/modules/eCallEventTwo/service/IECallEventTwoService.java
index 9ba1dc5..c4b583c 100644
--- a/src/main/java/org/springblade/modules/eCallEventTwo/service/IECallEventTwoService.java
+++ b/src/main/java/org/springblade/modules/eCallEventTwo/service/IECallEventTwoService.java
@@ -57,4 +57,6 @@
 	 * @return 工单集合
 	 */
 	public List<ECallEventTwoDTO> selectECallEventTwoList(ECallEventTwoDTO eCallEventTwoDTO);
+
+	boolean saveTwo(ECallEventTwoVO eCallEventTwo);
 }
diff --git a/src/main/java/org/springblade/modules/eCallEventTwo/service/impl/EcCallEventTwoServiceImpl.java b/src/main/java/org/springblade/modules/eCallEventTwo/service/impl/EcCallEventTwoServiceImpl.java
index 73f8a7e..19fc215 100644
--- a/src/main/java/org/springblade/modules/eCallEventTwo/service/impl/EcCallEventTwoServiceImpl.java
+++ b/src/main/java/org/springblade/modules/eCallEventTwo/service/impl/EcCallEventTwoServiceImpl.java
@@ -18,6 +18,7 @@
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.common.param.GridSet;
 import org.springblade.modules.eCallEventTwo.dto.ECallEventTwoDTO;
 import org.springblade.modules.eCallEventTwo.entity.ECallEventTwoEntity;
 import org.springblade.modules.eCallEventTwo.mapper.EcCallEventTwoMapper;
@@ -65,5 +66,16 @@
 		return this.baseMapper.selectECallEventTwoList(eCallEventTwoDTO);
 	}
 
-
+	@Override
+	public boolean saveTwo(ECallEventTwoVO eCallEventTwo) {
+		eCallEventTwo.setLat(eCallEventTwo.getSceneGeoLat().toString());
+		eCallEventTwo.setLng(eCallEventTwo.getSceneGeoLng().toString());
+		// 计算网格
+		if (eCallEventTwo.getLng() != null && eCallEventTwo.getLat() != null) {
+			// 点落面计算警格,网格,警格
+			GridSet invoke = new GridSet().invoke(ECallEventTwoVO.class, eCallEventTwo,
+				"lng", "lat", "applicantGrid", "jwGridCode");
+		}
+		return save(eCallEventTwo);
+	}
 }
diff --git a/src/main/java/org/springblade/modules/eCallEventTwo/vo/ECallEventTwoVO.java b/src/main/java/org/springblade/modules/eCallEventTwo/vo/ECallEventTwoVO.java
index 9b42bc3..55fce70 100644
--- a/src/main/java/org/springblade/modules/eCallEventTwo/vo/ECallEventTwoVO.java
+++ b/src/main/java/org/springblade/modules/eCallEventTwo/vo/ECallEventTwoVO.java
@@ -32,4 +32,8 @@
 public class ECallEventTwoVO extends ECallEventTwoEntity {
 	private static final long serialVersionUID = 1L;
 
+	private String lng;
+	private String lat;
+	private String jwGridCode;
+
 }

--
Gitblit v1.9.3