添加单据编号显示
This commit is contained in:
@@ -188,30 +188,32 @@
|
||||
pageList: initPageNum,
|
||||
columns: [[
|
||||
{field: 'id', width: 35, align: "center", checkbox: true},
|
||||
{field: 'depotheadId', hidden: true},
|
||||
{
|
||||
title: '操作', field: 'op', align: "center", width: 60, formatter: function (value, rec) {
|
||||
var str = '';
|
||||
var rowInfo = rec.id + 'AaBb' + rec.materialId + 'AaBb' + rec.materialName + 'AaBb' + rec.serialNumber + 'AaBb' + rec.isSell + 'AaBb' + rec.remark
|
||||
+ 'AaBb' + rec.deleteFlag + 'AaBb' + rec.createTime + 'AaBb' + rec.updateTime + 'AaBb' + rec.creator + 'AaBb' + rec.updater
|
||||
+ 'AaBb' + rec.creatorName + 'AaBb' + rec.updaterName;
|
||||
+ 'AaBb' + rec.creatorName + 'AaBb' + rec.updaterName +'AaBb' + rec.depotheadId+'AaBb' + rec.depotHeadNumber;
|
||||
str += '<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editSerialNumber(\'' + rowInfo + '\');"/> ';
|
||||
str += '<img title="删除" src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteSerialNumber(' + rec.id + ');"/>';
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{title: '商品名称', field: 'materialName', width: 100},
|
||||
{title: '序列号', field: 'serialNumber', width: 200},
|
||||
{title: '已卖出', field: 'isSell', width: 60 , formatter: function (value) {
|
||||
{title: '商品名称', align: "center",field: 'materialName', width: 100},
|
||||
{title: '序列号',align: "center", field: 'serialNumber', width: 200},
|
||||
{title: '单据编号', align: "center", field: 'depotHeadNumber', width: 200},
|
||||
{title: '已卖出', align: "center", field: 'isSell', width: 60 , formatter: function (value) {
|
||||
return value=='1' ? "是" : "否";
|
||||
}
|
||||
},
|
||||
{title: '已删除', field: 'deleteFlag', width: 60, formatter: function (value) {
|
||||
{title: '已删除', align: "center", field: 'deleteFlag', width: 60, formatter: function (value) {
|
||||
return value=='1' ? "是" : "否";
|
||||
}
|
||||
},
|
||||
{title: '创建时间', field: 'createTime', width: 140,formatter: formatDatebox},
|
||||
{title: '更新时间', field: 'updateTime', width: 140,formatter: formatDatebox},
|
||||
{title: '备注', field: 'remark',width: 300}
|
||||
{title: '创建时间',align: "center", field: 'createTime', width: 140,formatter: formatDatebox},
|
||||
{title: '更新时间', align: "center", field: 'updateTime', width: 140,formatter: formatDatebox},
|
||||
{title: '备注',align: "center", field: 'remark',width: 200}
|
||||
]],
|
||||
toolbar: [
|
||||
{
|
||||
|
||||
@@ -19,6 +19,8 @@ public class SerialNumberEx extends SerialNumber{
|
||||
* 更新者名称
|
||||
* */
|
||||
private String updaterName;
|
||||
/**单据编号*/
|
||||
private String depotHeadNumber;
|
||||
|
||||
public String getMaterialName() {
|
||||
return materialName;
|
||||
@@ -43,4 +45,12 @@ public class SerialNumberEx extends SerialNumber{
|
||||
public void setUpdaterName(String updaterName) {
|
||||
this.updaterName = updaterName;
|
||||
}
|
||||
|
||||
public String getDepotHeadNumber() {
|
||||
return depotHeadNumber;
|
||||
}
|
||||
|
||||
public void setDepotHeadNumber(String depotHeadNumber) {
|
||||
this.depotHeadNumber = depotHeadNumber;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,40 +342,34 @@ public class DepotItemService {
|
||||
if (tempInsertedJson.get("MType") != null) {
|
||||
depotItem.setMtype(tempInsertedJson.getString("MType"));
|
||||
}
|
||||
this.insertDepotItemWithObj(depotItem);
|
||||
|
||||
/**
|
||||
* 出库时判断库存是否充足
|
||||
* */
|
||||
if(!BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
||||
//非出库,可以直接跳过下面的操作
|
||||
continue;
|
||||
}
|
||||
if(depotItem==null){
|
||||
continue;
|
||||
}
|
||||
Material material= materialService.getMaterial(depotItem.getMaterialid());
|
||||
if(material==null){
|
||||
continue;
|
||||
}
|
||||
if(getCurrentInStock(depotItem.getMaterialid())<depotItem.getOpernumber().intValue()){
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
||||
if(depotItem==null){
|
||||
continue;
|
||||
}
|
||||
Material material= materialService.getMaterial(depotItem.getMaterialid());
|
||||
if(material==null){
|
||||
continue;
|
||||
}
|
||||
if(getCurrentInStock(depotItem.getMaterialid())<depotItem.getOpernumber().intValue()){
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
|
||||
/**出库时处理序列号*/
|
||||
if(BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())) {
|
||||
//调拨,不处理序列号问题
|
||||
continue;
|
||||
/**出库时处理序列号*/
|
||||
if(!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())) {
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber())) {
|
||||
//查询单据子表中开启序列号的数据列表
|
||||
serialNumberService.checkAndUpdateSerialNumber(depotItem, userInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber())) {
|
||||
//查询单据子表中开启序列号的数据列表
|
||||
serialNumberService.checkAndUpdateSerialNumber(depotItem, userInfo);
|
||||
}
|
||||
|
||||
this.insertDepotItemWithObj(depotItem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,27 +455,23 @@ public class DepotItemService {
|
||||
depotItem.setOtherfield4(tempUpdatedJson.getString("OtherField4"));
|
||||
depotItem.setOtherfield5(tempUpdatedJson.getString("OtherField5"));
|
||||
depotItem.setMtype(tempUpdatedJson.getString("MType"));
|
||||
this.updateDepotItemWithObj(depotItem);
|
||||
/**出库时处理序列号*/
|
||||
if(!BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
||||
//非出库,不处理下面的逻辑
|
||||
continue;
|
||||
}
|
||||
if(getCurrentInStock(depotItem.getMaterialid())<depotItem.getOpernumber().intValue()){
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
if(BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())) {
|
||||
//调拨,不处理序列号问题
|
||||
continue;
|
||||
}
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber())) {
|
||||
//查询单据子表中开启序列号的数据列表
|
||||
serialNumberService.checkAndUpdateSerialNumber(depotItem, userInfo);
|
||||
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
|
||||
if(getCurrentInStock(depotItem.getMaterialid())<depotItem.getOpernumber().intValue()){
|
||||
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
|
||||
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
|
||||
}
|
||||
if(!BusinessConstants.SUB_TYPE_TRANSFER.equals(depotHead.getSubtype())) {
|
||||
/**
|
||||
* 判断商品是否开启序列号,开启的收回序列号,未开启的跳过
|
||||
* */
|
||||
if(BusinessConstants.ENABLE_SERIAL_NUMBER_ENABLED.equals(material.getEnableSerialNumber())) {
|
||||
//查询单据子表中开启序列号的数据列表
|
||||
serialNumberService.checkAndUpdateSerialNumber(depotItem, userInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.updateDepotItemWithObj(depotItem);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -6,14 +6,16 @@
|
||||
<result column="materialName" jdbcType="VARCHAR" property="materialName" />
|
||||
<result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
|
||||
<result column="updaterName" jdbcType="VARCHAR" property="updaterName" />
|
||||
<result column="depotHeadNumber" jdbcType="VARCHAR" property="depotHeadNumber" />
|
||||
</resultMap>
|
||||
<select id="selectByConditionSerialNumber" resultMap="SerialNumberExBaseResultMap">
|
||||
select
|
||||
ser.id, ser.material_Id, ser.serial_Number, ser.is_Sell, ser.remark, ser.delete_Flag, ser.create_Time,
|
||||
ser.update_Time,mat.name as materialName,null as creator,null as updater,null as creatorName,
|
||||
null as updaterName,ser.depothead_Id
|
||||
null as updaterName,ser.depothead_Id, dh.number as depotHeadNumber
|
||||
FROM jsh_serial_number ser
|
||||
left JOIN jsh_material mat on mat.id = ser.material_Id
|
||||
left join jsh_material mat on mat.id = ser.material_Id
|
||||
left join jsh_depothead dh on dh.id= ser.depothead_Id
|
||||
where 1=1
|
||||
<if test="serialNumber != null">
|
||||
<bind name="serialNumber" value="'%' + _parameter.serialNumber + '%'" />
|
||||
|
||||
Reference in New Issue
Block a user