Browse Source

新增修改公出地点

anderx 3 years ago
parent
commit
26848950d5

+ 19 - 0
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -74,6 +74,10 @@ public class AdminReleaseApiController extends CertifyApiController{
 	@RequestMapping(value = "/updatePublicRelease", method = RequestMethod.POST)
 	public Result updatePublicRelease(InputPublicRelease in){
 		Result res = new Result();
+		if (in.getId()==null){
+			res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"编号"));
+			return res;
+		}
 		if (in.getStatus()!=3&&publicReleaseService.checkTime(in)) {
 			res.getError().add(buildError("公出时段已经被使用!","公出时段已经被使用!"));
 			return res;
@@ -82,6 +86,21 @@ public class AdminReleaseApiController extends CertifyApiController{
 		return res;
 	}
 
+	@RequestMapping(value = "/updateLocation", method = RequestMethod.POST)
+	public Result updateLocation(InputPublicRelease in){
+		Result res = new Result();
+		if (in.getId()==null){
+			res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"编号"));
+			return res;
+		}
+		if (in.getLatitude()==null&&in.getLongitude()==null&&in.getUserName()==null){
+			res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"位置"));
+			return res;
+		}
+		res.setData(publicReleaseService.updateLocation(in));
+		return res;
+	}
+
 	/**
 	 * 外出打卡、公出打卡
 	 * @return

+ 2 - 0
src/main/java/com/goafanti/weChat/service/PublicReleaseService.java

@@ -59,4 +59,6 @@ public interface PublicReleaseService {
     boolean checkdeleteAssistant(Integer id, String aid);
 
 	boolean checkaddAssistant(Integer id, String aid);
+
+    int updateLocation(InputPublicRelease in);
 }

+ 12 - 0
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -926,5 +926,17 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return false;
 	}
 
+	@Override
+	public int updateLocation(InputPublicRelease in) {
+		PublicRelease publicRelease=new PublicRelease();
+		publicRelease.setId(in.getId());
+		publicRelease.setLatitude(in.getLatitude());
+		publicRelease.setLongitude(in.getLongitude());
+		publicRelease.setUserName(in.getUserName());
+		publicRelease.setStatus(1);
+		addpublicLog(in.getId(),5,"发起公出地点修改");
+		return publicReleaseMapper.updateByPrimaryKeySelective(publicRelease);
+	}
+
 
 }

+ 5 - 5
src/main/resources/props/config_local.properties

@@ -1,12 +1,12 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20