上传文件至 src/main/java/co/jp/mamol/myapp/service
This commit is contained in:
@ -0,0 +1,55 @@
|
|||||||
|
package co.jp.mamol.myapp.service;
|
||||||
|
|
||||||
|
import co.jp.mamol.myapp.model.SizaiModel;
|
||||||
|
import co.jp.mamol.myapp.repository.BuyApprovalRepository;
|
||||||
|
import co.jp.mamol.myapp.repository.BuyRequestRepository;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BuyApprovalService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
BuyApprovalRepository buyApprovalRepository;
|
||||||
|
|
||||||
|
//BL 2001
|
||||||
|
public List<SizaiModel> getDeptRequestList(String startDate, String endDate, String request_dept_id){
|
||||||
|
|
||||||
|
List<SizaiModel> sizaiList = new ArrayList<SizaiModel>();
|
||||||
|
|
||||||
|
/*// 00:00:00
|
||||||
|
LocalDateTime startDateTime = startDate.atStartOfDay();
|
||||||
|
// 23:59:59
|
||||||
|
LocalDateTime endDateTime = endDate.atTime(23, 59, 59); */
|
||||||
|
|
||||||
|
//00:00:00
|
||||||
|
String startDateTime = startDate + " 00:00:00";
|
||||||
|
//23:59:59
|
||||||
|
String endDateTime = endDate + " 23:59:59";
|
||||||
|
|
||||||
|
sizaiList = buyApprovalRepository.getDeptRequestList(startDateTime, endDateTime, request_dept_id);
|
||||||
|
|
||||||
|
return sizaiList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// BL 2003
|
||||||
|
public boolean approval(int id){
|
||||||
|
|
||||||
|
return buyApprovalRepository.approval(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// BL 2004
|
||||||
|
public boolean reject(int id){
|
||||||
|
|
||||||
|
return buyApprovalRepository.reject(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// BL 2002
|
||||||
|
public SizaiModel getRequest(int id){
|
||||||
|
|
||||||
|
return buyApprovalRepository.getRequestById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package co.jp.mamol.myapp.service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import co.jp.mamol.myapp.repository.BuyRequestRepository;
|
||||||
|
import co.jp.mamol.myapp.model.CategoryModel;
|
||||||
|
import co.jp.mamol.myapp.model.SizaiModel;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BuyRequestService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
BuyRequestRepository buyRequestRepository;
|
||||||
|
|
||||||
|
/*public void requestRegist(SizaiDto sizai) throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CategoryDto> getCategory() throws Exception {
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// BL 1003
|
||||||
|
public List<SizaiModel> getUserRequsetList(String startDate, String endDate, String request_user_id){
|
||||||
|
|
||||||
|
List<SizaiModel> sizaiList = new ArrayList<SizaiModel>();
|
||||||
|
|
||||||
|
/*// 00:00:00
|
||||||
|
LocalDateTime startDateTime = startDate.atStartOfDay();
|
||||||
|
// 23:59:59
|
||||||
|
LocalDateTime endDateTime = endDate.atTime(23, 59, 59); */
|
||||||
|
|
||||||
|
//00:00:00
|
||||||
|
String startDateTime = startDate + " 00:00:00";
|
||||||
|
//23:59:59
|
||||||
|
String endDateTime = endDate + " 23:59:59";
|
||||||
|
|
||||||
|
sizaiList = buyRequestRepository.getUserRequsetList(startDateTime, endDateTime, request_user_id);
|
||||||
|
|
||||||
|
return sizaiList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// BL 1004
|
||||||
|
public SizaiModel getRequest(int id){
|
||||||
|
|
||||||
|
return buyRequestRepository.getRequestById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
//BL1006
|
||||||
|
public boolean deleteById(int id){
|
||||||
|
|
||||||
|
return buyRequestRepository.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// BL 1001
|
||||||
|
public void requestRegist(SizaiModel sizai){
|
||||||
|
|
||||||
|
buyRequestRepository.requestRegist(sizai);
|
||||||
|
}
|
||||||
|
|
||||||
|
// BL 1002
|
||||||
|
public List<CategoryModel> getCategory(){
|
||||||
|
|
||||||
|
return buyRequestRepository.getCategory();
|
||||||
|
}
|
||||||
|
|
||||||
|
// BL 1005
|
||||||
|
public boolean modifyRequest(SizaiModel sizai) {
|
||||||
|
|
||||||
|
return buyRequestRepository.modifyRequest(sizai);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user