提交 79e89650 作者: zhangqiliang

在确认收货和确认发货的时候,在详情中展示收货时间和发货时间;

在收货详情中展示申请人,车企单号,墙盒品牌,是否特殊申请,预约安装时间等
父级 9b0efb78
...@@ -84,32 +84,53 @@ public class DeliveryController { ...@@ -84,32 +84,53 @@ public class DeliveryController {
throw new ServiceException("当前SN号已经录入使用"); throw new ServiceException("当前SN号已经录入使用");
} }
} }
//辅材发货的时候校验一个申请单号下面的多个申请数量不能大于审批数量
Tauxiliarymaterials tauxiliarymaterials = tauxiliarymaterialsMapper.selectByApplyOrder(da.getInstallOrder());
if (ProductType.辅材.name().equals(da.getIsproduct())){
List<String> list=new ArrayList<>();
Integer quantity=0;
for (DeliveryAddVo deliveryAddVo:deliveryAddVoList){
quantity=quantity+deliveryAddVo.getQuantity();
if (list.contains(da.getInstallOrder())){
throw new ServiceException("400","一个申请单号下的多个物流单号不能重复!");
}else {
list.add(da.getInstallOrder());
}
}
if (!StringUtils.isEmpty(tauxiliarymaterials) && !StringUtils.isEmpty(tauxiliarymaterials.getApprovedQuantity())){
if (quantity.compareTo(Integer.parseInt(tauxiliarymaterials.getApprovedQuantity())) > 0){
throw new ServiceException("400","发货数量的总和不能大于批准数量!");
}
}
}
da.setInstallStatus(0); da.setInstallStatus(0);
Delivery delivery= DeliveryConvert.INSTANCE.convertAddVo(da); Delivery delivery= DeliveryConvert.INSTANCE.convertAddVo(da);
delivery.setDeliveryOrder("FH"+NumberUtil.getRandomOrderId()); delivery.setDeliveryOrder("FH"+NumberUtil.getRandomOrderId());
if(!StringUtils.isEmpty(delivery.getLogisticOrder())){ if(!StringUtils.isEmpty(delivery.getLogisticOrder())){
delivery.setLogisticStatus(TauxiliarymaterialStatusEnum.已发货.name()); delivery.setLogisticStatus(TauxiliarymaterialStatusEnum.已发货.name());
} }
//获取发货仓库信息
Map<String, String> paramSend = new HashMap<String, String>();
paramSend.put("id",da.getWarehouseId());
String jsonSend = HttpClientUtils.post(detailUrl,paramSend,"UTF-8", "UTF-8");
JSONObject jsonObjectSend=JSONObject.parseObject(jsonSend);
String data=jsonObjectSend.getString("data");
JSONObject jsonObjectData=JSONObject.parseObject(data);
delivery.setSender(jsonObjectData.getString("receivePeople"));
delivery.setSenderPhone(jsonObjectData.getString("receivePhone"));
delivery.setWarehouseId(da.getWarehouseId());
delivery.setWarehouseName(jsonObjectData.getString("name"));
if(!ProductType.辅材.name().equals(delivery.getIsproduct())){ if(!ProductType.辅材.name().equals(delivery.getIsproduct())){
//收货仓库的信息
Map<String, String> paramArrival = new HashMap<String, String>();
paramArrival.put("id",da.getArrivalWarehouseId());
String jsonArrival = HttpClientUtils.post(detailUrl,paramArrival,"UTF-8", "UTF-8");
JSONObject jsonObjectArrival=JSONObject.parseObject(jsonArrival);
String dataArrival=jsonObjectArrival.getString("data");
JSONObject jsonObjectDataArrival=JSONObject.parseObject(dataArrival);
delivery.setReceiver(jsonObjectDataArrival.getString("receivePeople"));
delivery.setReceiverPhone(jsonObjectDataArrival.getString("receivePhone"));
delivery.setArrivalWarehouseId(da.getArrivalWarehouseId());
delivery.setArrivalWarehouse(jsonObjectDataArrival.getString("name"));
//物料名称
if (StringUtils.isEmpty(jsonObjectDataArrival.getString("materialsName"))){
delivery.setMaterialName(jsonObjectDataArrival.getString("materialsName"));
}
//墙盒新增发货的时候,校验订单号是已经审核通过的
WallboxApply wallboxApply=wallboxApplyMapper.selectWallboxApplyByOrderId(da.getInstallOrder());
if (StringUtils.isEmpty(wallboxApply)){
throw new ServiceException("400","当前订单号没有进行墙盒申请!");
}else {
if (!"2".equals(wallboxApply.getCheckStatus())){
throw new ServiceException("400","只有审核通过的订单号才能发货!");
}
}
//申请团队
delivery.setTeam(wallboxApply.getSupplierTeam());
Delivery deliveryInstallOrder=deliveryMapper.selectByInstallOrder(da.getInstallOrder()); Delivery deliveryInstallOrder=deliveryMapper.selectByInstallOrder(da.getInstallOrder());
if (!StringUtils.isEmpty(deliveryInstallOrder)){ if (!StringUtils.isEmpty(deliveryInstallOrder)){
throw new ServiceException("400","订单号重复!"); throw new ServiceException("400","订单号重复!");
...@@ -120,50 +141,41 @@ public class DeliveryController { ...@@ -120,50 +141,41 @@ public class DeliveryController {
//如果是墙盒 根据订单号去订单表里把墙盒名称 墙盒类别 厂商拿到并添加到发货表里 //如果是墙盒 根据订单号去订单表里把墙盒名称 墙盒类别 厂商拿到并添加到发货表里
Order selectOrder = orderDao.selectById(da.getInstallOrder()); Order selectOrder = orderDao.selectById(da.getInstallOrder());
if (!StringUtils.isEmpty(selectOrder)){ if (!StringUtils.isEmpty(selectOrder)){
//物料名称
if (!StringUtils.isEmpty(selectOrder.getInstallWallboxModel())){ if (!StringUtils.isEmpty(selectOrder.getInstallWallboxModel())){
delivery.setMaterialName(selectOrder.getInstallWallboxModel()); delivery.setMaterialName(selectOrder.getInstallWallboxModel());
} }
if (!StringUtils.isEmpty(selectOrder.getInstallItemModel())){ //物料类型
delivery.setMaterialCategory(selectOrder.getInstallItemModel()); delivery.setMaterialCategory(da.getIsproduct());
} //厂商
if (!StringUtils.isEmpty(selectOrder.getOemName())){ if (!StringUtils.isEmpty(selectOrder.getOemName())){
delivery.setMaterialCategory(selectOrder.getOemName()); delivery.setMaterialCompany(selectOrder.getOemName());
} }
//物料编码
delivery.setMaterialCode(selectOrder.getItemModel());
} }
int result=this.wallboxApplyMapper.updateWallBoxTrackingStatusByOrderId("1",delivery.getInstallOrder()); int result=this.wallboxApplyMapper.updateWallBoxTrackingStatusByOrderId("1",delivery.getInstallOrder());
if(result!=1){ if(result!=1){
throw new ServiceException("400","更新订单发货状态失败!订单号:"+delivery.getInstallOrder()); throw new ServiceException("400","更新订单发货状态失败!订单号:"+delivery.getInstallOrder());
} }
}else{ }else{
int result=this.tauxiliarymaterialsMapper.updateTauxiliarymaterialsLogisticStatusByApplyOrder(TauxiliarymaterialStatusEnum.已发货.name(),delivery.getInstallOrder()); Tauxiliarymaterials tauxiliarymaterials = tauxiliarymaterialsMapper.selectByApplyOrder(da.getInstallOrder());
if(result!=1){ List<String> list=new ArrayList<>();
throw new ServiceException("400","更新辅材订单发货状态失败!订单号:"+delivery.getInstallOrder()); Integer quantity=0;
for (DeliveryAddVo deliveryAddVo:deliveryAddVoList){
quantity=quantity+deliveryAddVo.getQuantity();
if (list.contains(deliveryAddVo.getLogisticOrder())){
throw new ServiceException("400","相同申请单号下的多个物流单号不能重复!");
}else {
list.add(deliveryAddVo.getLogisticOrder());
}
} }
} if (!StringUtils.isEmpty(tauxiliarymaterials) && !StringUtils.isEmpty(tauxiliarymaterials.getApprovedQuantity())){
//获取发货仓库信息 if (quantity.compareTo(Integer.parseInt(tauxiliarymaterials.getApprovedQuantity())) > 0){
Map<String, String> paramSend = new HashMap<String, String>(); throw new ServiceException("400","发货数量的总和不能大于批准数量!");
paramSend.put("id",da.getWarehouseId()); }
String jsonSend = HttpClientUtils.post(detailUrl,paramSend,"UTF-8", "UTF-8"); }
JSONObject jsonObjectSend=JSONObject.parseObject(jsonSend); //收货仓库的信息
String data=jsonObjectSend.getString("data");
JSONObject jsonObjectData=JSONObject.parseObject(data);
delivery.setSender(jsonObjectData.getString("receivePeople"));
delivery.setSenderPhone(jsonObjectData.getString("receivePhone"));
delivery.setWarehouseId(da.getWarehouseId());
delivery.setWarehouseName(jsonObjectData.getString("name"));
//收货仓库的信息
if (!ProductType.辅材.name().equals(da.getIsproduct())){
Map<String, String> paramArrival = new HashMap<String, String>();
paramArrival.put("id",da.getArrivalWarehouseId());
String jsonArrival = HttpClientUtils.post(detailUrl,paramArrival,"UTF-8", "UTF-8");
JSONObject jsonObjectArrival=JSONObject.parseObject(jsonArrival);
String dataArrival=jsonObjectArrival.getString("data");
JSONObject jsonObjectDataArrival=JSONObject.parseObject(dataArrival);
delivery.setReceiver(jsonObjectDataArrival.getString("receivePeople"));
delivery.setReceiverPhone(jsonObjectDataArrival.getString("receivePhone"));
delivery.setArrivalWarehouseId(da.getArrivalWarehouseId());
delivery.setArrivalWarehouse(jsonObjectDataArrival.getString("name"));
}else {
if (!StringUtils.isEmpty(tauxiliarymaterials)){ if (!StringUtils.isEmpty(tauxiliarymaterials)){
delivery.setReceiver(tauxiliarymaterials.getRecipents()); delivery.setReceiver(tauxiliarymaterials.getRecipents());
delivery.setReceiverPhone(tauxiliarymaterials.getReceivePhone()); delivery.setReceiverPhone(tauxiliarymaterials.getReceivePhone());
...@@ -171,7 +183,17 @@ public class DeliveryController { ...@@ -171,7 +183,17 @@ public class DeliveryController {
delivery.setArrivalWarehouseId(da.getArrivalWarehouseId()); delivery.setArrivalWarehouseId(da.getArrivalWarehouseId());
delivery.setArrivalWarehouse(tauxiliarymaterials.getWarehouseName()); delivery.setArrivalWarehouse(tauxiliarymaterials.getWarehouseName());
} }
} delivery.setTeam(tauxiliarymaterials.getTeam());
delivery.setMaterialCode(tauxiliarymaterials.getMaterialCode());
delivery.setMaterialName(tauxiliarymaterials.getMaterialName());
delivery.setMaterialCategory(da.getIsproduct());
int result=this.tauxiliarymaterialsMapper.updateTauxiliarymaterialsLogisticStatusByApplyOrder(TauxiliarymaterialStatusEnum.已发货.name(),delivery.getInstallOrder());
if(result!=1){
throw new ServiceException("400","更新辅材订单发货状态失败!订单号:"+delivery.getInstallOrder());
}
}
this.commonUpdateService.UpdateColumns(delivery,true); this.commonUpdateService.UpdateColumns(delivery,true);
return this.deliveryMapper.insertSelective(delivery); return this.deliveryMapper.insertSelective(delivery);
}).reduce(0,Integer::sum)); }).reduce(0,Integer::sum));
......
...@@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -133,6 +134,7 @@ public class ReceivedNoteController { ...@@ -133,6 +134,7 @@ public class ReceivedNoteController {
throw new ServiceException("发货仓库库存减少失败"); throw new ServiceException("发货仓库库存减少失败");
} }
deliveryUpdateDTO.setLogisticStatus(LogisticStatus.已收货.name()); deliveryUpdateDTO.setLogisticStatus(LogisticStatus.已收货.name());
deliveryUpdateDTO.setReceiveTime(LocalDateTime.now());
this.commonUpdateService.UpdateColumns(deliveryUpdateDTO,false); this.commonUpdateService.UpdateColumns(deliveryUpdateDTO,false);
return new BaseResponse(this.deliveryMapper.updateByPrimaryKeySelective(deliveryUpdateDTO)); return new BaseResponse(this.deliveryMapper.updateByPrimaryKeySelective(deliveryUpdateDTO));
} }
......
...@@ -155,6 +155,7 @@ public class RejectController { ...@@ -155,6 +155,7 @@ public class RejectController {
throw new ServiceException("到货仓库库存扣减失败"); throw new ServiceException("到货仓库库存扣减失败");
} }
deliveryUpdateDTO.setLogisticStatus("退货完成"); deliveryUpdateDTO.setLogisticStatus("退货完成");
deliveryUpdateDTO.setRejectTime(LocalDateTime.now());
this.commonUpdateService.UpdateColumns(deliveryUpdateDTO,false); this.commonUpdateService.UpdateColumns(deliveryUpdateDTO,false);
return new BaseResponse(this.deliveryMapper.updateByPrimaryKeySelective(deliveryUpdateDTO)); return new BaseResponse(this.deliveryMapper.updateByPrimaryKeySelective(deliveryUpdateDTO));
} }
......
...@@ -335,6 +335,49 @@ public class Delivery extends PageVo implements Serializable { ...@@ -335,6 +335,49 @@ public class Delivery extends PageVo implements Serializable {
*/ */
@ApiModelProperty(value = "收货地址") @ApiModelProperty(value = "收货地址")
private String receiveAddress; private String receiveAddress;
/**
* 收件时间
*
* @mbg.generated
*/
@ApiModelProperty(value = "收件时间")
private LocalDateTime receiveTime;
/**
* 退货时间
*
* @mbg.generated
*/
@ApiModelProperty(value = "退货时间")
private LocalDateTime rejectTime;
/**
* 墙盒申请人
*
* @mbg.generated
*/
@ApiModelProperty(value = "墙盒申请人")
private String createAccount;
/**
* 预约安装日期
*
* @mbg.generated
*/
@ApiModelProperty(value = "预约安装日期")
private String installReserveTime;
/**
* 是否特殊申请
*
* @mbg.generated
*/
@ApiModelProperty(value = "是否特殊申请0:否,1:是")
private String ifEmergency;
/**
* 墙盒品牌
*
* @mbg.generated
*/
@ApiModelProperty(value = "墙盒品牌")
private String wallboxModelName;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
<result column="file_url" jdbcType="VARCHAR" property="fileUrl" /> <result column="file_url" jdbcType="VARCHAR" property="fileUrl" />
<result column="material_sn" jdbcType="VARCHAR" property="materialSn" /> <result column="material_sn" jdbcType="VARCHAR" property="materialSn" />
<result column="warehouse_id" jdbcType="VARCHAR" property="warehouseId" /> <result column="warehouse_id" jdbcType="VARCHAR" property="warehouseId" />
<result column="receive_time" jdbcType="VARCHAR" property="receiveTime" />
<result column="reject_time" jdbcType="VARCHAR" property="rejectTime" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -171,10 +173,13 @@ ...@@ -171,10 +173,13 @@
t.material_name, t.material_company, t.logistic_order, t.logistic_company, t.logistic_status, t.material_name, t.material_company, t.logistic_order, t.logistic_company, t.logistic_status,
t.team, t.isproduct, t.CREATED_BY, t.CREATED_TIME, t.UPDATED_BY, t.UPDATED_TIME, t.arrival_warehouse, t.team, t.isproduct, t.CREATED_BY, t.CREATED_TIME, t.UPDATED_BY, t.UPDATED_TIME, t.arrival_warehouse,
t.arrival_warehouse_id, t.receiver,t.remarks,t.reject_material,t.reason,t.check_time,t.check_user,t.check_user_name,t.check_suggestion, t.arrival_warehouse_id, t.receiver,t.remarks,t.reject_material,t.reason,t.check_time,t.check_user,t.check_user_name,t.check_suggestion,
e.out_order_id,t.reject_logistic_order,t.arrival_quantity,t.auxiliary_id,t.file_url,t.material_sn,t.warehouse_id,t.receiver_phone, ,t.reject_logistic_order,t.arrival_quantity,t.auxiliary_id,t.file_url,t.material_sn,t.warehouse_id,t.receiver_phone,
t.sender,t.sender_phone,t.receive_address t.sender,t.sender_phone,t.receive_address,t.receive_time,t.reject_time,e.out_order_id outOrderId,
tw.create_account createAccount,tw.install_reserve_time installReserveTime,tw.if_emergency ifEmergency,tc.name wallboxModelName
from t_delivery t from t_delivery t
left join t_order e on e.id = t.install_order left join t_order e on e.id = t.install_order
left join t_wallbox_apply tw on tw.order_id = t.install_order
left join t_oem_cascade tc on tc.id = tw.wallbox_model
where t.id = #{id,jdbcType=INTEGER} where t.id = #{id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
......
...@@ -278,6 +278,20 @@ public class DeliveryUpdateDTO{ ...@@ -278,6 +278,20 @@ public class DeliveryUpdateDTO{
*/ */
@ApiModelProperty(value = "安装状态,0-未安装,1-已安装") @ApiModelProperty(value = "安装状态,0-未安装,1-已安装")
private Integer installStatus; private Integer installStatus;
/**
* 收件时间
*
* @mbg.generated
*/
@ApiModelProperty(value = "收件时间")
private LocalDateTime receiveTime;
/**
* 退货时间
*
* @mbg.generated
*/
@ApiModelProperty(value = "退货时间")
private LocalDateTime rejectTime;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论