ky 5 years ago
parent f3e07ac5be
commit 4880e8c2ea

@ -63,13 +63,28 @@ public class PcCustomV2Controller {
@PostMapping("/updateCustom")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "custom", value = "公司实体custom", required = true, dataType = "Custom")
// })
@ApiOperation(value = "公司编辑", notes = "公司编辑")
@ResponseBody
public Result updateCustom(@ModelAttribute @Valid Custom custom) {
customService.updateCustom(custom);
public Result updateCustom(@ModelAttribute @Valid Custom custom,@ApiParam(name = "customSupports", value = "股东列表", required = true) @RequestBody List<CustomSupport> customSupports) {
customService.updateCustom(custom,customSupports);
return ResultBuilder.success().build();
}
@PostMapping("/revertLogoutCustom")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "注销公司还原", notes = "注销公司还原")
public Result revertLogoutCustom(String customId) {
customService.revertLogoutCustom(customId);
return ResultBuilder.success().build();
}
@PostMapping("/deleteDeleteCustom")
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header")
@ApiOperation(value = "清理已删除用户", notes = "清理已删除用户")
public Result deleteDeleteCustom(String customId) {
customService.deleteDeleteCustom(customId);
return ResultBuilder.success().build();
}
}

@ -446,8 +446,39 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
customMapper.updateById(custom);
}
public void updateCustom(Custom custom){
public void updateCustom(Custom custom,List<CustomSupport> customSupports){
custom.setModifyDate(new Date());
customMapper.updateById(custom);
customSupportMapper.delete(new EntityWrapper<CustomSupport>().eq("custom_id", custom.getId()));
if(customSupports.size()>0){
for(CustomSupport customSupport:customSupports){
String supportId = UUID.randomUUID().toString();
customSupport.setId(supportId);
customSupport.setCreateDate( new Date());
customSupport.setModifyDate( new Date());
customSupport.setCustomId(custom.getId());
customSupportMapper.insert(customSupport);
}
}
}
/**
*
* @param customId
*/
public void revertLogoutCustom(String customId){
Custom custom = new Custom();
custom.setId(customId);
custom.setModifyDate( new Date());
custom.setStatusCode("enable");
customMapper.updateById(custom);
}
/**
*
* @param customId
*/
public void deleteDeleteCustom(String customId){
customMapper.deleteById(customId);
}
}

@ -201,23 +201,25 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
Integer count = null;
List<Invoice> invoiceList = new ArrayList<>();
Wrapper<Invoice> invoiceWrapper = new EntityWrapper<Invoice>().eq("status_code", "enable");
if (null == copycatId) {
Wrapper<Custom> wrapper = new EntityWrapper<Custom>();
if(null!=keyword){
wrapper.like("company_name",keyword);
}
if(null!=beginTime){
wrapper.ge("create_date",new Date(beginTime));
invoiceWrapper.ge("create_date",new Date(beginTime));
}
if(null!=endTime){
wrapper.le("create_date",new Date(endTime));
invoiceWrapper.le("create_date",new Date(endTime));
}
List<Custom> customList = customMapper.selectList(wrapper);
if (customList.size() != 0) {
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
count = invoiceMapper.selectCount(invoiceWrapper.in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())));
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), invoiceWrapper.in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())).orderBy("create_date", false));
}
@ -228,26 +230,27 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, Invoice> impl
wrapper.like("company_name",keyword);
}
if(null!=beginTime){
wrapper.ge("create_date",new Date(beginTime));
invoiceWrapper.ge("create_date",new Date(beginTime));
}
if(null!=endTime){
wrapper.le("create_date",new Date(endTime));
invoiceWrapper.le("create_date",new Date(endTime));
}
List<Custom> customList = customMapper.selectList(wrapper);
if (customList.size() != 0) {
count = invoiceMapper.selectCount(new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
count = invoiceMapper.selectCount(invoiceWrapper.in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())));
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), new EntityWrapper<Invoice>().eq("status_code", "enable").in("custom_id", customList.stream().map(item ->
invoiceList = invoiceMapper.selectPage(new RowBounds((pageNum - 1) * pageSize, pageSize), invoiceWrapper.in("custom_id", customList.stream().map(item ->
item.getId()
).collect(Collectors.toList())).orderBy("create_date", false));
}
}
for (Invoice invoice : invoiceList) {
String invoiceHeaderId = invoice.getInvoiceHeaderId();
InvoiceHeader invoiceHeader = invoiceHeaderMapper.selectById(invoiceHeaderId);
String customId = invoice.getCustomId();
Custom custom = customMapper.selectById(customId);
InvoiceHeader invoiceHeader = invoiceHeaderMapper.selectById(invoiceHeaderId);
invoice.setCustomName(custom.getCompanyName());
invoice.setInvoiceHeaderName(invoiceHeader.getCompanyName());
if (null != custom.getCopycatId()) {

@ -32,6 +32,7 @@ mybatis-plus:
call-setters-on-nulls: true
jdbc-type-for-null: VARCHAR
cache-enabled: false
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
wx:
miniapp:

Loading…
Cancel
Save