Commit cbf16fec by zhanghj

V1.2.0--提交订单详情相关代码

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@21782 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent f980e4a2
...@@ -184,4 +184,22 @@ public class IndentController extends BaseController{ ...@@ -184,4 +184,22 @@ public class IndentController extends BaseController{
List<SysIndentLogModel> list=indentService.listIndentLog(indentId); List<SysIndentLogModel> list=indentService.listIndentLog(indentId);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(),ResultCodeEnum.SUCCESS.getMsg(),list); return new ResultObject(ResultCodeEnum.SUCCESS.getCode(),ResultCodeEnum.SUCCESS.getMsg(),list);
} }
/**
*
* @author zhanghj
* @Title: getDetail
* @Description: TODO 获取订单详情
* @param id
* @return
* ResultObject
*
*/
@AuthCheck
@RequestMapping(value="/getDetail", method=RequestMethod.GET)
public ResultObject getDetail(Integer id) {
SysIndent indent = indentService.getDetail(id);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), indent);
}
} }
...@@ -37,4 +37,16 @@ public interface SysIndentMapper { ...@@ -37,4 +37,16 @@ public interface SysIndentMapper {
List<SysIndent> getIndentListByPage(SysIndent indent); List<SysIndent> getIndentListByPage(SysIndent indent);
SysIndent getByIndentNo(String indentNo); SysIndent getByIndentNo(String indentNo);
/**
*
* @author zhanghj
* @Title: getDetail
* @Description: TODO 获取订货单详情
* @param id
* @return
* SysIndent
*
*/
SysIndent getDetail(@Param("id")Integer id);
} }
\ No newline at end of file \ No newline at end of file
...@@ -64,6 +64,10 @@ public class SysIndent extends BaseModel{ ...@@ -64,6 +64,10 @@ public class SysIndent extends BaseModel{
*/ */
private String endDate; private String endDate;
private SysIndentLogistics sysIndentLogistics;
private SysArea sysArea;
public Integer getId() { public Integer getId() {
return id; return id;
} }
...@@ -200,6 +204,22 @@ public class SysIndent extends BaseModel{ ...@@ -200,6 +204,22 @@ public class SysIndent extends BaseModel{
this.username = username; this.username = username;
} }
public SysIndentLogistics getSysIndentLogistics() {
return sysIndentLogistics;
}
public void setSysIndentLogistics(SysIndentLogistics sysIndentLogistics) {
this.sysIndentLogistics = sysIndentLogistics;
}
public SysArea getSysArea() {
return sysArea;
}
public void setSysArea(SysArea sysArea) {
this.sysArea = sysArea;
}
@Override @Override
public String toString() { public String toString() {
return "SysIndent [id=" + id + ", indentNo=" + indentNo + ", sendType=" return "SysIndent [id=" + id + ", indentNo=" + indentNo + ", sendType="
......
...@@ -30,6 +30,8 @@ public class SysIndentLogistics { ...@@ -30,6 +30,8 @@ public class SysIndentLogistics {
private Date updateTime; private Date updateTime;
private String expressCompany;
public Integer getId() { public Integer getId() {
return id; return id;
} }
...@@ -109,4 +111,13 @@ public class SysIndentLogistics { ...@@ -109,4 +111,13 @@ public class SysIndentLogistics {
public void setUpdateTime(Date updateTime) { public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public String getExpressCompany() {
return expressCompany;
}
public void setExpressCompany(String expressCompany) {
this.expressCompany = expressCompany;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -94,4 +94,16 @@ public interface IndentService { ...@@ -94,4 +94,16 @@ public interface IndentService {
List<SysIndentLogModel> listIndentLog(String indentId); List<SysIndentLogModel> listIndentLog(String indentId);
SysIndent getByIndentNo(String indentNo); SysIndent getByIndentNo(String indentNo);
/**
*
* @author zhanghj
* @Title: getDetail
* @Description: TODO 获取订货单详情
* @param id
* @return
* SysIndent
*
*/
SysIndent getDetail(Integer id);
} }
...@@ -24,6 +24,7 @@ import com.glsx.ordercenter.pojo.SysIndentLogModel; ...@@ -24,6 +24,7 @@ import com.glsx.ordercenter.pojo.SysIndentLogModel;
import com.glsx.ordercenter.pojo.SysIndentLogistics; import com.glsx.ordercenter.pojo.SysIndentLogistics;
import com.glsx.ordercenter.pojo.SysReceiveAddress; import com.glsx.ordercenter.pojo.SysReceiveAddress;
import com.glsx.ordercenter.service.DeviceRepertoryService; import com.glsx.ordercenter.service.DeviceRepertoryService;
import com.glsx.ordercenter.service.IAreaService;
import com.glsx.ordercenter.service.IndentService; import com.glsx.ordercenter.service.IndentService;
import com.glsx.ordercenter.service.ReceiveAddressService; import com.glsx.ordercenter.service.ReceiveAddressService;
...@@ -45,6 +46,9 @@ public class IndentServiceImpl implements IndentService { ...@@ -45,6 +46,9 @@ public class IndentServiceImpl implements IndentService {
@Autowired @Autowired
private SysIndentLogMapper indentLogDao; private SysIndentLogMapper indentLogDao;
@Autowired
private IAreaService areaService;
@Override @Override
@Transactional @Transactional
public ResultObject add(SysIndent indent) { public ResultObject add(SysIndent indent) {
...@@ -237,4 +241,13 @@ public class IndentServiceImpl implements IndentService { ...@@ -237,4 +241,13 @@ public class IndentServiceImpl implements IndentService {
return indentDao.getByIndentNo(indentNo); return indentDao.getByIndentNo(indentNo);
} }
@Override
public SysIndent getDetail(Integer id) {
// TODO Auto-generated method stub
SysIndent indent = indentDao.getDetail(id);
Integer districtCode = indent.getDistrictCode();
indent.setSysArea(areaService.getAllChargeItems(districtCode));
return indent;
}
} }
...@@ -302,4 +302,57 @@ ...@@ -302,4 +302,57 @@
<select id="getByIndentNo" resultMap="BaseResultMap"> <select id="getByIndentNo" resultMap="BaseResultMap">
SELECT * from sys_indent WHERE indent_no=#{indentNo} SELECT * from sys_indent WHERE indent_no=#{indentNo}
</select> </select>
<resultMap id="detailResultMap" type="com.glsx.ordercenter.pojo.SysIndent">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="indent_no" jdbcType="VARCHAR" property="indentNo" />
<result column="send_type" jdbcType="INTEGER" property="sendType" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="device_type" jdbcType="VARCHAR" property="deviceType" />
<result column="device_amount" jdbcType="INTEGER" property="deviceAmount" />
<result column="indent_status" jdbcType="INTEGER" property="indentStatus" />
<result column="is_canceled" jdbcType="TINYINT" property="isCanceled" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="receiver_name" jdbcType="VARCHAR" property="receiverName" />
<result column="district_code" jdbcType="INTEGER" property="districtCode" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="deviceName" jdbcType="VARCHAR" property="deviceName" />
<association property="sysIndentLogistics" javaType="com.glsx.ordercenter.pojo.SysIndentLogistics">
<result property="logisticsNo" column="logistics_no"/>
<result property="logisticsTime" column="logistics_time"/>
<result property="logisticsUnicode" column="logistics_unicode"/>
<result property="remark" column="remark"/>
<result property="expressCompany" column="express_company"/>
</association>
</resultMap>
<select id="getDetail" parameterType="java.lang.Integer" resultMap="detailResultMap">
select
si.id, si.indent_no, si.send_type, si.user_id, si.device_type,
si.device_amount, si.indent_status, si.is_canceled, si.phone,
si.receiver_name, si.district_code, si.address, si.remark,
si.create_by, si.create_time, si.update_by, si.update_time,
su.username,
sdd.data_value as deviceName,
sil.logistics_no, sil.logistics_time, sil.logistics_unicode, sil.remark,
sl.express_company,
sa1.id as districtCode, sa1.area_name as district,
sa2.id as cityCode, sa2.area_name as city,
sa3.id as provinceCode, sa3.area_name as province
FROM
sys_indent si
LEFT JOIN sys_user su ON si.user_id = su.id
LEFT JOIN sys_dict_data sdd ON si.device_type = sdd.data_key
LEFT JOIN sys_indent_logistics sil ON si.id = sil.indent_id
LEFT JOIN sys_logistics sl ON sil.logistics_unicode = sl.unicode
LEFT JOIN sys_area sa1 ON si.district_code = sa1.id
LEFT JOIN sys_area sa2 ON sa1.parent_id = sa2.id
LEFT JOIN sys_area sa3 ON sa2.parent_id = sa3.id
where si.id = #{id}
</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!