zhitong.yu
2024-10-11 4f58a93c95ff123d51adcb8fa2e521333e8ab022
src/main/java/com/hxzk/controller/PergatherController.java
@@ -4,9 +4,11 @@
import com.hxzk.pojo.TbAchor;
import com.hxzk.pojo.TbPergather;
import com.hxzk.pojo.TbSystemOperationLog;
import com.hxzk.pojo.TbUser;
import com.hxzk.service.PergatherService;
import com.hxzk.service.SystemLogService;
import com.hxzk.udp.Udp_Out;
import com.hxzk.util.SessionManager;
import com.hxzk.util.result;
import com.hxzk.util.resultutil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -15,6 +17,7 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.SimpleDateFormat;
@@ -28,7 +31,8 @@
    PergatherService pergatherService;
    @Autowired
    SystemLogService systemLogService;
    @Autowired
    SessionManager sessionManager;
    @GetMapping("findPerAll")
    public List<TbPergather> findperAll(){
        return pergatherService.findAll();
@@ -40,14 +44,13 @@
        return resultutil.returnSuccess(cz.getTotal(), cz.getList());
    }
    @PostMapping("upPersonJuJi")
    public void upPersonJuJi(TbPergather pergather, HttpServletResponse response) throws IOException {
    public void upPersonJuJi(TbPergather pergather, HttpServletResponse response, HttpServletRequest request) throws IOException {
        TbUser user = sessionManager.getCurrentUser(request);
        String upds = "BSTOCS1,ALTERGATHER,"+pergather.getName()+","+pergather.getPernum()+","+pergather.getTypec2()+","+pergather.getRedius()+","+pergather.getShichang()+","+pergather.getWeixianpin()+",END";
        Udp_Out.udp_to_cs(upds);
        TbSystemOperationLog systemOperationLog = new TbSystemOperationLog();
        systemOperationLog.setName(UserController.username);
        systemOperationLog.setTime(gettime());
        systemOperationLog.setContent("修改了聚集设置该围栏名称是:"+pergather.getName());
        systemLogService.insertSystem(systemOperationLog);
        String content = "修改了人员聚集设置该围栏名称是:"+pergather.getName();
        String contentew = "Изменено название ограждения::"+pergather.getName();
        SystemLogController.InsertSystemLog(user.getUsername(),gettime(),content,contentew);
        response.sendRedirect("/hxzkuwb/HouTai/WeiLanList/PersonJuji.jsp");
    }