1.新增定时下载第三方系统基础信息

2.新增定时提交已核对单据
master
x_z 3 years ago
parent ebc6c8d8d2
commit d9bcca035d

@ -10,7 +10,6 @@ import com.glxp.api.admin.req.info.SystemParamConfigSaveRequest;
import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.info.SystemParamConfigResponse; import com.glxp.api.admin.res.info.SystemParamConfigResponse;
import com.glxp.api.admin.service.info.SystemParamConfigService; import com.glxp.api.admin.service.info.SystemParamConfigService;
import com.glxp.api.admin.thread.IoModifyErpTask;
import com.glxp.api.admin.util.CronUtils; import com.glxp.api.admin.util.CronUtils;
import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
@ -140,6 +139,34 @@ public class SystemParamConfigController {
} catch (Exception e) { } catch (Exception e) {
return ResultVOUtils.error(500, "格式错误!"); return ResultVOUtils.error(500, "格式错误!");
} }
} else if (systemParamConfigSaveRequest.getParamKey().equals("auto_download_thirdSys_data")) {
try {
int time = 1;
if (!"0".equals(systemParamConfigSaveRequest.getParamValue())) {
time = Integer.parseInt(systemParamConfigSaveRequest.getParamValue());
}
String cornStr = CronUtils.parseHourIntervel(time);
ScheduledEntity scheduledEntity = new ScheduledEntity();
scheduledEntity.setCron(cornStr);
scheduledEntity.setCronName("downThirdSysDataTask");
scheduledDao.modifyScheduled(scheduledEntity);
} catch (Exception e) {
return ResultVOUtils.error(500, "格式错误!");
}
} else if (systemParamConfigSaveRequest.getParamKey().equals("auto_submit_order")) {
try {
int time = 1;
if (!"0".equals(systemParamConfigSaveRequest.getParamValue())) {
time = Integer.parseInt(systemParamConfigSaveRequest.getParamValue());
}
String cornStr = CronUtils.parseHourIntervel(time);
ScheduledEntity scheduledEntity = new ScheduledEntity();
scheduledEntity.setCron(cornStr);
scheduledEntity.setCronName("submitOrderTask");
scheduledDao.modifyScheduled(scheduledEntity);
} catch (Exception e) {
return ResultVOUtils.error(500, "格式错误!");
}
} }
return ResultVOUtils.success("修改成功"); return ResultVOUtils.success("修改成功");
} }

@ -27,4 +27,11 @@ public interface BasicThirdSysBusApiDao {
boolean deleteById(@Param("id") Integer id); boolean deleteById(@Param("id") Integer id);
BasicThirdSysBusApiEntity selectByCode(@Param("code") String code); BasicThirdSysBusApiEntity selectByCode(@Param("code") String code);
/**
*
*
* @return
*/
List<String> selectAllCode();
} }

@ -16,5 +16,11 @@ public interface BasicThirdSysDao {
List<BasicThirdSysEntity> filterBasicThiSys(FilterBasicThirdSysRequest filterBasicThirdSysRequest); List<BasicThirdSysEntity> filterBasicThiSys(FilterBasicThirdSysRequest filterBasicThirdSysRequest);
/**
* ID
*
* @return
*/
List<String> selectEnabledThirdId();
} }

@ -58,4 +58,10 @@ public interface StockOrderDao {
boolean deleteByOrderIdFk(String orderIdFk); boolean deleteByOrderIdFk(String orderIdFk);
StockOrderEntity findById(@Param("id") String id); StockOrderEntity findById(@Param("id") String id);
/**
*
* @return
*/
List<String> selectWaitSubmitOrders();
} }

@ -80,6 +80,7 @@ public interface OrderService {
* @return * @return
*/ */
List<StockOrderResponse> checkSubmitOrder(List<StockOrderResponse> orderResponseList); List<StockOrderResponse> checkSubmitOrder(List<StockOrderResponse> orderResponseList);
/** /**
* *
* *
@ -112,4 +113,12 @@ public interface OrderService {
* @param orders * @param orders
*/ */
public void getAllOrder(OrderEntity orderEntity, List<OrderEntity> orders); public void getAllOrder(OrderEntity orderEntity, List<OrderEntity> orders);
/**
*
*
* @return
*/
List<String> getWaitSubmitOrder();
} }

@ -351,6 +351,11 @@ public class OrderServiceImpl implements OrderService {
return orderResponseList; return orderResponseList;
} }
@Override
public List<String> getWaitSubmitOrder() {
return stockOrderDao.selectWaitSubmitOrders();
}
@Override @Override
public List<OrderEntity> filterOrderForDelete(String billNo) { public List<OrderEntity> filterOrderForDelete(String billNo) {

@ -29,4 +29,13 @@ public class CronUtils {
return cron; return cron;
} }
public static String parseHourIntervel(int time) {
int hour = time;
String cron = "0 0 0/" + hour + " * * ?";
if (time >= 24) {
hour = 24;
cron = "0 0 0/" + hour + " * * ?";
}
return cron;
}
} }

@ -82,4 +82,9 @@
from basic_third_sys_bus_api from basic_third_sys_bus_api
where code = #{code} where code = #{code}
</select> </select>
<select id="selectAllCode" resultType="java.lang.String">
select code from basic_third_sys_bus_api
</select>
</mapper> </mapper>

@ -41,4 +41,10 @@
<select id="selectByThirdId" parameterType="Map" resultType="com.glxp.api.admin.entity.basic.BasicThirdSysEntity"> <select id="selectByThirdId" parameterType="Map" resultType="com.glxp.api.admin.entity.basic.BasicThirdSysEntity">
select * FROM basic_third_sys WHERE thirdId = #{thirdId} select * FROM basic_third_sys WHERE thirdId = #{thirdId}
</select> </select>
<select id="selectEnabledThirdId" resultType="java.lang.String">
select thirdId
from basic_third_sys
where enabled = true
</select>
</mapper> </mapper>

@ -293,4 +293,18 @@
where orderIdFk = #{orderIdFk} where orderIdFk = #{orderIdFk}
</delete> </delete>
<select id="selectWaitSubmitOrders" resultType="java.lang.String">
select id
from stock_order
where billNo in (
select erpFk
from io_order
where erpFk in
(select billNo
from stock_order
where stock_order.billType in (select code from basic_third_sys_bus_api))
and exportStatus = 0
)
</select>
</mapper> </mapper>
Loading…
Cancel
Save