diff --git a/src/main/java/com/cloudservice/ccs/biz/IAttendanceStatisticsBiz.java b/src/main/java/com/cloudservice/ccs/biz/IAttendanceStatisticsBiz.java index a44688b4150a68f07e2e2397b56b6062529c81f3..0b87e80a7da5131e2b542ba995a2c7048efbed29 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IAttendanceStatisticsBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IAttendanceStatisticsBiz.java @@ -6,8 +6,12 @@ import java.util.List; public interface IAttendanceStatisticsBiz { void save(AttendanceStatistics attendanceStatistics); + void update(Integer id, AttendanceStatistics attendanceStatistics); + void delete(Integer id); + AttendanceStatistics getOne(Integer id); + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/IBlackListBiz.java b/src/main/java/com/cloudservice/ccs/biz/IBlackListBiz.java index ece964ef027f7ba4ec73e1c0c04d1151c3f88442..2a6858110c0367848f71bf5ab4f4da460b142f26 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IBlackListBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IBlackListBiz.java @@ -6,8 +6,12 @@ import java.util.List; public interface IBlackListBiz { void save(BlackList blackList); + void update(Integer id, BlackList blackList); + void delete(Integer id); + BlackList getOne(Integer id); + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/ICommonWordBiz.java b/src/main/java/com/cloudservice/ccs/biz/ICommonWordBiz.java index 1c3ec6a73d9e76964b5af01c3779871435aa057f..bd7ecc0d0cb19acb07b0dc6e049368611b8e6849 100644 --- a/src/main/java/com/cloudservice/ccs/biz/ICommonWordBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/ICommonWordBiz.java @@ -6,8 +6,12 @@ import java.util.List; public interface ICommonWordBiz { void save(CommonWord commonWord); + void update(Integer id, CommonWord commonWord); + void delete(Integer id); + CommonWord getOne(Integer id); + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/ICustomerInfoBiz.java b/src/main/java/com/cloudservice/ccs/biz/ICustomerInfoBiz.java index 7352c0e266a15d213aac48c1992e248bab0d64a3..602a653fd25e100faf1d7d1ab8d4de5745bbc696 100644 --- a/src/main/java/com/cloudservice/ccs/biz/ICustomerInfoBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/ICustomerInfoBiz.java @@ -6,8 +6,12 @@ import java.util.List; public interface ICustomerInfoBiz { void save(CustomerInfo customerInfo); + void update(String email, CustomerInfo customerInfo); + void delete(String email); + CustomerInfo getOne(String email); + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/ICustomerServiceBiz.java b/src/main/java/com/cloudservice/ccs/biz/ICustomerServiceBiz.java index 9a934622b93dc69a54e76e3da2fa7f864eab2294..3028d3ebd5be8cac34d2f3bebe9ac10d511216a0 100644 --- a/src/main/java/com/cloudservice/ccs/biz/ICustomerServiceBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/ICustomerServiceBiz.java @@ -3,6 +3,7 @@ package com.cloudservice.ccs.biz; import com.cloudservice.ccs.entity.CustomerService; import java.util.List; +import java.util.Map; public interface ICustomerServiceBiz { @@ -10,6 +11,8 @@ public interface ICustomerServiceBiz { void update(Integer id, CustomerService customerService); + void partialUpdate(Integer id, Map fields); + void delete(Integer id); CustomerService getOne(Integer id); diff --git a/src/main/java/com/cloudservice/ccs/biz/IGroupManageBiz.java b/src/main/java/com/cloudservice/ccs/biz/IGroupManageBiz.java index 6f9479acbf06ba449acb83360226d9bcefcdba13..f5ceb6401ceef530a29af2c438035e1a9d85a4f1 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IGroupManageBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IGroupManageBiz.java @@ -5,9 +5,13 @@ import com.cloudservice.ccs.entity.GroupManage; import java.util.List; public interface IGroupManageBiz { - void save(GroupManage groupManage); + void save( GroupManage groupManage); + void update(Integer id, GroupManage groupManage); + void delete(Integer id); + GroupManage getOne(Integer id); + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/INoticeBiz.java b/src/main/java/com/cloudservice/ccs/biz/INoticeBiz.java index 19ee88d4f0a4e6a08c6ff8501786ac718ba5c23a..d3b5636aa0b8af3c658763aadffa13a94fc03e2b 100644 --- a/src/main/java/com/cloudservice/ccs/biz/INoticeBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/INoticeBiz.java @@ -5,9 +5,13 @@ import com.cloudservice.ccs.entity.Notice; import java.util.List; public interface INoticeBiz { - void save(Notice notice); + void save( Notice notice); + void update(Integer id, Notice notice); + void delete(Integer id); + Notice getOne(Integer id); + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/IRoleManageBiz.java b/src/main/java/com/cloudservice/ccs/biz/IRoleManageBiz.java index 1b9eec22fa3746283ccec7ab28807b1edf5d3532..acf1351a1b0eb942d11df0b8546fedad94e1168f 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IRoleManageBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IRoleManageBiz.java @@ -1,4 +1,17 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.RoleManage; + +import java.util.List; + public interface IRoleManageBiz { + void save(RoleManage roleManage); + + void update(Integer id, RoleManage roleManage); + + void delete(Integer id); + + RoleManage getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/ISessionBiz.java b/src/main/java/com/cloudservice/ccs/biz/ISessionBiz.java index 06dbf88499626cb8e1d48a69728bfcd61dbcb384..3b2ed6d7fa776571cd2129157d18009d199ef52f 100644 --- a/src/main/java/com/cloudservice/ccs/biz/ISessionBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/ISessionBiz.java @@ -1,4 +1,18 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.Session; +import com.cloudservice.ccs.mapper.SessionMapper; + +import java.util.List; + public interface ISessionBiz { + void save(Session session); + + void update(Integer id, Session session); + + void delete(Integer id); + + Session getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/ISessionMessageBiz.java b/src/main/java/com/cloudservice/ccs/biz/ISessionMessageBiz.java index b024b7b219350975062a4d8cfc4e3cd942b99916..7de74756cb63e33b39d7b4e28b3fc5423f4d5604 100644 --- a/src/main/java/com/cloudservice/ccs/biz/ISessionMessageBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/ISessionMessageBiz.java @@ -1,4 +1,17 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.SessionMessage; + +import java.util.List; + public interface ISessionMessageBiz { + void save(SessionMessage sessionMessage); + + void update(Integer id, SessionMessage sessionMessage); + + void delete(Integer id); + + SessionMessage getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/ISystemMessageBiz.java b/src/main/java/com/cloudservice/ccs/biz/ISystemMessageBiz.java index 7213f628630f286d2747356487defb61508cc14a..64cf013facd9130193810a90dfd4fce304478eeb 100644 --- a/src/main/java/com/cloudservice/ccs/biz/ISystemMessageBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/ISystemMessageBiz.java @@ -1,4 +1,17 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.SystemMessage; + +import java.util.List; + public interface ISystemMessageBiz { + void save(SystemMessage systemMessage); + + void update(Integer id, SystemMessage systemMessage); + + void delete(Integer id); + + SystemMessage getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/ITagsBiz.java b/src/main/java/com/cloudservice/ccs/biz/ITagsBiz.java index a4b9092ba7f1561b47176eb624c7d016303c943b..c34314aa018db1be68dcd5816ad68bdb285d12d5 100644 --- a/src/main/java/com/cloudservice/ccs/biz/ITagsBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/ITagsBiz.java @@ -1,4 +1,17 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.Tags; + +import java.util.List; + public interface ITagsBiz { + void save(Tags tags); + + void update(Integer id, Tags tags); + + void delete(Integer id); + + Tags getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/IViewStatisticsBiz.java b/src/main/java/com/cloudservice/ccs/biz/IViewStatisticsBiz.java index 1ac59d80b79dbdf913abc8779d9d0dafc9992711..c2d4a1bbae896a694c746dfe286727446de1c97b 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IViewStatisticsBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IViewStatisticsBiz.java @@ -1,4 +1,17 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.ViewStatistics; + +import java.util.List; + public interface IViewStatisticsBiz { + void save(ViewStatistics viewStatistics); + + void update(Integer id, ViewStatistics viewStatistics); + + void delete(Integer id); + + ViewStatistics getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/IVisitorInfoBiz.java b/src/main/java/com/cloudservice/ccs/biz/IVisitorInfoBiz.java index 0d8ba52a4e7ab5aedcddc27a2263fbcbdfbc936d..80e7743c4429a1382505f51bc61a7eb605033d64 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IVisitorInfoBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IVisitorInfoBiz.java @@ -1,4 +1,17 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.VisitorInfo; + +import java.util.List; + public interface IVisitorInfoBiz { + void save(VisitorInfo visitorInfo); + + void update(String ip, VisitorInfo visitorInfo); + + void delete(String ip); + + VisitorInfo getOne(String ip); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/IWorkLogBiz.java b/src/main/java/com/cloudservice/ccs/biz/IWorkLogBiz.java index 109c1c50e7dcbb468b57b64f85bbdc9512b1e2c8..57dd485adabe7175045e86b79eec9224e392f7de 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IWorkLogBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IWorkLogBiz.java @@ -1,4 +1,22 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.CustomerService; +import com.cloudservice.ccs.entity.WorkLog; + +import java.util.List; +import java.util.Map; + public interface IWorkLogBiz { + + void save(WorkLog workLog); + + void update(Integer id, WorkLog workLog); + + void partialUpdate(Integer id, Map fields); + + void delete(Integer id); + + WorkLog getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/IWorkOrderBiz.java b/src/main/java/com/cloudservice/ccs/biz/IWorkOrderBiz.java index 0a243b617e2e5aac2e8e6821eeecc66e290187ff..3e4633ce7c983711edbb64c9ad861fc63873cf5c 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IWorkOrderBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IWorkOrderBiz.java @@ -1,4 +1,20 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.WorkOrder; + +import java.util.List; +import java.util.Map; + public interface IWorkOrderBiz { + void save(WorkOrder workOrder); + + void update(Integer id, WorkOrder workOrder); + + void partialUpdate(Integer id, Map fields); + + void delete(Integer id); + + WorkOrder getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/IWorkOrderReplyBiz.java b/src/main/java/com/cloudservice/ccs/biz/IWorkOrderReplyBiz.java index 7d4117d5800e23d4ee4d620ec3451be631f5bcaf..3a9e1b6f704afc3010fceb09da5e4cecfb9ba5a3 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IWorkOrderReplyBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IWorkOrderReplyBiz.java @@ -1,4 +1,20 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.WorkOrderReply; + +import java.util.List; +import java.util.Map; + public interface IWorkOrderReplyBiz { + void save(WorkOrderReply workOrderReply); + + void update(Integer id, WorkOrderReply workOrderReply); + + void partialUpdate(Integer id, Map fields); + + void delete(Integer id); + + WorkOrderReply getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/IWorkQualityStatisticsBiz.java b/src/main/java/com/cloudservice/ccs/biz/IWorkQualityStatisticsBiz.java index 540fde37b1b9f65b867d161360ec0cb25a9b2c8c..8a03d5e16daa559380bb9685293f626dd347d98b 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IWorkQualityStatisticsBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IWorkQualityStatisticsBiz.java @@ -1,4 +1,20 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.WorkQualityStatistics; + +import java.util.List; +import java.util.Map; + public interface IWorkQualityStatisticsBiz { + void save(WorkQualityStatistics workQualityStatistics); + + void update(Integer id, WorkQualityStatistics workQualityStatistics); + + void partialUpdate(Integer id, Map fields); + + void delete(Integer id); + + WorkQualityStatistics getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/IWorkloadStatisticsBiz.java b/src/main/java/com/cloudservice/ccs/biz/IWorkloadStatisticsBiz.java index 2578146f706975c5d5884c7e41c7c67215e736d4..ab85feb9c12dfe74d20579dc2dd27027683ed1fd 100644 --- a/src/main/java/com/cloudservice/ccs/biz/IWorkloadStatisticsBiz.java +++ b/src/main/java/com/cloudservice/ccs/biz/IWorkloadStatisticsBiz.java @@ -1,4 +1,18 @@ package com.cloudservice.ccs.biz; +import com.cloudservice.ccs.entity.WorkloadStatistics; + +import java.util.List; + public interface IWorkloadStatisticsBiz { + + void save(WorkloadStatistics workloadStatistics); + + void update(Integer id, WorkloadStatistics workloadStatistics); + + void delete(Integer id); + + WorkloadStatistics getOne(Integer id); + + List getAll(); } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/CustomerServiceImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/CustomerServiceImpl.java index 5064744714c70c7b96744fa56745d3a0ce0d411d..659f11e9c440a438139119c1f267d04a5fbceb34 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/CustomerServiceImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/CustomerServiceImpl.java @@ -10,6 +10,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.PathVariable; import java.util.List; +import java.util.Map; @Service public class CustomerServiceImpl implements ICustomerServiceBiz { @@ -33,6 +34,11 @@ public class CustomerServiceImpl implements ICustomerServiceBiz { } } + @Override + public void partialUpdate(Integer id, Map fields) { + int result = customerServiceMapper.partialUpdate(id, fields); + } + @Override public void delete(Integer id) { int result = customerServiceMapper.delete(id); diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/RoleManageImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/RoleManageImpl.java index 0da3966275287963433860f718bcc914075632f3..625a7d838c0c98dbd144aeac7e4f0016842e2730 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/RoleManageImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/RoleManageImpl.java @@ -1,8 +1,53 @@ package com.cloudservice.ccs.biz.impl; import com.cloudservice.ccs.biz.IRoleManageBiz; +import com.cloudservice.ccs.entity.RoleManage; +import com.cloudservice.ccs.exception.RoleManageException; +import com.cloudservice.ccs.mapper.RoleManageMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service -public class RoleManageImpl { +public class RoleManageImpl implements IRoleManageBiz{ + @Autowired + private RoleManageMapper roleManageMapper; + @Override + public void save(RoleManage roleManage) { + int result = roleManageMapper.save(roleManage); + if (result == 0) { + throw new RoleManageException( "Create RoleManage entity error"); + } + } + + @Override + public void update(Integer id, RoleManage roleManage) { + int result = roleManageMapper.update(id, roleManage); + if (result == 0) { + throw new RoleManageException("Update RoleManage entity error"); + } + } + + @Override + public void delete(Integer id) { + int result = roleManageMapper.delete(id); + if (result == 0) { + throw new RoleManageException("Delete RoleManage entity error"); + } + } + + @Override + public RoleManage getOne(Integer id) { + RoleManage roleManage = roleManageMapper.getOne(id); + if (roleManage == null) { + throw new RoleManageException("Get RoleManage entity error: no such entity"); + } + return roleManage; + } + + @Override + public List getAll() { + return roleManageMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/SessionImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/SessionImpl.java index 611fdb2640f29b8c189b48fa9a382a0f7b8281f7..c751f784c6ee961cdb8b8cd190183960a735b2ba 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/SessionImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/SessionImpl.java @@ -1,7 +1,53 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.ISessionBiz; +import com.cloudservice.ccs.entity.Session; +import com.cloudservice.ccs.exception.SessionException; +import com.cloudservice.ccs.mapper.SessionMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service -public class SessionImpl { +public class SessionImpl implements ISessionBiz { + @Autowired + private SessionMapper sessionMapper; + @Override + public void save(Session session) { + int result = sessionMapper.save(session); + if (result == 0) { + throw new SessionException("Create Session entity error"); + } + } + + @Override + public void update(Integer id, Session session) { + int result = sessionMapper.update(id, session); + if (result == 0) { + throw new SessionException("Update Session entity error"); + } + } + + @Override + public void delete(Integer id) { + int result = sessionMapper.delete(id); + if (result == 0) { + throw new SessionException("Delete Session entity error"); + } + } + + @Override + public Session getOne(Integer id) { + Session session = sessionMapper.getOne(id); + if (session == null) { + throw new SessionException("Get Session entity error: no such entity"); + } + return session; + } + + @Override + public List getAll() { + return sessionMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/SessionMessageImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/SessionMessageImpl.java index 47f4e55efc703e966e73cdf23eec0b4b12d236c8..559d720cb2f2eacdd1b21a6c90a13a71e3356148 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/SessionMessageImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/SessionMessageImpl.java @@ -1,7 +1,53 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.ISessionMessageBiz; +import com.cloudservice.ccs.entity.SessionMessage; +import com.cloudservice.ccs.exception.SessionMessageException; +import com.cloudservice.ccs.mapper.SessionMessageMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service -public class SessionMessageImpl { +public class SessionMessageImpl implements ISessionMessageBiz { + @Autowired + private SessionMessageMapper sessionMessageMapper; + @Override + public void save(SessionMessage sessionMessage) { + int result = sessionMessageMapper.save(sessionMessage); + if (result == 0) { + throw new SessionMessageException("Create SessionMessage entity error"); + } + } + + @Override + public void update(Integer id, SessionMessage sessionMessage) { + int result = sessionMessageMapper.update(id, sessionMessage); + if (result == 0) { + throw new SessionMessageException("Update SessionMessage entity error"); + } + } + + @Override + public void delete(Integer id) { + int result = sessionMessageMapper.delete(id); + if (result == 0) { + throw new SessionMessageException("Delete SessionMessage entity error"); + } + } + + @Override + public SessionMessage getOne(Integer id) { + SessionMessage sessionMessage = sessionMessageMapper.getOne(id); + if (sessionMessage == null) { + throw new SessionMessageException("Get SessionMessage entity error: no such entity"); + } + return sessionMessage; + } + + @Override + public List getAll() { + return sessionMessageMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/SystemMessageImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/SystemMessageImpl.java index fc84e935590387916cf262713358f990e778a839..bad518d48e68226d9ef71fa8d6c1e37f8361cd67 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/SystemMessageImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/SystemMessageImpl.java @@ -1,7 +1,54 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.ISystemMessageBiz; +import com.cloudservice.ccs.entity.SystemMessage; +import com.cloudservice.ccs.exception.SystemMessageException; +import com.cloudservice.ccs.mapper.SystemMessageMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; @Service -public class SystemMessageImpl { +public class SystemMessageImpl implements ISystemMessageBiz { + + @Autowired + SystemMessageMapper systemMessageMapper; + + @Override + public void save(SystemMessage systemMessage) { + int result = systemMessageMapper.save(systemMessage); + if (result == 0) { + throw new SystemMessageException("Create CustomerService entity error"); + } + } + + @Override + public void update(Integer id, SystemMessage systemMessage) { + int result = systemMessageMapper.update(id, systemMessage); + if (result == 0) { + throw new SystemMessageException("Update CustomerService entity error"); + } + } + + @Override + public void delete(Integer id) { + int result = systemMessageMapper.delete(id); + if (result == 0) { + throw new SystemMessageException("Delete CustomerService entity error"); + } + } + + @Override + public SystemMessage getOne(Integer id) { + SystemMessage systemMessage = systemMessageMapper.getOne(id); + if (systemMessage == null) { + throw new SystemMessageException("Get CustomerService entity error: no such entity"); + } + return systemMessage; + } + + @Override + public List getAll() { + return systemMessageMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/TagsImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/TagsImpl.java index f4542b39413a087d097f24f487357d63b9c58302..80ba3499c4d460df0c2f838d3302905d0ddc6871 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/TagsImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/TagsImpl.java @@ -1,7 +1,54 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.ITagsBiz; +import com.cloudservice.ccs.entity.Tags; +import com.cloudservice.ccs.exception.TagsException; +import com.cloudservice.ccs.mapper.TagsMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service -public class TagsImpl { +public class TagsImpl implements ITagsBiz { + @Autowired + TagsMapper tagsMapper; + + @Override + public void save(Tags tags) { + int result = tagsMapper.save(tags); + if (result == 0) { + throw new TagsException("Create CustomerService entity error"); + } + } + + @Override + public void update(Integer id, Tags tags) { + int result = tagsMapper.update(id, tags); + if (result == 0) { + throw new TagsException("Update CustomerService entity error"); + } + } + + @Override + public void delete(Integer id) { + int result = tagsMapper.delete(id); + if (result == 0) { + throw new TagsException("Delete CustomerService entity error"); + } + } + + @Override + public Tags getOne(Integer id) { + Tags tags = tagsMapper.getOne(id); + if (tags == null) { + throw new TagsException("Get CustomerService entity error: no such entity"); + } + return tags; + } + + @Override + public List getAll() { + return tagsMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/ViewStatisticsImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/ViewStatisticsImpl.java index 04e2757c7059e2680ba56ef66323fadf627fcaac..0d96b4c381852dc8db492ed9d150c7a151504fd9 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/ViewStatisticsImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/ViewStatisticsImpl.java @@ -1,7 +1,54 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.IViewStatisticsBiz; +import com.cloudservice.ccs.entity.ViewStatistics; +import com.cloudservice.ccs.exception.ViewStatisticsException; +import com.cloudservice.ccs.mapper.ViewStatisticsMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service -public class ViewStatisticsImpl { +public class ViewStatisticsImpl implements IViewStatisticsBiz { + @Autowired + ViewStatisticsMapper viewStatisticsMapper; + + @Override + public void save(ViewStatistics viewStatistics) { + int result = viewStatisticsMapper.save(viewStatistics); + if (result == 0) { + throw new ViewStatisticsException("Create CustomerService entity error"); + } + } + + @Override + public void update(Integer id, ViewStatistics viewStatistics) { + int result = viewStatisticsMapper.update(id, viewStatistics); + if (result == 0) { + throw new ViewStatisticsException("Update CustomerService entity error"); + } + } + + @Override + public void delete(Integer id) { + int result = viewStatisticsMapper.delete(id); + if (result == 0) { + throw new ViewStatisticsException("Delete CustomerService entity error"); + } + } + + @Override + public ViewStatistics getOne(Integer id) { + ViewStatistics viewStatistics = viewStatisticsMapper.getOne(id); + if (viewStatistics == null) { + throw new ViewStatisticsException("Get CustomerService entity error: no such entity"); + } + return viewStatistics; + } + + @Override + public List getAll() { + return viewStatisticsMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/VisitorInfoImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/VisitorInfoImpl.java index d276df89065e41f7d16f55af08be8e864969f46f..bc02a670119d9ee62eb88dab0dbd3a0bd66e2af3 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/VisitorInfoImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/VisitorInfoImpl.java @@ -1,7 +1,54 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.IVisitorInfoBiz; +import com.cloudservice.ccs.entity.VisitorInfo; +import com.cloudservice.ccs.exception.VisitorInfoException; +import com.cloudservice.ccs.mapper.VisitorInfoMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service -public class VisitorInfoImpl { +public class VisitorInfoImpl implements IVisitorInfoBiz { + @Autowired + VisitorInfoMapper visitorInfoMapper; + + @Override + public void save(VisitorInfo visitorInfo) { + int result = visitorInfoMapper.save(visitorInfo); + if (result == 0) { + throw new VisitorInfoException("Create CustomerService entity error"); + } + } + + @Override + public void update(String ip, VisitorInfo visitorInfo) { + int result = visitorInfoMapper.update(ip, visitorInfo); + if (result == 0) { + throw new VisitorInfoException("Update CustomerService entity error"); + } + } + + @Override + public void delete(String ip) { + int result = visitorInfoMapper.delete(ip); + if (result == 0) { + throw new VisitorInfoException("Delete CustomerService entity error"); + } + } + + @Override + public VisitorInfo getOne(String ip) { + VisitorInfo visitorInfo = visitorInfoMapper.getOne(ip); + if (visitorInfo == null) { + throw new VisitorInfoException("Get CustomerService entity error: no such entity"); + } + return visitorInfo; + } + + @Override + public List getAll() { + return visitorInfoMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/WorkLogImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/WorkLogImpl.java index edc6251784b35cf29008dd8dd8c316f893fb3522..c5157b3c9550f5859b5b51788e6906efb1bdb8b5 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/WorkLogImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/WorkLogImpl.java @@ -1,7 +1,63 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.IWorkLogBiz; +import com.cloudservice.ccs.entity.WorkLog; +import com.cloudservice.ccs.exception.WorkLogException; +import com.cloudservice.ccs.mapper.WorkLogMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Map; + @Service -public class WorkLogImpl { +public class WorkLogImpl implements IWorkLogBiz { + @Autowired + private WorkLogMapper workLogMapper; + + @Override + public void save(WorkLog workLog) { + int res = workLogMapper.save(workLog); + if (res == 0) { + throw new WorkLogException("Create WorkLog failed"); + } + } + + @Override + public void update(Integer id, WorkLog workLog) { + int res = workLogMapper.update(id, workLog); + if (res == 0) { + throw new WorkLogException("Update WorkLog failed"); + } + } + + @Override + public void partialUpdate(Integer id, Map fields) { + int res = workLogMapper.partialUpdate(id, fields); + if (res == 0) { + throw new WorkLogException("Partial update WorkLog failed"); + } + } + + @Override + public void delete(Integer id) { + int res = workLogMapper.delete(id); + if (res == 0) { + throw new WorkLogException("Delete WorkLog failed"); + } + } + + @Override + public WorkLog getOne(Integer id) { + WorkLog workLog = workLogMapper.getOne(id); + if (workLog == null) { + throw new WorkLogException("Requested WorkLog does not exist"); + } + return workLog; + } + + @Override + public List getAll() { + return workLogMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/WorkOrderImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/WorkOrderImpl.java index fe4006a460c986a3a3bc819648505207694a37ed..47b9701f6ba0dd964c53fffe4d00e45df342b8ed 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/WorkOrderImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/WorkOrderImpl.java @@ -1,7 +1,63 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.IWorkOrderBiz; +import com.cloudservice.ccs.entity.WorkOrder; +import com.cloudservice.ccs.exception.WorkOrderException; +import com.cloudservice.ccs.mapper.WorkOrderMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Map; + @Service -public class WorkOrderImpl { +public class WorkOrderImpl implements IWorkOrderBiz { + @Autowired + private WorkOrderMapper workOrderMapper; + + @Override + public void save(WorkOrder workOrder) { + int res = workOrderMapper.save(workOrder); + if (res == 0) { + throw new WorkOrderException("Create WorkOrder failed"); + } + } + + @Override + public void update(Integer id, WorkOrder workOrder) { + int res = workOrderMapper.update(id, workOrder); + if (res == 0) { + throw new WorkOrderException("Update WorkOrder failed"); + } + } + + @Override + public void partialUpdate(Integer id, Map fields) { + int res = workOrderMapper.partialUpdate(id, fields); + if (res == 0) { + throw new WorkOrderException("Partial update WorkOrder failed"); + } + } + + @Override + public void delete(Integer id) { + int res = workOrderMapper.delete(id); + if (res == 0) { + throw new WorkOrderException("Delete WorkOrder failed"); + } + } + + @Override + public WorkOrder getOne(Integer id) { + WorkOrder workOrder = workOrderMapper.getOne(id); + if (workOrder == null) { + throw new WorkOrderException("Requested WorkOrder does not exist"); + } + return workOrder; + } + + @Override + public List getAll() { + return workOrderMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/WorkOrderReplyImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/WorkOrderReplyImpl.java index aa9f4175173178d89c2b2e1561c3a20ca1b56732..87c7f7e75e05810194c443bcd679a12b9bba537a 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/WorkOrderReplyImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/WorkOrderReplyImpl.java @@ -1,7 +1,65 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.IWorkOrderReplyBiz; +import com.cloudservice.ccs.entity.WorkOrderReply; +import com.cloudservice.ccs.exception.WorkOrderReplyException; +import com.cloudservice.ccs.mapper.WorkOrderMapper; +import com.cloudservice.ccs.mapper.WorkOrderReplyMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Map; + @Service -public class WorkOrderReplyImpl { +public class WorkOrderReplyImpl implements IWorkOrderReplyBiz { + + @Autowired + private WorkOrderReplyMapper workOrderReplyMapper; + + @Override + public void save(WorkOrderReply workOrderReply) { + int res = workOrderReplyMapper.save(workOrderReply); + if (res == 0) { + throw new WorkOrderReplyException("Create WorkOrder failed"); + } + } + + @Override + public void update(Integer id, WorkOrderReply workOrderReply) { + int res = workOrderReplyMapper.update(id, workOrderReply); + if (res == 0) { + throw new WorkOrderReplyException("Update WorkOrder failed"); + } + } + + @Override + public void partialUpdate(Integer id, Map fields) { + int res = workOrderReplyMapper.partialUpdate(id, fields); + if (res == 0) { + throw new WorkOrderReplyException("Partial update WorkOrder failed"); + } + } + + @Override + public void delete(Integer id) { + int res = workOrderReplyMapper.delete(id); + if (res == 0) { + throw new WorkOrderReplyException("Delete WorkOrder failed"); + } + } + + @Override + public WorkOrderReply getOne(Integer id) { + WorkOrderReply workOrderReply = workOrderReplyMapper.getOne(id); + if (workOrderReply == null) { + throw new WorkOrderReplyException("Requested WorkOrderReply does not exist"); + } + return workOrderReply; + } + + @Override + public List getAll() { + return workOrderReplyMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/WorkQualityStatisticsImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/WorkQualityStatisticsImpl.java index d2c4fb7ff53ddc3f89d18b76cd11094a2fb46a39..5354e52f7e5a52f6832582194a76a7d0158dfba3 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/WorkQualityStatisticsImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/WorkQualityStatisticsImpl.java @@ -1,7 +1,63 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.IWorkQualityStatisticsBiz; +import com.cloudservice.ccs.entity.WorkQualityStatistics; +import com.cloudservice.ccs.exception.WorkQualityStatisticsException; +import com.cloudservice.ccs.mapper.WorkQualityStatisticsMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Map; + @Service -public class WorkQualityStatisticsImpl { +public class WorkQualityStatisticsImpl implements IWorkQualityStatisticsBiz { + @Autowired + private WorkQualityStatisticsMapper workQualityStatisticsMapper; + + @Override + public void save(WorkQualityStatistics workQualityStatistics) { + int res = workQualityStatisticsMapper.save(workQualityStatistics); + if (res == 0) { + throw new WorkQualityStatisticsException("Create WorkQualityStatistics failed"); + } + } + + @Override + public void update(Integer id, WorkQualityStatistics workQualityStatistics) { + int res = workQualityStatisticsMapper.update(id, workQualityStatistics); + if (res == 0) { + throw new WorkQualityStatisticsException("Update WorkQualityStatistics failed"); + } + } + + @Override + public void partialUpdate(Integer id, Map fields) { + int res = workQualityStatisticsMapper.partialUpdate(id, fields); + if (res == 0) { + throw new WorkQualityStatisticsException("Partial update WorkQualityStatistics failed"); + } + } + + @Override + public void delete(Integer id) { + int res = workQualityStatisticsMapper.delete(id); + if (res == 0) { + throw new WorkQualityStatisticsException("Delete WorkQualityStatistics failed"); + } + } + + @Override + public WorkQualityStatistics getOne(Integer id) { + WorkQualityStatistics workQualityStatistics = workQualityStatisticsMapper.getOne(id); + if (workQualityStatistics == null) { + throw new WorkQualityStatisticsException("Requested WorkQualityStatistics does not exist"); + } + return workQualityStatistics; + } + + @Override + public List getAll() { + return workQualityStatisticsMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/biz/impl/WorkloadStatisticsImpl.java b/src/main/java/com/cloudservice/ccs/biz/impl/WorkloadStatisticsImpl.java index e0a7cb975a2422aaffcc930eaebe910c10b9140a..1727b7183e41efdbb74eddf9afb9b5d33ea0e5cc 100644 --- a/src/main/java/com/cloudservice/ccs/biz/impl/WorkloadStatisticsImpl.java +++ b/src/main/java/com/cloudservice/ccs/biz/impl/WorkloadStatisticsImpl.java @@ -1,7 +1,54 @@ package com.cloudservice.ccs.biz.impl; +import com.cloudservice.ccs.biz.IWorkloadStatisticsBiz; +import com.cloudservice.ccs.entity.WorkloadStatistics; +import com.cloudservice.ccs.exception.WorkloadStatisticsException; +import com.cloudservice.ccs.mapper.WorkLoadStatisticsMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + @Service -public class WorkloadStatisticsImpl { +public class WorkloadStatisticsImpl implements IWorkloadStatisticsBiz { + @Autowired + WorkLoadStatisticsMapper workLoadStatisticsMapper; + + @Override + public void save(WorkloadStatistics workloadStatistics) { + int result = workLoadStatisticsMapper.save(workloadStatistics); + if (result == 0) { + throw new WorkloadStatisticsException("Create CustomerService entity error"); + } + } + + @Override + public void update(Integer id, WorkloadStatistics workloadStatistics) { + int result = workLoadStatisticsMapper.update(id, workloadStatistics); + if (result == 0) { + throw new WorkloadStatisticsException("Update CustomerService entity error"); + } + } + + @Override + public void delete(Integer id) { + int result = workLoadStatisticsMapper.delete(id); + if (result == 0) { + throw new WorkloadStatisticsException("Delete CustomerService entity error"); + } + } + + @Override + public WorkloadStatistics getOne(Integer id) { + WorkloadStatistics workloadStatistics = workLoadStatisticsMapper.getOne(id); + if (workloadStatistics == null) { + throw new WorkloadStatisticsException("Get CustomerService entity error: no such entity"); + } + return workloadStatistics; + } + + @Override + public List getAll() { + return workLoadStatisticsMapper.getAll(); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/AttendanceStatisticsController.java b/src/main/java/com/cloudservice/ccs/controller/AttendanceStatisticsController.java index 0761631cda1baa7cecbb8c05a04c8b54af051300..ee674e134d093cf754237a07a2000dd4b91f3268 100644 --- a/src/main/java/com/cloudservice/ccs/controller/AttendanceStatisticsController.java +++ b/src/main/java/com/cloudservice/ccs/controller/AttendanceStatisticsController.java @@ -1,4 +1,48 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.IAttendanceStatisticsBiz; +import com.cloudservice.ccs.entity.AttendanceStatistics; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/attendance-statistics") public class AttendanceStatisticsController { + @Autowired + private IAttendanceStatisticsBiz attendanceStatisticsBiz; + + @PostMapping("/") + void save(@RequestBody AttendanceStatistics attendanceStatistics) { + // 接口问题待讨论:是否应当返回生成的 id? + attendanceStatisticsBiz.save(attendanceStatistics); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody AttendanceStatistics attendanceStatistics) { + attendanceStatisticsBiz.update(id, attendanceStatistics); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + attendanceStatisticsBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + AttendanceStatistics result = attendanceStatisticsBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("attendance-statistics", attendanceStatisticsBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/BlackListController.java b/src/main/java/com/cloudservice/ccs/controller/BlackListController.java index fb84c9479713e08430f76976714f8c663fc69ce0..e08fcf0a69d65e45c1d608b8a1db2298e7a9e127 100644 --- a/src/main/java/com/cloudservice/ccs/controller/BlackListController.java +++ b/src/main/java/com/cloudservice/ccs/controller/BlackListController.java @@ -1,5 +1,48 @@ package com.cloudservice.ccs.controller; -public class -BlackListController { +import com.cloudservice.ccs.biz.IBlackListBiz; +import com.cloudservice.ccs.entity.BlackList; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/black-list") +public class BlackListController { + @Autowired + private IBlackListBiz blackListBiz; + + @PostMapping("/") + void save(@RequestBody BlackList blackList) { + // 接口问题待讨论:是否应当返回生成的 id? + blackListBiz.save(blackList); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody BlackList blackList) { + blackListBiz.update(id, blackList); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + blackListBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + BlackList result = blackListBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("black-list", blackListBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/CommonWordController.java b/src/main/java/com/cloudservice/ccs/controller/CommonWordController.java index 9f90326e897ca04805152781cd0a49cdffb441ca..2e5a5f507faae58372fa3147c11ea86f3e07fcf8 100644 --- a/src/main/java/com/cloudservice/ccs/controller/CommonWordController.java +++ b/src/main/java/com/cloudservice/ccs/controller/CommonWordController.java @@ -1,4 +1,48 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.ICommonWordBiz; +import com.cloudservice.ccs.entity.CommonWord; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/common-word") public class CommonWordController { + @Autowired + private ICommonWordBiz commonWordBiz; + + @PostMapping("/") + void save(@RequestBody CommonWord commonWord) { + // 接口问题待讨论:是否应当返回生成的 id? + commonWordBiz.save(commonWord); + } + +@PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody CommonWord commonWord) { + commonWordBiz.update(id, commonWord); + } + +@DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + commonWordBiz.delete(id); + } + +@GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + CommonWord result = commonWordBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + +@GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("common-word", commonWordBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/CustomerInfoController.java b/src/main/java/com/cloudservice/ccs/controller/CustomerInfoController.java index b04624da352b0b5a5abdd1e17f5b7655a55c19b9..8ff60d67b2f455cca20236c61ae3dd40554b602e 100644 --- a/src/main/java/com/cloudservice/ccs/controller/CustomerInfoController.java +++ b/src/main/java/com/cloudservice/ccs/controller/CustomerInfoController.java @@ -1,4 +1,48 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.ICustomerInfoBiz; +import com.cloudservice.ccs.entity.CustomerInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/customer-info") public class CustomerInfoController { + @Autowired + private ICustomerInfoBiz customerInfoBiz; + + @PostMapping("/") + void save(@RequestBody CustomerInfo customerInfo) { + // 接口问题待讨论:是否应当返回生成的 id? + customerInfoBiz.save(customerInfo); + } + + @PutMapping("/{email}") + void update(@PathVariable String email, @RequestBody CustomerInfo customerInfo) { + customerInfoBiz.update(email, customerInfo); + } + + @DeleteMapping("/{email}") + void delete(@PathVariable String email) { + customerInfoBiz.delete(email); + } + + @GetMapping("/{email}") + ResponseEntity queryById(@PathVariable String email) { + CustomerInfo result = customerInfoBiz.getOne(email); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("customer-info", customerInfoBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/CustomerServiceController.java b/src/main/java/com/cloudservice/ccs/controller/CustomerServiceController.java index 479a5724336fea9adb228595adb9ed56b9e0afd5..6299c11bc735c6ef13de854d4156c1f9bc7fcdef 100644 --- a/src/main/java/com/cloudservice/ccs/controller/CustomerServiceController.java +++ b/src/main/java/com/cloudservice/ccs/controller/CustomerServiceController.java @@ -30,6 +30,11 @@ public class CustomerServiceController { customerServiceBiz.update(id, customerService); } + @PutMapping("/{id}/partial") + void partialUpdate(@PathVariable Integer id, @RequestBody Map fields) { + customerServiceBiz.partialUpdate(id, fields); + } + @DeleteMapping("/{id}") void delete(@PathVariable Integer id) { customerServiceBiz.delete(id); diff --git a/src/main/java/com/cloudservice/ccs/controller/GroupManageController.java b/src/main/java/com/cloudservice/ccs/controller/GroupManageController.java index 3d19aaf1f7b02892d1e3332dc35eac0b42711ecd..873c3c6bca5f869f8b545c03c46ff32217d7281f 100644 --- a/src/main/java/com/cloudservice/ccs/controller/GroupManageController.java +++ b/src/main/java/com/cloudservice/ccs/controller/GroupManageController.java @@ -1,4 +1,47 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.IGroupManageBiz; +import com.cloudservice.ccs.entity.GroupManage; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/group-manage") public class GroupManageController { + @Autowired + IGroupManageBiz groupManageBiz; + + @PostMapping("/") + void save(@RequestBody GroupManage groupManage) { + groupManageBiz.save(groupManage); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody GroupManage groupManage) { + groupManageBiz.update(id, groupManage); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + groupManageBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + GroupManage result = groupManageBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("group-manage", groupManageBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/NoticeController.java b/src/main/java/com/cloudservice/ccs/controller/NoticeController.java index e6833c4851cf0e2b778d52ded2d80c8cee6086a6..78c8b1a7feb0eab6d116894809326b0e36b49af9 100644 --- a/src/main/java/com/cloudservice/ccs/controller/NoticeController.java +++ b/src/main/java/com/cloudservice/ccs/controller/NoticeController.java @@ -1,4 +1,48 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.INoticeBiz; +import com.cloudservice.ccs.entity.Notice; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/notice") public class NoticeController { + + @Autowired + INoticeBiz noticeBiz; + + @PostMapping("/") + void save(@RequestBody Notice notice) { + noticeBiz.save(notice); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody Notice notice) { + noticeBiz.update(id, notice); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + noticeBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + Notice result = noticeBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("notice", noticeBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/RoleManageController.java b/src/main/java/com/cloudservice/ccs/controller/RoleManageController.java index ebee282894664ed85b64d2f880dcc023117488ea..ec57b7dca0fb37533603dfe4905fd9401d37a429 100644 --- a/src/main/java/com/cloudservice/ccs/controller/RoleManageController.java +++ b/src/main/java/com/cloudservice/ccs/controller/RoleManageController.java @@ -1,4 +1,48 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.IRoleManageBiz; +import com.cloudservice.ccs.entity.RoleManage; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/role-manage") public class RoleManageController { + + @Autowired + IRoleManageBiz roleManageBiz; + + @PostMapping("/") + void save(@RequestBody RoleManage roleManage) { + roleManageBiz.save(roleManage); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody RoleManage roleManage) { + roleManageBiz.update(id, roleManage); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + roleManageBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + RoleManage result = roleManageBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("role-manage", roleManageBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/SessionController.java b/src/main/java/com/cloudservice/ccs/controller/SessionController.java index df6f4763e9ee2a08fb5aeef85fd300800697a2ed..56d88f8771b7dda83fe28f88d438290379291b7e 100644 --- a/src/main/java/com/cloudservice/ccs/controller/SessionController.java +++ b/src/main/java/com/cloudservice/ccs/controller/SessionController.java @@ -1,4 +1,48 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.ISessionBiz; +import com.cloudservice.ccs.entity.Session; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/session") public class SessionController { + + @Autowired + ISessionBiz sessionBiz; + + @PostMapping("/") + void save(@RequestBody Session session) { + sessionBiz.save(session); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody Session session) { + sessionBiz.update(id, session); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + sessionBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + Session result = sessionBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("session", sessionBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/SessionMessageController.java b/src/main/java/com/cloudservice/ccs/controller/SessionMessageController.java new file mode 100644 index 0000000000000000000000000000000000000000..5732685c77929d8d8729793b37c1146d496eb3b2 --- /dev/null +++ b/src/main/java/com/cloudservice/ccs/controller/SessionMessageController.java @@ -0,0 +1,48 @@ +package com.cloudservice.ccs.controller; + +import com.cloudservice.ccs.biz.ISessionMessageBiz; +import com.cloudservice.ccs.entity.SessionMessage; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/session-message") +public class SessionMessageController { + + @Autowired + ISessionMessageBiz sessionMessageBiz; + + @PostMapping("/") + void save(@RequestBody SessionMessage sessionMessage) { + sessionMessageBiz.save(sessionMessage); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody SessionMessage sessionMessage) { + sessionMessageBiz.update(id, sessionMessage); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + sessionMessageBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + SessionMessage result = sessionMessageBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("session-message", sessionMessageBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } +} diff --git a/src/main/java/com/cloudservice/ccs/controller/SystemMessageController.java b/src/main/java/com/cloudservice/ccs/controller/SystemMessageController.java index e42eaa0d2d2b8770d0c5ce343c6008f8985295bc..336b8a77627820b724755f00d34b4b182d605b93 100644 --- a/src/main/java/com/cloudservice/ccs/controller/SystemMessageController.java +++ b/src/main/java/com/cloudservice/ccs/controller/SystemMessageController.java @@ -1,4 +1,51 @@ package com.cloudservice.ccs.controller; + +import com.cloudservice.ccs.biz.ISystemMessageBiz; +import com.cloudservice.ccs.entity.SystemMessage; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/system-message") public class SystemMessageController { + @Autowired + ISystemMessageBiz systemMessageBiz; + + @PostMapping("/") + void save(@RequestBody SystemMessage systemMessage) { + // 接口问题待讨论:是否应当返回生成的 id? + systemMessageBiz.save(systemMessage); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody SystemMessage systemMessage) { + systemMessageBiz.update(id, systemMessage); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + systemMessageBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + SystemMessage result = systemMessageBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @RequiresPermissions("all") + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("system-message", systemMessageBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/TagsController.java b/src/main/java/com/cloudservice/ccs/controller/TagsController.java index da5dd56fcfe18b65b9bd62e58e3bc51bb74f1b1a..05e93d973771a11f70e2cb2f8bf63d9206200b18 100644 --- a/src/main/java/com/cloudservice/ccs/controller/TagsController.java +++ b/src/main/java/com/cloudservice/ccs/controller/TagsController.java @@ -1,4 +1,51 @@ package com.cloudservice.ccs.controller; + +import com.cloudservice.ccs.biz.ITagsBiz; +import com.cloudservice.ccs.entity.Tags; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/tags") public class TagsController { + @Autowired + ITagsBiz tagsBiz; + + @PostMapping("/") + void save(@RequestBody Tags tags) { + // 接口问题待讨论:是否应当返回生成的 id? + tagsBiz.save(tags); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody Tags tags) { + tagsBiz.update(id, tags); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + tagsBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + Tags result = tagsBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @RequiresPermissions("all") + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("tags", tagsBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/ViewStatisticsController.java b/src/main/java/com/cloudservice/ccs/controller/ViewStatisticsController.java index cb904d1a7380ebade55c8e6f89dfc2f3f59a536c..eb554e8cd9ccfb5687abdf92340826e6cfb0fcb9 100644 --- a/src/main/java/com/cloudservice/ccs/controller/ViewStatisticsController.java +++ b/src/main/java/com/cloudservice/ccs/controller/ViewStatisticsController.java @@ -1,4 +1,53 @@ package com.cloudservice.ccs.controller; + +import com.cloudservice.ccs.biz.ITagsBiz; +import com.cloudservice.ccs.biz.IViewStatisticsBiz; +import com.cloudservice.ccs.entity.Tags; +import com.cloudservice.ccs.entity.ViewStatistics; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/view-statistics") public class ViewStatisticsController { + @Autowired + IViewStatisticsBiz viewStatisticsBiz; + + @PostMapping("/") + void save(@RequestBody ViewStatistics viewStatistics) { + // 接口问题待讨论:是否应当返回生成的 id? + viewStatisticsBiz.save(viewStatistics); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody ViewStatistics viewStatistics) { + viewStatisticsBiz.update(id, viewStatistics); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + viewStatisticsBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + ViewStatistics result = viewStatisticsBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @RequiresPermissions("all") + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("view-statistics", viewStatisticsBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/VisitorInfoController.java b/src/main/java/com/cloudservice/ccs/controller/VisitorInfoController.java index f217f82c1c1454e95b749f37e6960f0546b948e0..ed0be282e0c60140edf3f5e20818286b5e39a6ee 100644 --- a/src/main/java/com/cloudservice/ccs/controller/VisitorInfoController.java +++ b/src/main/java/com/cloudservice/ccs/controller/VisitorInfoController.java @@ -1,4 +1,51 @@ package com.cloudservice.ccs.controller; + +import com.cloudservice.ccs.biz.IVisitorInfoBiz; +import com.cloudservice.ccs.entity.VisitorInfo; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/visitor-info") public class VisitorInfoController { + @Autowired + IVisitorInfoBiz visitorInfoBiz; + + @PostMapping("/") + void save(@RequestBody VisitorInfo visitorInfo) { + // 接口问题待讨论:是否应当返回生成的 id? + visitorInfoBiz.save(visitorInfo); + } + + @PutMapping("/{ip}") + void update(@PathVariable String ip, @RequestBody VisitorInfo visitorInfo) { + visitorInfoBiz.update(ip, visitorInfo); + } + + @DeleteMapping("/{ip}") + void delete(@PathVariable String ip) { + visitorInfoBiz.delete(ip); + } + + @GetMapping("/{ip}") + ResponseEntity queryById(@PathVariable String ip) { + VisitorInfo result = visitorInfoBiz.getOne(ip); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @RequiresPermissions("all") + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("visitor-info", visitorInfoBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/WorkLogController.java b/src/main/java/com/cloudservice/ccs/controller/WorkLogController.java index f6eaf3e5b2c2b60c9c07113567c242f9d89f6172..aeae5ff27e959e76e49f2e0fa3ca8bc88c909091 100644 --- a/src/main/java/com/cloudservice/ccs/controller/WorkLogController.java +++ b/src/main/java/com/cloudservice/ccs/controller/WorkLogController.java @@ -1,4 +1,55 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.IWorkLogBiz; +import com.cloudservice.ccs.entity.CustomerService; +import com.cloudservice.ccs.entity.WorkLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RequestMapping("work-log") public class WorkLogController { + @Autowired + IWorkLogBiz workLogBiz; + + @PostMapping("/") + void save(@RequestBody WorkLog workLog) { + // 接口问题待讨论:是否应当返回生成的 id? + workLogBiz.save(workLog); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody WorkLog workLog) { + workLogBiz.update(id, workLog); + } + + @PutMapping("/{id}/partial") + void partialUpdate(@PathVariable Integer id, @RequestBody Map fields) { + workLogBiz.partialUpdate(id, fields); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + workLogBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + WorkLog result = workLogBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @RequiresPermissions("all") + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("customer-services", workLogBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/WorkOrderController.java b/src/main/java/com/cloudservice/ccs/controller/WorkOrderController.java index c8b4131f07d6f5486e3beb564a35607ee53a8693..5ab4ba94ef0cd1b553daf6375f7f4a87ee41b89e 100644 --- a/src/main/java/com/cloudservice/ccs/controller/WorkOrderController.java +++ b/src/main/java/com/cloudservice/ccs/controller/WorkOrderController.java @@ -1,4 +1,53 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.IWorkOrderBiz; +import com.cloudservice.ccs.entity.WorkOrder; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public class WorkOrderController { + @Autowired + IWorkOrderBiz workOrderBiz; + + @PostMapping("/") + void save(@RequestBody WorkOrder workOrder) { + // 接口问题待讨论:是否应当返回生成的 id? + workOrderBiz.save(workOrder); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody WorkOrder workOrder) { + workOrderBiz.update(id, workOrder); + } + + @PutMapping("/{id}/partial") + void partialUpdate(@PathVariable Integer id, @RequestBody Map fields) { + workOrderBiz.partialUpdate(id, fields); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + workOrderBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + WorkOrder result = workOrderBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @RequiresPermissions("all") + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("customer-services", workOrderBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/WorkOrderReplyController.java b/src/main/java/com/cloudservice/ccs/controller/WorkOrderReplyController.java index 0420d03daae0dcc22f277e47ae9a5c6e26ba6c39..ec1023569fff5095dfb68ebb90afd750cb7383a5 100644 --- a/src/main/java/com/cloudservice/ccs/controller/WorkOrderReplyController.java +++ b/src/main/java/com/cloudservice/ccs/controller/WorkOrderReplyController.java @@ -1,4 +1,53 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.IWorkOrderReplyBiz; +import com.cloudservice.ccs.entity.WorkOrderReply; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public class WorkOrderReplyController { + @Autowired + IWorkOrderReplyBiz workOrderReplyBiz; + + @PostMapping("/") + void save(@RequestBody WorkOrderReply workOrderReply) { + // 接口问题待讨论:是否应当返回生成的 id? + workOrderReplyBiz.save(workOrderReply); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody WorkOrderReply workOrderReply) { + workOrderReplyBiz.update(id, workOrderReply); + } + + @PutMapping("/{id}/partial") + void partialUpdate(@PathVariable Integer id, @RequestBody Map fields) { + workOrderReplyBiz.partialUpdate(id, fields); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + workOrderReplyBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + WorkOrderReply result = workOrderReplyBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @RequiresPermissions("all") + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("customer-services", workOrderReplyBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/WorkQualityStatisticsController.java b/src/main/java/com/cloudservice/ccs/controller/WorkQualityStatisticsController.java index c52781653751000c476005e8f01206797efba38e..3ee147835ace2bb5b166ec82629b627135f29a47 100644 --- a/src/main/java/com/cloudservice/ccs/controller/WorkQualityStatisticsController.java +++ b/src/main/java/com/cloudservice/ccs/controller/WorkQualityStatisticsController.java @@ -1,4 +1,53 @@ package com.cloudservice.ccs.controller; +import com.cloudservice.ccs.biz.IWorkQualityStatisticsBiz; +import com.cloudservice.ccs.entity.WorkQualityStatistics; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public class WorkQualityStatisticsController { + @Autowired + IWorkQualityStatisticsBiz workQualityStatisticsBiz; + + @PostMapping("/") + void save(@RequestBody WorkQualityStatistics workQualityStatistics) { + // 接口问题待讨论:是否应当返回生成的 id? + workQualityStatisticsBiz.save(workQualityStatistics); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody WorkQualityStatistics workQualityStatistics) { + workQualityStatisticsBiz.update(id, workQualityStatistics); + } + + @PutMapping("/{id}/partial") + void partialUpdate(@PathVariable Integer id, @RequestBody Map fields) { + workQualityStatisticsBiz.partialUpdate(id, fields); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + workQualityStatisticsBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + WorkQualityStatistics result = workQualityStatisticsBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @RequiresPermissions("all") + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("customer-services", workQualityStatisticsBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/controller/WorkloadStatisticsController.java b/src/main/java/com/cloudservice/ccs/controller/WorkloadStatisticsController.java index 29dade618b8df7287af3ac07ec9652b0b30a607f..20dd44bbeba725d0b6eae3442be8a8a09d6cb3b1 100644 --- a/src/main/java/com/cloudservice/ccs/controller/WorkloadStatisticsController.java +++ b/src/main/java/com/cloudservice/ccs/controller/WorkloadStatisticsController.java @@ -1,4 +1,51 @@ package com.cloudservice.ccs.controller; + +import com.cloudservice.ccs.biz.IWorkloadStatisticsBiz; +import com.cloudservice.ccs.entity.WorkloadStatistics; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("/workload-statistics") public class WorkloadStatisticsController { + @Autowired + IWorkloadStatisticsBiz workloadStatisticsBiz; + + @PostMapping("/") + void save(@RequestBody WorkloadStatistics workloadStatistics) { + // 接口问题待讨论:是否应当返回生成的 id? + workloadStatisticsBiz.save(workloadStatistics); + } + + @PutMapping("/{id}") + void update(@PathVariable Integer id, @RequestBody WorkloadStatistics workloadStatistics) { + workloadStatisticsBiz.update(id, workloadStatistics); + } + + @DeleteMapping("/{id}") + void delete(@PathVariable Integer id) { + workloadStatisticsBiz.delete(id); + } + + @GetMapping("/{id}") + ResponseEntity queryById(@PathVariable Integer id) { + WorkloadStatistics result = workloadStatisticsBiz.getOne(id); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + @RequiresPermissions("all") + @GetMapping("/") + ResponseEntity>> queryAll() { + Map> result = new HashMap<>(); + result.put("workload-statistics", workloadStatisticsBiz.getAll()); + return new ResponseEntity<>(result, HttpStatus.OK); + } } diff --git a/src/main/java/com/cloudservice/ccs/entity/BlackList.java b/src/main/java/com/cloudservice/ccs/entity/BlackList.java index c2b562042e88fbc2a1702a726d0aa45996bd3630..00507fa15d1437bd429f2f7660b2676e501d3b3d 100644 --- a/src/main/java/com/cloudservice/ccs/entity/BlackList.java +++ b/src/main/java/com/cloudservice/ccs/entity/BlackList.java @@ -1,6 +1,7 @@ package com.cloudservice.ccs.entity; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -9,6 +10,8 @@ public class BlackList { private Integer customerServiceId; private Integer customerId; private String reason; + + @DateTimeFormat(pattern = "yyyy-MM-dd") private Date time; private String source; } diff --git a/src/main/java/com/cloudservice/ccs/entity/CustomerInfo.java b/src/main/java/com/cloudservice/ccs/entity/CustomerInfo.java index 8a79038852e1a94c89b618a3f578ac103b8ec8a6..67efd4d70f237b05e0e18ff1aaa85006d86959de 100644 --- a/src/main/java/com/cloudservice/ccs/entity/CustomerInfo.java +++ b/src/main/java/com/cloudservice/ccs/entity/CustomerInfo.java @@ -1,6 +1,7 @@ package com.cloudservice.ccs.entity; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -18,5 +19,7 @@ public class CustomerInfo { private Integer tagsId; private String remark; private Integer customerServiceId; + + @DateTimeFormat(pattern = "yyyy-MM-dd") private Date lastedLoginTime; } diff --git a/src/main/java/com/cloudservice/ccs/entity/CustomerService.java b/src/main/java/com/cloudservice/ccs/entity/CustomerService.java index e8ceaca98b5b0da0c6b1221745172b0986a1cb93..8d15fbb7a7cc98d91c706b4bf7a4645ea9dfb24e 100644 --- a/src/main/java/com/cloudservice/ccs/entity/CustomerService.java +++ b/src/main/java/com/cloudservice/ccs/entity/CustomerService.java @@ -1,6 +1,7 @@ package com.cloudservice.ccs.entity; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @@ -16,7 +17,9 @@ public class CustomerService { private String customerServicePhone; private Integer customerServiceId; private Integer totalOnlineTime; + @DateTimeFormat(pattern = "yyyy-MM-dd") private Date onlineTimeBegin; + @DateTimeFormat(pattern = "yyyy-MM-dd") private Date onlineTimeEnd; private Integer sessionCount; private Integer msgCount; diff --git a/src/main/java/com/cloudservice/ccs/entity/VisitorInfo.java b/src/main/java/com/cloudservice/ccs/entity/VisitorInfo.java index 307886d125129edc3982c78dd7d5856bf4a61566..130c1f8da7de983f058638fb8bb631077c2357aa 100644 --- a/src/main/java/com/cloudservice/ccs/entity/VisitorInfo.java +++ b/src/main/java/com/cloudservice/ccs/entity/VisitorInfo.java @@ -13,4 +13,7 @@ public class VisitorInfo { private Integer customerServiceId; private String state; private Integer visitDuration; + + + private Data visitTime; } diff --git a/src/main/java/com/cloudservice/ccs/mapper/CustomerServiceMapper.java b/src/main/java/com/cloudservice/ccs/mapper/CustomerServiceMapper.java index 45c9779c214485b07bd074951c039e873d6ca0df..f710af5232deae47dbd6313843f3dbdc1d82a5e9 100644 --- a/src/main/java/com/cloudservice/ccs/mapper/CustomerServiceMapper.java +++ b/src/main/java/com/cloudservice/ccs/mapper/CustomerServiceMapper.java @@ -4,6 +4,7 @@ import com.cloudservice.ccs.entity.CustomerService; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; @Mapper public interface CustomerServiceMapper { @@ -12,6 +13,8 @@ public interface CustomerServiceMapper { int update(Integer id, CustomerService customerService); + int partialUpdate(Integer id, Map fields); + int delete(Integer id); CustomerService getOne(Integer id); diff --git a/src/main/java/com/cloudservice/ccs/mapper/SessionMapper.java b/src/main/java/com/cloudservice/ccs/mapper/SessionMapper.java index 2875cbd17752b130e364d3b16603f933eea637a5..da915c46db15e70ee219029280342ab100d83aea 100644 --- a/src/main/java/com/cloudservice/ccs/mapper/SessionMapper.java +++ b/src/main/java/com/cloudservice/ccs/mapper/SessionMapper.java @@ -8,9 +8,9 @@ import java.util.List; @Mapper public interface SessionMapper { - int save(SessionMapper sessionMapper); + int save(Session session); - int update(Integer id, SessionMapper sessionMapper); + int update(Integer id, Session session); int delete(Integer id); diff --git a/src/main/java/com/cloudservice/ccs/mapper/VisitorInfoMapper.java b/src/main/java/com/cloudservice/ccs/mapper/VisitorInfoMapper.java index c0248440e74e4dfa262bfd616113be79e8002ef0..cb538b7cfb8a637d2efb653b0f223f6bf6731c13 100644 --- a/src/main/java/com/cloudservice/ccs/mapper/VisitorInfoMapper.java +++ b/src/main/java/com/cloudservice/ccs/mapper/VisitorInfoMapper.java @@ -11,7 +11,7 @@ import java.util.List; public interface VisitorInfoMapper { int save(VisitorInfo visitorInfo); - int update(Integer id, VisitorInfo visitorInfo); + int update(String ip, VisitorInfo visitorInfo); int delete(String ip); diff --git a/src/main/java/com/cloudservice/ccs/mapper/WorkLogMapper.java b/src/main/java/com/cloudservice/ccs/mapper/WorkLogMapper.java index 59c02f939fb0a1df6354259f69a0efd1ca980bfb..bae1b539a95c5f11ed1a2a1e67d646fff1eabe9c 100644 --- a/src/main/java/com/cloudservice/ccs/mapper/WorkLogMapper.java +++ b/src/main/java/com/cloudservice/ccs/mapper/WorkLogMapper.java @@ -6,6 +6,7 @@ import com.cloudservice.ccs.entity.WorkloadStatistics; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; @Mapper public interface WorkLogMapper { @@ -13,6 +14,8 @@ public interface WorkLogMapper { int update(Integer id, WorkLog workLog); + int partialUpdate(Integer id, Map fields); + int delete(Integer id); WorkLog getOne(Integer id); diff --git a/src/main/java/com/cloudservice/ccs/mapper/WorkOrderMapper.java b/src/main/java/com/cloudservice/ccs/mapper/WorkOrderMapper.java index 3f54881a57672f43d374800cc2615a0d9801112b..f2fc612ef44eec79bd2556bc4fa5d3a0ab3db248 100644 --- a/src/main/java/com/cloudservice/ccs/mapper/WorkOrderMapper.java +++ b/src/main/java/com/cloudservice/ccs/mapper/WorkOrderMapper.java @@ -6,6 +6,7 @@ import com.cloudservice.ccs.entity.WorkOrder; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; @Mapper public interface WorkOrderMapper { @@ -13,6 +14,8 @@ public interface WorkOrderMapper { int update(Integer id, WorkOrder workOrder); + int partialUpdate(Integer id, Map fields); + int delete(Integer id); WorkOrder getOne(Integer id); diff --git a/src/main/java/com/cloudservice/ccs/mapper/WorkOrderReplyMapper.java b/src/main/java/com/cloudservice/ccs/mapper/WorkOrderReplyMapper.java index 0a9cd481cc7344d532720e5edb1fdb4864d9b0a7..3166a263cb79ab02d49839c0a95814a934c301aa 100644 --- a/src/main/java/com/cloudservice/ccs/mapper/WorkOrderReplyMapper.java +++ b/src/main/java/com/cloudservice/ccs/mapper/WorkOrderReplyMapper.java @@ -6,6 +6,7 @@ import com.cloudservice.ccs.entity.WorkOrderReply; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; @Mapper public interface WorkOrderReplyMapper { @@ -13,6 +14,8 @@ public interface WorkOrderReplyMapper { int update(Integer workOrderId, WorkOrderReply WorkOrderReply); + int partialUpdate(Integer id, Map fields); + int delete(Integer workOrderId); WorkOrderReply getOne(Integer workOrderId); diff --git a/src/main/java/com/cloudservice/ccs/mapper/WorkQualityStatisticsMapper.java b/src/main/java/com/cloudservice/ccs/mapper/WorkQualityStatisticsMapper.java index f1cdfef9ff431d7b09ed62a42ba87a20178c442e..41666720c4c95414f347bd3d71f4a91cd605c6b0 100644 --- a/src/main/java/com/cloudservice/ccs/mapper/WorkQualityStatisticsMapper.java +++ b/src/main/java/com/cloudservice/ccs/mapper/WorkQualityStatisticsMapper.java @@ -6,6 +6,7 @@ import com.cloudservice.ccs.entity.WorkQualityStatistics; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; @Mapper public interface WorkQualityStatisticsMapper { @@ -13,6 +14,8 @@ public interface WorkQualityStatisticsMapper { int update(Integer id, WorkQualityStatistics workQualityStatistics); + int partialUpdate(Integer id, Map fields); + int delete(Integer id); WorkQualityStatistics getOne(Integer id); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index c1d2d2236f9dc7ce69d0088f2ca96efbe2a8fc78..635175f72cf0e9bcbb5cd158b9f584143d53a028 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -3,6 +3,9 @@ spring: password: Biri-biri&Sisters url: jdbc:mysql://bank.accelerator.wtf/ccs username: misaka + jackson: + date-format: 'yyyy-MM-dd' + time-zone: 'Asia/Shanghai' mybatis: mapper-locations: classpath:mapper/*.xml diff --git a/src/main/resources/mapper/CustomerServiceMapper.xml b/src/main/resources/mapper/CustomerServiceMapper.xml index 970a5e69a4209ada86638218e5b9823812da22a3..9a19c9dea88ffb7aad6c78e470560a0390eecd6f 100644 --- a/src/main/resources/mapper/CustomerServiceMapper.xml +++ b/src/main/resources/mapper/CustomerServiceMapper.xml @@ -13,7 +13,9 @@ UPDATE customer_service SET + phone = #{customerService.phone}, + password = #{customerService.password}, headImg = #{customerService.headImg}, email = #{customerService.email}, @@ -31,6 +33,14 @@ WHERE customerServiceId = #{id}; + + UPDATE customer_service SET + + ${field} = #{value} + + WHERE customerServiceId = #{id}; + + DELETE FROM customer_service WHERE customerServiceId = #{id}; diff --git a/src/main/resources/mapper/WorkLogMapper.xml b/src/main/resources/mapper/WorkLogMapper.xml index 5533b0419633da5d417c5fec4ef5b2e6827e39d1..5613f1ee1f7c4af545a055bb1f68e6202d732ee2 100644 --- a/src/main/resources/mapper/WorkLogMapper.xml +++ b/src/main/resources/mapper/WorkLogMapper.xml @@ -13,12 +13,20 @@ UPDATE work_log SET - id = #{WorkLog.id}, - operatePerson = #{WorkLog.operatePerson}, - operatorAction = #{WorkLog.operatorAction}, - operatorClass = #{WorkLog.operatorClass}, - operatorTime = #{WorkLog.operatorTime}, - operatorIp = #{WorkLog.operatorIp} + id = #{workLog.id}, + operatePerson = #{workLog.operatePerson}, + operatorAction = #{workLog.operatorAction}, + operatorClass = #{workLog.operatorClass}, + operatorTime = #{workLog.operatorTime}, + operatorIp = #{workLog.operatorIp} + WHERE id = #{id}; + + + + UPDATE work_log SET + + ${field} = #{value} + WHERE id = #{id}; diff --git a/src/main/resources/mapper/WorkOrderMapper.xml b/src/main/resources/mapper/WorkOrderMapper.xml index 70b627a6ee3b6b5997de1ed08323d417b6cd2ac6..a28fc075379612ada88bedc3e46052568cdae42c 100644 --- a/src/main/resources/mapper/WorkOrderMapper.xml +++ b/src/main/resources/mapper/WorkOrderMapper.xml @@ -13,19 +13,26 @@ UPDATE work_order SET - id = #{WorkOrder.id}, - workType = #{WorkOrder.workType}, - title = #{WorkOrder.title}, - workDesc = #{WorkOrder.workDesc}, - attachments = #{WorkOrder.attachments}, - cclist = #{WorkOrder.cclist}, - priority = #{WorkOrder.priority}, - state = #{WorkOrder.state}, - customerServiceGroupId = #{WorkOrder.customerServiceGroupId}, - customerServiceId = #{WorkOrder.customerServiceId}, - custmerId = #{WorkOrder.custmerId}, - channel = #{WorkOrder.channel} + id = #{workOrder.id}, + workType = #{workOrder.workType}, + title = #{workOrder.title}, + orderDesc = #{workOrder.orderDesc}, + attachments = #{workOrder.attachments}, + cclist = #{workOrder.cclist}, + priority = #{workOrder.priority}, + state = #{workOrder.state}, + customerServiceGroupId = #{workOrder.customerServiceGroupId}, + customerServiceId = #{workOrder.customerServiceId}, + custmerId = #{workOrder.custmerId}, + channel = #{workOrder.channel} + WHERE id = #{id}; + + + UPDATE work_order SET + + ${field} = #{value} + WHERE id = #{id}; diff --git a/src/main/resources/mapper/WorkOrderReplyMapper.xml b/src/main/resources/mapper/WorkOrderReplyMapper.xml index bb15f9b3ee241f873559a7490a1a5377f189c504..cb54abdc4c843177a3842810033ebdaa73df7114 100644 --- a/src/main/resources/mapper/WorkOrderReplyMapper.xml +++ b/src/main/resources/mapper/WorkOrderReplyMapper.xml @@ -13,14 +13,22 @@ UPDATE work_order_reply SET - workOrderId = #{WorkOrderReply.workOrderId}, - customerServiceId = #{WorkOrderReply.customerServiceId}, - replyTime = #{WorkOrderReply.replyTime}, - content = #{WorkOrderReply.content} + workOrderId = #{workOrderReply.workOrderId}, + customerServiceId = #{workOrderReply.customerServiceId}, + replyTime = #{workOrderReply.replyTime}, + content = #{workOrderReply.content} WHERE workOrderId = #{workOrderId}; + + UPDATE work_order_reply SET + + ${field} = #{value} + + WHERE workOrderId = #{id}; + + DELETE FROM work_order_reply WHERE workOrderId = #{workOrderId}; diff --git a/src/main/resources/mapper/WorkQualityStatisticsMapper.xml b/src/main/resources/mapper/WorkQualityStatisticsMapper.xml index 21de99533fa659c315e51674a77439ef3892bb0e..9baf0c7dd8ceb8f52106810f77cc3b38eacf0595 100644 --- a/src/main/resources/mapper/WorkQualityStatisticsMapper.xml +++ b/src/main/resources/mapper/WorkQualityStatisticsMapper.xml @@ -13,15 +13,23 @@ UPDATE work_quality_statistics SET - id = #{WorkQualityStatistics.id}, - nickName = #{WorkQualityStatistics.nickName}, - effectiveSessionCount = #{WorkQualityStatistics.effectiveSessionCount}, - resolved = #{WorkQualityStatistics.resolved}, - unsolved = #{WorkQualityStatistics.unsolved}, - goodReview = #{WorkQualityStatistics.goodReview}, - mediumReview = #{WorkQualityStatistics.mediumReview}, - badReview = #{WorkQualityStatistics.badReview}, - noReview = #{WorkQualityStatistics.noReview} + id = #{workQualityStatistics.id}, + nickName = #{workQualityStatistics.nickName}, + effectiveSessionCount = #{workQualityStatistics.effectiveSessionCount}, + resolved = #{workQualityStatistics.resolved}, + unsolved = #{workQualityStatistics.unsolved}, + goodReview = #{workQualityStatistics.goodReview}, + mediumReview = #{workQualityStatistics.mediumReview}, + badReview = #{workQualityStatistics.badReview}, + noReview = #{workQualityStatistics.noReview} + WHERE id = #{id}; + + + + UPDATE work_quality_statistics SET + + ${field} = #{value} + WHERE id = #{id};