update
This commit is contained in:
parent
f7dc74b3fc
commit
02f1b63096
@ -657,6 +657,7 @@ class TaskLogic extends BaseLogic
|
||||
*/
|
||||
private static function marketingManagerTaskSettlement($taskSchedulePlan)
|
||||
{
|
||||
try {
|
||||
$taskTemplateInfo = $taskSchedulePlan['template_info'];
|
||||
// 任务类型用的数据字典主键id,将id和value作映射,避免测试和正式环境数据字典数据不一致时出问题
|
||||
$townTaskTypeList = DictData::where(['type_value' => 'town_task_type_marketing_director', 'status' => 1])->column('value', 'id');
|
||||
@ -709,6 +710,10 @@ class TaskLogic extends BaseLogic
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Log::error(['镇农科任务结算失败',$e->getFile(), $e->getLine(), $e->getMessage()]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -779,11 +784,11 @@ class TaskLogic extends BaseLogic
|
||||
$param['end_time'] = time();
|
||||
$param['responsible_area'] = $townCompany['responsible_area'];
|
||||
$result = ShopRequestLogic::getSupplyChainMerchantCount($param);
|
||||
if (!$result) {
|
||||
if ($result['status'] != 200) {
|
||||
Log::error('查询供应链商户统计接口失败'.ShopRequestLogic::getError());
|
||||
return false;
|
||||
}
|
||||
$count = $result['count']; // todo 从$result取值
|
||||
$count = $result['data']['count'];
|
||||
|
||||
// 完成数小于3,关闭任务,不做结算
|
||||
if ($count < 3){
|
||||
@ -830,9 +835,13 @@ class TaskLogic extends BaseLogic
|
||||
'mer_intention_id' => $merIntentionId,
|
||||
];
|
||||
$result = ShopRequestLogic::getProductListing($param);
|
||||
if ($result['status'] != 200) {
|
||||
Log::info(['4.市场部长-供应链商户完成商品上架和库存更新任务-查询商城接口结果', json_encode($result)]);
|
||||
// 达到目标数 完成则结算 todo 返回字段要对接
|
||||
if ($result['count'] >= $templateInfo['extend']['target']){
|
||||
return false;
|
||||
}
|
||||
$count = $result['data']['count'];
|
||||
// 达到目标数 完成则结算
|
||||
if ($count >= $templateInfo['extend']['target']){
|
||||
// 结算金额 任务金额/目标数 * 天数
|
||||
$taskInfo['money'] = bcmul($templateInfo['stage_day_one'], bcdiv($templateInfo['money'], $templateInfo['extend']['target']));
|
||||
Log::info(['5.市场部长-供应链商户完成商品上架任务-$taskSchedulePlan', json_encode($taskSchedulePlan)]);
|
||||
@ -852,8 +861,11 @@ class TaskLogic extends BaseLogic
|
||||
'end_time' => $endTime,
|
||||
'mer_intention_id' => $merIntentionId,
|
||||
];
|
||||
$result1 = ShopRequestLogic::getStockUpdate($param); // todo 返回字段要对接
|
||||
$result1 = ShopRequestLogic::getStockUpdate($param);
|
||||
if ($result['status'] != 200) {
|
||||
Log::info(['4.市场部长-供应链商户完成库存更新任务-查询商城接口结果', json_encode($result)]);
|
||||
return false;
|
||||
}
|
||||
if ($result1['is_done'] == 1){
|
||||
// 结算金额 任务金额/目标数 * 天数
|
||||
$taskInfo['money'] = bcmul($templateInfo['stage_day_two'], bcdiv($templateInfo['money_two'], $templateInfo['extend']['target']));
|
||||
|
Loading…
x
Reference in New Issue
Block a user