winter 1 год назад
Родитель
Сommit
a8bda1fa60
3 измененных файлов: 23 добавлений и 18 удалений
  1. +8
    -8
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxFinanceController.java
  2. +5
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxFinancePrintTemplate.java
  3. +10
    -10
      mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java

+ 8
- 8
mallinkAdmin/src/main/java/com/iformall/controller/market/WxFinanceController.java Просмотреть файл

@@ -312,14 +312,6 @@ public class WxFinanceController extends BaseController {
return new ResultData(page); return new ResultData(page);
} }
@ApiOperation("过账")
@PostMapping("receiveFinish")
public ResultData receiveFinish(@RequestBody WxFinanceReceive record) {
record.updateTenantInfo(getTenantInfo());
wxFinanceService.finishReceive(record, getUser());
return new ResultData();
}
@ApiOperation("打印项项目需要获取的租户号") @ApiOperation("打印项项目需要获取的租户号")
@GetMapping("templateCurrentTenant") @GetMapping("templateCurrentTenant")
@TenantIgnore @TenantIgnore
@@ -352,4 +344,12 @@ public class WxFinanceController extends BaseController {
return new ResultData(page); return new ResultData(page);
} }
@ApiOperation("过账")
@PostMapping("receiveFinish")
public ResultData receiveFinish(@RequestBody WxFinanceReceive record) {
record.updateTenantInfo(getTenantInfo());
wxFinanceService.finishReceive(record, getUser());
return new ResultData();
}
} }

+ 5
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxFinancePrintTemplate.java Просмотреть файл

@@ -1,6 +1,7 @@
package com.iformall.domain.po; package com.iformall.domain.po;


import java.util.Date; import java.util.Date;
import java.util.List;


import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@@ -27,6 +28,8 @@ public class WxFinancePrintTemplate extends TenantEntity {


@io.swagger.annotations.ApiModelProperty(value="name",name="name") @io.swagger.annotations.ApiModelProperty(value="name",name="name")
private String name; private String name;
@TableField(exist = false)
private String title;
@io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime")
private Date createTime; private Date createTime;
@@ -50,5 +53,7 @@ public class WxFinancePrintTemplate extends TenantEntity {
} }
return null; return null;
} }
@TableField(exist = false)
private List tempItems;
} }

+ 10
- 10
mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java Просмотреть файл

@@ -58,15 +58,13 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService {


@Override @Override
public void saveOrUpdate(WxFinancePrintTemplate record) { public void saveOrUpdate(WxFinancePrintTemplate record) {
boolean isGenarated = false;
Map map = new HashMap();
if (StringUtils.isBlank(record.getContent())) { if (StringUtils.isBlank(record.getContent())) {
Map map = new HashMap();
map.put("width", 770); map.put("width", 770);
map.put("height", 500); map.put("height", 500);
map.put("pageWidth", 215); map.put("pageWidth", 215);
map.put("pageHeight", 140); map.put("pageHeight", 140);
record.setContent(JSON.toJSONString(map)); record.setContent(JSON.toJSONString(map));
isGenarated = true;
} }
Date date = new Date(); Date date = new Date();
if (record.getId() == null) { if (record.getId() == null) {
@@ -74,10 +72,12 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService {
record.setId(idWorker.nextId()); record.setId(idWorker.nextId());
record.setCreateTime(date); record.setCreateTime(date);
record.setUpdateTime(date); record.setUpdateTime(date);
record.setName(record.getTitle());
JSONObject o = record.getContentJson(); JSONObject o = record.getContentJson();
o.put("id", String.valueOf(record.getId())); o.put("id", String.valueOf(record.getId()));
o.put("title", record.getName()); o.put("title", record.getName());
o.put("type", record.getType()); o.put("type", record.getType());
o.put("tempItems", record.getTempItems());
record.setContent(JSON.toJSONString(o)); record.setContent(JSON.toJSONString(o));
try { try {
wxFinancePrintTemplateMapper.insert(record); wxFinancePrintTemplateMapper.insert(record);
@@ -86,13 +86,13 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService {
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
} }
} else { } else {
if (null != record.getContentJson()) {
JSONObject o = record.getContentJson();
o.put("id", String.valueOf(record.getId()));
o.put("title", record.getName());
o.put("type", record.getType());
record.setContent(JSON.toJSONString(o));
}
JSONObject o = record.getContentJson();
o.put("id", String.valueOf(record.getId()));
o.put("title", record.getName());
o.put("type", record.getType());
o.put("tempItems", record.getTempItems());
record.setContent(JSON.toJSONString(o));
record.setName(record.getTitle());
record.setUpdateTime(date); record.setUpdateTime(date);
wxFinancePrintTemplateMapper.updateById(record); wxFinancePrintTemplateMapper.updateById(record);
} }


Загрузка…
Отмена
Сохранить