包装方式
This commit is contained in:
@@ -39,8 +39,10 @@ class ProductOrderSyncJob extends BaseJob implements JobInterface
|
||||
$recipe = $prescriptionContent['repice'][0];
|
||||
$recipeContent = Json::decode($recipe['content']);
|
||||
$processContent = '';
|
||||
if($recipe['process_rule_id']){
|
||||
$processContent = $recipe['process_rule'];
|
||||
if($recipe['process_rule_id'] != 0){
|
||||
$processContent = '煎服,每天'.$recipe['deployment'].'次。'.$recipe['process_rule'];
|
||||
} elseif ($recipe['package_method_id'] != 0) {
|
||||
$processContent = '外配,每天'.$recipe['deployment'].'次。'. $recipe['process_rule'];
|
||||
}
|
||||
$params = [
|
||||
'cht_id' => 'XK_'.$ProductOrder->user_id.'_'.$ProductOrder->up_id.'_'.$ProductOrder->prescription->register_id,
|
||||
@@ -50,7 +52,7 @@ class ProductOrderSyncJob extends BaseJob implements JobInterface
|
||||
'age' => FuncHelper::getAgeFromIdNo($prescriptionContent['patient']['id_card']),
|
||||
'tot_posts' => $recipe['dosage'],
|
||||
'tisane_posts' => $recipe['dosage'],
|
||||
'usage' => '煎服,每天'.$recipe['deployment'].'次。'.$processContent,//`, 每次'.$recipe['volume'].'ml
|
||||
'usage' => $processContent,//`, 每次'.$recipe['volume'].'ml
|
||||
'doctor' => $prescriptionContent['doctor']['name'],
|
||||
'department' => $prescriptionContent['doctor']['depart']['name'],//科室
|
||||
'post_weight' => count($recipeContent),
|
||||
|
||||
27
common/models/oldDb/PackageMethod.php
Normal file
27
common/models/oldDb/PackageMethod.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/*
|
||||
* @author: liudiao1992
|
||||
* @Date: 2023-09-18 15:29:29
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
namespace common\models\oldDb;
|
||||
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
class PackageMethod extends \common\modelsgii\oldDb\PackageMethod
|
||||
{
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'class' => TimestampBehavior::class,
|
||||
'attributes' => [
|
||||
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
|
||||
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
60
common/modelsgii/oldDb/PackageMethod.php
Normal file
60
common/modelsgii/oldDb/PackageMethod.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/*
|
||||
* @author: liudiao1992
|
||||
* @Date: 2023-09-18 15:23:55
|
||||
* @Description: 重要加工规则表
|
||||
*/
|
||||
|
||||
namespace common\modelsgii\oldDb;
|
||||
|
||||
/**
|
||||
* This is the model class for table "yii2_process_rule".
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $pid
|
||||
* @property string|null $name
|
||||
* @property int $calc_method
|
||||
* @property float $price
|
||||
* @property float $unit
|
||||
* @property int|null $created_at 创建时间
|
||||
*/
|
||||
class PackageMethod extends \common\core\BaseActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return '{{package_method}}';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['created_at','pid'], 'integer'],
|
||||
[['name','unit'], 'string', 'max' => 50],
|
||||
[['name'], 'unique'],
|
||||
[['calc_method'],'in','range' => [1,2,3]],
|
||||
['price','double'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'pid' => 'Pid',
|
||||
'name' => 'Name',
|
||||
'calc_method' => 'calc_method',
|
||||
'price' => 'price',
|
||||
'unit' => 'unit',
|
||||
'created_at' => '创建时间',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ use common\models\oldDb\DrugUseTime;
|
||||
use common\models\oldDb\DrugUseType;
|
||||
use common\models\oldDb\DrugUseWay;
|
||||
use common\models\oldDb\GranularRepice;
|
||||
use common\models\oldDb\PackageMethod;
|
||||
use common\models\oldDb\Prescription;
|
||||
use common\models\oldDb\PrescriptionChinese;
|
||||
use common\models\oldDb\PrescriptionGranular;
|
||||
@@ -913,7 +914,16 @@ class PrescriptionController extends BaseAppController
|
||||
$processRuleContent = '加工方式:'.$parentProcessRule->name.'-'.$processRule->name.'-'.$param['process_rule_note'].",".$processRule->price."元/".$processRule->unit.',共'.$totalNum.'g';
|
||||
}
|
||||
}
|
||||
|
||||
if($param['process_rule_id1']){
|
||||
if ($param['process_rule_type'] == 0) {
|
||||
$processRule = PackageMethod::find()->where(['id' => $param['process_rule_id1']])->one();
|
||||
if(empty($processRule)){
|
||||
throw new Exception("包装方式错误");
|
||||
}
|
||||
$processRuleContent = '包装方式:'.$processRule->name;
|
||||
$param['package_method_id'] = $param['process_rule_id1'];
|
||||
}
|
||||
}
|
||||
|
||||
$encode = Json::encode($medicine);
|
||||
|
||||
@@ -927,6 +937,7 @@ class PrescriptionController extends BaseAppController
|
||||
$chineseRecipe->volume = $param['volume']??0;
|
||||
$chineseRecipe->cm_id = $param['cm_id'];
|
||||
$chineseRecipe->process_rule_id = $param['process_rule_id'] ?? 0;
|
||||
$chineseRecipe->package_method_id = $param['package_method_id'] ?? 0;
|
||||
$chineseRecipe->process_rule = $processRuleContent;
|
||||
$chineseRecipe->process_rule_note = $param['process_rule_note'];
|
||||
$chineseRecipe->process_price = $process_price;
|
||||
|
||||
Reference in New Issue
Block a user