Quellcode durchsuchen

合伙人收益管理迁移

liaoyongfei vor 4 Jahren
Ursprung
Commit
0c8a728925

+ 16 - 15
UI/src/pages/ymall/accountDetails.js

@@ -163,8 +163,9 @@ class AccountDetails extends React.Component {
     }
 
     componentWillMount() {
-        let str = formatDate(new Date())
-        console.log(str)
+        let now =new Date();
+        // let str = formatDate(new Date())
+        // console.log(str)
         this.props.history.listen(router => {
             console.log('router:', router)
             if(router.pathname == '/ymall/accountDetails' && !!router.query.id) {
@@ -172,14 +173,14 @@ class AccountDetails extends React.Component {
                     id: router.query.id,
                     userRoleName: router.query.userRoleName,
                     idPhone: router.query.idPhone,
-                    startTime: str + ' 00:00',
-                    endTime: str + ' 00:00',
-                    startTimeStamp: moment(str).valueOf(),
-                    endtTimeStamp: moment(str).valueOf(),
-                    orderStartTime: str + ' 00:00',
-                    orderEndTime: str + ' 00:00',
-                    orderStartTimeStamp: moment(str).valueOf(),
-                    orderEndtTimeStamp: moment(str).valueOf()
+                    startTime: now.getFullYear() + '-' + (now.getMonth() + 1) + '-1'  + ' 00:00',
+                    endTime: now.getFullYear() + '-' + (now.getMonth() + 1) + '-'+ now.getDate() + ' 23:59',
+                    // startTimeStamp: moment(str).valueOf(),
+                    // endtTimeStamp: moment(str).valueOf(),
+                    // orderStartTime: str + ' 00:00',
+                    // orderEndTime: str + ' 23:59',
+                    // orderStartTimeStamp: moment(str).valueOf(),
+                    // orderEndtTimeStamp: moment(str).valueOf()
                 },() => { this.loadDataList() })
             }
         })
@@ -512,7 +513,7 @@ class AccountDetails extends React.Component {
                             // allowClear={false}
                             showNow={true}
                             value={!this.state.endTime ? null : moment(this.state.endTime)}
-                            defaultValue={moment(this.state.endTime, 'YYYY-MM-DD')}
+                             defaultValue={moment(this.state.endTime, 'YYYY-MM-DD')}
                             // format={['YYYY-MM-DD hh:mm']}
                             onChange={(date, dateStr) => {
                                 if(moment(dateStr).valueOf() < this.state.startTimeStamp) {
@@ -521,7 +522,7 @@ class AccountDetails extends React.Component {
                                 }
                                 this.setState({
                                     endtTimeStamp: moment(dateStr).valueOf(),
-                                    endTime: !date ? null : dateStr + ' 00:00'
+                                    endTime: !date ? null : dateStr + ' 23:59'
                                 })
                             }}
                         >
@@ -535,7 +536,7 @@ class AccountDetails extends React.Component {
                         <DatePicker
                             showNow={true}
                             value={!this.state.orderStartTime ? null : moment(this.state.orderStartTime)}
-                            defaultValue={ moment(this.state.orderStartTime, 'YYYY-MM-DD')}
+                            // defaultValue={ moment(this.state.orderStartTime, 'YYYY-MM-DD')}
                             onChange={(date, dateStr) => {
                                 if(moment(dateStr).valueOf() > this.state.orderEndtTimeStamp) {
                                     message.error('开始时间不能大于结束时间')
@@ -554,7 +555,7 @@ class AccountDetails extends React.Component {
                         <DatePicker
                             showNow={true}
                             value={!this.state.orderEndTime ? null : moment(this.state.orderEndTime)}
-                            defaultValue={moment(this.state.orderEndTime, 'YYYY-MM-DD')}
+                            // defaultValue={moment(this.state.orderEndTime, 'YYYY-MM-DD')}
                             onChange={(date, dateStr) => {
                                 if(moment(dateStr).valueOf() < this.state.orderStartTimeStamp) {
                                     message.error('结束时间不能小于开始时间')
@@ -562,7 +563,7 @@ class AccountDetails extends React.Component {
                                 }
                                 this.setState({
                                     orderEndtTimeStamp: moment(dateStr).valueOf(),
-                                    orderEndTime: !date ? null : dateStr + ' 00:00'
+                                    orderEndTime: !date ? null : dateStr + ' 23:59'
                                 })
                             }}
                         >

+ 7 - 1
ymall/src/main/resources/mapper/CalculationProfitMapper.xml

@@ -77,7 +77,13 @@
     select <include refid="baseSQL"></include> ,(select max(calculation_explain) from profit_rule_detail where id = a.profit_rule_detail_id)as "calculationExplain"
     from calculation_profit a
     where
-      a.account_id=#{id} and a.create_time &gt;= #{beginDate} and a.create_time &lt;= #{endDate}
+      a.account_id=#{id}
+      <if test="beginDate !=null">
+        and a.create_time &gt;= #{beginDate}
+      </if>
+      <if test="endDate !=null">
+        and a.create_time &lt;= #{endDate}
+      </if>
       <if test="type!=null">
         and a.type=#{type}
       </if>