1.创建主磅单下的磅单时,将主磅单号赋值到磅单信息中。

2.完善铁水磅,钢材磅逻辑。
This commit is contained in:
xiaosuonian 2025-07-15 11:21:38 +08:00
parent 1e1da7086f
commit 9021b079e8
8 changed files with 170 additions and 54 deletions

View File

@ -129,6 +129,16 @@ public class PoundBillController extends BaseController
{
return toAjax(poundBillService.insertTransPoundBill(poundBill));
}
/**
* 新增磅单信息铁水磅
*/
@PreAuthorize("@ss.hasPermi('measurement:poundbill:add')")
@Log(title = "磅单信息", businessType = BusinessType.INSERT)
@PostMapping(value = "/molteniron")
public AjaxResult addMolteniron(@RequestBody PoundBill poundBill)
{
return toAjax(poundBillService.insertMoltenironPoundBill(poundBill));
}
/**
* 新增磅单信息成品磅
*/
@ -173,6 +183,16 @@ public class PoundBillController extends BaseController
{
return toAjax(poundBillService.updateTransPoundBill(poundBill));
}
/**
* 修改磅单信息(倒短磅过皮申请变完成状态)
*/
@PreAuthorize("@ss.hasPermi('measurement:poundbill:edit')")
@Log(title = "磅单信息", businessType = BusinessType.UPDATE)
@PutMapping(value = "/molteniron")
public AjaxResult editMolteniron(@RequestBody PoundBill poundBill)
{
return toAjax(poundBillService.updateMoltenironPoundBill(poundBill));
}
/**
* 删除磅单信息

View File

@ -44,6 +44,8 @@ public interface IPoundBillService extends IService<PoundBill>
public int insertTransPoundBill(PoundBill poundBill);
public int insertMoltenironPoundBill(PoundBill poundBill);
public int insertSteelPoundBill(PoundBill poundBill);
/**
@ -58,6 +60,8 @@ public interface IPoundBillService extends IService<PoundBill>
public int updateTransPoundBill(PoundBill poundBill);
public int updateMoltenironPoundBill(PoundBill poundBill);
/**
* 批量删除磅单信息
*

View File

@ -306,12 +306,48 @@ public class PoundBillServiceImpl extends ServiceImpl<PoundBillMapper, PoundBill
return 0;
}
@Override
@Transactional(rollbackFor = Exception.class)
public int insertMoltenironPoundBill(PoundBill poundBill)
{
poundBill.initAddFields(poundBill);
poundBill.setBillstate("1");
//设置星空单据类型为简单生产入库
poundBill.setSrcblltype("SP_InStock");
poundBill.setFid("0");
poundBill.setFentity_fentryid("0");
//获取系统参数中的公司编码
String companyCode = sysConfigService.selectConfigByKey("OA_Company_Code");
//设置OA组织编码
poundBill.setOaOrgNumber(companyCode);
poundBill.setInStockNumber("CK001");
poundBill.setOutStockNumber("CK002");
//设置当前时间为过毛重时间
poundBill.setWghdt(new Date());
//设置当前登录人为毛重司磅员
String currentUser = "admin";
try {
currentUser = SecurityUtils.getUsername();
}catch (Exception e){
//Do nothing
}
poundBill.setWghdtoprname(currentUser);
boolean save = save(poundBill);
if(save){
return 1;
}
return 0;
}
@Override
@Transactional(rollbackFor = Exception.class)
public int insertSteelPoundBill(PoundBill poundBill)
{
poundBill.initAddFields(poundBill);
poundBill.setBillstate("2");
//设置星空单据类型为简单生产入库
poundBill.setSrcblltype("SP_InStock");
//设置当前时间为过毛重时间
poundBill.setWghdt(new Date());
//设置当前登录人为毛重司磅员
@ -423,11 +459,44 @@ public class PoundBillServiceImpl extends ServiceImpl<PoundBillMapper, PoundBill
boolean b = updateById(byId);
//推送榜单信息到星空系统
//调用磅单回调接口
// try {
// apiPostBack.makePoundBillFormData(poundBill.getId());
// } catch (IOException e) {
// throw new RuntimeException("磅单:" + poundBill.getUsrcode() + "推送星空时,出现异常:"+e.getMessage());
// }
try {
apiPostBack.makePoundBillFormData(poundBill.getId());
} catch (IOException e) {
throw new RuntimeException("磅单:" + poundBill.getUsrcode() + "推送星空时,出现异常:"+e.getMessage());
}
if(b){
return 1;
}else{
return 0;
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public int updateMoltenironPoundBill(PoundBill poundBill)
{
String id = poundBill.getId();
Empwgtdata empwgtdata = new Empwgtdata();
empwgtdata.setCarno(poundBill.getCarno());
empwgtdata.setEmptycarqty(poundBill.getEmpmqty());
Map<String, Object> params = poundBill.getParams();
String ttsid = (String) params.get("ttsid");
String poundid = (String) params.get("poundid");
empwgtdata.setTtsid(ttsid);
empwgtdata.setPoundid(poundid);
empwgtdata.setIsused("N");
empwgtdataService.insertEmpwgtdata(empwgtdata);
String empDataId = empwgtdata.getId();
String empUsrcode = empwgtdata.getUsrcode();
//开始对磅单信息进行赋值
PoundBill byId = getById(id);
byId.setEmpsysid(empDataId);
byId.setEmpusrcode(empUsrcode);
byId.setEmpmqty(poundBill.getEmpmqty());
byId.setNetmqty(poundBill.getNetmqty());
byId.setEmpdt(new Date());
byId.setEmpdtoprname(SecurityUtils.getUsername());
byId.setBillstate("2");
boolean b = updateById(byId);
if(b){
return 1;
}else{

View File

@ -69,7 +69,15 @@ export function addTransPoundbill(data) {
data: data
})
}
// 新增磅单信息(倒短)
// 新增磅单信息(铁水)
export function addMoltenironPoundbill(data) {
return request({
url: '/measurement/poundbill/molteniron',
method: 'post',
data: data
})
}
// 新增磅单信息(钢材)
export function addSteelPoundbill(data) {
return request({
url: '/measurement/poundbill/steel',
@ -103,6 +111,14 @@ export function updateTransPoundbill(data) {
data: data
})
}
// 修改磅单信息(铁水)
export function updateMoltenironPoundbill(data) {
return request({
url: '/measurement/poundbill/molteniron',
method: 'put',
data: data
})
}
// 删除磅单信息
export function delPoundbill(id) {

View File

@ -1,44 +1,44 @@
import request from '@/utils/request'
// 查询铁水磅列表
export function listMoltenironpound(query) {
return request({
url: '/measurement/operation/moltenironpound/list',
method: 'get',
params: query
})
}
// 查询铁水磅详细
export function getMoltenironpound(id) {
return request({
url: '/measurement/operation/moltenironpound/' + id,
method: 'get'
})
}
// 新增铁水磅
export function addMoltenironpound(data) {
return request({
url: '/measurement/operation/moltenironpound',
method: 'post',
data: data
})
}
// 修改铁水磅
export function updateMoltenironpound(data) {
return request({
url: '/measurement/operation/moltenironpound',
method: 'put',
data: data
})
}
// 删除铁水磅
export function delMoltenironpound(id) {
return request({
url: '/measurement/operation/moltenironpound/' + id,
method: 'delete'
})
}
// import request from '@/utils/request'
//
// // 查询铁水磅列表
// export function listMoltenironpound(query) {
// return request({
// url: '/measurement/operation/moltenironpound/list',
// method: 'get',
// params: query
// })
// }
//
// // 查询铁水磅详细
// export function getMoltenironpound(id) {
// return request({
// url: '/measurement/operation/moltenironpound/' + id,
// method: 'get'
// })
// }
//
// // 新增铁水磅
// export function addMoltenironpound(data) {
// return request({
// url: '/measurement/operation/moltenironpound',
// method: 'post',
// data: data
// })
// }
//
// // 修改铁水磅
// export function updateMoltenironpound(data) {
// return request({
// url: '/measurement/operation/moltenironpound',
// method: 'put',
// data: data
// })
// }
//
// // 删除铁水磅
// export function delMoltenironpound(id) {
// return request({
// url: '/measurement/operation/moltenironpound/' + id,
// method: 'delete'
// })
// }

View File

@ -386,7 +386,7 @@
/>
</el-col>
<el-col :span="4" v-show="activeTab === 'weighingRequest'">
<el-button type="primary" size="mini" @click="handleQuery">操作</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">
@ -630,7 +630,8 @@ import {
addTransPoundbill,
getNumber as getPoundBillNumber,
getPoundbill, listPoundbill,
updateTransPoundbill
addMoltenironPoundbill,
updateMoltenironPoundbill,
} from "@/api/measurement/bill/poundbill";
import {getCarnoEmpwgtData} from "@/api/measurement/basedata/empwgtdata";
//searchSelect
@ -1015,6 +1016,7 @@ export default {
const mainRow = this.mstBillFormData.thisSelectedRow;
const form = this.poundBillDetailFormData.poundBillDetailForm;
form.appliid = this.mstBillFormData.selectedIds[0];
form.wetusrcode = this.mstBillFormData.selectedUsrcodes[0];
form.sendunitid = mainRow.sendunitid;
form.recunitid = mainRow.recunitid;
form.trnunitid = mainRow.trnunitid;
@ -1048,7 +1050,7 @@ export default {
cancelButtonText: "取消",
type: "warning"
}).then(() => {
addTransPoundbill(this.poundBillDetailFormData.poundBillDetailForm).then(response => {
addMoltenironPoundbill(this.poundBillDetailFormData.poundBillDetailForm).then(response => {
this.$message.success("新增榜单明细成功!");
this.poundBillDetailFormData.poundBillDetailOpen = false;
//
@ -1112,7 +1114,7 @@ export default {
cancelButtonText: "取消",
type: "warning"
}).then(() => {
updateTransPoundbill(this.poundBillDetailFormData.poundBillDetailForm).then(response => {
updateMoltenironPoundbill(this.poundBillDetailFormData.poundBillDetailForm).then(response => {
this.$message.success("榜单明细称皮重成功!");
this.poundBillDetailFormData.poundBillDetailOpen = false;
//

View File

@ -838,6 +838,7 @@ export default {
//
mstBillFormData:{
selectedIds:[],
selectedUsrcodes:[],
mstBillForm:{},
mstBillRules:{},
mstBillTitle:"主榜单信息",
@ -967,9 +968,11 @@ watch: {
handleMstSelectionChange(selection) {
if (selection.length > 0){
this.mstBillFormData.selectedIds = selection.map(item => item.id)
this.mstBillFormData.selectedUsrcodes = selection.map(item => item.usrcode)
this.queryPoundBillDetailFirst();
}else {
this.mstBillFormData.selectedIds = [];
this.mstBillFormData.selectedUsrcodes = [];
}
},
//
@ -1203,6 +1206,7 @@ watch: {
const mainRow = this.mstBillFormData.thisSelectedRow;
const form = this.poundBillDetailFormData.poundBillDetailForm;
form.appliid = this.mstBillFormData.selectedIds[0];
form.wetusrcode = this.mstBillFormData.selectedUsrcodes[0];
form.sendunitid = mainRow.sendunitid;
form.recunitid = mainRow.recunitid;
form.trnunitid = mainRow.trnunitid;

View File

@ -838,6 +838,7 @@ export default {
const mainRow = this.mstBillFormData.thisSelectedRow;
const form = this.poundBillDetailFormData.poundBillDetailForm;
form.appliid = this.mstBillFormData.selectedIds[0];
form.wetusrcode = this.mstBillFormData.selectedUsrcodes[0];
form.sendunitid = mainRow.sendunitid;
form.recunitid = mainRow.recunitid;
form.itmcode = mainRow.itmcode;