Commit 05859e5d by zhanghj

V1.2.0--取消单增加取消人姓名,去掉重复的IndentLogmodel

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@22217 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 05586789
......@@ -84,5 +84,10 @@ public interface BizConstants {
public static final int INDENT_SEND_TYPE_SERVICE = 1;
public static final int INDENT_SEND_TYPE_GLSX = 2;
/**
* 订货单取消状态
*/
public static final int INDENT_CANCEL = 1;
}
......@@ -8,7 +8,6 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.validation.groups.Default;
import com.glsx.ordercenter.pojo.user.SysUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -29,7 +28,7 @@ import com.glsx.common.utils.UserUtils;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.pojo.GroupA;
import com.glsx.ordercenter.pojo.SysIndent;
import com.glsx.ordercenter.pojo.SysIndentLogModel;
import com.glsx.ordercenter.pojo.SysIndentLog;
import com.glsx.ordercenter.pojo.SysIndentLogistics;
import com.glsx.ordercenter.service.IndentService;
import com.glsx.ordercenter.service.ReceiveAddressService;
......@@ -187,7 +186,7 @@ public class IndentController extends BaseController{
*/
@RequestMapping(value = "/listIndentLog", method = RequestMethod.GET)
public ResultObject listIndentLog(String indentId) {
List<SysIndentLogModel> list=indentService.listIndentLog(indentId);
List<SysIndentLog> list=indentService.listIndentLog(indentId);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(),ResultCodeEnum.SUCCESS.getMsg(),list);
}
......
package com.glsx.ordercenter.mapper;
import com.glsx.ordercenter.pojo.SysIndentLog;
import com.glsx.ordercenter.pojo.SysIndentLogModel;
import java.util.List;
import com.glsx.ordercenter.pojo.SysIndentLog;
public interface SysIndentLogMapper {
int insert(SysIndentLog record);
int insertSelective(SysIndentLog record);
List<SysIndentLogModel> listIndentLog(String indentId);
List<SysIndentLog> listIndentLog(String indentId);
SysIndentLog get(SysIndentLog indentLog);
}
\ No newline at end of file
......@@ -87,6 +87,8 @@ public class SysIndent extends BaseModel{
*/
private SysUser user;
private String cancelOperatorName;
public Integer getId() {
return id;
}
......@@ -270,6 +272,14 @@ public class SysIndent extends BaseModel{
public void setUser(SysUser user) {
this.user = user;
}
public String getCancelOperatorName() {
return cancelOperatorName;
}
public void setCancelOperatorName(String cancelOperatorName) {
this.cancelOperatorName = cancelOperatorName;
}
@Override
public String toString() {
......
......@@ -14,6 +14,8 @@ public class SysIndentLog {
private Integer createBy;
private Date createTime;
private String operatorName;
public Integer getId() {
return id;
......@@ -62,4 +64,13 @@ public class SysIndentLog {
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getOperatorName() {
return operatorName;
}
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
}
\ No newline at end of file
package com.glsx.ordercenter.pojo;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
public class SysIndentLogModel {
private Integer indentId;
private Integer indentStatus;
private String remark;
private String createBy;
private Date createTime;
public Integer getIndentId() {
return indentId;
}
public void setIndentId(Integer indentId) {
this.indentId = indentId;
}
public Integer getIndentStatus() {
return indentStatus;
}
public void setIndentStatus(Integer indentStatus) {
this.indentStatus = indentStatus;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
......@@ -7,7 +7,7 @@ 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.SysIndentLogModel;
import com.glsx.ordercenter.pojo.SysIndentLog;
import com.glsx.ordercenter.pojo.SysIndentLogistics;
......@@ -88,7 +88,7 @@ public interface IndentService {
*/
List<SysIndent> getIndentListByPage(Page page, SysIndent indent);
List<SysIndentLogModel> listIndentLog(String indentId);
List<SysIndentLog> listIndentLog(String indentId);
SysIndent getByIndentNo(String indentNo);
......
......@@ -39,7 +39,6 @@ import com.glsx.ordercenter.mapper.SysIndentMapper;
import com.glsx.ordercenter.pojo.SysDevice;
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.SysReceiveAddress;
import com.glsx.ordercenter.pojo.user.SysUser;
......@@ -359,8 +358,8 @@ public class IndentServiceImpl implements IndentService {
* @return
*/
@Override
public List<SysIndentLogModel> listIndentLog(String indentId) {
List<SysIndentLogModel> sysIndentLogs=indentLogDao.listIndentLog(indentId);
public List<SysIndentLog> listIndentLog(String indentId) {
List<SysIndentLog> sysIndentLogs=indentLogDao.listIndentLog(indentId);
return sysIndentLogs;
}
......@@ -392,7 +391,29 @@ public class IndentServiceImpl implements IndentService {
}
}
/*
* 取消单,获取取消人的姓名
*/
Integer isCancel = indent.getIsCanceled();
String cancelOperatorName = null;
if (BizConstants.INDENT_CANCEL == isCancel) {
Integer indentStatus = IndentStatusEnum.INDENT_CANCEL.getIndentStatus();
SysIndentLog indentLog = new SysIndentLog();
indentLog.setIndentId(id);
indentLog.setIndentStatus(indentStatus);
indentLog = indentLogDao.get(indentLog);
if (indentLog != null) {
Integer createBy = indentLog.getCreateBy();
JSONObject result = userClient.getUserById(createBy);
if (result != null && result.getIntValue("code") == ResultCodeEnum.SUCCESS.getCode()) {
JSONObject object = result.getJSONObject("data");
cancelOperatorName = object.getString("name");
indent.setCancelOperatorName(cancelOperatorName);
}
}
}
return indent;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!