ky 6 years ago
parent c4f7a5db86
commit aea75f3476

@ -7,10 +7,7 @@ import com.gszc.entity.Custom;
import com.gszc.entity.CustomSupport; import com.gszc.entity.CustomSupport;
import com.gszc.service.CountService; import com.gszc.service.CountService;
import com.gszc.service.impl.CustomServiceImpl; import com.gszc.service.impl.CustomServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.*;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -30,7 +27,7 @@ public class MiniCustomController {
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header") @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "公司注册", notes = "公司注册") @ApiOperation(value = "公司注册", notes = "公司注册")
@ResponseBody @ResponseBody
public Result customRegister(@ModelAttribute @Valid Custom custom, List<CustomSupport> customSupports) { public Result customRegister(@ModelAttribute @Valid Custom custom,@ApiParam(name = "customSupports", value = "股东列表", required = true) @RequestBody List<CustomSupport> customSupports) {
customService.customRegister(custom,customSupports); customService.customRegister(custom,customSupports);
return ResultBuilder.success().build(); return ResultBuilder.success().build();
} }

@ -1,7 +1,5 @@
package com.gszc.service; package com.gszc.service;
import com.alibaba.fastjson.JSONObject;
import org.mockito.Mock;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;

@ -11,6 +11,7 @@ import com.gszc.mapper.MiniUserMapper;
import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap; import java.util.HashMap;
@ -19,6 +20,7 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
@Service @Service
@Transactional
public class MiniAppService { public class MiniAppService {
final WxMaService wxService = WxMaConfiguration.getMaService("wxb3f8c04dd0f5922f"); final WxMaService wxService = WxMaConfiguration.getMaService("wxb3f8c04dd0f5922f");

@ -10,6 +10,7 @@ import com.gszc.mapper.CustomSupportMapper;
import com.gszc.service.ICustomService; import com.gszc.service.ICustomService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -24,6 +25,7 @@ import java.util.UUID;
* @since 2020-04-27 * @since 2020-04-27
*/ */
@Service @Service
@Transactional
public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> implements ICustomService { public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> implements ICustomService {
@Autowired @Autowired
@ -38,13 +40,15 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
custom.setCreateDate(LocalDateTime.now()); custom.setCreateDate(LocalDateTime.now());
custom.setModifyDate(LocalDateTime.now()); custom.setModifyDate(LocalDateTime.now());
customMapper.insert(custom); customMapper.insert(custom);
for(CustomSupport customSupport:customSupports){ if(customSupports.size()>0){
String id = UUID.randomUUID().toString(); for(CustomSupport customSupport:customSupports){
customSupport.setId(id); String id = UUID.randomUUID().toString();
customSupport.setCreateDate(LocalDateTime.now()); customSupport.setId(id);
customSupport.setModifyDate(LocalDateTime.now()); customSupport.setCreateDate(LocalDateTime.now());
customSupport.setCustomId(uuid); customSupport.setModifyDate(LocalDateTime.now());
customSupportMapper.insert(customSupport); customSupport.setCustomId(uuid);
customSupportMapper.insert(customSupport);
}
} }
} }

@ -11,6 +11,7 @@ import com.gszc.mapper.InvoiceMapper;
import com.gszc.service.IInvoiceService; import com.gszc.service.IInvoiceService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
@ -26,6 +27,7 @@ import java.util.UUID;
* @since 2020-04-27 * @since 2020-04-27
*/ */
@Service @Service
@Transactional
public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> implements IInvoiceService { public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> implements IInvoiceService {
@Autowired @Autowired

Loading…
Cancel
Save