Commit 1928ed55 authored by jianqian's avatar jianqian

BASE

parent a32aae14
......@@ -11,14 +11,7 @@ import com.zehong.system.domain.vo.TUserLocationVo;
import com.zehong.system.service.ISysUserService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
......@@ -123,7 +116,17 @@ public class TUserLocationController extends BaseController
{
return toAjax(tUserLocationService.insertTUserLocation(tUserLocation));
}
/**
* 小程序巡检员批量定位
* @param tUserLocationList
* @return
*/
@Log(title = "巡检员定位", businessType = BusinessType.INSERT)
@PostMapping(value = "/addlist")
public AjaxResult addlist(@RequestParam String tUserLocationList)
{
return toAjax(tUserLocationService.addTUserLocationList(tUserLocationList));
}
/**
* 修改巡检员定位
*/
......@@ -134,7 +137,6 @@ public class TUserLocationController extends BaseController
{
return toAjax(tUserLocationService.updateTUserLocation(tUserLocation));
}
/**
* 删除巡检员定位
*/
......
package com.zehong.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 巡检员定位对象 t_user_location
......@@ -36,7 +39,18 @@ public class TUserLocation extends BaseEntity
private String phonenumber;
private String nickName;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Override
public Date getCreateTime() {
return createTime;
}
@Override
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getNickName() {
return nickName;
}
......
......@@ -43,6 +43,7 @@ public interface TUserLocationMapper
* @return 结果
*/
public int insertTUserLocation(TUserLocation tUserLocation);
public int insertTUserLocationList(List<TUserLocation> list);
/**
* 修改巡检员定位
......
......@@ -43,6 +43,7 @@ public interface ITUserLocationService
* @return 结果
*/
public int insertTUserLocation(TUserLocation tUserLocation);
public int addTUserLocationList(String tUserLocationList);
/**
* 修改巡检员定位
......
......@@ -3,6 +3,7 @@ package com.zehong.system.service.impl;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -63,7 +64,11 @@ public class TUserLocationServiceImpl implements ITUserLocationService
tUserLocation.setCreateTime(DateUtils.getNowDate());
return tUserLocationMapper.insertTUserLocation(tUserLocation);
}
@Override
public int addTUserLocationList(String tUserLocationList){
List<TUserLocation> list =(List<TUserLocation> )JSONObject.parse(tUserLocationList);
return tUserLocationMapper.insertTUserLocationList(list);
}
/**
* 修改巡检员定位
*
......
......@@ -61,7 +61,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<insert id="insertTUserLocationList">
INSERT INTO t_user_location (user_id,longitude,latitude,create_time)
VALUES
<foreach collection="list" index="index" separator="," item="item">
(#{item.userId},
#{item.longitude},
#{item.latitude},
#{item.createTime})
</foreach>
</insert>
<update id="updateTUserLocation" parameterType="TUserLocation">
update t_user_location
<trim prefix="SET" suffixOverrides=",">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment