add:单据转发中鼎开关
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
package org.nl.wms.ext_manage.purchase.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.ext_manage.purchase.service.EasToWmsService;
|
||||
import org.nl.wms.ext_manage.purchase.service.dto.BillChangeDto;
|
||||
import org.nl.wms.ext_manage.service.WmsToZDWmdService;
|
||||
import org.nl.wms.system_manage.enums.SysParamConstant;
|
||||
import org.nl.wms.system_manage.service.param.ISysParamService;
|
||||
import org.nl.wms.system_manage.service.param.dao.Param;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;import org.nl.common.base.ResponseData;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -19,7 +24,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
public class EasToWmsController {
|
||||
|
||||
private final EasToWmsService easToWmsService;
|
||||
|
||||
private final WmsToZDWmdService wmsToZDWmdService;
|
||||
private final ISysParamService paramService;
|
||||
|
||||
|
||||
@PostMapping("/orderChangeNotice")
|
||||
@@ -27,6 +33,10 @@ public class EasToWmsController {
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> billChange(@RequestBody BillChangeDto body) {
|
||||
JSONObject result = easToWmsService.billChangeHandler(body);
|
||||
Param forwardAllZD = paramService.findByCode(SysParamConstant.FORWARD_ALL_ZD);
|
||||
if (ObjectUtil.isNotEmpty(forwardAllZD) && "1".equals(forwardAllZD.getValue())) {
|
||||
wmsToZDWmdService.syncPurchaseReceiving(body);
|
||||
}
|
||||
return ResponseData.build(result, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +69,15 @@ class SysParamController {
|
||||
return ResponseData.build(paramService.findByCode(code), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping("/updateValueByCode")
|
||||
@Log("根据编码更新参数值")
|
||||
public ResponseEntity<Object> updateValueByCode(@RequestBody Map<String, String> body) {
|
||||
String code = body.get("code");
|
||||
String value = body.get("value");
|
||||
paramService.updateValueByCode(code, value);
|
||||
return ResponseData.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -42,4 +42,9 @@ public class SysParamConstant {
|
||||
*/
|
||||
public final static String PRINTER_PORT = "printer_port";
|
||||
|
||||
/**
|
||||
* 单据转发中鼎开关 0-关闭 1-开启
|
||||
*/
|
||||
public final static String FORWARD_ALL_ZD = "forward_all_zd";
|
||||
|
||||
}
|
||||
|
||||
@@ -56,4 +56,12 @@ public interface ISysParamService extends IService<Param> {
|
||||
* @return Param
|
||||
*/
|
||||
Param findByCode(String code);
|
||||
|
||||
/**
|
||||
* 根据编码更新参数值,不存在则创建
|
||||
*
|
||||
* @param code 参数编码
|
||||
* @param value 参数值
|
||||
*/
|
||||
void updateValueByCode(String code, String value);
|
||||
}
|
||||
|
||||
@@ -101,4 +101,38 @@ public class SysParamServiceImpl extends ServiceImpl<SysParamMapper, Param> impl
|
||||
Param param = paramMapper.selectOne(queryWrapper);
|
||||
return param;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateValueByCode(String code, String value) {
|
||||
Param param = findByCode(code);
|
||||
if (param == null) {
|
||||
param = new Param();
|
||||
param.setCode(code);
|
||||
param.setName(code);
|
||||
param.setZh_name(code);
|
||||
param.setEn_name(code);
|
||||
param.setIn_name(code);
|
||||
param.setValue(value);
|
||||
param.setIs_active(true);
|
||||
param.setIs_delete(false);
|
||||
param.setId(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
param.setCreate_id(currentUserId);
|
||||
param.setCreate_name(nickName);
|
||||
param.setCreate_time(now);
|
||||
param.setUpdate_id(currentUserId);
|
||||
param.setUpdate_name(nickName);
|
||||
param.setUpdate_time(now);
|
||||
paramMapper.insert(param);
|
||||
} else {
|
||||
param.setValue(value);
|
||||
param.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
param.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
param.setUpdate_time(DateUtil.now());
|
||||
paramMapper.updateById(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ export default {
|
||||
html += '<div class="label">'
|
||||
html += '<h3>上海诺力</h3>'
|
||||
html += '<table>'
|
||||
html += '<tr><td class="lbl">订单号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="5"><img src="' + imgSrc + '" width="100" height="100" /></td></tr>'
|
||||
html += '<tr><td class="lbl">单据号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="5"><img src="' + imgSrc + '" width="100" height="100" /></td></tr>'
|
||||
html += '<tr><td class="lbl">行号</td><td class="val">' + itemNo + '</td></tr>'
|
||||
html += '<tr><td class="lbl">物料编码</td><td class="val">' + skuCode + '</td></tr>'
|
||||
html += '<tr><td class="lbl">物料名称</td><td class="val">' + skuName + '</td></tr>'
|
||||
|
||||
@@ -293,7 +293,7 @@ export default {
|
||||
html += '<div class="label">'
|
||||
html += '<h3>上海诺力</h3>'
|
||||
html += '<table>'
|
||||
html += '<tr><td class="lbl">订单号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="5"><img src="' + imgSrc + '" width="100" height="100" /></td></tr>'
|
||||
html += '<tr><td class="lbl">单据号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="5"><img src="' + imgSrc + '" width="100" height="100" /></td></tr>'
|
||||
html += '<tr><td class="lbl">行号</td><td class="val">' + itemNo + '</td></tr>'
|
||||
html += '<tr><td class="lbl">物料编码</td><td class="val">' + skuCode + '</td></tr>'
|
||||
html += '<tr><td class="lbl">物料名称</td><td class="val">' + skuName + '</td></tr>'
|
||||
|
||||
@@ -27,8 +27,34 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传单</el-button>
|
||||
<el-button slot="right" class="filter-item" type="primary" icon="el-icon-printer" size="mini" :disabled="audit_flag" @click="printBill">打印</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-s-promotion"
|
||||
size="mini"
|
||||
:disabled="audit_flag"
|
||||
@click="issueReturnBill"
|
||||
>下发回传单
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
:disabled="audit_flag"
|
||||
@click="printBill"
|
||||
>打印
|
||||
</el-button>
|
||||
<el-switch
|
||||
slot="right"
|
||||
v-model="forwardAllZD"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#dcdfe6"
|
||||
active-text="开启转发中鼎"
|
||||
@change="onForwardAllZDToggle"
|
||||
/>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
@@ -150,6 +176,7 @@ export default {
|
||||
currentRow: null,
|
||||
audit_flag: true,
|
||||
printPreviewVisible: false,
|
||||
forwardAllZD: false,
|
||||
billStatusOptions: [
|
||||
{ value: '0', label: '已创建' },
|
||||
{ value: '1', label: '执行中' },
|
||||
@@ -157,7 +184,27 @@ export default {
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadForwardZDStatus()
|
||||
},
|
||||
methods: {
|
||||
loadForwardZDStatus() {
|
||||
crudPurchase.getForwardZDStatus().then(res => {
|
||||
if (res.data && res.data.value) {
|
||||
this.forwardAllZD = res.data.value === '1'
|
||||
}
|
||||
}).catch(() => {
|
||||
this.forwardAllZD = false
|
||||
})
|
||||
},
|
||||
onForwardAllZDToggle(val) {
|
||||
crudPurchase.setForwardZDStatus(val ? '1' : '0').then(() => {
|
||||
this.crud.notify(val ? '已开启所有单据转发中鼎' : '已关闭所有单据转发中鼎')
|
||||
}).catch(() => {
|
||||
this.forwardAllZD = !val
|
||||
this.crud.notify('操作失败', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
})
|
||||
},
|
||||
canUd(row) {
|
||||
return row.bill_status !== '0'
|
||||
},
|
||||
@@ -314,7 +361,7 @@ export default {
|
||||
html += '<div class="label">'
|
||||
html += '<h3>上海诺力</h3>'
|
||||
html += '<table>'
|
||||
html += '<tr><td class="lbl">订单号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="5"><img src="' + imgSrc + '" width="100" height="100" /></td></tr>'
|
||||
html += '<tr><td class="lbl">单据号</td><td class="val">' + orderNo + '</td><td class="qr" rowspan="5"><img src="' + imgSrc + '" width="100" height="100" /></td></tr>'
|
||||
html += '<tr><td class="lbl">行号</td><td class="val">' + itemNo + '</td></tr>'
|
||||
html += '<tr><td class="lbl">物料编码</td><td class="val">' + skuCode + '</td></tr>'
|
||||
html += '<tr><td class="lbl">物料名称</td><td class="val">' + skuName + '</td></tr>'
|
||||
|
||||
@@ -55,4 +55,19 @@ export function pushZD(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, issueReturnBill, print, pushZD }
|
||||
export function getForwardZDStatus() {
|
||||
return request({
|
||||
url: '/api/param/getValueByCode/forward_all_zd',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function setForwardZDStatus(value) {
|
||||
return request({
|
||||
url: '/api/param/updateValueByCode',
|
||||
method: 'put',
|
||||
data: { code: 'forward_all_zd', value: value }
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, issueReturnBill, print, pushZD, getForwardZDStatus, setForwardZDStatus }
|
||||
|
||||
Reference in New Issue
Block a user