| @@ -6,6 +6,7 @@ import java.util.List; | |||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| @@ -36,6 +37,7 @@ public class WxDateAmountRecordController extends BaseController | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="tenantId",value="租户id",dataType="String", paramType = "query",required=true), | @ApiImplicitParam(name="tenantId",value="租户id",dataType="String", paramType = "query",required=true), | ||||
| @ApiImplicitParam(name="merchantId",value="商户id",dataType="long", paramType = "query",required=true)}) | @ApiImplicitParam(name="merchantId",value="商户id",dataType="long", paramType = "query",required=true)}) | ||||
| @GetMapping("list") | |||||
| public ResultData getRecord(String tenantId,Long merchantId) { | public ResultData getRecord(String tenantId,Long merchantId) { | ||||
| Calendar c =Calendar.getInstance(); | Calendar c =Calendar.getInstance(); | ||||
| int weekOfYear =c.get(Calendar.WEEK_OF_YEAR); | int weekOfYear =c.get(Calendar.WEEK_OF_YEAR); | ||||
| @@ -9,7 +9,7 @@ public interface WxDateAmountRecordMapper extends CommonMapper<WxDateAmountRecor | |||||
| List<WxDateAmountRecord> findList(WxDateAmountRecord wxDateAmountRecord); | List<WxDateAmountRecord> findList(WxDateAmountRecord wxDateAmountRecord); | ||||
| int updateAmount(WxDateAmountRecord wxDateAmountRecord); | |||||
| @@ -38,8 +38,16 @@ public interface WxDateAmountRecordService { | |||||
| */ | */ | ||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| /** | |||||
| * 修改交易核销 | |||||
| * @param tenantId 租户id | |||||
| * @param merchantId 商户id | |||||
| * @param type 类型 0 交易记录 1.核销记录 | |||||
| * @param payPrice 金额 | |||||
| * @return | |||||
| */ | |||||
| int updateAmount(String tenantId,Long merchantId | |||||
| ,Integer type,Integer payPrice); | |||||
| @@ -43,12 +43,24 @@ public class WxDateAmountRecordServiceImpl implements WxDateAmountRecordService | |||||
| public void deleteById(Long id) { | public void deleteById(Long id) { | ||||
| wxDateAmountRecordMapper.deleteByPrimaryKey(id); | wxDateAmountRecordMapper.deleteByPrimaryKey(id); | ||||
| } | } | ||||
| @Override | |||||
| public int updateAmount(String tenantId, Long merchantId, Integer type, Integer payPrice) { | |||||
| Date now = new Date(); | |||||
| Calendar cal1 = Calendar.getInstance(); | |||||
| cal1.setTime(now); // 将时分秒,毫秒域清零 | |||||
| cal1.set(Calendar.HOUR_OF_DAY, 0); | |||||
| cal1.set(Calendar.MINUTE, 0); | |||||
| cal1.set(Calendar.SECOND, 0); | |||||
| cal1.set(Calendar.MILLISECOND, 0); | |||||
| now = cal1.getTime(); | |||||
| WxDateAmountRecord r = new WxDateAmountRecord(); | |||||
| r.setDate(now); | |||||
| r.setTenantId(tenantId); | |||||
| r.setMerchantId(merchantId); | |||||
| r.setType(type); | |||||
| r.setPayPrice(payPrice); | |||||
| return wxDateAmountRecordMapper.updateAmount(r); | |||||
| } | |||||
| } | } | ||||
| @@ -90,7 +90,12 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <update id="updateAmount" parameterType="com.simple.domain.po.WxDateAmountRecord"> | |||||
| update wx_date_amount_record set pay_price=pay_price+#{payPrice} | |||||
| where tenant_id=#{tenantId} and merchant_id=#{merchantId} | |||||
| and type=#{type} and date = #{date} | |||||
| </update> | |||||