Commit 30c5df55 zshaohui

1.工单缺料时是否可以关闭增加配置

1 个父辈 72ffa6a3
......@@ -168,4 +168,9 @@ public class Constants {
*/
public static final String CACHE_spSettings="spSettings";
/**
* 缺料不自动关闭工单
*/
public static final String CACHE_closeWorkOrder = "CACHE_closeWorkOrder";
}
......@@ -129,7 +129,10 @@ public class DataCache {
cacheMap = Maps.newConcurrentMap();
List<CacheItem> all = cacheItemDao.findAll();
for (CacheItem cacheItem : all) {
cacheMap.put(cacheItem.getCacheKey(), cacheItem.getCacheValue());
Object cacheValue = cacheItem.getCacheValue();
if(cacheValue != null) {
cacheMap.put(cacheItem.getCacheKey(), cacheItem.getCacheValue());
}
}
if (cacheMap.get(Constants.CACHE_StopOut) == null) {
updateCache(Constants.CACHE_StopOut, false);
......@@ -176,7 +179,9 @@ public class DataCache {
*/
public void updateCache(String cacheKey, Object value) {
cacheItemDao.updateCacheItem(cacheKey, value);
cacheMap.put(cacheKey, value);
if (value != null){
cacheMap.put(cacheKey, value);
}
if (cacheKey.equals(Constants.CACHE_CodeRule)) {
List<String> ruleList = (List<String>) value;
codeResolve.updateBarcodeRuleList(ruleList);
......
......@@ -215,16 +215,26 @@ public class LiteOrderCache {
* 结束当前的任务
*/
public void finishedOrderTasks(LiteOrder liteOrder){
boolean noCloseWorkOrder = false;
Object cache = dataCache.getCache(Constants.CACHE_closeWorkOrder);
if (cache != null){
noCloseWorkOrder = Boolean.valueOf(cache.toString());
}
if(liteOrder.isOutOne()){
// setStatus(LITEORDER_STATUS.ONE_FINISHED);
liteOrder.setClosed(true);
if (noCloseWorkOrder){
liteOrder.setStatus(LITEORDER_STATUS.ONE_FINISHED);
} else {
liteOrder.setClosed(true);
}
}else if(liteOrder.isOutBom()){
liteOrder.setStatus(LITEORDER_STATUS.BOM_FINISHED);
}else if(liteOrder.isOutTails()){
// setStatus(LITEORDER_STATUS.TAILS_FINISHED);
liteOrder.setClosed(true);
if (noCloseWorkOrder){
liteOrder.setStatus(LITEORDER_STATUS.TAILS_FINISHED);
} else {
liteOrder.setClosed(true);
}
}
liteOrder.setTaskFinishedTime(System.currentTimeMillis());
smfApi.onOrderStatusChange(liteOrder);
}
......
......@@ -81,6 +81,7 @@ public class SettingsController {
Integer expiresDay=dataCache.getCache(Constants.CACHE_ExpiresDay);
Integer caWarn=dataCache.getCache(Constants.CACHE_CapacityWarn);
Integer backUpMonth = dataCache.getCache(Constants.BACKUP_MONTH_KEY);
boolean closeWorkOrder = dataCache.getCache(Constants.CACHE_closeWorkOrder);
SysSettingsDto dto = new SysSettingsDto();
dto.setStartJob(startJob);
dto.setStopOut(stopOut);
......@@ -88,6 +89,7 @@ public class SettingsController {
dto.setExpiresDay(expiresDay);
dto.setCapacityWarn(caWarn);
dto.setBackUpMonth(backUpMonth);
dto.setCloseWorkOrder(closeWorkOrder);
return dto;
}
......@@ -101,8 +103,10 @@ public class SettingsController {
dataCache.updateCache(Constants.CACHE_ExpiresDay,sysSettingsDto.getExpiresDay());
dataCache.updateCache(Constants.CACHE_CapacityWarn,sysSettingsDto.getCapacityWarn());
dataCache.updateCache(Constants.BACKUP_MONTH_KEY,sysSettingsDto.getBackUpMonth());
dataCache.updateCache(Constants.CACHE_closeWorkOrder,sysSettingsDto.isCloseWorkOrder());
log.info("更改系统设置:stopout=" + sysSettingsDto.isStopOut() + ",stopjob=" + sysSettingsDto.isStartJob()+",sluggishDay="+sysSettingsDto.getSluggishDay()
+",expiresDay="+sysSettingsDto.getExpiresDay()+",capacityWarn="+sysSettingsDto.getCapacityWarn()+",backUpMonth="+sysSettingsDto.getBackUpMonth());
+",expiresDay="+sysSettingsDto.getExpiresDay()+",capacityWarn="+sysSettingsDto.getCapacityWarn()+",backUpMonth="+sysSettingsDto.getBackUpMonth()
+",缺料不自动关闭工单="+sysSettingsDto.isCloseWorkOrder());
return ResultBean.newOkResult("保存成功");
}
......
......@@ -27,4 +27,7 @@ public class SysSettingsDto implements Serializable {
@ApiModelProperty("备份时间")
private Integer backUpMonth=0;
@ApiModelProperty("缺料不自动关闭工单")
private boolean closeWorkOrder = false;
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!