Browse Source

修改物料编码生产规则

lwx_dev
erdanergou 3 years ago
parent
commit
efca64ae3a
  1. 9
      src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java
  2. 2
      target/classes/templates/pages/depository/table-stock.html
  3. 2
      target/classes/templates/pages/user/login.html

9
src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java

@ -112,12 +112,15 @@ public class MaterialServiceImpl implements MaterialService {
Integer typeId = ObjectFormatUtil.toInteger(map.get("typeId").toString());
MaterialType materialTypeById = materialTypeMapper.findMaterialTypeById(typeId);
map.put("materialTypeId", materialTypeById.getOldId());
String code = materialTypeById.getOldId().toString();
List<Material> materialByType = materialMapper.findMaterialByType(materialTypeById.getOldId());
String newCode = "";
if (materialByType == null) {
materialByType = new ArrayList<>();
newCode = String.format("%04d", 1);
} else {
newCode = String.format("%04d",Integer.parseInt(materialByType.get(materialByType.size() - 1).getCode()) + 1);
}
map.put("code", code + String.format("%04d", materialByType.size() + 1));
map.put("code",newCode);
}
if (map.containsKey("barCode")) {
materialMapper.addBarCodeAndMcode(map);

2
target/classes/templates/pages/depository/table-stock.html

@ -193,7 +193,7 @@
}
// 所处库位
var placeCodeItem = $("[lay-id='currentTableId'] tr:eq(" + (i + 1) + ")").children()[9];
var placeCodeItem = $("[lay-id='currentTableId'] tr:eq(" + (i + 1) + ")").children()[10];
//计量单位
// 用于库位的添加
var aItem = placeCodeItem.childNodes[0];

2
target/classes/templates/pages/user/login.html

@ -200,7 +200,7 @@
<script src="static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="static/lib/jq-module/jquery.particleground.min.js" charset="utf-8"></script>
<script src="https://wwcdn.weixin.qq.com/node/open/js/wecom-jssdk-1.3.1.js"></script>
<script src="http://wwcdn.weixin.qq.com/node/wework/wwopen/js/wwLogin-1.2.4.js"></script>
<script src="https://wwcdn.weixin.qq.com/node/wework/wwopen/js/wwLogin-1.2.4.js"></script>
<script>
layui.use(['layer', 'form'], function () {
var form = layui.form,

Loading…
Cancel
Save