|
@@ -1,14 +1,20 @@
|
|
package com.ygj.yuemum.service.customer;
|
|
package com.ygj.yuemum.service.customer;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.ygj.yuemum.dao.customer.CustomerInfoFeedbackDao;
|
|
import com.ygj.yuemum.dao.customer.CustomerInfoFeedbackDao;
|
|
|
|
+import com.ygj.yuemum.domain.admin.JlAdminUser;
|
|
import com.ygj.yuemum.domain.customer.CustomerInfoFeedback;
|
|
import com.ygj.yuemum.domain.customer.CustomerInfoFeedback;
|
|
|
|
+import com.ygj.yuemum.domain.customer.CustomerInfoServiceLog;
|
|
import com.ygj.yuemum.domain.customer.dto.CustomerInfoFeedbackCyDto;
|
|
import com.ygj.yuemum.domain.customer.dto.CustomerInfoFeedbackCyDto;
|
|
import com.ygj.yuemum.domain.customer.dto.CustomerInfoFeedbackDto;
|
|
import com.ygj.yuemum.domain.customer.dto.CustomerInfoFeedbackDto;
|
|
|
|
+import com.ygj.yuemum.service.admin.JlAdminUserService;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
+import org.apache.shiro.SecurityUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -17,6 +23,12 @@ public class CustomerInfoFeedbackService {
|
|
@Resource
|
|
@Resource
|
|
CustomerInfoFeedbackDao feedbackDao;
|
|
CustomerInfoFeedbackDao feedbackDao;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ CustomerInfoServiceLogService customerInfoServiceLogService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ JlAdminUserService jladminuserService;
|
|
|
|
+
|
|
public List<CustomerInfoFeedback> selectByPageNumSize(CustomerInfoFeedbackDto customerInfoFeedbackDto) {
|
|
public List<CustomerInfoFeedback> selectByPageNumSize(CustomerInfoFeedbackDto customerInfoFeedbackDto) {
|
|
PageHelper.startPage(customerInfoFeedbackDto.getPage(), customerInfoFeedbackDto.getLimit(), true, false);
|
|
PageHelper.startPage(customerInfoFeedbackDto.getPage(), customerInfoFeedbackDto.getLimit(), true, false);
|
|
return feedbackDao.selectByPageNumSize(customerInfoFeedbackDto);
|
|
return feedbackDao.selectByPageNumSize(customerInfoFeedbackDto);
|
|
@@ -26,7 +38,12 @@ public class CustomerInfoFeedbackService {
|
|
if (StringUtils.isBlank(customerInfoFeedback.getFb_remarks())) {
|
|
if (StringUtils.isBlank(customerInfoFeedback.getFb_remarks())) {
|
|
customerInfoFeedback.setFb_remarks("");
|
|
customerInfoFeedback.setFb_remarks("");
|
|
}
|
|
}
|
|
- return feedbackDao.insertInfoFeedback(customerInfoFeedback);
|
|
|
|
|
|
+ int count = feedbackDao.insertInfoFeedback(customerInfoFeedback);
|
|
|
|
+ if (count != 0) {
|
|
|
|
+ this.insertServiceLog(customerInfoFeedback.getId(), "新增", customerInfoFeedback);
|
|
|
|
+ return count;
|
|
|
|
+ }
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
public CustomerInfoFeedback getById(Integer id) {
|
|
public CustomerInfoFeedback getById(Integer id) {
|
|
@@ -34,6 +51,7 @@ public class CustomerInfoFeedbackService {
|
|
}
|
|
}
|
|
|
|
|
|
public int updateByPrimaryKeySelective(CustomerInfoFeedback customerInfoFeedback) {
|
|
public int updateByPrimaryKeySelective(CustomerInfoFeedback customerInfoFeedback) {
|
|
|
|
+ this.insertServiceLog(customerInfoFeedback.getId(), "修改", customerInfoFeedback);
|
|
return feedbackDao.updateByPrimaryKeySelective(customerInfoFeedback);
|
|
return feedbackDao.updateByPrimaryKeySelective(customerInfoFeedback);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -41,4 +59,20 @@ public class CustomerInfoFeedbackService {
|
|
feedbackDao.insertInfoFeedbackList(customerInfoFeedbacks);
|
|
feedbackDao.insertInfoFeedbackList(customerInfoFeedbacks);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void insertServiceLog(Integer sl_no, String type, CustomerInfoFeedback customerInfoBasic) {
|
|
|
|
+ String principal = (String) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
+ JlAdminUser jlAdminUser = jladminuserService.getUserMkt(principal);
|
|
|
|
+
|
|
|
|
+ CustomerInfoServiceLog customerInfoServiceLog = new CustomerInfoServiceLog();
|
|
|
|
+ customerInfoServiceLog.setSl_userid(jlAdminUser.getId());
|
|
|
|
+ customerInfoServiceLog.setSl_username(jlAdminUser.getName());
|
|
|
|
+ customerInfoServiceLog.setSl_createdate(new Date());
|
|
|
|
+ customerInfoServiceLog.setSl_no(sl_no);
|
|
|
|
+ customerInfoServiceLog.setSl_table("customer_info_feedback");
|
|
|
|
+ customerInfoServiceLog.setSl_type(type);
|
|
|
|
+ customerInfoServiceLog.setSl_comment(JSONObject.toJSONString(customerInfoBasic));
|
|
|
|
+
|
|
|
|
+ customerInfoServiceLogService.insert(customerInfoServiceLog);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|