1.添加网页新增单据草稿保存接口

master
x_z 3 years ago
parent f56c14c4b6
commit c4e5f8418b

@ -36,10 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.*;
@RestController
public class WareHouseController {
@ -318,8 +315,9 @@ public class WareHouseController {
}
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
if (udiEntity == null)
if (udiEntity == null) {
return ResultVOUtils.error(500, "无效条码!");
}
if (StrUtil.isNotEmpty(addOrderRequest.getBatchNo())) {
udiEntity.setBatchNo(addOrderRequest.getBatchNo());
}
@ -449,11 +447,7 @@ public class WareHouseController {
}
warehousetempEntity.setCount(warehousetempEntity.getCount() * actCount);
} else {
if (unitFk == null)
return ResultVOUtils.error(500, "耗材字典不存在此产品!");
else
return ResultVOUtils.error(500, "当前供应商不存在此配送产品!");
return ResultVOUtils.error(500, "耗材字典不存在此产品!");
}
OrderEntity isExit = orderService.findById(orderId);
@ -480,6 +474,7 @@ public class WareHouseController {
orderSaveRequest.setCustomerId(customerId);
orderService.insertOrder(orderSaveRequest);
}
warehouseTempService.insertTempWarehouses(warehousetempEntities);
}
addCodeResult.setOrderId(orderId);
@ -517,4 +512,28 @@ public class WareHouseController {
}
return null;
}
@AuthRuleAnnotation("")
@PostMapping("warehouse/inout/saveOrderWeb")
public BaseResponse saveOrderWeb(@RequestBody AddOrderRequest addOrderRequest) {
OrderEntity orderEntity = new OrderEntity();
orderEntity.setOrderId(addOrderRequest.getOrderId());
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(addOrderRequest.getAction(), addOrderRequest.getCustomerId());
orderEntity.setAction(addOrderRequest.getAction());
orderEntity.setMainAction(bussinessTypeEntity.getMainAction());
orderEntity.setFromCorp(addOrderRequest.getFromCorp());
orderEntity.setFromCorpId(addOrderRequest.getFromCorpId());
orderEntity.setLocStorageCode(addOrderRequest.getLocStorageCode());
orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity);
WarehouseEntity warehouseEntity = new WarehouseEntity();
warehouseEntity.setOrderId(addOrderRequest.getOrderId());
warehouseEntity.setAction(addOrderRequest.getAction());
warehouseEntity.setMainAction(addOrderRequest.getMainAction());
warehouseEntity.setFromCorp(addOrderRequest.getFromCorp());
warehouseEntity.setFromCorpId(addOrderRequest.getFromCorpId());
warehouseEntity.setLocStorageCode(addOrderRequest.getLocStorageCode());
warehouseTempService.updateByOrderId(warehouseEntity);
return ResultVOUtils.success();
}
}

@ -69,4 +69,11 @@ public interface CodesTempDao extends BaseMapper<WarehousetempEntity> {
* @return
*/
List<WarehouseEntity> findByOrderIdAndCode(WarehouseQueryRequest warehouseQueryRequest);
/**
*
*
* @param warehouseEntity
*/
void updateByOrderId(WarehouseEntity warehouseEntity);
}

@ -130,4 +130,12 @@ public class WarehouseTempService {
return codesTempDao.findByOrderIdAndCode(warehouseQueryRequest);
}
/**
*
*
* @param warehouseEntity
*/
public void updateByOrderId(WarehouseEntity warehouseEntity) {
codesTempDao.updateByOrderId(warehouseEntity);
}
}

@ -45,4 +45,19 @@
where orderId = #{orderId}
and code = #{code}
</select>
<update id="updateByOrderId">
update io_codes_temp
<set>
<if test="action != null and action != ''">`action`=#{action},</if>
<if test="mainAction != null and mainAction != ''">mainAction=#{mainAction},</if>
<if test="fromCorp != null and fromCorp != ''">fromCorp=#{fromCorp},</if>
<if test="fromCorpId != null and fromCorpId != ''">fromCorpId=#{fromCorpId},</if>
<if test="locStorageCode != null and locStorageCode != ''">locStorageCode=#{locStorageCode},</if>
<if test="supId != null and supId != ''">supId=#{supId},</if>
<if test="serialNo != null and serialNo != ''">serialNo=#{serialNo},</if>
<if test="relId != null and relId != ''">relId=#{relId},</if>
</set>
where orderId = #{orderId}
</update>
</mapper>
Loading…
Cancel
Save