Browse Source

Merge remote-tracking branch 'origin/master'

pzc 4 years ago
parent
commit
7db56afd10

+ 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'
                                 })
                             }}
                         >

+ 1 - 1
ymall/src/main/java/com/liangjian11/ymall/controller/common/WechatController.java

@@ -91,7 +91,7 @@ public class WechatController {
 						@RequestParam(name = "code", defaultValue = "", required = false) String code,
 						@RequestParam(name = "id", defaultValue = "", required = false) String id,// ID参数占位
 						@RequestParam(name = "redirectCode", defaultValue = "", required = false) String redirectCode,
-						@RequestParam(name = "identity", defaultValue = "0") Integer identity,
+						@RequestParam(name = "identity", defaultValue = "0",required = false) Integer identity,
 						HttpServletRequest request, HttpServletResponse response) throws IOException {
 		String fillInfoPath = redirectPathSource.getFillInfo();
 		if (StringUtils.isBlank(code)) {

+ 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>