1.钢材磅自动过磅逻辑。钢材磅完成主榜单推送星空简单生产入库单。

2.铁水磅完成主榜单推送星空简单生产入库单。
This commit is contained in:
xiaosuonian 2025-07-04 19:50:58 +08:00
parent e1ce92d937
commit 1a2461dcbf
10 changed files with 167 additions and 36 deletions

View File

@ -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));
}
/**
* 修改主榜单信息
*/

View File

@ -53,6 +53,14 @@ public interface IPoundmstService extends IService<Poundmst>
*/
public int updatePoundmst(Poundmst poundmst);
/**
* 完成主榜单信息
*
* @param id 主榜单信息
* @return 结果
*/
public int completePoundmst(String id);
/**
* 批量删除主榜单信息
*

View File

@ -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){

View File

@ -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;
}
/**
* 批量删除主榜单信息
*

View File

@ -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">

View File

@ -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({

View File

@ -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])
}
}
}

View File

@ -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;

View File

@ -1252,8 +1252,6 @@ watch: {
//
this.resetPoundBillDetailForm();
try {
//
await this.handleGetweight();
//
const response = await getPoundBillNumber();
this.poundBillDetailFormData.poundBillDetailForm.usrcode = response.data.number;

View File

@ -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();
//
// ,
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])
}
}
}