Commit 8ae1f816 by liulei

新增厂区的查询条件

parent d69424ef
...@@ -54,6 +54,8 @@ public class HPKC004 extends DaoEPBase { ...@@ -54,6 +54,8 @@ public class HPKC004 extends DaoEPBase {
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除*/ public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除*/
public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/ public static final String FIELD_INVENT_RECORD_ID = "inventRecordId"; /* 存货档案ID*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂*/
public static final String COL_ID = "ID"; /* ID*/ public static final String COL_ID = "ID"; /* ID*/
...@@ -88,6 +90,8 @@ public class HPKC004 extends DaoEPBase { ...@@ -88,6 +90,8 @@ public class HPKC004 extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除*/ public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除*/
public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/ public static final String COL_INVENT_RECORD_ID = "INVENT_RECORD_ID"; /* 存货档案ID*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂*/
public static final String QUERY = "HPKC004.query"; public static final String QUERY = "HPKC004.query";
public static final String COUNT = "HPKC004.count"; public static final String COUNT = "HPKC004.count";
...@@ -127,6 +131,8 @@ public class HPKC004 extends DaoEPBase { ...@@ -127,6 +131,8 @@ public class HPKC004 extends DaoEPBase {
private String updatedTime = " "; /* 修改时间*/ private String updatedTime = " "; /* 修改时间*/
private Integer deleteFlag; /* 是否删除*/ private Integer deleteFlag; /* 是否删除*/
private Long inventRecordId = new Long(0); /* 存货档案ID*/ private Long inventRecordId = new Long(0); /* 存货档案ID*/
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 工厂*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -280,6 +286,14 @@ public class HPKC004 extends DaoEPBase { ...@@ -280,6 +286,14 @@ public class HPKC004 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID); eiColumn = new EiColumn(FIELD_INVENT_RECORD_ID);
eiColumn.setDescName("存货档案ID"); eiColumn.setDescName("存货档案ID");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("厂区编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -802,6 +816,38 @@ public class HPKC004 extends DaoEPBase { ...@@ -802,6 +816,38 @@ public class HPKC004 extends DaoEPBase {
this.inventRecordId = inventRecordId; this.inventRecordId = inventRecordId;
} }
/** /**
* get the factoryCode - 厂区编码.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 厂区编码.
*
* @param factoryCode - 厂区编码
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 工厂.
* @return the factoryName
*/
public String getFactoryName() {
return this.factoryName;
}
/**
* set the factoryName - 工厂.
*
* @param factoryName - 工厂
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
/**
* get the value from Map. * get the value from Map.
* *
* @param map - source data map * @param map - source data map
...@@ -841,6 +887,8 @@ public class HPKC004 extends DaoEPBase { ...@@ -841,6 +887,8 @@ public class HPKC004 extends DaoEPBase {
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag)); setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId)); setInventRecordId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_INVENT_RECORD_ID)), inventRecordId));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
} }
/** /**
...@@ -882,6 +930,8 @@ public class HPKC004 extends DaoEPBase { ...@@ -882,6 +930,8 @@ public class HPKC004 extends DaoEPBase {
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG))); map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID))); map.put(FIELD_INVENT_RECORD_ID, StringUtils.toString(inventRecordId, eiMetadata.getMeta(FIELD_INVENT_RECORD_ID)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
return map; return map;
} }
} }
...@@ -52,6 +52,8 @@ public class HPKC005 extends DaoEPBase { ...@@ -52,6 +52,8 @@ public class HPKC005 extends DaoEPBase {
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/ public static final String FIELD_UPDATED_NAME = "updatedName"; /* 更新人名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/ public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 更新时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/ public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0.否1.是*/
public static final String FIELD_FACTORY_CODE = "factoryCode"; /* 厂区编码*/
public static final String FIELD_FACTORY_NAME = "factoryName"; /* 工厂*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/ public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
...@@ -83,6 +85,8 @@ public class HPKC005 extends DaoEPBase { ...@@ -83,6 +85,8 @@ public class HPKC005 extends DaoEPBase {
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/ public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 更新人名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 更新时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/ public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0.否1.是*/
public static final String COL_FACTORY_CODE = "FACTORY_CODE"; /* 厂区编码*/
public static final String COL_FACTORY_NAME = "FACTORY_NAME"; /* 工厂*/
public static final String QUERY = "HPKC005.query"; public static final String QUERY = "HPKC005.query";
public static final String COUNT = "HPKC005.count"; public static final String COUNT = "HPKC005.count";
...@@ -120,6 +124,8 @@ public class HPKC005 extends DaoEPBase { ...@@ -120,6 +124,8 @@ public class HPKC005 extends DaoEPBase {
private String updatedName = " "; /* 更新人名称*/ private String updatedName = " "; /* 更新人名称*/
private String updatedTime = " "; /* 更新时间*/ private String updatedTime = " "; /* 更新时间*/
private Integer deleteFlag; /* 是否删除0.否1.是*/ private Integer deleteFlag; /* 是否删除0.否1.是*/
private String factoryCode = " "; /* 厂区编码*/
private String factoryName = " "; /* 工厂*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -272,6 +278,14 @@ public class HPKC005 extends DaoEPBase { ...@@ -272,6 +278,14 @@ public class HPKC005 extends DaoEPBase {
eiColumn.setDescName("是否删除0.否1.是"); eiColumn.setDescName("是否删除0.否1.是");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_CODE);
eiColumn.setDescName("厂区编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FACTORY_NAME);
eiColumn.setDescName("工厂");
eiMetadata.addMeta(eiColumn);
} }
...@@ -763,6 +777,38 @@ public class HPKC005 extends DaoEPBase { ...@@ -763,6 +777,38 @@ public class HPKC005 extends DaoEPBase {
this.deleteFlag = deleteFlag; this.deleteFlag = deleteFlag;
} }
/** /**
* get the factoryCode - 厂区编码.
* @return the factoryCode
*/
public String getFactoryCode() {
return this.factoryCode;
}
/**
* set the factoryCode - 厂区编码.
*
* @param factoryCode - 厂区编码
*/
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
/**
* get the factoryName - 工厂.
* @return the factoryName
*/
public String getFactoryName() {
return this.factoryName;
}
/**
* set the factoryName - 工厂.
*
* @param factoryName - 工厂
*/
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
/**
* get the value from Map. * get the value from Map.
* *
* @param map - source data map * @param map - source data map
...@@ -800,6 +846,8 @@ public class HPKC005 extends DaoEPBase { ...@@ -800,6 +846,8 @@ public class HPKC005 extends DaoEPBase {
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName)); setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag)); setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setFactoryCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_CODE)), factoryCode));
setFactoryName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FACTORY_NAME)), factoryName));
} }
/** /**
...@@ -839,7 +887,8 @@ public class HPKC005 extends DaoEPBase { ...@@ -839,7 +887,8 @@ public class HPKC005 extends DaoEPBase {
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME))); map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG))); map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_FACTORY_CODE, StringUtils.toString(factoryCode, eiMetadata.getMeta(FIELD_FACTORY_CODE)));
map.put(FIELD_FACTORY_NAME, StringUtils.toString(factoryName, eiMetadata.getMeta(FIELD_FACTORY_NAME)));
return map; return map;
} }
} }
...@@ -159,7 +159,7 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -159,7 +159,7 @@ public class ServiceHPKC001 extends ServiceBase {
DaoUtils.insert(HPKC001.INSERT, fKc001); DaoUtils.insert(HPKC001.INSERT, fKc001);
// 修改库存 // 修改库存
HPKCTools.updateStock(fKc001.getWhCode(), fKc001.getInventRecordId(), fKc001.getAmount(), HPKCTools.updateStock(fKc001.getWhCode(), fKc001.getInventRecordId(), fKc001.getAmount(),
fKc001.getUnitWeight(), fKc001.getWeight()); fKc001.getUnitWeight(), fKc001.getWeight(),fKc001.getFactoryCode());
} }
/** /**
...@@ -252,7 +252,7 @@ public class ServiceHPKC001 extends ServiceBase { ...@@ -252,7 +252,7 @@ public class ServiceHPKC001 extends ServiceBase {
DaoUtils.insert(HPKC001.INSERT, newKc006); DaoUtils.insert(HPKC001.INSERT, newKc006);
// 修改库存 // 修改库存
HPKCTools.updateStock(dbKc001.getWhCode(), dbKc001.getInventRecordId(), dbKc001.getAmount().negate(), HPKCTools.updateStock(dbKc001.getWhCode(), dbKc001.getInventRecordId(), dbKc001.getAmount().negate(),
dbKc001.getUnitWeight(), dbKc001.getWeight().negate()); dbKc001.getUnitWeight(), dbKc001.getWeight().negate(),fKc001.getFactoryCode());
} }
} }
......
...@@ -115,7 +115,7 @@ public class ServiceHPKC002 extends ServiceBase { ...@@ -115,7 +115,7 @@ public class ServiceHPKC002 extends ServiceBase {
DaoUtils.insert(HPKC002.INSERT, newKc002); DaoUtils.insert(HPKC002.INSERT, newKc002);
// 修改库存 // 修改库存
HPKCTools.updateStock(dbKc002.getWhCode(), dbKc002.getInventRecordId(), HPKCTools.updateStock(dbKc002.getWhCode(), dbKc002.getInventRecordId(),
dbKc002.getAmount(), dbKc002.getUnitWeight(), dbKc002.getWeight()); dbKc002.getAmount(), dbKc002.getUnitWeight(), dbKc002.getWeight(),dbKc002.getFactoryCode());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -173,7 +173,7 @@ public class ServiceHPKC002A extends ServiceEPBase { ...@@ -173,7 +173,7 @@ public class ServiceHPKC002A extends ServiceEPBase {
DaoUtils.insert(HPKC002.INSERT, newKc002); DaoUtils.insert(HPKC002.INSERT, newKc002);
// 修改库存数量 // 修改库存数量
HPKCTools.updateStock(newKc002.getWhCode(), newKc002.getInventRecordId(), HPKCTools.updateStock(newKc002.getWhCode(), newKc002.getInventRecordId(),
newKc002.getAmount().negate(), dbKc010.getUnitWeight(), newKc002.getWeight().negate()); newKc002.getAmount().negate(), dbKc010.getUnitWeight(), newKc002.getWeight().negate(),dbKc010.getFactoryCode());
} }
} }
} }
...@@ -164,7 +164,7 @@ public class ServiceHPKC002B extends ServiceEPBase { ...@@ -164,7 +164,7 @@ public class ServiceHPKC002B extends ServiceEPBase {
DaoUtils.insert(HPKC002.INSERT, newKc002); DaoUtils.insert(HPKC002.INSERT, newKc002);
// 修改库存数量 // 修改库存数量
HPKCTools.updateStock(newKc002.getWhCode(), newKc002.getInventRecordId(), HPKCTools.updateStock(newKc002.getWhCode(), newKc002.getInventRecordId(),
newKc002.getAmount().negate(), dbKc010.getUnitWeight(), newKc002.getWeight().negate()); newKc002.getAmount().negate(), dbKc010.getUnitWeight(), newKc002.getWeight().negate(),dbKc010.getFactoryCode());
} }
} }
} }
...@@ -8,6 +8,7 @@ import com.baosight.hpjx.core.dao.DaoUtils; ...@@ -8,6 +8,7 @@ import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.hp.constant.HPConstant; import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.kc.domain.HPKC004; import com.baosight.hpjx.hp.kc.domain.HPKC004;
import com.baosight.hpjx.hp.kc.domain.HPKC010; import com.baosight.hpjx.hp.kc.domain.HPKC010;
import com.baosight.hpjx.hp.kc.domain.HPKC011;
import com.baosight.hpjx.hp.kc.tools.HPKCTools; import com.baosight.hpjx.hp.kc.tools.HPKCTools;
import com.baosight.hpjx.util.BeanUtils; import com.baosight.hpjx.util.BeanUtils;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
...@@ -53,6 +54,7 @@ public class ServiceHPKC004 extends ServiceBase { ...@@ -53,6 +54,7 @@ public class ServiceHPKC004 extends ServiceBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_NAME_BLOCK_ID), queryMap);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), queryMap, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_SPEC_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC004().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC004().eiMetadata);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
...@@ -99,9 +101,14 @@ public class ServiceHPKC004 extends ServiceBase { ...@@ -99,9 +101,14 @@ public class ServiceHPKC004 extends ServiceBase {
// 查询数据库记录 // 查询数据库记录
Map<String, HPKC004> mapKc004 = HPKCTools.HpKc004.map(saleNos); Map<String, HPKC004> mapKc004 = HPKCTools.HpKc004.map(saleNos);
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HPKC011 hpkc011 = null;
HPKC010 hpkc010 = null;
HPKC004 fKc004 = new HPKC004(); HPKC004 fKc004 = new HPKC004();
fKc004.fromMap(resultRows.get(i)); fKc004.fromMap(resultRows.get(i));
HPKC010 hpkc010 = HPKCTools.HpKc010.listById(fKc004.getKcId()); if (!fKc004.getSubInventCode().equals(" "))
hpkc011 = HPKCTools.HpKc011.listById(fKc004.getKcId());
else
hpkc010 = HPKCTools.HpKc010.listById(fKc004.getKcId());
DaoUtils.update(HPKC004.DELETE, fKc004); DaoUtils.update(HPKC004.DELETE, fKc004);
// 生成红冲记录 // 生成红冲记录
HPKC004 dbKc004 = mapKc004.get(fKc004.getSaleNo()); HPKC004 dbKc004 = mapKc004.get(fKc004.getSaleNo());
...@@ -116,12 +123,12 @@ public class ServiceHPKC004 extends ServiceBase { ...@@ -116,12 +123,12 @@ public class ServiceHPKC004 extends ServiceBase {
newKc004.setDeleteFlag(CommonConstant.YesNo.YES_1); newKc004.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.insert(HPKC004.INSERT, newKc004); DaoUtils.insert(HPKC004.INSERT, newKc004);
// 修改库存 // 修改库存
if (dbKc004.getProdNo().equals(" ")) if (hpkc010!=null)
HPKCTools.updateStock(dbKc004.getWhCode(), hpkc010.getInventRecordId(), HPKCTools.updateStock(dbKc004.getWhCode(), hpkc010.getInventRecordId(),
dbKc004.getAmount(), dbKc004.getWeight().multiply(new BigDecimal(1000))); dbKc004.getAmount(), dbKc004.getWeight().multiply(new BigDecimal(1000)),hpkc010.getFactoryCode());
else else
HPKCTools.updateProdStock(dbKc004.getWhCode(), dbKc004.getProdNo(), HPKCTools.updateProdStock(dbKc004.getWhCode(), dbKc004.getProdNo(),
dbKc004.getAmount(), dbKc004.getWeight(),hpkc010.getFactoryCode()); dbKc004.getAmount(), dbKc004.getWeight(),hpkc011.getFactoryCode());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -58,6 +58,7 @@ public class ServiceHPKC004B extends ServiceEPBase { ...@@ -58,6 +58,7 @@ public class ServiceHPKC004B extends ServiceEPBase {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.SPEC_NAME_BLOCK_ID), queryMap, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), queryMap2, false); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID), queryMap2, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC010().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPKC010().eiMetadata);
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
...@@ -163,7 +164,7 @@ public class ServiceHPKC004B extends ServiceEPBase { ...@@ -163,7 +164,7 @@ public class ServiceHPKC004B extends ServiceEPBase {
// 修改库存数量 // 修改库存数量
HPKCTools.updateStock(newKc004.getWhCode(), dbKc010.getInventRecordId(), HPKCTools.updateStock(newKc004.getWhCode(), dbKc010.getInventRecordId(),
newKc004.getAmount().negate(), dbKc010.getUnitWeight(), newKc004.getWeight().negate()); newKc004.getAmount().negate(), dbKc010.getUnitWeight(), newKc004.getWeight().negate(),dbKc010.getFactoryCode());
} }
} }
} }
...@@ -142,7 +142,7 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -142,7 +142,7 @@ public class ServiceHPKC005 extends ServiceBase {
DaoUtils.insert(HPKC005.INSERT, fKc005); DaoUtils.insert(HPKC005.INSERT, fKc005);
// 修改库存 // 修改库存
HPKCTools.updateStock(fKc005.getWhCode(), fKc005.getInventRecordId(), HPKCTools.updateStock(fKc005.getWhCode(), fKc005.getInventRecordId(),
fKc005.getDiffAmount(), fKc005.getDiffWeight()); fKc005.getDiffAmount(), fKc005.getDiffWeight(),fKc005.getFactoryCode());
} }
/** /**
...@@ -238,7 +238,7 @@ public class ServiceHPKC005 extends ServiceBase { ...@@ -238,7 +238,7 @@ public class ServiceHPKC005 extends ServiceBase {
DaoUtils.insert(HPKC005.INSERT, newKc005); DaoUtils.insert(HPKC005.INSERT, newKc005);
// 修改库存 // 修改库存
HPKCTools.updateStock(newKc005.getWhCode(), newKc005.getInventRecordId(), HPKCTools.updateStock(newKc005.getWhCode(), newKc005.getInventRecordId(),
newKc005.getDiffAmount(), newKc005.getDiffWeight()); newKc005.getDiffAmount(), newKc005.getDiffWeight(),newKc005.getFactoryCode());
} }
} }
......
...@@ -150,7 +150,7 @@ public class ServiceHPKC005A extends ServiceEPBase { ...@@ -150,7 +150,7 @@ public class ServiceHPKC005A extends ServiceEPBase {
DaoUtils.insert(HPKC005.INSERT, newKc005); DaoUtils.insert(HPKC005.INSERT, newKc005);
// 修改库存数量 // 修改库存数量
HPKCTools.updateStock(newKc005.getWhCode(), newKc005.getInventRecordId(), HPKCTools.updateStock(newKc005.getWhCode(), newKc005.getInventRecordId(),
newKc005.getDiffAmount(), newKc005.getDiffWeight()); newKc005.getDiffAmount(), newKc005.getDiffWeight(),dbKc010.getFactoryCode());
} }
} }
} }
...@@ -156,7 +156,7 @@ public class ServiceHPKC006 extends ServiceBase { ...@@ -156,7 +156,7 @@ public class ServiceHPKC006 extends ServiceBase {
DaoUtils.insert(HPKC006.INSERT, fKc006); DaoUtils.insert(HPKC006.INSERT, fKc006);
// 修改库存 // 修改库存
HPKCTools.updateStock(fKc006.getWhCode(), fKc006.getInventRecordId(), fKc006.getAmount(), HPKCTools.updateStock(fKc006.getWhCode(), fKc006.getInventRecordId(), fKc006.getAmount(),
fKc006.getWeight()); fKc006.getWeight(), fKc006.getFactoryCode());
} }
/** /**
...@@ -221,7 +221,7 @@ public class ServiceHPKC006 extends ServiceBase { ...@@ -221,7 +221,7 @@ public class ServiceHPKC006 extends ServiceBase {
DaoUtils.insert(HPKC006.INSERT, newKc006); DaoUtils.insert(HPKC006.INSERT, newKc006);
// 修改库存 // 修改库存
HPKCTools.updateStock(dbKc006.getWhCode(), dbKc006.getInventRecordId(), dbKc006.getAmount().negate(), HPKCTools.updateStock(dbKc006.getWhCode(), dbKc006.getInventRecordId(), dbKc006.getAmount().negate(),
dbKc006.getWeight().negate()); dbKc006.getWeight().negate(),dbKc006.getFactoryCode());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -111,7 +111,7 @@ public class ServiceHPKC007 extends ServiceBase { ...@@ -111,7 +111,7 @@ public class ServiceHPKC007 extends ServiceBase {
DaoUtils.insert(HPKC007.INSERT, fKc007); DaoUtils.insert(HPKC007.INSERT, fKc007);
// 修改库存 // 修改库存
HPKCTools.updateStock(fKc007.getWhCode(), fKc007.getInventRecordId(), fKc007.getAmount().negate(), HPKCTools.updateStock(fKc007.getWhCode(), fKc007.getInventRecordId(), fKc007.getAmount().negate(),
fKc007.getWeight().negate()); fKc007.getWeight().negate(),fKc007.getFactoryCode());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -152,7 +152,7 @@ public class ServiceHPKC007 extends ServiceBase { ...@@ -152,7 +152,7 @@ public class ServiceHPKC007 extends ServiceBase {
BigDecimal diffWeight = fKc007.getWeight().subtract(dbKc007.getWeight()); BigDecimal diffWeight = fKc007.getWeight().subtract(dbKc007.getWeight());
// 修改库存 // 修改库存
HPKCTools.updateStock(fKc007.getWhCode(), fKc007.getInventRecordId(), diffAmount.negate(), HPKCTools.updateStock(fKc007.getWhCode(), fKc007.getInventRecordId(), diffAmount.negate(),
diffWeight.negate()); diffWeight.negate(), dbKc007.getFactoryCode());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
...@@ -226,7 +226,7 @@ public class ServiceHPKC007 extends ServiceBase { ...@@ -226,7 +226,7 @@ public class ServiceHPKC007 extends ServiceBase {
DaoUtils.insert(HPKC007.INSERT, newKc007); DaoUtils.insert(HPKC007.INSERT, newKc007);
// 修改库存 // 修改库存
HPKCTools.updateStock(dbKc007.getWhCode(), dbKc007.getInventRecordId(), dbKc007.getAmount(), HPKCTools.updateStock(dbKc007.getWhCode(), dbKc007.getInventRecordId(), dbKc007.getAmount(),
dbKc007.getWeight()); dbKc007.getWeight(),dbKc007.getFactoryCode());
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -150,7 +150,7 @@ public class ServiceHPKC007A extends ServiceEPBase { ...@@ -150,7 +150,7 @@ public class ServiceHPKC007A extends ServiceEPBase {
DaoUtils.insert(HPKC007.INSERT, kc007); DaoUtils.insert(HPKC007.INSERT, kc007);
// 修改库存数量 // 修改库存数量
HPKCTools.updateStock(kc007.getWhCode(), kc007.getInventRecordId(), kc007.getAmount().negate(), HPKCTools.updateStock(kc007.getWhCode(), kc007.getInventRecordId(), kc007.getAmount().negate(),
kc007.getWeight().negate()); kc007.getWeight().negate(),kc007.getFactoryCode());
} }
} }
......
...@@ -125,6 +125,7 @@ public class ServiceHPKC010 extends ServiceBase { ...@@ -125,6 +125,7 @@ public class ServiceHPKC010 extends ServiceBase {
throw new PlatException("当前库存为空,库存变更数量与重量不能小于等于0!"); throw new PlatException("当前库存为空,库存变更数量与重量不能小于等于0!");
} }
generatorBaseInfo(newObj); generatorBaseInfo(newObj);
newObj.setFactoryCode(inInfo.getString("factoryCode"));
DaoUtils.insert("HPKC010.insert", newObj); DaoUtils.insert("HPKC010.insert", newObj);
} else { } else {
//修改 //修改
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
UPDATED_BY as "updatedBy", <!-- 更新人 --> UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 --> UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 --> UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag" <!-- 是否删除0.否1.是 --> DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
FACTORY_CODE as "factoryCode", <!-- 厂区编码 -->
FACTORY_NAME as "factoryName" <!-- 工厂 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -85,6 +87,12 @@ ...@@ -85,6 +87,12 @@
<isNotEmpty prepend=" AND " property="deleteFlag"> <isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag# DELETE_FLAG = #deleteFlag#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
...@@ -173,13 +181,15 @@ ...@@ -173,13 +181,15 @@
CREATED_BY, <!-- 创建人 --> CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 --> CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 --> CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG <!-- 是否删除0.否1.是 --> DELETE_FLAG, <!-- 是否删除0.否1.是 -->
FACTORY_CODE, <!-- 厂区编码 -->
FACTORY_NAME <!-- 工厂 -->
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #receiptDate#, #checkNo#, #whCode#, #whName#, #companyCode#, #depCode#, #receiptDate#, #checkNo#, #whCode#, #whName#,
#inventType#, #inventCode#, #inventName#, #inventRecordId#, #bookAmount#, #inventType#, #inventCode#, #inventName#, #inventRecordId#, #bookAmount#,
#bookWeight#, #entityAmount#, #entityWeight#, #diffAmount#, #diffWeight#, #bookWeight#, #entityAmount#, #entityWeight#, #diffAmount#, #diffWeight#,
#kcId#, #remark#, #oldCheckNo#, #createdBy#, #createdName#, #createdTime#, #kcId#, #remark#, #oldCheckNo#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag# #deleteFlag#,#factoryCode#, #factoryName#
) )
</insert> </insert>
...@@ -207,7 +217,9 @@ ...@@ -207,7 +217,9 @@
REMARK = #remark#, <!-- 备注 --> REMARK = #remark#, <!-- 备注 -->
UPDATED_BY = #updatedBy#, <!-- 更新人 --> UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 --> UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime# <!-- 更新时间 --> UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
FACTORY_CODE = #factoryCode#,
FACTORY_NAME = #factoryName#
WHERE ID = #id# WHERE ID = #id#
</update> </update>
...@@ -228,6 +240,8 @@ ...@@ -228,6 +240,8 @@
<select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC005"> <select id="statDate" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC005">
SELECT SELECT
COMPANY_CODE AS "companyCode", COMPANY_CODE AS "companyCode",
FACTORY_CODE as "factoryCode",
FACTORY_NAME as "factoryName",
DEP_CODE AS "depCode", DEP_CODE AS "depCode",
WH_CODE AS "whCode", WH_CODE AS "whCode",
INVENT_TYPE AS "inventType", INVENT_TYPE AS "inventType",
...@@ -240,7 +254,7 @@ ...@@ -240,7 +254,7 @@
<isNotEmpty prepend=" AND " property="createdTimeFrom"> <isNotEmpty prepend=" AND " property="createdTimeFrom">
CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo# CREATED_TIME BETWEEN #createdTimeFrom# AND #createdTimeTo#
</isNotEmpty> </isNotEmpty>
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, INVENT_TYPE, INVENT_CODE, INVENT_RECORD_ID,FACTORY_CODE,FACTORY_NAME
</select> </select>
</sqlMap> </sqlMap>
...@@ -448,8 +448,8 @@ public class HPKCTools { ...@@ -448,8 +448,8 @@ public class HPKCTools {
* @param amount * @param amount
* @param weight * @param weight
*/ */
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal weight) { public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal weight,String factCode) {
updateStock(whCode, inventRecordId, amount, BigDecimal.ZERO, weight); updateStock(whCode, inventRecordId, amount, BigDecimal.ZERO, weight,factCode);
} }
/** /**
...@@ -476,6 +476,18 @@ public class HPKCTools { ...@@ -476,6 +476,18 @@ public class HPKCTools {
} }
/** /**
* 查询
*
* @param id
* @return
*/
public static HPKC011 listById(Long id) {
Map queryMap = new HashMap();
queryMap.put("id", id);
return (HPKC011) DaoBase.getInstance().query(HPKC011.QUERY, queryMap).get(0);
}
/**
* 查询库存信息 * 查询库存信息
* *
* @param ids * @param ids
...@@ -516,7 +528,7 @@ public class HPKCTools { ...@@ -516,7 +528,7 @@ public class HPKCTools {
* @param weight * @param weight
*/ */
public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal unitWeight, public static void updateStock(String whCode, Long inventRecordId, BigDecimal amount, BigDecimal unitWeight,
BigDecimal weight) { BigDecimal weight,String factoryCode) {
if (amount.compareTo(BigDecimal.ZERO) == 0) { if (amount.compareTo(BigDecimal.ZERO) == 0) {
throw new PlatException("入库数量不能为空"); throw new PlatException("入库数量不能为空");
} }
...@@ -526,6 +538,7 @@ public class HPKCTools { ...@@ -526,6 +538,7 @@ public class HPKCTools {
inInfo.set("amount", amount); inInfo.set("amount", amount);
inInfo.set("unitWeight", unitWeight); inInfo.set("unitWeight", unitWeight);
inInfo.set("weight", weight); inInfo.set("weight", weight);
inInfo.set("factoryCode", factoryCode);
inInfo.set(EiConstant.serviceName, "HPKC010"); inInfo.set(EiConstant.serviceName, "HPKC010");
inInfo.set(EiConstant.methodName, "updateStock"); inInfo.set(EiConstant.methodName, "updateStock");
EiInfo outInfo = XLocalManager.call(inInfo); EiInfo outInfo = XLocalManager.call(inInfo);
......
...@@ -41,6 +41,10 @@ ...@@ -41,6 +41,10 @@
<EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="90" align="center" <EF:EFColumn ename="receiptDate" cname="单据日期" enable="false" width="90" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/> <EF:EFColumn ename="projName" cname="项目名称" enable="false" width="140" align="center"/>
<EF:EFComboColumn ename="factoryCode" enable="false" cname="厂区" width="110" align="center" defaultValue=""
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center" <EF:EFComboColumn ename="whCode" cname="仓库名称" enable="false" width="120" align="center"
blockName="wh_record_block_id" textField="textField" valueField="valueField" blockName="wh_record_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#"> columnTemplate="#=textField#" itemTemplate="#=textField#">
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
<EF:EFPage title="库存查询"> <EF:EFPage title="库存查询">
<EF:EFRegion id="inqu" title="查询区域" type="query"> <EF:EFRegion id="inqu" title="查询区域" type="query">
<div class="row"> <div class="row">
<EF:EFSelect ename="inqu_status-0-factoryCode" cname="厂区" colWidth="3" filter="contains" defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains"> <EF:EFSelect cname="仓库名称" ename="inqu_status-0-whCode" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
...@@ -26,6 +30,10 @@ ...@@ -26,6 +30,10 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row"> <EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="库存ID" enable="false" width="60" align="center" hidden="true"/> <EF:EFColumn ename="id" cname="库存ID" enable="false" width="60" align="center" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" enable="false" cname="厂区" width="110" align="center" defaultValue=""
filter="contains" readonly="true">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center"> <EF:EFComboColumn ename="inventType" cname="存货类型" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('2')"/> <EF:EFCodeOption codeName="hpjx.hpkc.inventType" condition="ITEM_CODE IN ('2')"/>
</EF:EFComboColumn> </EF:EFComboColumn>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment