Merge branch 'refs/heads/master' into dev_1.0.0
commit
30d551fe59
|
|
@ -84,6 +84,7 @@
|
|||
import { addDelivery, listProductSn } from '@/api/inventory/delivery';
|
||||
import {importSnData,exportDownloadTemplate} from '@/api/inventory/outer'
|
||||
import PurchaseOrderSelectDialog from '../../../purchaseorder/components/PurchaseOrderSelectDialog.vue';
|
||||
import {handleTree} from "@/utils/ruoyi";
|
||||
|
||||
export default {
|
||||
name: "GenerateDeliveryForm",
|
||||
|
|
@ -176,7 +177,12 @@ export default {
|
|||
});
|
||||
},
|
||||
handleSelectPurchaseBeforeImport() {
|
||||
this.purchaseOrderSelectVisible = true;
|
||||
if ((this.productData.orderType || '1') === '1') {
|
||||
this.purchaseOrderSelectVisible = true;
|
||||
}else{
|
||||
this.handleImport()
|
||||
}
|
||||
|
||||
},
|
||||
handlePurchaseOrderSelect(order) {
|
||||
this.warehouseId = order.warehouseId;
|
||||
|
|
@ -198,6 +204,7 @@ export default {
|
|||
formData.append('file', file);
|
||||
formData.append('productCode', this.productData.productCode);
|
||||
formData.append('quantity', this.queryParams.pageSize);
|
||||
formData.append('orderType', this.productData.orderType);
|
||||
|
||||
importSnData(formData).then(response => {
|
||||
this.$message.success('导入成功');
|
||||
|
|
|
|||
|
|
@ -164,7 +164,8 @@
|
|||
</style>
|
||||
|
||||
<script>
|
||||
import { getOrder, addOrder, updateOrder, delContractFile, uploadContractFile, getProject } from "@/api/project/order";
|
||||
import { getOrder, addOrder, updateOrder, delContractFile, uploadContractFile } from "@/api/project/order";
|
||||
import { getProject } from "@/api/project/info";
|
||||
import ProductConfig from '@/views/project/info/ProductConfig.vue';
|
||||
import SelectCommitType from "./SelectCommitType.vue";
|
||||
import OrderInfo from '@/views/project/order/components/OrderInfo.vue';
|
||||
|
|
@ -399,6 +400,8 @@ export default {
|
|||
]
|
||||
});
|
||||
this.activeContractVersionTab = currentVersion;
|
||||
console.log('11111')
|
||||
console.log(this.projectId)
|
||||
if (this.projectId) {
|
||||
getProject(this.projectId).then(response => {
|
||||
this.handleProjectSelected(response.data.project);
|
||||
|
|
|
|||
|
|
@ -61,11 +61,18 @@
|
|||
<el-input v-model="localOrderData.orderCode" placeholder="自动生成" readonly :disabled="isReadonly"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="执行单截止时间" prop="orderEndTime">
|
||||
<el-date-picker v-model="localOrderData.orderEndTime" type="date" value-format="yyyy-MM-dd" placeholder="审批完成后自动计算" disabled></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="订单类型" prop="orderType">
|
||||
<el-select v-model="localOrderData.orderType" :disabled="isReadonly">
|
||||
<el-option v-for="dict in dict.type.delivery_order_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="币种" prop="currencyType">
|
||||
<el-select v-model="localOrderData.currencyType" placeholder="请选择币种" :disabled="isReadonly">
|
||||
|
|
@ -82,7 +89,7 @@
|
|||
</el-col>
|
||||
<el-col :span="(localOrderData.processTemplate=='1' ||(localOrderData.processTemplate!='1' &&( localOrderData.orderStatus=='1'||localOrderData.orderStatus=='2')))?8:16">
|
||||
<el-form-item label="总代出货金额" prop="shipmentAmount">
|
||||
<el-input v-model="localOrderData.shipmentAmount" placeholder="请输入金额" :disabled="isReadonly"/>
|
||||
<el-input v-model="localOrderData.shipmentAmount" placeholder="请输入金额" readonly :disabled="isReadonly"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
|
@ -227,6 +234,7 @@ export default {
|
|||
default: false
|
||||
}
|
||||
},
|
||||
dicts:['delivery_order_type'],
|
||||
data() {
|
||||
return {
|
||||
localOrderData: {},
|
||||
|
|
|
|||
|
|
@ -286,9 +286,9 @@ export default {
|
|||
},
|
||||
totalAmountWithoutTax() {
|
||||
const total = this.form.omsPurchaseOrderItemList?.reduce((acc, cur) => {
|
||||
const amount = this.$calc.mul(cur.quantity, cur.price) || 0;
|
||||
const amount = this.$calc.mul(cur.quantity||0, cur.price||0) || 0;
|
||||
const taxRate = cur.taxRate || 0;
|
||||
console.log(taxRate)
|
||||
|
||||
return acc + this.$calc.div(amount , (1 + taxRate));
|
||||
}, 0);
|
||||
return (this.$calc.toFixed(total)) || 0;
|
||||
|
|
@ -369,7 +369,7 @@ export default {
|
|||
this.$set(item, 'productCode', product.productCode);
|
||||
this.$set(item, 'productModel', product.model);
|
||||
this.$set(item, 'productDescription', product.description);
|
||||
this.$set(item, 'price', product.cataloguePrice);
|
||||
// this.$set(item, 'price', product.cataloguePrice);
|
||||
this.calculateRowTotal(item)
|
||||
}
|
||||
this.productSelectOpen = false;
|
||||
|
|
@ -402,13 +402,10 @@ export default {
|
|||
},
|
||||
/** 计算含税小计 */
|
||||
calculateRowTotal(row) {
|
||||
if (row.quantity != null && row.price != null) {
|
||||
row.amountTotal = this.$calc.mul(row.quantity , row.price);
|
||||
row.taxTotal = row.amountTotal - this.$calc.div(row.amountTotal , (1 + row.taxRate));
|
||||
} else {
|
||||
row.amountTotal = 0;
|
||||
row.taxTotal = 0;
|
||||
}
|
||||
|
||||
row.amountTotal = this.$calc.mul(row.quantity || 0, row.price || 0);
|
||||
row.taxTotal = row.amountTotal - this.$calc.div(row.amountTotal, (1 + row.taxRate || 0));
|
||||
|
||||
},
|
||||
/** 获取厂商列表 */
|
||||
getVendorList() {
|
||||
|
|
|
|||
|
|
@ -228,7 +228,6 @@ import {listAllVendor} from "@/api/base/vendor";
|
|||
import {getDicts} from "@/api/system/dict/data";
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
name: "PurchaseOrderDetailView",
|
||||
dicts: ['approve_status'],
|
||||
|
|
@ -309,7 +308,11 @@ export default {
|
|||
created() {
|
||||
this.getVendorList().then(() => {
|
||||
getDicts("product_type").then(response => {
|
||||
this.productTypeOptions = response.data;
|
||||
this.productTypeOptions = response.data.map(item => ({
|
||||
value: item.dictValue,
|
||||
label: item.dictLabel,
|
||||
id:item.id
|
||||
}));
|
||||
});
|
||||
// 如果已经有 orderData 则立即处理
|
||||
if (this.orderData) {
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@
|
|||
>发起供应商确认
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.approveStatus === '2' && (!scope.row.confirmStatus || scope.row.confirmStatus === ''|| scope.row.confirmStatus === '2')"
|
||||
v-if="scope.row.approveStatus === '2' && (!scope.row.confirmStatus || scope.row.confirmStatus === ''|| scope.row.confirmStatus === '1')"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-refresh-left"
|
||||
|
|
|
|||
|
|
@ -5,20 +5,12 @@ import java.io.InputStream;
|
|||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.sip.domain.OmsInventoryInner;
|
||||
import com.ruoyi.sip.domain.ProjectOrderFileLog;
|
||||
import com.ruoyi.sip.dto.inventory.InventoryInfoExcelDto;
|
||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IOmsInventoryInnerService;
|
||||
import com.ruoyi.sip.vo.ExecutionOrderVo;
|
||||
import com.ruoyi.sip.vo.OuterDeliveryVo;
|
||||
import com.ruoyi.sip.vo.OuterViewVo;
|
||||
import liquibase.pro.packaged.A;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -171,7 +163,8 @@ public class InventoryOuterController extends BaseController
|
|||
|
||||
@PostMapping("/importData")
|
||||
@ResponseBody
|
||||
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode,@RequestParam(value = "quantity") Long quantity) {
|
||||
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode
|
||||
, @RequestParam(value = "orderType") String orderType,@RequestParam(value = "quantity") Long quantity) {
|
||||
ExcelUtil<InventoryInfoExcelDto> util = new ExcelUtil<InventoryInfoExcelDto>(InventoryInfoExcelDto.class);
|
||||
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
|
|
@ -182,7 +175,7 @@ public class InventoryOuterController extends BaseController
|
|||
if (inventoryInfoExcelDtoList.size()!=quantity.intValue()){
|
||||
return AjaxResult.error("导入数据应等于发货数量");
|
||||
}
|
||||
return AjaxResult.success(innerService.getInventoryInfoList(inventoryInfoExcelDtoList, productCode));
|
||||
return AjaxResult.success(innerService.getInventoryInfoList(inventoryInfoExcelDtoList, productCode, orderType));
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("读取excel错误,请联系管理员");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.sip.controller.vue;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
|
@ -8,9 +9,11 @@ import com.ruoyi.common.enums.ApproveStatusEnum;
|
|||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.sip.domain.OmsPurchaseOrder;
|
||||
import com.ruoyi.sip.domain.VendorInfo;
|
||||
import com.ruoyi.sip.dto.inventory.OmsPurchaseOrderItemDto;
|
||||
import com.ruoyi.sip.flowable.domain.Todo;
|
||||
import com.ruoyi.sip.flowable.service.TodoService;
|
||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IOmsPurchaseOrderHistoryService;
|
||||
import com.ruoyi.sip.service.IOmsPurchaseOrderService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
|
@ -19,7 +22,9 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 采购单主表Controller
|
||||
|
|
@ -39,6 +44,9 @@ public class OmsPurchaseOrderController extends BaseController
|
|||
@Autowired
|
||||
private TodoService todoService;
|
||||
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
/**
|
||||
* 查询采购单主表列表
|
||||
*/
|
||||
|
|
@ -46,6 +54,14 @@ public class OmsPurchaseOrderController extends BaseController
|
|||
@GetMapping("/list")
|
||||
public TableDataInfo list(OmsPurchaseOrder omsPurchaseOrder)
|
||||
{
|
||||
if (!inventoryAuthService.authAll()) {
|
||||
List<VendorInfo> vendorInfos = inventoryAuthService.currentVendor();
|
||||
|
||||
if (CollUtil.isEmpty(vendorInfos)) {
|
||||
return getDataTable(Collections.emptyList());
|
||||
}
|
||||
omsPurchaseOrder.setAuthVendorCodeList(vendorInfos.stream().map(VendorInfo::getVendorCode).collect(Collectors.toList()));
|
||||
}
|
||||
startPage();
|
||||
List<OmsPurchaseOrder> list = omsPurchaseOrderService.selectOmsPurchaseOrderList(omsPurchaseOrder);
|
||||
clearPage();
|
||||
|
|
@ -59,6 +75,14 @@ public class OmsPurchaseOrderController extends BaseController
|
|||
@GetMapping("/item/list")
|
||||
public TableDataInfo listItem(OmsPurchaseOrderItemDto omsPurchaseOrder)
|
||||
{
|
||||
if (!inventoryAuthService.authAll()) {
|
||||
List<VendorInfo> vendorInfos = inventoryAuthService.currentVendor();
|
||||
|
||||
if (CollUtil.isEmpty(vendorInfos)) {
|
||||
return getDataTable(Collections.emptyList());
|
||||
}
|
||||
omsPurchaseOrder.setAuthVendorCodeList(vendorInfos.stream().map(VendorInfo::getVendorCode).collect(Collectors.toList()));
|
||||
}
|
||||
startPage();
|
||||
List<OmsPurchaseOrderItemDto> list = omsPurchaseOrderService.listItem(omsPurchaseOrder);
|
||||
return getDataTable(list);
|
||||
|
|
@ -70,7 +94,14 @@ public class OmsPurchaseOrderController extends BaseController
|
|||
@GetMapping("/vendor/list")
|
||||
public TableDataInfo listVendor(OmsPurchaseOrder omsPurchaseOrder)
|
||||
{
|
||||
if (!inventoryAuthService.authAll()) {
|
||||
List<VendorInfo> vendorInfos = inventoryAuthService.currentVendor();
|
||||
|
||||
if (CollUtil.isEmpty(vendorInfos)) {
|
||||
return getDataTable(Collections.emptyList());
|
||||
}
|
||||
omsPurchaseOrder.setAuthVendorCodeList(vendorInfos.stream().map(VendorInfo::getVendorCode).collect(Collectors.toList()));
|
||||
}
|
||||
omsPurchaseOrder.setApproveStatus(ApproveStatusEnum.APPROVE_COMPLETE.getCode());
|
||||
omsPurchaseOrder.setFlowType(OmsPurchaseOrder.FlowTypeEnum.ONLINE.getCode());
|
||||
startPage();
|
||||
|
|
|
|||
|
|
@ -110,7 +110,8 @@ public class VueInventoryOuterController extends BaseController
|
|||
}
|
||||
@PostMapping("/importData")
|
||||
@ResponseBody
|
||||
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode, @RequestParam(value = "quantity") Long quantity) {
|
||||
public AjaxResult importTemplate(@RequestPart("file") MultipartFile file, @RequestParam(value = "productCode") String productCode
|
||||
,@RequestParam(value = "orderType",defaultValue = "1") String orderType, @RequestParam(value = "quantity") Long quantity) {
|
||||
ExcelUtil<InventoryInfoExcelDto> util = new ExcelUtil<InventoryInfoExcelDto>(InventoryInfoExcelDto.class);
|
||||
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
|
|
@ -121,7 +122,7 @@ public class VueInventoryOuterController extends BaseController
|
|||
if (inventoryInfoExcelDtoList.size()!=quantity.intValue()){
|
||||
return AjaxResult.error("导入数据应等于发货数量");
|
||||
}
|
||||
return AjaxResult.success(innerService.getInventoryInfoList(inventoryInfoExcelDtoList, productCode));
|
||||
return AjaxResult.success(innerService.getInventoryInfoList(inventoryInfoExcelDtoList, productCode,orderType));
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException("读取excel错误,请联系管理员");
|
||||
|
|
|
|||
|
|
@ -1,16 +1,19 @@
|
|||
package com.ruoyi.sip.controller.vue;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.sip.domain.VendorInfo;
|
||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IVendorInfoService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -25,6 +28,8 @@ public class VueVendorInfoController extends BaseController {
|
|||
@Autowired
|
||||
private IVendorInfoService vendorInfoService;
|
||||
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
/**
|
||||
* 查询制造商信息列表
|
||||
*/
|
||||
|
|
@ -80,7 +85,7 @@ public class VueVendorInfoController extends BaseController {
|
|||
*/
|
||||
@GetMapping("/listAll")
|
||||
public AjaxResult listAll() {
|
||||
List<VendorInfo> list = vendorInfoService.selectVendorInfoList(new VendorInfo());
|
||||
return AjaxResult.success(list);
|
||||
|
||||
return AjaxResult.success(inventoryAuthService.currentVendor());
|
||||
}
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ public class VueWarehouseInfoController extends BaseController {
|
|||
public AjaxResult listAll() {
|
||||
OmsWarehouseInfo params = new OmsWarehouseInfo();
|
||||
params.setWarehouseStatus(OmsWarehouseInfo.WarehouseStatusEnum.NORMAL.getValue());
|
||||
List<OmsWarehouseInfo> list = omsWarehouseInfoService.list(params);
|
||||
List<OmsWarehouseInfo> list = omsWarehouseInfoService.listByAuth(params);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
@ -50,6 +50,7 @@ public class InventoryOuter extends BaseEntity
|
|||
@Excel(name = "产品型号")
|
||||
private String model;
|
||||
private String vendorName;
|
||||
private String orderType;
|
||||
private List<String> productCodeList;
|
||||
|
||||
/** 数量 */
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class OmsInventoryInner extends BaseEntity {
|
|||
private String warehouseType;
|
||||
@Excel(name = "经办人")
|
||||
private String createByName;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@Excel(name = "入库时间",dateFormat="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public class OmsPurchaseOrder extends BaseEntity
|
|||
private Long vendorId;
|
||||
|
||||
private String vendorCode;
|
||||
private List<String> authVendorCodeList;
|
||||
private String vendorName;
|
||||
private String vendorUser;
|
||||
private String vendorPhone;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ public class ProjectOrderInfo extends BaseEntity {
|
|||
private String customerCode;
|
||||
private String customerPhone;
|
||||
private String customerUserName;
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 出货金额
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class TodoController extends BaseController {
|
|||
@ResponseBody
|
||||
public TableDataInfo todoList( Todo todo) {
|
||||
startPage();
|
||||
todo.setApproveUserName(getSysUser().getUserName());
|
||||
todo.setApproveUser(getSysUser().getUserId().toString());
|
||||
List<Todo> list = todoService.selectTodoList(todo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ public class TodoController extends BaseController {
|
|||
@ResponseBody
|
||||
public TableDataInfo editSave( Todo todo) {
|
||||
startPage();
|
||||
todo.setApproveUserName(getSysUser().getUserName());
|
||||
todo.setApproveUser(getSysUser().getUserId().toString());
|
||||
List<Todo> list = todoService.selectTodoCompletedList(todo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
@ -110,4 +110,10 @@ public class TodoController extends BaseController {
|
|||
public AjaxResult statistics(@RequestBody Todo todo){
|
||||
return todoService.statistics(todo);
|
||||
}
|
||||
|
||||
@GetMapping("/todo/statistics")
|
||||
@ResponseBody
|
||||
public AjaxResult statisticsTodo(){
|
||||
return todoService.statisticsTodo();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,4 +136,9 @@ public interface TodoService
|
|||
void fillOrderApproveNode(List<ProjectOrderInfo> list);
|
||||
|
||||
void fillPurchaseOrderApproveNode(List<OmsPurchaseOrder> list);
|
||||
|
||||
|
||||
AjaxResult statisticsTodo();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -370,6 +370,29 @@ public class TodoServiceImpl implements TodoService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult statisticsTodo() {
|
||||
Long userId = ShiroUtils.getUserId();
|
||||
if (userId == null) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
List<String> orderKeyList = Arrays.asList(processConfig.getDefinition().getOrderApproveOffline(), processConfig.getDefinition().getOrderApproveOnline());
|
||||
Todo todo = new Todo();
|
||||
todo.setApproveUser(userId.toString());
|
||||
List<Todo> todoList = todoMapper.selectTodoList(todo);
|
||||
Map<String, Long> map = todoList.stream().collect(Collectors.groupingBy(Todo::getProcessKey, Collectors.counting()));
|
||||
HashMap<String, Long> resultMap = new HashMap<>();
|
||||
for (Map.Entry<String, Long> entry : map.entrySet()) {
|
||||
|
||||
String key = orderKeyList.contains(entry.getKey()) ? "order_approve" : entry.getKey();
|
||||
resultMap.compute(key, (k, v) -> {
|
||||
Long value = entry.getValue() == null ? 0L : entry.getValue();
|
||||
return v == null ? value : v + value;
|
||||
});
|
||||
}
|
||||
return AjaxResult.success(resultMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程审批
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -65,5 +65,5 @@ public interface IOmsInventoryInnerService
|
|||
|
||||
|
||||
void importByOuter(List<InventoryInfo> inventoryInfoList, String productCode, String purchaseNo,Long itemId);
|
||||
Map<String,Object> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode);
|
||||
Map<String,Object> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode, String orderType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -278,6 +278,7 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService
|
|||
vo.setQuantity(item.getQuantity());
|
||||
vo.setDeliveryGenerateQuantity(0L);
|
||||
vo.setDeliveryConfirmQuantity(0L);
|
||||
vo.setOrderType(inventoryOuter.getOrderType());
|
||||
List<InventoryDelivery> tempDeliveryList = deliveryListMap.get(vo.getWarehouseId());
|
||||
if (CollUtil.isNotEmpty(tempDeliveryList)){
|
||||
for (InventoryDelivery inventoryDelivery : tempDeliveryList) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.sip.service.impl;
|
|||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
|
@ -249,7 +250,8 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
// omsInventoryInner.setTaxTotal(inventoryInfoList.stream().map(item->
|
||||
// item.getInnerPrice().divide(BigDecimal.ONE.add(item.getTaxRate()),2, RoundingMode.HALF_UP)
|
||||
// ).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
BigDecimal divide = omsInventoryInner.getTotalAmount().divide(BigDecimal.ONE.add(omsInventoryInner.getTaxRate()), 2, RoundingMode.HALF_UP);
|
||||
BigDecimal taxRate = omsInventoryInner.getTaxRate()==null?new BigDecimal("0.13"):omsInventoryInner.getTaxRate();
|
||||
BigDecimal divide = omsInventoryInner.getTotalAmount().divide(BigDecimal.ONE.add(taxRate), 2, RoundingMode.HALF_UP);
|
||||
omsInventoryInner.setTaxTotal(omsInventoryInner.getTotalAmount().subtract(divide));
|
||||
|
||||
|
||||
|
|
@ -263,24 +265,30 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<String,Object> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode) {
|
||||
public Map<String,Object> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode, String orderType) {
|
||||
long count = inventoryInfoExcelDtoList.stream().filter(item -> !item.getProductCode().equals(productCode)).count();
|
||||
if (count > 0){
|
||||
throw new ServiceException("导入清单的产品与出库单不符");
|
||||
}
|
||||
// List<String> warehouseNameList = inventoryInfoExcelDtoList.stream().map(InventoryInfoExcelDto::getWarehouseName).distinct().collect(Collectors.toList());
|
||||
// if (warehouseNameList.size() > 1){
|
||||
// throw new ServiceException("导入清单只能有一个仓库");
|
||||
// }
|
||||
|
||||
List<ProductInfo> productInfos = productInfoService.selectProductInfoByCodeList(Collections.singletonList(productCode));
|
||||
if (CollUtil.isEmpty(productInfos)){
|
||||
throw new ServiceException("产品编码对应产品未找到");
|
||||
}
|
||||
// List<OmsWarehouseInfo> warehouseInfoList = warehouseInfoService.listByNameList(warehouseNameList);
|
||||
// if (CollUtil.isEmpty(warehouseInfoList)) {
|
||||
// throw new ServiceException("仓库未找到,导入失败");
|
||||
// }
|
||||
// Map<String, OmsWarehouseInfo> warehouseInfoMap = warehouseInfoList.stream().collect(Collectors.toMap(OmsWarehouseInfo::getWarehouseName, Function.identity(), (v1, v2) -> v1));
|
||||
Map<String, OmsWarehouseInfo> warehouseInfoMap=Collections.emptyMap();
|
||||
if ("2".equalsIgnoreCase(orderType)){
|
||||
List<String> warehouseNameList = inventoryInfoExcelDtoList.stream().map(InventoryInfoExcelDto::getWarehouseName).distinct().collect(Collectors.toList());
|
||||
if (warehouseNameList.size() > 1){
|
||||
throw new ServiceException("导入清单只能有一个仓库");
|
||||
}
|
||||
List<OmsWarehouseInfo> warehouseInfoList = warehouseInfoService.listByNameList(warehouseNameList);
|
||||
if (CollUtil.isEmpty(warehouseInfoList)) {
|
||||
throw new ServiceException("仓库未找到,导入失败");
|
||||
}
|
||||
warehouseInfoMap = warehouseInfoList.stream().collect(Collectors.toMap(OmsWarehouseInfo::getWarehouseName, Function.identity(), (v1, v2) -> v1));
|
||||
}
|
||||
Map<String, OmsWarehouseInfo> finalWarehouseInfoMap=warehouseInfoMap;
|
||||
|
||||
List<InventoryInfo> inventoryInfoList = inventoryInfoExcelDtoList.stream().map(item -> {
|
||||
InventoryInfo info = new InventoryInfo();
|
||||
info.setInventoryStatus(InventoryInfo.InventoryStatusEnum.INNER.getCode());
|
||||
|
|
@ -289,9 +297,12 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
info.setModel(productInfos.get(0).getModel());
|
||||
info.setProductDesc(productInfos.get(0).getDescription());
|
||||
info.setInnerPrice(item.getInnerPrice());
|
||||
// OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(item.getWarehouseName());
|
||||
// info.setWarehouseId(omsWarehouseInfo.getId());
|
||||
// info.setWarehouseName(omsWarehouseInfo.getWarehouseName());
|
||||
if ("2".equalsIgnoreCase(orderType)){
|
||||
OmsWarehouseInfo omsWarehouseInfo = finalWarehouseInfoMap.get(item.getWarehouseName());
|
||||
info.setWarehouseId(omsWarehouseInfo.getId());
|
||||
info.setWarehouseName(omsWarehouseInfo.getWarehouseName());
|
||||
}
|
||||
|
||||
|
||||
return info;
|
||||
}).collect(Collectors.toList());
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.ruoyi.sip.flowable.service.TodoService;
|
|||
import com.ruoyi.sip.mapper.OmsPurchaseOrderItemHistoryMapper;
|
||||
import com.ruoyi.sip.mapper.OmsPurchaseOrderHistoryMapper;
|
||||
import com.ruoyi.sip.service.ICnareaService;
|
||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IVendorInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
|
|
@ -373,6 +374,7 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To
|
|||
for (OmsPurchaseOrderItem omsPurchaseOrderItem : omsPurchaseOrderItemList)
|
||||
{
|
||||
omsPurchaseOrderItem.setPurchaseId(id);
|
||||
omsPurchaseOrderItem.setInnerQuantity(BigDecimal.ZERO);
|
||||
list.add(omsPurchaseOrderItem);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
|
|
@ -490,7 +492,7 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To
|
|||
OmsPurchaseOrder omsPurchaseOrder = new OmsPurchaseOrder();
|
||||
omsPurchaseOrder.setPurchaseNo(businessKey);
|
||||
omsPurchaseOrder.setApproveStatus(ApproveStatusEnum.APPROVE_COMPLETE.getCode());
|
||||
if (existOrder.getFlowType().equalsIgnoreCase(OmsPurchaseOrder.FlowTypeEnum.OFFLINE.getValue())){
|
||||
if (existOrder.getFlowType().equalsIgnoreCase(OmsPurchaseOrder.FlowTypeEnum.OFFLINE.getCode())){
|
||||
omsPurchaseOrder.setConfirmStatus(OmsPurchaseOrder.ConfirmStatusEnum.CONFIRM.getCode());
|
||||
}
|
||||
omsPurchaseOrder.setApproveTime(DateUtils.getNowDate());
|
||||
|
|
|
|||
|
|
@ -523,7 +523,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
public String exportList(ProjectOrderInfo projectOrderInfo) {
|
||||
try {
|
||||
// 获取项目信息列表
|
||||
List<ProjectOrderInfo> projectInfos = fetchProjectInfos(projectOrderInfo);
|
||||
List<ProjectOrderInfo> projectInfos = this.selectProjectOrderInfoList(projectOrderInfo);
|
||||
|
||||
// 补充项目详细数据
|
||||
enrichProjectData(projectInfos);
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ public class OuterDeliveryProductVo {
|
|||
private Long deliveryConfirmQuantity;
|
||||
private Long availableCount;
|
||||
private String warehouseName;
|
||||
private String orderType;
|
||||
private Long warehouseId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
<if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="approveUserName != null and approveUserName != ''">and approve_user_name = #{approveUserName}
|
||||
</if>
|
||||
<if test="approveUser != null and approveUser != ''">and approve_user = #{approveUser}
|
||||
</if>
|
||||
<if test="applyUserName != null and applyUserName != ''">and apply_user_name like concat('%',
|
||||
#{applyUserName}, '%')
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
t1.update_time,
|
||||
t2.model,
|
||||
t3.vendor_name,
|
||||
t4.order_type,
|
||||
t5.project_name,
|
||||
t5.project_code
|
||||
from oms_inventory_outer t1
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="flowType != null "> and t1.flow_type = #{flowType}</if>
|
||||
<if test="vendorName != null "> and t2.vendor_name = #{vendorName}</if>
|
||||
<if test="ownerName != null "> and t1.owner_name = #{ownerName}</if>
|
||||
<if test="authVendorCodeList != null and authVendorCodeList.size>0 "> and t2.vendor_code in
|
||||
<foreach item="item" collection="authVendorCodeList" separator="," open="(" close=")">#{item}</foreach>
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
|
@ -192,6 +195,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="authVendorCodeList != null and authVendorCodeList.size>0 "> and t4.vendor_code in
|
||||
<foreach item="item" collection="authVendorCodeList" separator="," open="(" close=")">#{item}</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by t2.create_time desc
|
||||
|
||||
|
|
|
|||
|
|
@ -44,13 +44,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
shipment_amount, actual_purchase_amount, order_end_time, delivery_time, company_delivery, notifier,finance_status,
|
||||
notifier_email, notifier_phone, duty, duty_email, duty_phone, order_channel, partner_code, supplier,notifier_address,
|
||||
remark, order_status, create_by, create_time, update_by, update_time,version_code,process_type,process_template,discount_fold,
|
||||
delivery_status,sign_status,outer_status,approve_time,payment_method,payment_ratio,payment_description
|
||||
delivery_status,sign_status,outer_status,approve_time,payment_method,payment_ratio,payment_description,order_type
|
||||
|
||||
from project_order_info t1
|
||||
</sql>
|
||||
<sql id="selectProjectOrderInfoRelationVo">
|
||||
select t1.id, t1.project_id,t1.province, t1.city, t1.business_person, t1.business_email, t1.business_phone, t1.order_code, t1.currencyType,
|
||||
t1.shipment_amount, t1.actual_purchase_amount, t1.order_end_time, t1.delivery_time, t1.company_delivery, t1.notifier,
|
||||
t1.shipment_amount, t1.actual_purchase_amount, t1.order_end_time, t1.delivery_time, t1.company_delivery, t1.notifier,t1.order_type,
|
||||
t1.notifier_email, t1.notifier_phone, t1.duty, t1.duty_email, t1.duty_phone, t1.order_channel, t1.partner_code, t1.supplier,
|
||||
t1.remark, t1.order_status, t1.create_by, t1.create_time, t1.update_by, t1.update_time,t1.partner_user_name,t1.partner_email
|
||||
,t1.partner_phone,t1.version_code,t1.process_type,t1.process_template,t1.discount_fold,t1.notifier_address,t1.finance_status,
|
||||
|
|
@ -491,6 +491,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="notifierPhone != null">notifier_phone,</if>
|
||||
<if test="notifierAddress != null">notifier_address,</if>
|
||||
<if test="duty != null">duty,</if>
|
||||
<if test="orderType != null and orderType!=''">order_type,</if>
|
||||
<if test="dutyEmail != null">duty_email,</if>
|
||||
<if test="dutyPhone != null">duty_phone,</if>
|
||||
<if test="orderChannel != null">order_channel,</if>
|
||||
|
|
@ -532,6 +533,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="notifierPhone != null">#{notifierPhone},</if>
|
||||
<if test="notifierAddress != null">#{notifierAddress},</if>
|
||||
<if test="duty != null">#{duty},</if>
|
||||
<if test="orderType != null and orderType!=''">#{orderType},</if>
|
||||
<if test="dutyEmail != null">#{dutyEmail},</if>
|
||||
<if test="dutyPhone != null">#{dutyPhone},</if>
|
||||
<if test="orderChannel != null">#{orderChannel},</if>
|
||||
|
|
@ -595,6 +597,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update_time,
|
||||
process_type,
|
||||
process_template,
|
||||
order_type,
|
||||
discount_fold)
|
||||
select id,
|
||||
project_id,
|
||||
|
|
@ -636,6 +639,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update_time,
|
||||
process_type,
|
||||
process_template,
|
||||
order_type,
|
||||
discount_fold
|
||||
from project_order_info
|
||||
where order_code = #{orderCode}
|
||||
|
|
@ -647,6 +651,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
<if test="city != null">city = #{city},</if>
|
||||
<if test="orderType != null and orderType!=''">order_type=#{orderType},</if>
|
||||
<if test="businessPerson != null">business_person = #{businessPerson},</if>
|
||||
<if test="businessEmail != null">business_email = #{businessEmail},</if>
|
||||
<if test="businessPhone != null">business_phone = #{businessPhone},</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue