Commit 45e5a71e by xiaoyj

提交代码

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@21835 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 3b5ccd6d
...@@ -66,6 +66,7 @@ public enum ResultCodeEnum { ...@@ -66,6 +66,7 @@ public enum ResultCodeEnum {
DEVICE_EXIST(5102,"数据库设备已存在"), DEVICE_EXIST(5102,"数据库设备已存在"),
DEVICE_MWECHANT_NOT_EXIST(5103,"该设备不属于你的服务商库存"), DEVICE_MWECHANT_NOT_EXIST(5103,"该设备不属于你的服务商库存"),
INDENT_COMPLETE_CANNOT_CANCEL(5104, "该订货单已经完成,不允许取消"), INDENT_COMPLETE_CANNOT_CANCEL(5104, "该订货单已经完成,不允许取消"),
INDENT_NOT_EXIST(5105,"订货单不存在")
; ;
/** /**
*状态码 *状态码
......
...@@ -6,7 +6,9 @@ import com.glsx.common.constants.ResultObject; ...@@ -6,7 +6,9 @@ import com.glsx.common.constants.ResultObject;
import com.glsx.ordercenter.constants.ResultCodeEnum; import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.Traces; import com.glsx.ordercenter.dto.Traces;
import com.glsx.ordercenter.dto.TracesVo; import com.glsx.ordercenter.dto.TracesVo;
import com.glsx.ordercenter.pojo.SysIndentLogistics;
import com.glsx.ordercenter.pojo.SysLogistics; import com.glsx.ordercenter.pojo.SysLogistics;
import com.glsx.ordercenter.service.IndentLogisticsService;
import com.glsx.ordercenter.service.LogisticsService; import com.glsx.ordercenter.service.LogisticsService;
import com.glsx.ordercenter.utils.KdApiUtil; import com.glsx.ordercenter.utils.KdApiUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -23,16 +25,24 @@ public class LogisticsController extends BaseController{ ...@@ -23,16 +25,24 @@ public class LogisticsController extends BaseController{
@Autowired @Autowired
private LogisticsService logisticsService; private LogisticsService logisticsService;
@Autowired
private IndentLogisticsService indentLogisticsService;
/** /**
* @author xiaoyj * @author xiaoyj
* @param request * @param request
* @param expCode 快递公司编码 * @param indentId 订货单id
* @param expNo 快递单号
* @return ResultObject * @return ResultObject
*/ */
@RequestMapping(value = "/catLogisticsTrail", method = { RequestMethod.GET, RequestMethod.POST }) @RequestMapping(value = "/catLogisticsTrail", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject catLogisticsTrail(HttpServletRequest request, String expCode, String expNo) { public ResultObject catLogisticsTrail(HttpServletRequest request, Integer indentId) {
//查询订单物流详情
SysIndentLogistics sysIndentLogistics=indentLogisticsService.getByIndentId(indentId);
if (org.springframework.util.StringUtils.isEmpty(sysIndentLogistics)) {
return new ResultObject(ResultCodeEnum.INDENT_NOT_EXIST.getCode(), ResultCodeEnum.INDENT_NOT_EXIST.getMsg());
}
String expCode=sysIndentLogistics.getLogisticsUnicode();
String expNo=sysIndentLogistics.getLogisticsNo();
KdApiUtil kdApiUtil=new KdApiUtil(); KdApiUtil kdApiUtil=new KdApiUtil();
try { try {
String result=kdApiUtil.getOrderTracesByJson(expCode,expNo); String result=kdApiUtil.getOrderTracesByJson(expCode,expNo);
...@@ -48,9 +58,7 @@ public class LogisticsController extends BaseController{ ...@@ -48,9 +58,7 @@ public class LogisticsController extends BaseController{
TracesVo tracesVo=new TracesVo(); TracesVo tracesVo=new TracesVo();
tracesVo.setTraces(list); tracesVo.setTraces(list);
tracesVo.setExNo(expNo); tracesVo.setExNo(expNo);
//通过物流单号查询物流公司 tracesVo.setExpressCompany(sysIndentLogistics.getExpressCompany());
String expressCompany=logisticsService.selectByExpNo(expNo);
tracesVo.setExpressCompany(expressCompany);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(),ResultCodeEnum.SUCCESS.getMsg(),tracesVo); return new ResultObject(ResultCodeEnum.SUCCESS.getCode(),ResultCodeEnum.SUCCESS.getMsg(),tracesVo);
} catch (Exception e) { } catch (Exception e) {
logger.info("物流信息查询异常"); logger.info("物流信息查询异常");
......
package com.glsx.ordercenter.dto;
public class Traces {
private String acceptStation;
private String acceptTime;
public String getAcceptStation() {
return acceptStation;
}
public void setAcceptStation(String acceptStation) {
this.acceptStation = acceptStation;
}
public String getAcceptTime() {
return acceptTime;
}
public void setAcceptTime(String acceptTime) {
this.acceptTime = acceptTime;
}
}
package com.glsx.ordercenter.dto;
import java.util.List;
public class TracesVo {
private String exNo;
private String expressCompany;
private List<Traces> traces;
public String getExNo() {
return exNo;
}
public void setExNo(String exNo) {
this.exNo = exNo;
}
public String getExpressCompany() {
return expressCompany;
}
public void setExpressCompany(String expressCompany) {
this.expressCompany = expressCompany;
}
public List<Traces> getTraces() {
return traces;
}
public void setTraces(List<Traces> traces) {
this.traces = traces;
}
}
...@@ -27,4 +27,6 @@ public interface SysIndentLogisticsMapper { ...@@ -27,4 +27,6 @@ public interface SysIndentLogisticsMapper {
int updateByPrimaryKeySelective(SysIndentLogistics record); int updateByPrimaryKeySelective(SysIndentLogistics record);
int updateByPrimaryKey(SysIndentLogistics record); int updateByPrimaryKey(SysIndentLogistics record);
SysIndentLogistics getByIndentId(Integer indentId);
} }
\ No newline at end of file \ No newline at end of file
...@@ -17,4 +17,6 @@ public interface IndentLogisticsService { ...@@ -17,4 +17,6 @@ public interface IndentLogisticsService {
int addOrUpdateIndentLogistics(HttpServletRequest request, SysIndentLogistics indentLogistics); int addOrUpdateIndentLogistics(HttpServletRequest request, SysIndentLogistics indentLogistics);
SysIndentLogistics getByIndentId(Integer indentId);
} }
...@@ -48,4 +48,9 @@ public class IndentLogisticsServiceImpl implements IndentLogisticsService{ ...@@ -48,4 +48,9 @@ public class IndentLogisticsServiceImpl implements IndentLogisticsService{
return num; return num;
} }
@Override
public SysIndentLogistics getByIndentId(Integer indentId) {
return indentLogisticsDao.getByIndentId(indentId);
}
} }
...@@ -289,4 +289,17 @@ ...@@ -289,4 +289,17 @@
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<select id="getByIndentId" resultType="com.glsx.ordercenter.pojo.SysIndentLogistics">
SELECT
sil.id,
sil.indent_id AS indentId,
sil.logistics_no AS logisticsNo,
sil.logistics_unicode AS logisticsUnicode,
sil.logistics_time AS logisticsTime,
sl.express_company AS expressCompany
FROM
sys_indent_logistics sil
LEFT JOIN sys_logistics sl ON sil.logistics_unicode = sl.unicode
WHERE sil.indent_id=#{indentId}
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!