Commit 30c5df55 zshaohui

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

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