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;
import com.alibaba.fastjson.JSONObject;
import com.glsx.common.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -67,4 +68,20 @@ public interface CommonClient {
*/
@RequestMapping(value="/carservice/publicservice/common/sendDeviceSms", method= RequestMethod.GET)
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;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.Page;
import com.glsx.ordercenter.pojo.SysIndent;
import com.glsx.ordercenter.pojo.SysIndentLog;
import com.glsx.ordercenter.pojo.SysIndentLogModel;
import com.glsx.ordercenter.pojo.SysIndentLogistics;
import com.glsx.ordercenter.pojo.SysOrder;
import java.util.List;
/**
......
......@@ -8,6 +8,8 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -17,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.glsx.common.constants.Constants;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.feign.client.CommonClient;
import com.glsx.common.feign.client.UserClient;
import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.Page;
......@@ -48,6 +51,8 @@ import com.glsx.ordercenter.service.ReceiveAddressService;
@Service
public class IndentServiceImpl implements IndentService {
private Logger logger = LoggerFactory.getLogger(IndentServiceImpl.class);
@Autowired
private SysIndentMapper indentDao;
......@@ -78,6 +83,9 @@ public class IndentServiceImpl implements IndentService {
@Autowired
private LogisticsService logisticsService;
@Autowired
private CommonClient commonClient;
@Override
@Transactional
public ResultObject add(HttpServletRequest request, SysIndent indent) {
......@@ -86,6 +94,9 @@ public class IndentServiceImpl implements IndentService {
Integer terminalType = indent.getTerminalType();
Integer sendType = BizConstants.INDENT_SEND_TYPE_GLSX;
Integer indentStatus = IndentStatusEnum.INDENT_WAITDELIVER.getIndentStatus();
String mechanicName = "";
String servicePhone = "";
/*
* 技工端发订货单,先判断发货方式
*/
......@@ -100,6 +111,8 @@ public class IndentServiceImpl implements IndentService {
int userSendType = object.getIntValue("sendType");
if (BizConstants.INDENT_SEND_TYPE_SERVICE == userSendType) {
sendType = BizConstants.INDENT_SEND_TYPE_SERVICE;
mechanicName = object.getString("name");
servicePhone = object.getString("phoneNumber");
}
}
}
......@@ -130,8 +143,19 @@ public class IndentServiceImpl implements IndentService {
int num = indentDao.insertSelective(indent);
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 {
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
public Integer sendDevice(Integer userId,SysIndentLogistics sysIndentLogistics) {
//修改订单状态为待收货
......
......@@ -17,6 +17,11 @@ import java.util.List;
public class SysUser extends BaseModel implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 主键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!