mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -30,6 +30,7 @@ public class AccountController {
|
||||
int count = accountService.count(searchn, search, startRow, perPage);
|
||||
|
||||
|
||||
|
||||
int pageNum = 4;//보여질 페이지 번호 수
|
||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||
|
||||
@@ -37,7 +38,7 @@ public class AccountController {
|
||||
|
||||
|
||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||
List<AccountDto> list = accountService.selectAll(searchn, search, searchn, perPage);
|
||||
List<AccountDto> list = accountService.selectAll(searchn, search, startRow, perPage);
|
||||
|
||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||
int end = begin + pageNum - 1;
|
||||
@@ -48,8 +49,9 @@ public class AccountController {
|
||||
mav.addObject("end", end);
|
||||
mav.addObject("searchn", searchn);
|
||||
mav.addObject("search", search);
|
||||
mav.addObject("page", startRow);
|
||||
mav.addObject("pageNum", pageNum);
|
||||
mav.addObject("begin", begin);
|
||||
mav.addObject("page", page);
|
||||
mav.setViewName("account/list");
|
||||
return mav;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class AuthAspect {
|
||||
String[] list = targetController.split("\\.");
|
||||
|
||||
String packageName = list[3];
|
||||
if(packageName.equals("login")) {
|
||||
if(packageName.equals("login") || packageName.equals("resetpassword")) {
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package com.no1.wms.in;
|
||||
|
||||
public class InController {
|
||||
|
||||
|
||||
}
|
||||
|
||||
5
src/main/java/com/no1/wms/in/InDto.java
Normal file
5
src/main/java/com/no1/wms/in/InDto.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.no1.wms.in;
|
||||
|
||||
public class InDto {
|
||||
|
||||
}
|
||||
5
src/main/java/com/no1/wms/in/InMapper.java
Normal file
5
src/main/java/com/no1/wms/in/InMapper.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.no1.wms.in;
|
||||
|
||||
public class InMapper {
|
||||
|
||||
}
|
||||
5
src/main/java/com/no1/wms/in/InService.java
Normal file
5
src/main/java/com/no1/wms/in/InService.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.no1.wms.in;
|
||||
|
||||
public class InService {
|
||||
|
||||
}
|
||||
@@ -34,6 +34,21 @@ public class LoginController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/pass_reset_call")
|
||||
@ResponseBody
|
||||
public String passResetCall(AccountDto dto, Gson gson)
|
||||
{
|
||||
return gson.toJson("s");
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/passreset")
|
||||
public String passReset()
|
||||
{
|
||||
return "pass_reset_call";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/login/check_password")
|
||||
@@ -55,6 +70,7 @@ public class LoginController {
|
||||
auth.put("vendor",getAuthArrayFromInt(authDto.getVendor()));
|
||||
auth.put("warehouse",getAuthArrayFromInt(authDto.getWarehouse()));
|
||||
auth.put("stock",getAuthArrayFromInt(authDto.getStock()));
|
||||
auth.put("planin",getAuthArrayFromInt(authDto.getPlanIn()));
|
||||
auth.put("in",getAuthArrayFromInt(authDto.getProductIn())); //prodcut_in
|
||||
auth.put("out",getAuthArrayFromInt(authDto.getProductOut())); //product_out
|
||||
auth.put("board",getAuthArrayFromInt(authDto.getBoard()));
|
||||
|
||||
77
src/main/java/com/no1/wms/mypage/ImgService.java
Normal file
77
src/main/java/com/no1/wms/mypage/ImgService.java
Normal file
@@ -0,0 +1,77 @@
|
||||
package com.no1.wms.mypage;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.no1.wms.excel.EgovWebUtil;
|
||||
|
||||
@Service
|
||||
public class ImgService {
|
||||
|
||||
|
||||
public void imgFileUplode(HttpServletRequest request, MultipartFile imageFile, String fileName) {
|
||||
|
||||
String storePathString = "";
|
||||
try {
|
||||
|
||||
ClassPathResource resource = new ClassPathResource("/static/img/mypage/profile");
|
||||
storePathString = resource.getFile().getAbsolutePath();
|
||||
//storePathString = System.getProperty("user.dir") + "/src/main/resources/static/img/mypage/profile";
|
||||
//System.out.println("storePathString : " + storePathString);
|
||||
//String path = ResourceUtils.getFile("classpath:static/img/mypage/profile/").toPath().toString();
|
||||
//storePathString = path;
|
||||
|
||||
//System.out.println("storePathString : " + storePathString);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
File saveFolder = new File(EgovWebUtil.filePathBlackList(storePathString));
|
||||
//폴더 없으면 생성
|
||||
if (!saveFolder.exists() || saveFolder.isFile()) {
|
||||
saveFolder.mkdirs();
|
||||
}
|
||||
// 원본 파일 이름 가져오기
|
||||
String originalFileName = imageFile.getOriginalFilename();
|
||||
// 확장자 추출
|
||||
int index = originalFileName.lastIndexOf(".");
|
||||
String fileExt = originalFileName.substring(index + 1);
|
||||
|
||||
String newFileName = fileName;
|
||||
// 저장될 파일 경로 설정
|
||||
String filePath = storePathString + File.separator + newFileName + "." + fileExt;
|
||||
|
||||
try {
|
||||
// 동일한 파일명이 존재하는지 확인하고 있다면 기존 파일 삭제
|
||||
String jpg = storePathString + File.separator + newFileName + "." + "jpg";
|
||||
String png = storePathString + File.separator + newFileName + "." + "png";
|
||||
String jpeg = storePathString + File.separator + newFileName + "." + "jpeg";
|
||||
File existingJpgFile = new File(jpg);
|
||||
File existingPngFile = new File(png);
|
||||
File existingJpegFile = new File(jpeg);
|
||||
|
||||
String imgSrc = "";
|
||||
if(existingJpgFile.exists()) {
|
||||
existingJpgFile.delete();
|
||||
}else if(existingPngFile.exists()) {
|
||||
existingPngFile.delete();
|
||||
}else if(existingJpegFile.exists()) {
|
||||
existingJpegFile.delete();
|
||||
}
|
||||
|
||||
// 이미지를 지정된 경로에 저장
|
||||
imageFile.transferTo(new File(EgovWebUtil.filePathBlackList(filePath)));
|
||||
//System.out.println("Image file saved at: " + filePath);
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
103
src/main/java/com/no1/wms/mypage/MypageController.java
Normal file
103
src/main/java/com/no1/wms/mypage/MypageController.java
Normal file
@@ -0,0 +1,103 @@
|
||||
package com.no1.wms.mypage;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.no1.wms.account.AccountDto;
|
||||
import com.no1.wms.account.AccountService;
|
||||
|
||||
@Controller
|
||||
public class MypageController {
|
||||
|
||||
@Autowired
|
||||
AccountService accountService;
|
||||
|
||||
@Autowired
|
||||
ImgService imgService;
|
||||
|
||||
@GetMapping("/mypage")
|
||||
public String mypage(Model m, HttpServletRequest request) {
|
||||
|
||||
HttpSession session = request.getSession();
|
||||
AccountDto dto = (AccountDto) session.getAttribute("userData");
|
||||
|
||||
AccountDto list = accountService.selectById(dto);
|
||||
m.addAttribute("list", list);
|
||||
|
||||
String id = list.getId();
|
||||
|
||||
ClassPathResource resource = new ClassPathResource("/static/img/mypage/profile");
|
||||
String storePathString;
|
||||
try {
|
||||
storePathString = resource.getFile().getAbsolutePath();
|
||||
String jpg = storePathString + File.separator + id + "." + "jpg";
|
||||
String png = storePathString + File.separator + id + "." + "png";
|
||||
String jpeg = storePathString + File.separator + id + "." + "jpeg";
|
||||
File existingJpgFile = new File(jpg);
|
||||
File existingPngFile = new File(png);
|
||||
File existingJpegFile = new File(jpeg);
|
||||
|
||||
String imgSrc = "";
|
||||
if(existingJpgFile.exists()) {
|
||||
imgSrc = "/resources/static/img/mypage/profile/"+ id +".jpg";
|
||||
//System.out.println("jpg");
|
||||
}else if(existingPngFile.exists()) {
|
||||
imgSrc = "/resources/static/img/mypage/profile/"+ id +".png";
|
||||
//System.out.println("png");
|
||||
}else if(existingJpegFile.exists()) {
|
||||
imgSrc = "/resources/static/img/mypage/profile/"+ id +".jpeg";
|
||||
//System.out.println("jpeg");
|
||||
}else {
|
||||
imgSrc = "/resources/static/img/mypage/profile/defaultimg.png";
|
||||
//System.out.println("default");
|
||||
}
|
||||
m.addAttribute("imgSrc", imgSrc);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return "mypage/mypage";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PutMapping("/mypage/updateUserInfo")
|
||||
public boolean updateUserInfo(AccountDto dto) {
|
||||
int i = accountService.update(dto);
|
||||
System.out.println(i);
|
||||
if (i == 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/mypage/uplodeImg")
|
||||
public String imgFileUplode(HttpServletRequest request, MultipartFile file) {
|
||||
//System.out.println(file);
|
||||
HttpSession session = request.getSession();
|
||||
AccountDto dto = (AccountDto) session.getAttribute("userData");
|
||||
String fileName = dto.getId();
|
||||
//System.out.println(fileName);
|
||||
imgService.imgFileUplode(request, file, fileName);
|
||||
|
||||
return "redirect:/mypage";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
56
src/main/java/com/no1/wms/planin/PlanInController.java
Normal file
56
src/main/java/com/no1/wms/planin/PlanInController.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package com.no1.wms.planin;
|
||||
|
||||
import com.no1.wms.account.AccountDto;
|
||||
import com.no1.wms.planin.PlanInService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("planin")
|
||||
public class PlanInController {
|
||||
@Autowired
|
||||
PlanInService planinservice;
|
||||
|
||||
@GetMapping("/list")
|
||||
public ModelAndView list(ModelAndView mav,@RequestParam(defaultValue = "0") int searchn, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "1") int page){
|
||||
int perPage = 10;
|
||||
int startRow = (page - 1) * perPage;
|
||||
int count = planinservice.count(searchn, search, startRow, perPage);
|
||||
|
||||
|
||||
|
||||
int pageNum = 4;//보여질 페이지 번호 수
|
||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||
|
||||
|
||||
|
||||
|
||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||
List<AccountDto> list = planinservice.selectAll(searchn, search, startRow, perPage);
|
||||
|
||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||
int end = begin + pageNum - 1;
|
||||
if (end > totalPages) {
|
||||
end = totalPages;
|
||||
}
|
||||
mav.addObject("list", list);
|
||||
mav.addObject("end", end);
|
||||
mav.addObject("searchn", searchn);
|
||||
mav.addObject("search", search);
|
||||
mav.addObject("pageNum", pageNum);
|
||||
mav.addObject("begin", begin);
|
||||
mav.addObject("page", page);
|
||||
mav.setViewName("account/list");
|
||||
return mav;
|
||||
}
|
||||
|
||||
}
|
||||
5
src/main/java/com/no1/wms/planin/PlanInDto.java
Normal file
5
src/main/java/com/no1/wms/planin/PlanInDto.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.no1.wms.planin;
|
||||
|
||||
public class PlanInDto {
|
||||
|
||||
}
|
||||
18
src/main/java/com/no1/wms/planin/PlanInMapper.java
Normal file
18
src/main/java/com/no1/wms/planin/PlanInMapper.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.no1.wms.planin;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.no1.wms.account.AccountDto;
|
||||
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface PlanInMapper {
|
||||
|
||||
List<AccountDto> selectAll(Map<String, Object> m);
|
||||
|
||||
int count(Map<String, Object> m);
|
||||
}
|
||||
37
src/main/java/com/no1/wms/planin/PlanInService.java
Normal file
37
src/main/java/com/no1/wms/planin/PlanInService.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.no1.wms.planin;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.no1.wms.account.AccountDto;
|
||||
|
||||
@Service
|
||||
public class PlanInService {
|
||||
@Autowired
|
||||
PlanInMapper mapper;
|
||||
|
||||
public List<AccountDto> selectAll(int searchn, String search, int start, int perPage){
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("search", search);
|
||||
map.put("start", start);
|
||||
map.put("perPage", perPage);
|
||||
map.put("searchn", searchn);
|
||||
|
||||
|
||||
|
||||
return mapper.selectAll(map);
|
||||
}
|
||||
|
||||
|
||||
int count(int searchn, String search, int start, int perPage){
|
||||
HashMap<String, Object> m = new HashMap<>();
|
||||
m.put("searchn", searchn);
|
||||
m.put("search", search);
|
||||
m.put("start", start);
|
||||
m.put("perPage", perPage);
|
||||
return mapper.count(m);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.no1.wms.resetpassword;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/resetpassword")
|
||||
public class ResetPasswordController {
|
||||
|
||||
|
||||
@Autowired
|
||||
ResetPasswordService resetPasswordService;
|
||||
|
||||
@PostMapping("/insert")
|
||||
@ResponseBody
|
||||
public String insert(ResetPasswordDto dto, Gson gson){
|
||||
resetPasswordService.insert(dto);
|
||||
|
||||
return gson.toJson("s");
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@ResponseBody
|
||||
public String delete(ResetPasswordDto dto, Gson gson){
|
||||
resetPasswordService.delete(dto);
|
||||
|
||||
return gson.toJson("s");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.no1.wms.resetpassword;
|
||||
|
||||
import com.no1.wms.account.AccountDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Alias("ResetPasswordDto")
|
||||
public class ResetPasswordDto {
|
||||
String id;
|
||||
String accountId;
|
||||
String note;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
Date date;
|
||||
|
||||
AccountDto accountDto;
|
||||
String employeeNumber;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.no1.wms.resetpassword;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface ResetPasswordMapper {
|
||||
|
||||
void insert(ResetPasswordDto dto);
|
||||
|
||||
void delete(ResetPasswordDto dto);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.no1.wms.resetpassword;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ResetPasswordService {
|
||||
|
||||
@Autowired
|
||||
ResetPasswordMapper mapper;
|
||||
|
||||
void insert(ResetPasswordDto dto){
|
||||
mapper.insert(dto);
|
||||
}
|
||||
|
||||
void delete(ResetPasswordDto dto){
|
||||
mapper.delete(dto);
|
||||
}
|
||||
}
|
||||
@@ -65,8 +65,8 @@
|
||||
from account acc join authority auth join authority auth2 on acc.personal_authority_id = auth.id and acc.group_authority_id = auth2.id
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 1"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
order by acc.id desc limit #{start}, #{perPage}
|
||||
@@ -140,6 +140,9 @@
|
||||
<update id="delete" parameterType="accountDto">
|
||||
update account SET activation = false WHERE id = #{id}
|
||||
</update>
|
||||
<update id="passReset" parameterType="accountDto">
|
||||
update account SET password = #{password} WHERE employee_number = #{employeeNumber}
|
||||
</update>
|
||||
|
||||
<select id="count" parameterType="map" resultType="java.lang.Integer">
|
||||
select count(*) from ( SELECT 1 from account
|
||||
@@ -149,6 +152,6 @@
|
||||
<when test="searchn == 0"> activation = 1 and employee_number like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
order by id desc limit #{start}, #{perPage} ) t
|
||||
) t
|
||||
</select>
|
||||
</mapper>
|
||||
116
src/main/resources/mappers/PlainInMapper.xml
Normal file
116
src/main/resources/mappers/PlainInMapper.xml
Normal file
@@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTO Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.no1.wms.planin.PlanInMapper">
|
||||
<resultMap id="planInResultMap" type="planInDto">
|
||||
<id column="group_number" property="groupNumber"/>
|
||||
<id column="product_id" property="productId" />
|
||||
<result column="quantity" property="quantity"/>
|
||||
<result column="date" property="date"/>
|
||||
<result column="vendor_id" property="vendorId"/>
|
||||
<result column="manager_id" property="managerId"/>
|
||||
<result column="warehouse_id" property="warehouseId"/>
|
||||
<result column="qr_hash" property="qrHash"/>
|
||||
<result column="url" property="url"/>
|
||||
<result column="clear" property="clear"/>
|
||||
<result column="vendor_date" property="vendorDate" />
|
||||
<result column="other" property="other" />
|
||||
<result column="activation" property="activation" />
|
||||
<result column="view_group_number" property="viewGroupNumber" />
|
||||
<association property="productDto" javaType="productDto">
|
||||
<id column="product.id" property="id" />
|
||||
<result column="product.name" property="name" />
|
||||
</association>
|
||||
<association property="accountDto" javaType="accountDto">
|
||||
<id column="acc.id" property="id" />
|
||||
<result column="acc.name" property="name" />
|
||||
</association>
|
||||
<association property="vendorDto" javaType="vendorDto">
|
||||
<id column="vendor.id" property="id" />
|
||||
<result column="vendor.name" property="name" />
|
||||
</association>
|
||||
<association property="warehouseDto" javaType="warehouseDto">
|
||||
<id column="warehouse.id" property="id" />
|
||||
<result column="warehouse.name" property="name" />
|
||||
</association>
|
||||
</resultMap>
|
||||
<select id="selectById" resultMap="planInResultMap" parameterType="planInDto">
|
||||
SELECT
|
||||
plan.group_number, plan.product_id, plan.quantity, plan.date, plan.vendor_id, plan.manager_id,
|
||||
plan.warehouse_id, plan.qr_hash, plan.url, plan.clear, plan.vendor_date, plan.other, plan.activation, plan.view_group_number,
|
||||
product.id, product.name, acc.id, acc.name, vendor.id, vendor.name, warehouse.id, warehouse.name
|
||||
from plan_In plan join account acc join vendor join warehouse join product
|
||||
on plan.product_id = product.id and plan.vendor_id = vendor.id and plan.manager_id = acc.id
|
||||
and plan.warehouse_id = warehouse.id
|
||||
where plan.group_number = #{groupNumber} and plan.product_id = #{productId}
|
||||
</select>
|
||||
<select id="selectAll" resultMap="planInResultMap" parameterType="map">
|
||||
SELECT
|
||||
plan.group_number, plan.product_id, plan.quantity, plan.date, plan.vendor_id, plan.manager_id,
|
||||
plan.warehouse_id, plan.qr_hash, plan.url, plan.clear, plan.vendor_date, plan.other, plan.activation, plan.view_group_number,
|
||||
product.id, product.name, acc.id, acc.name, vendor.id, vendor.name, warehouse.id, warehouse.name
|
||||
from plan_In plan join account acc join vendor join warehouse join product
|
||||
on plan.product_id = product.id and plan.vendor_id = vendor.id and plan.manager_id = acc.id
|
||||
and plan.warehouse_id = warehouse.id
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 1"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
order by acc.id desc limit #{start}, #{perPage}
|
||||
|
||||
</select>
|
||||
<insert id="insert" parameterType="planInDto">
|
||||
insert into plan_In
|
||||
(
|
||||
group_number, product_id, quantity, date,
|
||||
vendor_id, manager_id, warehouse_id, qr_hash,
|
||||
url, clear, vendor_date, other, activation, view_group_number
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
UUID(), #{productId}, #{quantity},
|
||||
#{date}, #{vendorId},
|
||||
#{managerId},#{warehouseId},#{qrHash},
|
||||
#{url},#{clear}, #{vendor_date},
|
||||
#{other},#{activation}, (select MAX(c.group_number)+1 as cnt
|
||||
from ( select group_number,MAX(group_number) from plan_In group by group_number ) as c)
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="update" parameterType="planInDto">
|
||||
update plan_In SET
|
||||
quantity = #{quantity},
|
||||
date = #{date},
|
||||
vendor_id = #{vendorId},
|
||||
manager_id = #{managerId},
|
||||
warehouse_id = #{warehouseId},
|
||||
qr_hash = #{qrHash},
|
||||
url = #{url},
|
||||
clear = #{clear},
|
||||
vendor_date = #{vendorDate},
|
||||
other = #{other},
|
||||
activation = #{activation},
|
||||
product_id = #{productId}
|
||||
WHERE group_number = #{groupNumber} and product_id = #{oldProductId}
|
||||
</update>
|
||||
|
||||
<update id="delete" parameterType="planInDto">
|
||||
update plan_In SET activation = false WHERE group_number = #{groupNumber}
|
||||
</update>
|
||||
<update id="deleteProduct" parameterType="planInDto">
|
||||
update plan_In SET activation = false WHERE group_number = #{groupNumber} and product_id = #{productId}
|
||||
</update>
|
||||
<select id="count" parameterType="map" resultType="java.lang.Integer">
|
||||
select count(*) from ( SELECT 1 from plan_In
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 1"> activation = 1 and name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> activation = 1 and employee_number like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
) t
|
||||
</select>
|
||||
</mapper>
|
||||
42
src/main/resources/mappers/ResetPasswordMapper.xml
Normal file
42
src/main/resources/mappers/ResetPasswordMapper.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTO Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.no1.wms.resetpassword.ResetPasswordMapper">
|
||||
<resultMap id="resetPasswordResultMap" type="resetPasswordDto">
|
||||
<id column="id" property="id"/>
|
||||
<result column="account_id" property="accountId"/>
|
||||
<result column="date" property="date"/>
|
||||
<result column="note" property="note"/>
|
||||
<association property="accountDto" javaType="accountDto">
|
||||
<id column="acc.id" property="id" />
|
||||
<result column="acc.name" property="name" />
|
||||
</association>
|
||||
</resultMap>
|
||||
<insert id="insert" parameterType="resetPasswordDto">
|
||||
insert into reset_password
|
||||
(
|
||||
id, account_id, note, date
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
UUID(), (SELECT id from account where employee_number = #{employeeNumber} ), #{note}, NOW()
|
||||
)
|
||||
</insert>
|
||||
<select id="selectAll" resultMap="resetPasswordResultMap" parameterType="map">
|
||||
SELECT
|
||||
id, account_id, note, date, acc.id, acc.name
|
||||
from reset_password rs join account acc on rs.account_id = acc.id
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 1"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
order by acc.id desc limit #{start}, #{perPage}
|
||||
|
||||
</select>
|
||||
<delete id="delete" parameterType="resetPasswordDto">
|
||||
delete from reset_password WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
3
src/main/resources/static/css/account.css
Normal file
3
src/main/resources/static/css/account.css
Normal file
@@ -0,0 +1,3 @@
|
||||
tbody tr{
|
||||
cursor: pointer;
|
||||
}
|
||||
BIN
src/main/resources/static/img/mypage/profile/defaultimg.png
Normal file
BIN
src/main/resources/static/img/mypage/profile/defaultimg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
@@ -1,7 +1,7 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<!-- 이 안에 내용 복사해서 jsp에 붙여넣기 -->
|
||||
<link rel="stylesheet" href="authority.css">
|
||||
<link rel="stylesheet" href="/resources/static/css/account.css">
|
||||
<script>
|
||||
/*
|
||||
yes no 모달의 확인 버튼을 누를때 재정의할 function
|
||||
@@ -57,14 +57,20 @@
|
||||
$form.trigger("submit");
|
||||
}
|
||||
|
||||
function goCreate(){
|
||||
const $form = $("<form method='post' action='/account/create'></form> ");
|
||||
$(".att").after($form);
|
||||
$form.trigger("submit");
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<div class="container-fluid">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="mt-5 mb-5 text-center">
|
||||
<h1>계정 관리</h1><form method="post" action="/account/create"><button class="btn btn-primary" type="submit" id="btn_create">생성</button></form>
|
||||
<h1>계정 관리</h1>
|
||||
</div>
|
||||
<div>
|
||||
<hr>
|
||||
@@ -72,60 +78,56 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="search" align="center">
|
||||
<form id="search_form">
|
||||
<select name="searchn">
|
||||
<option <c:if test="${searchn == 0}">selected="selected"</c:if> value="0">사번</option>
|
||||
<option <c:if test="${searchn == 1}">selected="selected"</c:if> value="1">사원명</option>
|
||||
</select>
|
||||
<input type="text" name="search" maxlength="50" value="${search}"/>
|
||||
<button type="submit" class="btn btn-primary" >검색</button>
|
||||
<input id="pPage" hidden type="text" name="page">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table" >
|
||||
<thead class="table-dark">
|
||||
<tr><th>사번</th><th>사용자 명</th><th>활성 여부</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${list }" var="dto" varStatus="status">
|
||||
<tr class="group_tr" data-mingu = "111" data-tid="${dto.id}">
|
||||
<td>${dto.employeeNumber}</td>
|
||||
<td>${dto.name}</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${dto.activation}">O</c:when>
|
||||
<c:otherwise>X</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="page" align="center">
|
||||
<c:if test="${begin > pageNum }">
|
||||
<a data-p='${begin-1 }' href="#" onclick="onPaging(this)">[<]</a>
|
||||
</c:if>
|
||||
<c:forEach begin="${begin }" end="${end}" var="i">
|
||||
<a data-p='${i}' href="#" onclick="onPaging(this)" >${i}</a>
|
||||
</c:forEach>
|
||||
<c:if test="${end < totalPages }">
|
||||
<a data-p='${end+1}' href="#" onclick="onPaging(this)">[>]</a>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 att">
|
||||
<form class="d-inline" id="search_form">
|
||||
<select name="searchn">
|
||||
<option <c:if test="${searchn == 0}">selected="selected"</c:if> value="0">사번</option>
|
||||
<option <c:if test="${searchn == 1}">selected="selected"</c:if> value="1">사원명</option>
|
||||
</select>
|
||||
<input type="text" name="search" maxlength="50" value="${search}"/>
|
||||
<button type="submit" class="btn btn-primary" >검색</button>
|
||||
<input id="pPage" hidden type="text" name="page">
|
||||
</form>
|
||||
<button style="float: right;" class="btn btn-primary" type="submit" id="btn_create" onclick="goCreate() ">생성</button>
|
||||
|
||||
</div>
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-12 m-0">
|
||||
<table class="table" >
|
||||
<thead class="table-dark">
|
||||
<tr><th>사번</th><th>사용자 명</th><th>활성 여부</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${list }" var="dto" varStatus="status">
|
||||
<tr class="group_tr" data-mingu = "111" data-tid="${dto.id}">
|
||||
<td>${dto.employeeNumber}</td>
|
||||
<td>${dto.name}</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${dto.activation}">O</c:when>
|
||||
<c:otherwise>X</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="page">
|
||||
<ul class="pagination justify-content-center">
|
||||
<c:if test="${begin > pageNum }">
|
||||
<li class="page-item"><a class="page-link" data-p='${begin-1 }' href="#" onclick="onPaging(this)">[<]</a></li>
|
||||
</c:if>
|
||||
<c:forEach begin="${begin }" end="${end}" var="i" varStatus="status">
|
||||
<li class="page-item <c:if test="${page eq status.count}">active</c:if> "><a class="page-link" data-p='${i}' href="#" onclick="onPaging(this)" >${i}</a></li>
|
||||
</c:forEach>
|
||||
<c:if test="${end < totalPages }">
|
||||
<li class="page-item"><a class="page-link" data-p='${end+1}' href="#" onclick="onPaging(this)">[>]</a></li>
|
||||
</c:if>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<div class="col-12">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="col-12">
|
||||
<!-- 탭 부분 -->
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
@@ -81,21 +81,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<div id="div_group_search" class="text-end">
|
||||
<input id="search_group_input" type="text" class="w-60 d-inline form-control" placeholder="검색">
|
||||
<button id="search_group_btn" type="button" class="btn btn-primary" onclick="onSearch(false)">검색</button>
|
||||
</div>
|
||||
<div id="div_personal_search" class="text-end">
|
||||
<select name="search_select" class="form-select d-inline">
|
||||
<option selected value="10">10</option>
|
||||
<option value="20">20</option>
|
||||
<option value="30">30</option>
|
||||
</select>
|
||||
<input id="search_personal_input" type="text" class="w-60 d-inline form-control" placeholder="검색">
|
||||
<button id="search_personal_btn" type="button" class="btn btn-primary" onclick="onSearch(true)">검색</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link d-flex align-items-center gap-2" href="#">
|
||||
<a class="nav-link d-flex align-items-center gap-2" href="/mypage">
|
||||
<div class="text-center">
|
||||
<img class="img-user" src="https://academy.ilwoo.org/data/file/reference/3531300541_J1gHPmC6_479f762b4825515abc781b3a616929d8949ea2c5.jpg" alt="유저 이미지">
|
||||
<br>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
<div class="checkbox mb-3">
|
||||
<label>
|
||||
<a href="/">비밀번호를 잊으셨나요?</a>
|
||||
<a href="/passreset">비밀번호를 잊으셨나요?</a>
|
||||
</label>
|
||||
</div>
|
||||
<button class="w-100 btn btn-lg btn-primary" type="button" onclick="onLogin()">로그인</button>
|
||||
|
||||
79
src/main/webapp/WEB-INF/views/modal/pass_reset_call.jsp
Normal file
79
src/main/webapp/WEB-INF/views/modal/pass_reset_call.jsp
Normal file
@@ -0,0 +1,79 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
||||
<script src="https://unpkg.com/feather-icons"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>No1 WMS</title>
|
||||
<style>
|
||||
.form-signin {
|
||||
width: 100%;
|
||||
max-width: 330px;
|
||||
padding: 15px;
|
||||
margin: auto;
|
||||
}
|
||||
body{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body class="text-center">
|
||||
<script>
|
||||
function onPassReset(){
|
||||
const data={};
|
||||
data.employeeNumber=$("#employ_number").val();
|
||||
data.note=$("#note").val();
|
||||
$.ajax({
|
||||
type: 'post', // 타입 (get, post, put 등등)
|
||||
url: '/resetpassword/insert', // 요청할 서버url
|
||||
dataType: 'json', // 데이터 타입 (html, xml, json, text 등등)
|
||||
data: data,
|
||||
success: function (result) { // 결과 성공 콜백함수
|
||||
if (result === 's') {
|
||||
alert("패스워드 초기화 요청이 완료되었습니다");
|
||||
window.location.href = "/login";
|
||||
}else if(result === 'f'){
|
||||
alert("요청에 실패하였습니다")
|
||||
}
|
||||
},
|
||||
error: function (request, status, error) {
|
||||
alert(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<main class="form-signin">
|
||||
<img class="mb-4" src="/docs/5.0/assets/brand/bootstrap-logo.svg" alt="" width="72" height="57">
|
||||
<h1 class="h3 mb-3 fw-normal">비밀번호 초기화 요청</h1>
|
||||
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" required class="form-control" id="employ_number" name="employeeNumber" placeholder="사번">
|
||||
<label for="employ_number">사번</label>
|
||||
|
||||
</div>
|
||||
<div class="form-floating mb-3">
|
||||
|
||||
|
||||
<textarea class="form-control w-100" name="note" id="note" placeholder="사유를 적으세요" required></textarea>
|
||||
<label for="note" class="form-label">사유</label>
|
||||
</div>
|
||||
<button class="w-100 btn btn-lg btn-primary" type="button" onclick="onPassReset()">초기화 요청</button>
|
||||
<p class="mt-5 mb-3 text-muted">© 2023–2024</p>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
207
src/main/webapp/WEB-INF/views/mypage/mypage.jsp
Normal file
207
src/main/webapp/WEB-INF/views/mypage/mypage.jsp
Normal file
@@ -0,0 +1,207 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Insert title here</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="mt-5 mb-5 text-center">
|
||||
<h1 style="color: green;" >마이페이지</h1>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-4" style="text-align: center;">
|
||||
<img alt="Default Image" src="${imgSrc}" width="200" />
|
||||
<!-- <img alt="Default Image" src="/resources/static/img/mypage/profile/${list.id}.png" width="200" /> -->
|
||||
<!-- -->
|
||||
<hr>
|
||||
<p><b>
|
||||
<span style="color: #6E6ED7; font-size: 20px;">${list.positionDto.name } </span>
|
||||
<span style="font-size: 20px;">${list.name}</span>
|
||||
</b></p>
|
||||
<br>
|
||||
<!-- -->
|
||||
<form method="post" action="/mypage/uplodeImg" enctype="multipart/form-data" class="form-horizontal">
|
||||
<div class="col-centered">
|
||||
<table id="datatable-scroller" class="table table-bordered tbl_Form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="active" style="text-align:right"><label class="control-label" for="">프로필사진 업로드</label></th>
|
||||
<td>
|
||||
<input type="file" name="file" id="file" accept=".jpg, .jpeg, .png" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-centered">
|
||||
|
||||
<button type="submit" class="btn btn-danger" id="uploadImg">프로필 사진 수정</button>
|
||||
|
||||
</div>
|
||||
</form><!-- uplodeImgForm -->
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-8">
|
||||
<form id="userInfoForm" action="/updateUserInfo" method="post">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="name" class="col-md-2 col-form-label">이름</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" id="name" name="name" value="${list.name}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="employeeNumber" class="col-md-2 col-form-label">사원 번호</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" id="employeeNumber" name="employeeNumber" value="${list.employeeNumber}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-md-2 col-form-label">비밀번호</label>
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" id="password" name="password" value="${list.password}">
|
||||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-md-2 col-form-label">이메일주소</label>
|
||||
<div class="col-md-6">
|
||||
<input type="email" class="form-control" id="email" name="email" value="${list.email }">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="gender" class="col-md-2 col-form-label">성별</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" id="gender" name="gender" value="${list.gender }">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="birth" class="col-md-2 col-form-label">생일</label>
|
||||
<div class="col-md-6">
|
||||
<fmt:formatDate value="${list.birth}" pattern="yyyy-MM-dd" type="date" var="formattedDate" />
|
||||
<input type="date" class="form-control" id="birth" name="birth" value="${formattedDate}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="telephone" class="col-md-2 col-form-label">전화번호</label>
|
||||
<div class="col-md-6">
|
||||
<input type="tel" class="form-control" id="telephone" name="telephone" value="${list.telephone }">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="address" class="col-md-2 col-form-label">주소</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" id="address" name="address" value="${list.address }">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="department" class="col-md-2 col-form-label">부서</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" id="department" name="department" value="${list.departmentDto.name }" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="position" class="col-md-2 col-form-label">직책</label>
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" id="position" name="position" value="${list.positionDto.name }" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<hr style="width: 700px;">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-6 text-end">
|
||||
<button type="button" id="submitBtn" class="btn btn-primary">저장</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="id" name="id" value="${list.id }">
|
||||
<input type="hidden" id="personalAuthorityId" name="personalAuthorityId" value="${list.personalAuthorityId }">
|
||||
<input type="hidden" id="groupAuthorityId" name="groupAuthorityId" value="${list.groupAuthorityId }">
|
||||
<input type="hidden" id="positionId" name="positionId" value="${list.positionId }">
|
||||
<input type="hidden" id="departmentId" name="departmentId" value="${list.departmentId }">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#submitBtn").on("click",function(){
|
||||
//
|
||||
var name = $("#name").val();
|
||||
var employeeNumber = $("#employeeNumber").val();
|
||||
var email = $("#email").val();
|
||||
var personalAuthorityId = $("#personalAuthorityId").val();
|
||||
var gender = $("#gender").val();
|
||||
var birth = $("#birth").val();
|
||||
var telephone = $("#telephone").val();
|
||||
var address = $("#address").val();
|
||||
var departmentId = $("#departmentId").val();
|
||||
var positionId = $("#positionId").val();
|
||||
var id = $("#id").val();
|
||||
var activation = true;
|
||||
|
||||
const data = { name : name,
|
||||
employeeNumber : employeeNumber,
|
||||
email : email,
|
||||
personalAuthorityId : personalAuthorityId,
|
||||
gender : gender,
|
||||
birth : birth,
|
||||
telephone : telephone,
|
||||
address : address,
|
||||
departmentId : departmentId,
|
||||
positionId : positionId,
|
||||
id : id,
|
||||
activation : activation,
|
||||
};
|
||||
$.ajax({
|
||||
type : 'put', // 타입 (get, post, put 등등)
|
||||
url : '/mypage/updateUserInfo', // 요청할 서버url
|
||||
dataType : 'json', // 데이터 타입 (html, xml, json, text 등등)
|
||||
data : data
|
||||
}).done(function(data) {
|
||||
console.log(data)//true
|
||||
if (data == true) {
|
||||
alert("개인정보가 변경되었습니다.");
|
||||
$(location).attr("href", "/mypage");
|
||||
|
||||
} else {
|
||||
alert("개인정보 변경에 실패했습니다.");
|
||||
}
|
||||
}).fail(function() {
|
||||
alert("오류가 발생했습니다.");
|
||||
}).always(function() {
|
||||
//
|
||||
});
|
||||
|
||||
//
|
||||
});//submitBtn
|
||||
});//ready
|
||||
function _onSubmit(){
|
||||
if($("#file").val() == ""){
|
||||
alert("이미지 파일을 업로드해주세요.");
|
||||
$("#file").focus();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user