parent
e1ce92d937
commit
1a2461dcbf
|
@ -104,6 +104,17 @@ public class PoundmstController extends BaseController
|
|||
return toAjax(poundmstService.insertPoundmst(poundmst));
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成主榜单信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('measurement/bill:poundmst:add')")
|
||||
@Log(title = "主榜单信息", businessType = BusinessType.INSERT)
|
||||
@GetMapping(value = "/complete/{id}")
|
||||
public AjaxResult complete(@PathVariable("id") String id)
|
||||
{
|
||||
return toAjax(poundmstService.completePoundmst(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改主榜单信息
|
||||
*/
|
||||
|
|
|
@ -53,6 +53,14 @@ public interface IPoundmstService extends IService<Poundmst>
|
|||
*/
|
||||
public int updatePoundmst(Poundmst poundmst);
|
||||
|
||||
/**
|
||||
* 完成主榜单信息
|
||||
*
|
||||
* @param id 主榜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int completePoundmst(String id);
|
||||
|
||||
/**
|
||||
* 批量删除主榜单信息
|
||||
*
|
||||
|
|
|
@ -49,7 +49,8 @@ public class PoundBillServiceImpl extends ServiceImpl<PoundBillMapper, PoundBill
|
|||
@Autowired
|
||||
private ApiPostBack apiPostBack;
|
||||
|
||||
private static final String OA_ORG_NUMBER = "HGGT";
|
||||
@Autowired
|
||||
private ISysConfigService sysConfigService;
|
||||
|
||||
/**
|
||||
* 查询磅单信息
|
||||
|
@ -268,7 +269,10 @@ public class PoundBillServiceImpl extends ServiceImpl<PoundBillMapper, PoundBill
|
|||
poundBill.setSrcblltype("STK_TransferDirect");
|
||||
poundBill.setFid("0");
|
||||
poundBill.setFentity_fentryid("0");
|
||||
poundBill.setOaOrgNumber("YXSY");
|
||||
//获取系统参数中的公司编码
|
||||
String companyCode = sysConfigService.selectConfigByKey("OA_Company_Code");
|
||||
//设置OA组织编码
|
||||
poundBill.setOaOrgNumber(companyCode);
|
||||
poundBill.setInStockNumber("CK001");
|
||||
poundBill.setOutStockNumber("CK002");
|
||||
//设置当前时间为过毛重时间
|
||||
|
@ -317,8 +321,12 @@ public class PoundBillServiceImpl extends ServiceImpl<PoundBillMapper, PoundBill
|
|||
//Do nothing
|
||||
}
|
||||
poundBill.setWghdtoprname(currentUser);
|
||||
poundBill.setFid("0");
|
||||
poundBill.setFentity_fentryid("0");
|
||||
//获取系统参数中的公司编码
|
||||
String companyCode = sysConfigService.selectConfigByKey("OA_Company_Code");
|
||||
//设置OA组织编码
|
||||
poundBill.setOaOrgNumber("");
|
||||
poundBill.setOaOrgNumber(companyCode);
|
||||
boolean save = save(poundBill);
|
||||
//
|
||||
if(save){
|
||||
|
|
|
@ -65,14 +65,6 @@ public class PoundmstServiceImpl extends ServiceImpl<PoundmstMapper, Poundmst> i
|
|||
{
|
||||
poundmst.initAddFields(poundmst);
|
||||
boolean save = save(poundmst);
|
||||
//调用主榜单导入方法。
|
||||
//调用磅单回调接口。
|
||||
try {
|
||||
if ("SP_InStock".equals(poundmst.getOabilltype()))
|
||||
apiPostBack.makePoundmstFormData(poundmst.getId());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("磅单:" + poundmst.getUsrcode() + "推送星空时,出现异常:"+e.getMessage());
|
||||
}
|
||||
if (save){
|
||||
return 1;
|
||||
}
|
||||
|
@ -110,6 +102,20 @@ public class PoundmstServiceImpl extends ServiceImpl<PoundmstMapper, Poundmst> i
|
|||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int completePoundmst(String id) {
|
||||
try {
|
||||
//推送星空
|
||||
apiPostBack.makePoundmstFormData(id);
|
||||
|
||||
//推送完成后。将单据状态设置为完成。
|
||||
|
||||
}catch (Exception e){
|
||||
throw new RuntimeException("主榜单:" + id + "推送星空时,出现异常:"+e.getMessage());
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除主榜单信息
|
||||
*
|
||||
|
|
|
@ -113,6 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="cangKuNumber != null and cangKuNumber != ''"> and cangKuNumber = #{cangKuNumber}</if>
|
||||
<if test="sccjNum != null and sccjNum != ''"> and sccjNum = #{sccjNum}</if>
|
||||
</where>
|
||||
order by crtdt desc
|
||||
</select>
|
||||
|
||||
<select id="selectPoundmstById" parameterType="String" resultMap="PoundmstResult">
|
||||
|
|
|
@ -43,6 +43,15 @@ export function updatePoundmst(data) {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询主榜单信息详细
|
||||
export function complete(id) {
|
||||
return request({
|
||||
url: '/measurement/bill/poundmst/complete/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除主榜单信息
|
||||
export function delPoundmst(id) {
|
||||
return request({
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
<el-button class="transition-all duration-200" size="mini" @click = "getMstBillData">新增</el-button>
|
||||
<el-button class="transition-all duration-200" size="mini" @click = "getMstBillDataById">修改</el-button>
|
||||
<el-button class="transition-all duration-200" size="mini" @click="handleSearchMstBillFirst">查询</el-button>
|
||||
<el-button class="transition-all duration-200" size="mini">完成</el-button>
|
||||
<el-button class="transition-all duration-200" size="mini" @click = "finishMstBill">完成</el-button>
|
||||
<el-button class="transition-all duration-200" size="mini">取消完成</el-button>
|
||||
<el-button class="transition-all duration-200" size="mini">主榜单作废</el-button>
|
||||
<el-table v-loading="mstBillLoading"
|
||||
|
@ -696,7 +696,14 @@
|
|||
<script>
|
||||
import { listMoltenironpound, getMoltenironpound, delMoltenironpound, addMoltenironpound, updateMoltenironpound } from "@/api/measurement/operation/moltenironpound"
|
||||
import SearchSelect from "@/components/SearchSelect/index.vue";
|
||||
import {addPoundmst, getNumber, getPoundmst, listPoundmst, updatePoundmst} from "@/api/measurement/bill/poundmst";
|
||||
import {
|
||||
addPoundmst,
|
||||
complete,
|
||||
getNumber,
|
||||
getPoundmst,
|
||||
listPoundmst,
|
||||
updatePoundmst
|
||||
} from "@/api/measurement/bill/poundmst";
|
||||
import Decimal from "decimal.js";
|
||||
import {getTruepound} from "@/api/measurement/basedata/truepound";
|
||||
import {
|
||||
|
@ -1067,8 +1074,6 @@ export default {
|
|||
//清空表单中数据
|
||||
this.resetPoundBillDetailForm();
|
||||
try {
|
||||
//自动调用一次获取重量的方法
|
||||
await this.handleGetweight();
|
||||
// 获取榜单编码
|
||||
const response = await getPoundBillNumber();
|
||||
this.poundBillDetailFormData.poundBillDetailForm.usrcode = response.data.number;
|
||||
|
@ -1245,6 +1250,17 @@ export default {
|
|||
this.poundBillFullList = response.rows;
|
||||
this.poundBillFullLoading = false;
|
||||
})
|
||||
},
|
||||
|
||||
//选中主榜单,点击完成
|
||||
async finishMstBill() {
|
||||
// 校验是否选中主榜单
|
||||
if (this.mstBillFormData.selectedIds.length === 0) {
|
||||
this.$message.error("请先选择主榜单!");
|
||||
return;
|
||||
}
|
||||
//触发完成方法
|
||||
await complete(this.mstBillFormData.selectedIds[0])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -820,7 +820,7 @@ export default {
|
|||
}
|
||||
},
|
||||
//点击“刷新”后的查询动作,查询过磅申请,过皮申请.
|
||||
handleSearchPoundData() {
|
||||
async handleSearchPoundData() {
|
||||
if(this.queryParams.poundid == null || this.queryParams.poundid === ""){
|
||||
this.$message.error("请选择磅点!");
|
||||
return;
|
||||
|
@ -828,8 +828,8 @@ export default {
|
|||
//查询前,需要将页数变为1
|
||||
this.queryPageParams.weighingRequest.pageNum = 1;
|
||||
this.queryPageParams.tareRequest.pageNum = 1;
|
||||
this.handleSearchPoundappli();
|
||||
this.handleSearchTareappli();
|
||||
await this.handleSearchPoundappli();
|
||||
await this.handleSearchTareappli();
|
||||
if (this.tareappliList.length > 0){
|
||||
this.activeTab = 'tareRequest';
|
||||
}else {
|
||||
|
@ -837,7 +837,7 @@ export default {
|
|||
}
|
||||
},
|
||||
//根据车号进行过磅申请的查询。
|
||||
handleSearchPoundappli() {
|
||||
async handleSearchPoundappli() {
|
||||
this.loading = true;
|
||||
var thisqueryParams = {
|
||||
carno:"",
|
||||
|
@ -850,14 +850,14 @@ export default {
|
|||
thisqueryParams.pageNum = this.queryPageParams.weighingRequest.pageNum;
|
||||
thisqueryParams.pageSize = this.queryPageParams.weighingRequest.pageSize;
|
||||
thisqueryParams.carno = this.queryParams.carno;
|
||||
listPoundappli(thisqueryParams).then(response => {
|
||||
await listPoundappli(thisqueryParams).then(response => {
|
||||
this.poundappliList = response.rows;
|
||||
this.queryPageParams.weighingRequest.total = response.total;
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
//根据车号查询过皮申请
|
||||
handleSearchTareappli() {
|
||||
async handleSearchTareappli() {
|
||||
this.loading = true;
|
||||
var thisqueryParams = {
|
||||
carno:"",
|
||||
|
@ -869,7 +869,7 @@ export default {
|
|||
thisqueryParams.pageNum = this.queryPageParams.tareRequest.pageNum;
|
||||
thisqueryParams.pageSize = this.queryPageParams.tareRequest.pageSize;
|
||||
thisqueryParams.carno = this.queryParams.carno;
|
||||
listPoundbill(thisqueryParams).then(response => {
|
||||
await listPoundbill(thisqueryParams).then(response => {
|
||||
this.tareappliList = response.rows;
|
||||
this.queryPageParams.tareRequest.total = response.total;
|
||||
this.loading = false;
|
||||
|
|
|
@ -1252,8 +1252,6 @@ watch: {
|
|||
//清空表单中数据
|
||||
this.resetPoundBillDetailForm();
|
||||
try {
|
||||
//自动调用一次获取重量的方法
|
||||
await this.handleGetweight();
|
||||
// 获取榜单编码
|
||||
const response = await getPoundBillNumber();
|
||||
this.poundBillDetailFormData.poundBillDetailForm.usrcode = response.data.number;
|
||||
|
|
|
@ -49,9 +49,9 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="mini" @click="handleSearchMstBillFirst">自动过磅</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleSearchMstBillFirst">手动过磅</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleSearchMstBillFirst">完成</el-button>
|
||||
<el-button type="primary" size="mini" @click="changePoundType(true)" :disabled = "autoPoundParams.autoPound">自动过磅</el-button>
|
||||
<el-button type="primary" size="mini" @click="changePoundType(false)" :disabled = "!autoPoundParams.autoPound">手动过磅</el-button>
|
||||
<el-button type="primary" size="mini" @click="finishMstBill">完成</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleSearchMstBillFirst">查询</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleSearchMstBillFirst">打印</el-button>
|
||||
</el-form-item>
|
||||
|
@ -191,7 +191,7 @@
|
|||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="primary" size="mini" @click="handleSearchMstBillFirst">操作</el-button>
|
||||
<el-button type="primary" size="mini" @click="">操作</el-button>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
|
@ -445,7 +445,7 @@
|
|||
import { listSteelpound, getSteelpound, delSteelpound, addSteelpound, updateSteelpound } from "@/api/measurement/operation/steelpound"
|
||||
import {getTruepound} from "@/api/measurement/basedata/truepound";
|
||||
import SearchSelect from "@/components/SearchSelect";
|
||||
import {addPoundmst, getNumber, getPoundmst, listPoundmst, updatePoundmst} from "@/api/measurement/bill/poundmst";
|
||||
import {addPoundmst, getNumber, getPoundmst, listPoundmst, updatePoundmst,complete} from "@/api/measurement/bill/poundmst";
|
||||
import {addTransPoundbill, getNumber as getPoundBillNumber,getMaxBundleNo, listPoundbill,addSteelPoundbill} from "@/api/measurement/bill/poundbill";
|
||||
import Decimal from "decimal.js";
|
||||
|
||||
|
@ -563,6 +563,12 @@ export default {
|
|||
isWght:true,
|
||||
mstAndbundleNo:{},
|
||||
},
|
||||
//自动过磅相关参数
|
||||
autoPoundParams:{
|
||||
autoPound:false,
|
||||
isWeighing: false, // 是否已完成一次称重
|
||||
weightTimer: null // 定时器引用
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -588,6 +594,37 @@ export default {
|
|||
this.truepoundData = {};
|
||||
}
|
||||
},
|
||||
//监听重量变化
|
||||
'queryParams.weight': function(newVal, oldVal) {
|
||||
if (!this.autoPoundParams.autoPound){
|
||||
return;
|
||||
}
|
||||
// 如果重量 <= 10kg,说明货物被拿走,准备下一次称重
|
||||
if (newVal <= 0.01) {
|
||||
if (this.weightTimer) {
|
||||
clearTimeout(this.weightTimer);
|
||||
this.weightTimer = null;
|
||||
}
|
||||
this.isWeighing = false; // 允许下一次称重
|
||||
}
|
||||
|
||||
// 如果重量 > 10kg,可能是称重开始或过程
|
||||
if (newVal > 0.01 && !this.isWeighing) {
|
||||
// 每次重量变化都重置定时器,防止不稳定就触发
|
||||
if (this.weightTimer) {
|
||||
clearTimeout(this.weightTimer);
|
||||
}
|
||||
|
||||
// 启动一个新的 5 秒定时器:只要连续 5 秒内重量都大于 10kg,就认为称重完成
|
||||
this.weightTimer = setTimeout(() => {
|
||||
// 进入称重完成流程
|
||||
this.stableWeight = this.queryParams.weight;
|
||||
this.poundBillDetailForNetwgtBack(); // 生成单据
|
||||
this.isWeighing = true; // 标记称重已完成,防止重复触发
|
||||
this.weightTimer = null;
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询钢材磅列表 */
|
||||
|
@ -782,7 +819,7 @@ export default {
|
|||
},
|
||||
|
||||
//点击增明细,打开榜单明细弹窗。
|
||||
async addPoundBillDetail() {
|
||||
async addPoundBillDetail(isOpen) {
|
||||
// 校验是否选中主榜单
|
||||
if (this.mstBillFormData.selectedIds.length === 0) {
|
||||
this.$message.error("请先选择主榜单!");
|
||||
|
@ -791,8 +828,6 @@ export default {
|
|||
//清空表单中数据
|
||||
this.resetPoundBillDetailForm();
|
||||
try {
|
||||
//自动调用一次获取重量的方法
|
||||
await this.handleGetweight();
|
||||
// 获取榜单编码
|
||||
const response = await getPoundBillNumber();
|
||||
this.poundBillDetailFormData.poundBillDetailForm.usrcode = response.data.number;
|
||||
|
@ -815,8 +850,10 @@ export default {
|
|||
form.poundname = this.truepoundData.name;
|
||||
//调用一次获取捆号的方法
|
||||
await this.getMaxBundleNo();
|
||||
// 展示弹窗
|
||||
this.poundBillDetailFormData.poundBillDetailOpen = true;
|
||||
// 展示弹窗,根据传入的参数判断是否需要展示弹窗。
|
||||
if (isOpen){
|
||||
this.poundBillDetailFormData.poundBillDetailOpen = true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("新增明细失败:", error);
|
||||
this.$message.error("新增明细失败,请稍后重试!");
|
||||
|
@ -848,6 +885,24 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
//直接根据榜单详情进行数据新增。
|
||||
async poundBillDetailForNetwgtBack() {
|
||||
//将稳定重量赋值到稳定重量字段中。
|
||||
this.queryParams.stableWeight = this.queryParams.weight;
|
||||
await this.addPoundBillDetail(false);
|
||||
debugger
|
||||
addSteelPoundbill(this.poundBillDetailFormData.poundBillDetailForm).then(response => {
|
||||
this.$message.success("新增榜单明细成功!");
|
||||
this.poundBillDetailFormData.poundBillDetailOpen = false;
|
||||
//查询榜单明细数据
|
||||
this.queryPoundBillDetailFirst();
|
||||
//将当前捆号自增1,并更新到缓存中。
|
||||
const appliId = this.poundBillDetailFormData.poundBillDetailForm.appliid;
|
||||
const bundleNo = this.poundBillDetailFormData.poundBillDetailForm.bundleNo;
|
||||
//将捆号数据缓存到queryPageParams中
|
||||
this.poundBillDetailFormData.mstAndbundleNo[appliId] = parseInt(bundleNo) + 1;
|
||||
});
|
||||
},
|
||||
//点击取消,关闭榜单明细弹窗。
|
||||
poundBillDetailFormCancel() {
|
||||
this.poundBillDetailFormData.poundBillDetailOpen = false;
|
||||
|
@ -878,7 +933,7 @@ export default {
|
|||
})
|
||||
},
|
||||
//根据选中的主榜单信息获取最大捆号
|
||||
getMaxBundleNo() {
|
||||
async getMaxBundleNo() {
|
||||
//校验是否选中主榜单
|
||||
if (this.mstBillFormData.selectedIds.length === 0) {
|
||||
this.$message.error("请先选择主榜单!");
|
||||
|
@ -894,7 +949,7 @@ export default {
|
|||
}else {
|
||||
//获取最大捆号
|
||||
debugger
|
||||
getMaxBundleNo(mstId).then(response => {
|
||||
await getMaxBundleNo(mstId).then(response => {
|
||||
var bundleNo = response.data;
|
||||
if (bundleNo == null){
|
||||
this.poundBillDetailFormData.poundBillDetailForm.bundleNo = 1;
|
||||
|
@ -912,6 +967,25 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
//切换自动或手动过磅
|
||||
changePoundType(isAuto){
|
||||
//判断是否选中主榜单
|
||||
if (this.mstBillFormData.selectedIds.length === 0) {
|
||||
this.$message.error("请先选择主榜单!");
|
||||
return;
|
||||
}
|
||||
this.autoPoundParams.autoPound = isAuto;
|
||||
},
|
||||
//选中主榜单,点击完成
|
||||
async finishMstBill() {
|
||||
// 校验是否选中主榜单
|
||||
if (this.mstBillFormData.selectedIds.length === 0) {
|
||||
this.$message.error("请先选择主榜单!");
|
||||
return;
|
||||
}
|
||||
//触发完成方法
|
||||
await complete(this.mstBillFormData.selectedIds[0])
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue