Commit 22d9b0f2 by zhanghj

V1.2.0--技工端增加订货单,增加给对应服务商发送短信

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@21947 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent c00c2354
...@@ -2,6 +2,7 @@ package com.glsx.common.feign.client; ...@@ -2,6 +2,7 @@ package com.glsx.common.feign.client;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.glsx.common.config.FeignConfig; import com.glsx.common.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -67,4 +68,20 @@ public interface CommonClient { ...@@ -67,4 +68,20 @@ public interface CommonClient {
*/ */
@RequestMapping(value="/carservice/publicservice/common/sendDeviceSms", method= RequestMethod.GET) @RequestMapping(value="/carservice/publicservice/common/sendDeviceSms", method= RequestMethod.GET)
public JSONObject sendDeviceSms(@RequestParam("phone")String phone,@RequestParam("indentNo")String indentNo); public JSONObject sendDeviceSms(@RequestParam("phone")String phone,@RequestParam("indentNo")String indentNo);
/**
*
* @author zhanghj
* @Title: sendSmsToService
* @Description: TODO 向对应服务商发送新增订货单短信
* @param mechanicName
* @param phone
* @param indentNo
* @return
* JSONObject
*
*/
@RequestMapping(value="/carservice/publicservice/common/sendIndentSmsToService", method= RequestMethod.GET)
public JSONObject sendIndentSmsToService(@RequestParam("mechanicName")String mechanicName, @RequestParam("phone") String phone,
@RequestParam("indentNo")String indentNo);
} }
...@@ -7,12 +7,8 @@ import javax.servlet.http.HttpServletRequest; ...@@ -7,12 +7,8 @@ import javax.servlet.http.HttpServletRequest;
import com.glsx.common.constants.ResultObject; import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.Page; import com.glsx.common.utils.Page;
import com.glsx.ordercenter.pojo.SysIndent; import com.glsx.ordercenter.pojo.SysIndent;
import com.glsx.ordercenter.pojo.SysIndentLog;
import com.glsx.ordercenter.pojo.SysIndentLogModel; import com.glsx.ordercenter.pojo.SysIndentLogModel;
import com.glsx.ordercenter.pojo.SysIndentLogistics; import com.glsx.ordercenter.pojo.SysIndentLogistics;
import com.glsx.ordercenter.pojo.SysOrder;
import java.util.List;
/** /**
......
...@@ -8,6 +8,8 @@ import java.util.Map; ...@@ -8,6 +8,8 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -17,6 +19,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -17,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glsx.common.constants.Constants; import com.glsx.common.constants.Constants;
import com.glsx.common.constants.ResultObject; import com.glsx.common.constants.ResultObject;
import com.glsx.common.feign.client.CommonClient;
import com.glsx.common.feign.client.UserClient; import com.glsx.common.feign.client.UserClient;
import com.glsx.common.utils.DateUtil; import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.Page; import com.glsx.common.utils.Page;
...@@ -48,6 +51,8 @@ import com.glsx.ordercenter.service.ReceiveAddressService; ...@@ -48,6 +51,8 @@ import com.glsx.ordercenter.service.ReceiveAddressService;
@Service @Service
public class IndentServiceImpl implements IndentService { public class IndentServiceImpl implements IndentService {
private Logger logger = LoggerFactory.getLogger(IndentServiceImpl.class);
@Autowired @Autowired
private SysIndentMapper indentDao; private SysIndentMapper indentDao;
...@@ -78,6 +83,9 @@ public class IndentServiceImpl implements IndentService { ...@@ -78,6 +83,9 @@ public class IndentServiceImpl implements IndentService {
@Autowired @Autowired
private LogisticsService logisticsService; private LogisticsService logisticsService;
@Autowired
private CommonClient commonClient;
@Override @Override
@Transactional @Transactional
public ResultObject add(HttpServletRequest request, SysIndent indent) { public ResultObject add(HttpServletRequest request, SysIndent indent) {
...@@ -86,6 +94,9 @@ public class IndentServiceImpl implements IndentService { ...@@ -86,6 +94,9 @@ public class IndentServiceImpl implements IndentService {
Integer terminalType = indent.getTerminalType(); Integer terminalType = indent.getTerminalType();
Integer sendType = BizConstants.INDENT_SEND_TYPE_GLSX; Integer sendType = BizConstants.INDENT_SEND_TYPE_GLSX;
Integer indentStatus = IndentStatusEnum.INDENT_WAITDELIVER.getIndentStatus(); Integer indentStatus = IndentStatusEnum.INDENT_WAITDELIVER.getIndentStatus();
String mechanicName = "";
String servicePhone = "";
/* /*
* 技工端发订货单,先判断发货方式 * 技工端发订货单,先判断发货方式
*/ */
...@@ -100,6 +111,8 @@ public class IndentServiceImpl implements IndentService { ...@@ -100,6 +111,8 @@ public class IndentServiceImpl implements IndentService {
int userSendType = object.getIntValue("sendType"); int userSendType = object.getIntValue("sendType");
if (BizConstants.INDENT_SEND_TYPE_SERVICE == userSendType) { if (BizConstants.INDENT_SEND_TYPE_SERVICE == userSendType) {
sendType = BizConstants.INDENT_SEND_TYPE_SERVICE; sendType = BizConstants.INDENT_SEND_TYPE_SERVICE;
mechanicName = object.getString("name");
servicePhone = object.getString("phoneNumber");
} }
} }
} }
...@@ -130,8 +143,19 @@ public class IndentServiceImpl implements IndentService { ...@@ -130,8 +143,19 @@ public class IndentServiceImpl implements IndentService {
int num = indentDao.insertSelective(indent); int num = indentDao.insertSelective(indent);
if (num >0) { if (num >0) {
/* /*
* 添加操作日志 * 若是技工端,并且是给服务商发的订货单,发送短信
*/ */
if (Constants.USER_TYPE_MECHANIC == terminalType) {
if (sendType == BizConstants.INDENT_SEND_TYPE_SERVICE) {
//给对应服务商发短信
try {
logger.info("技工端增加订货单,发送短信给服务商!");
sendIndentSmsToService(mechanicName, servicePhone, indentNo);
} catch (Exception e) {
logger.info("技工端增加订货单,发送短信给服务商失败" + e);
}
}
}
/* /*
* 添加操作日志 * 添加操作日志
*/ */
...@@ -144,6 +168,13 @@ public class IndentServiceImpl implements IndentService { ...@@ -144,6 +168,13 @@ public class IndentServiceImpl implements IndentService {
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg()); return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg());
} }
private void sendIndentSmsToService(String mechanicName, String phone,
String indentNo) {
// TODO Auto-generated method stub
commonClient.sendIndentSmsToService(mechanicName, phone, indentNo);
}
@Override @Override
public Integer sendDevice(Integer userId,SysIndentLogistics sysIndentLogistics) { public Integer sendDevice(Integer userId,SysIndentLogistics sysIndentLogistics) {
//修改订单状态为待收货 //修改订单状态为待收货
......
...@@ -17,6 +17,11 @@ import java.util.List; ...@@ -17,6 +17,11 @@ import java.util.List;
public class SysUser extends BaseModel implements Serializable{ public class SysUser extends BaseModel implements Serializable{
/** /**
*
*/
private static final long serialVersionUID = 1L;
/**
* 主键id * 主键id
*/ */
private Integer id; private Integer id;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!