1,根据效期批量转移任务生成

master
e 2018-09-23 22:53:54 +08:00
parent 422d227894
commit d2b5f03639
4 changed files with 126 additions and 6 deletions

View File

@ -0,0 +1,100 @@
package org.jeecgframework.web.system.sms.util.task;
import com.zzjee.md.entity.MdBinEntity;
import com.zzjee.md.entity.MdCusEntity;
import com.zzjee.md.entity.MdGoodsEntity;
import com.zzjee.wm.entity.WmDayCostConfEntity;
import com.zzjee.wm.entity.WmDayCostEntity;
import com.zzjee.wm.entity.WmToMoveGoodsEntity;
import com.zzjee.wm.entity.WvStockEntity;
import org.jeecgframework.core.constant.Globals;
import org.jeecgframework.core.util.DateUtils;
import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.core.util.StringUtil;
import org.jeecgframework.web.system.service.SystemService;
import org.jeecgframework.web.system.sms.service.TSSmsServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.DecimalFormat;
import java.util.*;
/**
*
* @ClassName:SmsSendTask
* @Description: TODO
* @date 2014-11-13 5:06:34
*
*/
@Service("goodsMoveTask")
public class GoodsMoveTask {
@Autowired
private SystemService systemService;
/* @Scheduled(cron="0 0 01 * * ?") */
public void run() {
long start = System.currentTimeMillis();
String datestr = DateUtils.date2Str(DateUtils.date_sdf);
org.jeecgframework.core.util.LogUtil
.info("===================转移定时任务开始===================");
String moveStats = ResourceUtil.getConfigByName("moveStats");
String binStoress = ResourceUtil.getConfigByName("binStoress");
if(StringUtil.isEmpty(moveStats)){
moveStats = "计划中";
}
if(StringUtil.isNotEmpty(binStoress)){
String binStoressa[] = binStoress.split(",");
for(String binstore:binStoressa){
this.goodsMove(binstore,moveStats);
}
}
org.jeecgframework.core.util.LogUtil
.info("===================转移定时任务结束===================");
long end = System.currentTimeMillis();
long times = end - start;
org.jeecgframework.core.util.LogUtil.info("转移定时任务总耗时" + times + "毫秒");
}
public void goodsMove(String binstrore,String moveStatus ){
String tsql = "";
List<Map<String, Object>> resulmove = systemService
.findForJdbc(tsql, binstrore);
//生成任务
for (int i = 0; i < resulmove.size(); i++) {
WvStockEntity t = systemService.get(WvStockEntity.class,resulmove.get(i).get("id").toString());
try {
WmToMoveGoodsEntity wmtomove = new WmToMoveGoodsEntity();
wmtomove.setOrderTypeCode("TPZY");
wmtomove.setBinFrom(t.getKuWeiBianMa());
wmtomove.setBinTo(t.getKuWeiBianMa());
wmtomove.setCusCode(t.getCusCode());
wmtomove.setCusName(t.getZhongWenQch());
wmtomove.setToCusCode(t.getCusCode());
wmtomove.setToCusName(t.getZhongWenQch());
wmtomove.setGoodsId(t.getGoodsId());
wmtomove.setGoodsName(t.getShpMingCheng());
wmtomove.setGoodsProData(t.getGoodsProData());
wmtomove.setGoodsQua(t.getGoodsQua().toString());
wmtomove.setGoodsUnit(t.getGoodsUnit());
wmtomove.setBaseGoodscount(t.getGoodsQua().toString());
wmtomove.setBaseUnit(t.getGoodsUnit());
wmtomove.setMoveSta(moveStatus);
wmtomove.setTinFrom(t.getBinId());
wmtomove.setTinId("B");
systemService.save(wmtomove);
}catch (Exception e){
}
}
}
}

View File

@ -0,0 +1,5 @@
package org.jeecgframework.web.system.sms.util.task;
public class GoodsMoveTaskJob {
}

View File

@ -46,6 +46,21 @@
<property name="cronExpression" value="0 0/1 * * * ?" />
</bean>
<!-- 定时任务配置 costTask 可配置到管理界面 -->
<bean id="goodsMoveTaskJob"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="goodsMoveTask" />
<property name="targetMethod" value="run" />
<property name="concurrent" value="false"/>
</bean>
<bean id="goodsMoveTaskCronTrigger" class="org.jeecgframework.core.timer.DataBaseCronTriggerBean">
<property name="jobDetail" ref="goodsMoveTaskJob" />
<property name="cronExpression" value="0 0/1 * * * ?" />
</bean>
<!-- 定时任务调度器 -->
<bean id="schedulerFactory" lazy-init="false" autowire="no"
class="org.jeecgframework.core.timer.DataBaseSchedulerFactoryBean">
@ -53,14 +68,9 @@
<list>
<ref bean="costTaskCronTrigger" />
<ref bean="smsSendTaskCronTrigger" />
<ref bean="goodsMoveTaskCronTrigger" />
</list>
</property>
</bean>
</beans>

View File

@ -121,6 +121,11 @@ chaoshou=y
#\u6253\u5370\u65B9\u5F0F excel page
printtype=page
binStoress=01A
moveStats=\u8BA1\u5212\u4E2D
##isSend =0:\u4E0D\u53D1\u9001\uFF0CisSend=1:\u53D1\u9001(\u9ED8\u8BA4)
#sms.tip.control=1