| | |
| | | Session session = this.getSessionFactory().openSession(); |
| | | data.setUpdateTime(new Date()); |
| | | data.setUpdateUser(ContextUtil.getLoginUserCName()); |
| | | if ("OVER".equals(data.getType())) { |
| | | data.setAmount(0 - data.getAmount()); |
| | | } |
| | | |
| | | try { |
| | | if (null == data.getId()) { |
| | |
| | | if (data.getSubmitTime().before(curDate)) { |
| | | data.setSubmitTime(curDate); |
| | | } |
| | | String id = createId(data.getSubmitTime(), data.getCompanyId(), data.getHwdm()); |
| | | String id = createId(data.getSubmitTime(), data.getCompanyId(), data.getType()); |
| | | // String id = addInoutDataByLossOver(data); |
| | | data.setCzbz("i"); |
| | | data.setId(id); |
| | | |
| | | session.save(data); |
| | | } else { |
| | | data.setCzbz("u"); |
| | | session.update(data); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | return this.query(hql, args); |
| | | } |
| | | |
| | | public String createId(Date date, String companyId, String freightId) { |
| | | public String createId(Date date, String companyId, String type) { |
| | | // 时间戳标签 |
| | | String timeKey = DateFormatUtils.format(date, "yyyyMMdd"); |
| | | |
| | |
| | | |
| | | String cacheId = (String) redisUtil.get(cacheKey); |
| | | |
| | | if (null != cacheId && cacheId.indexOf(freightId + timeKey) >= 0) { |
| | | if (null != cacheId && cacheId.indexOf(timeKey) >= 0) { |
| | | String temp = cacheId.substring(cacheId.length() - 3); |
| | | Integer i = Integer.valueOf(temp); |
| | | cacheId = freightId + timeKey + String.format("%03d", ++i); |
| | | cacheId = timeKey + String.format("%03d", ++i); |
| | | } else { |
| | | Map<String, Object> args = new HashMap<>(); |
| | | args.put("timeKey", freightId + timeKey + "%"); |
| | | args.put("timeKey", timeKey + "%"); |
| | | List<InoutLossOver> result = getMaxId(args); |
| | | |
| | | if (null == result || result.size() == 0) { |
| | | cacheId = freightId + timeKey + "001"; |
| | | cacheId = timeKey + "001"; |
| | | } else { |
| | | int max = 0; |
| | | int num; |
| | |
| | | num = Integer.parseInt(inoutLossOver.getId().substring(inoutLossOver.getId().length() - 3)); |
| | | max = Math.max(max, num); |
| | | } |
| | | cacheId = freightId + timeKey + String.format("%03d", ++max); |
| | | cacheId = timeKey + String.format("%03d", ++max); |
| | | } |
| | | } |
| | | // 更新缓存 |
| | |
| | | data.setUpdateTime(new Date()); |
| | | data.setUpdateUser(ContextUtil.getLoginUserCName()); |
| | | try { |
| | | if (null == data.getCzbz()) { |
| | | if (null == data.getId()) { |
| | | String id = createId(data.getChangeDate(), ContextUtil.getCompanyId()); |
| | | data.setId(id); |
| | | data.setCzbz("i"); |
| | | session.save(data); |
| | | } else { |
| | | data.setCzbz("u"); |
| | | session.update(data); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | |
| | | try { |
| | | if (null == data.getId()) { |
| | | String id = createId(data.getChangeTime(), ContextUtil.getCompanyId(), data.getHwdm()); |
| | | String id = createId(data.getChangeTime(), ContextUtil.getCompanyId()); |
| | | data.setId(id); |
| | | data.setCzbz("i"); |
| | | session.save(data); |
| | | } else { |
| | | data.setCzbz("u"); |
| | | session.update(data); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | return this.query(hql, args); |
| | | } |
| | | |
| | | public String createId(Date date, String companyId, String freightId) { |
| | | public String createId(Date date, String companyId) { |
| | | // 时间戳标签 |
| | | String timeKey = DateFormatUtils.format(date, "yyyyMMdd"); |
| | | |
| | |
| | | |
| | | String cacheId = (String) redisUtil.get(cacheKey); |
| | | |
| | | if (null != cacheId && cacheId.indexOf(freightId + timeKey) >= 0) { |
| | | if (null != cacheId && cacheId.indexOf(timeKey) >= 0) { |
| | | String temp = cacheId.substring(cacheId.length() - 3); |
| | | Integer i = Integer.valueOf(temp); |
| | | i++; |
| | | cacheId = freightId + timeKey + String.format("%03d", i); |
| | | cacheId = timeKey + String.format("%03d", i); |
| | | } else { |
| | | Map<String, Object> args = new HashMap<>(); |
| | | args.put("timeKey", freightId + timeKey + "%"); |
| | | args.put("timeKey", timeKey + "%"); |
| | | List<InoutVarietyChange> result = getMaxId(args); |
| | | |
| | | if (null == result || result.size() == 0) { |
| | | cacheId = freightId + timeKey + "001"; |
| | | cacheId = timeKey + "001"; |
| | | } else { |
| | | int max = 0; |
| | | int num; |
| | |
| | | num = Integer.parseInt(varietyChange.getId().substring(varietyChange.getId().length() - 3)); |
| | | max = Math.max(max, num); |
| | | } |
| | | cacheId = freightId + timeKey + String.format("%03d", ++max); |
| | | cacheId = timeKey + String.format("%03d", ++max); |
| | | } |
| | | } |
| | | // 更新缓存 |
| | |
| | | <Property name="label">类型</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="submitTime"> |
| | | <Property name="dataType">DateTime</Property> |
| | | <Property name="label">登记时间</Property> |
| | | <Property name="displayFormat">Y-m-d H:i</Property> |
| | | <Property name="dataType">Date</Property> |
| | | <Property name="label">业务日期</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="depotId"> |
| | | <Property></Property> |
| | |
| | | <PropertyDef name="remark"> |
| | | <Property></Property> |
| | | <Property name="label">备注</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="hwdm"> |
| | | <Property></Property> |
| | | <Property name="label">货位代码</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="rkjz"> |
| | | <Property name="dataType">double</Property> |
| | |
| | | <PropertyDef name="infoLdsh"> |
| | | <Property></Property> |
| | | <Property name="label">审核说明</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="czbz"> |
| | | <Property></Property> |
| | | <Property name="label">操作标志</Property> |
| | | <Property name="readOnly">true</Property> |
| | | </PropertyDef> |
| | | </DataType> |
| | | <DataType name="dtParam"> |
| | |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">companyId</Property> |
| | | <Property name="property">companyId</Property> |
| | | <Property name="name">submitTime</Property> |
| | | <Property name="property">submitTime</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">submitTime</Property> |
| | | <Property name="property">submitTime</Property> |
| | | <Property name="name">deptId</Property> |
| | | <Property name="property">deptId</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | |
| | | <Property name="property">amount</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">deptId</Property> |
| | | <Property name="property">deptId</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">hwdm</Property> |
| | | <Property name="property">hwdm</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <Label> |
| | | <Property name="text">说明:损溢重量在损耗页面和溢出页面均填正数</Property> |
| | | <Property name="style"> |
| | | <Property name="color">blue</Property> |
| | | <Property name="padding-left">80px</Property> |
| | | </Property> |
| | | </Label> |
| | | <AutoFormElement> |
| | | <Property name="name">rkjz</Property> |
| | | <Property name="property">rkjz</Property> |
| | |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">syyy</Property> |
| | | <Property name="property">syyy</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">updateUser</Property> |
| | | <Property name="property">updateUser</Property> |
| | | <Editor/> |
| | |
| | | <Property name="property">updateTime</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">czbz</Property> |
| | | <Property name="property">czbz</Property> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">syyy</Property> |
| | | <Property name="property">syyy</Property> |
| | | <Property name="editorType">TextArea</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | </AutoForm> |
| | |
| | | <Property></Property> |
| | | <Property name="label">更新人</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="dchwdm"> |
| | | <Property></Property> |
| | | <Property name="label">倒出货位代码</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="drhwdm"> |
| | | <Property></Property> |
| | | <Property name="label">倒入货位代码</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="bzw"> |
| | | <Property></Property> |
| | | <Property name="label">包装物</Property> |
| | |
| | | <Property name="keyProperty">code</Property> |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="czbz"> |
| | | <Property></Property> |
| | | <Property name="label">操作标志</Property> |
| | | <Property name="readOnly">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="bzbjs"> |
| | | <Property name="dataType">Integer</Property> |
| | |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">companyId</Property> |
| | | <Property name="property">companyId</Property> |
| | | <Property name="name">deptId</Property> |
| | | <Property name="property">deptId</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">deptId</Property> |
| | | <Property name="property">deptId</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">type</Property> |
| | | <Property name="property">type</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">dchwdm</Property> |
| | | <Property name="property">dchwdm</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">drhwdm</Property> |
| | | <Property name="property">drhwdm</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | |
| | | <Property></Property> |
| | | <Property name="label">备注</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="hwdm"> |
| | | <Property></Property> |
| | | <Property name="label">货位代码</Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="ccshr"> |
| | | <Property></Property> |
| | | <Property name="label">仓储审核人</Property> |
| | |
| | | <PropertyDef name="infoLdsh"> |
| | | <Property></Property> |
| | | <Property name="label">审核说明</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="czbz"> |
| | | <Property></Property> |
| | | <Property name="label">操作标志</Property> |
| | | <Property name="readOnly">true</Property> |
| | | </PropertyDef> |
| | | </DataType> |
| | | <DataType name="dtParam"> |
| | |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">companyId</Property> |
| | | <Property name="property">companyId</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">approvalId</Property> |
| | | <Property name="property">approvalId</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">hwdm</Property> |
| | | <Property name="property">hwdm</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | |
| | | @PropertyDef(label = "所属仓库") |
| | | private String depotId; |
| | | |
| | | @Column(name = "hwdm", length = 50) |
| | | @PropertyDef(label = "货位代码") |
| | | private String hwdm; |
| | | |
| | | @Column(name = "TYPE_", length = 10) |
| | | @PropertyDef(label = "类型", description = "损耗/溢出") |
| | |
| | | @PropertyDef(label = "重量", description = "损溢数量KG;损耗为正数,溢余为负数") |
| | | private Double amount; |
| | | |
| | | // @PropertyDef(label = "其中:成货位前损耗(公斤)" ) |
| | | // @Column(name = "qzchwqsh", precision = 20, scale = 6) |
| | | // private double qzchwqsh; |
| | | // |
| | | // @PropertyDef(label = "其中水杂减量(公斤)" ) |
| | | // @Column(name = "qzszkl", precision = 20, scale = 6) |
| | | // private double qzszkl; |
| | | // |
| | | // @PropertyDef(label = "其中:自然损耗定额(公斤)" ) |
| | | // @Column(name = "qzzrshde", precision = 20, scale = 6) |
| | | // private double qzzrshde; |
| | | // |
| | | // @PropertyDef(label = "超耗数量(公斤)" ) |
| | | // @Column(name = "chsl", precision = 20, scale = 6) |
| | | // private double chsl; |
| | | |
| | | @PropertyDef(label = "损益是否正常", description = "0:正常 1:不正常") |
| | | @Column(name = "sysfzc", length = 1) |
| | |
| | | @Column(name = "UPDATE_USER_", length = 50) |
| | | @PropertyDef(label = "更新人") |
| | | private String updateUser; |
| | | |
| | | @PropertyDef(label = "操作标志", description = "i:新增数据(默认)u:更新数据d:删除数据") |
| | | @Column(name = "czbz", length = 1) |
| | | private String czbz; |
| | | |
| | | } |
| | |
| | | @PropertyDef(label = "倒仓数量", description = "单位:公斤") |
| | | private Double number = 0.0; |
| | | |
| | | @Column(name = "czbz", length = 1) |
| | | @PropertyDef(label = "操作标志", description = "i:新增数据(默认)u:更新数据 d:删除数据") |
| | | private String czbz; |
| | | |
| | | @Column(name = "UPDATE_TIME_") |
| | | @PropertyDef(label = "最后更新时间") |
| | | private Date updateTime; |
| | |
| | | @Column(name = "UPDATE_USER_", length = 50) |
| | | @PropertyDef(label = "更新人") |
| | | private String updateUser; |
| | | |
| | | @Column(name = "dchwdm", length = 30) |
| | | @PropertyDef(label = "倒出货位代码", description = "关联货位信息接口货位代码") |
| | | private String dchwdm; |
| | | |
| | | @Column(name = "drhwdm", length = 30) |
| | | @PropertyDef(label = "倒入货位代码", description = "关联货位信息接口货位代码") |
| | | private String drhwdm; |
| | | |
| | | |
| | | @Column(name = "bzw", length = 1) |
| | | @PropertyDef(label = "包装物", description = "1:麻袋 2:编织袋 3:散装 9:其他") |
| | | private String bzw; |
| | |
| | | @PropertyDef(label = "组织编码") |
| | | private String companyId; |
| | | |
| | | @Column(name = "hwdm", length = 30) |
| | | @PropertyDef(label = "货位代码", description = "关联货位信息接口货位代码") |
| | | private String hwdm; |
| | | |
| | | @Column(name = "DEPT_ID_", length = 40) |
| | | @PropertyDef(label = "分库编码") |
| | | private String deptId; |
| | |
| | | @Column(name = "INFO_LDSH_", length = 200) |
| | | @PropertyDef(label = "审核说明") |
| | | private String infoLdsh; |
| | | |
| | | @Column(name = "czbz", length = 1) |
| | | @PropertyDef(label = "操作标志", description = "i:新增数据(默认)u:更新数据 d:删除数据") |
| | | private String czbz; |
| | | |
| | | |
| | | @Column(name = "UPDATE_TIME_") |
| | | @PropertyDef(label = "最后更新时间") |