Merge branch 'master' of https://e.coding.net/g-cphe0354/shouyinjixitong/cashier-client
This commit is contained in:
@@ -11,6 +11,7 @@ import com.chaozhanggui.system.cashierservice.util.JSONUtil;
|
|||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -59,6 +60,7 @@ public class TbPrintPCMachineService {
|
|||||||
*/
|
*/
|
||||||
public Result queryByPage(TbPrintPCMachine tbPrintMachine) {
|
public Result queryByPage(TbPrintPCMachine tbPrintMachine) {
|
||||||
PageHelper.startPage(tbPrintMachine.getPage(), tbPrintMachine.getPageSize());
|
PageHelper.startPage(tbPrintMachine.getPage(), tbPrintMachine.getPageSize());
|
||||||
|
tbPrintMachine.setContentType("local");
|
||||||
List<TbPrintPCMachine> tbPrintMachines = this.tbPrintMachineMapper.queryAll(tbPrintMachine);
|
List<TbPrintPCMachine> tbPrintMachines = this.tbPrintMachineMapper.queryAll(tbPrintMachine);
|
||||||
PageInfo pageInfo=new PageInfo(tbPrintMachines);
|
PageInfo pageInfo=new PageInfo(tbPrintMachines);
|
||||||
return Result.success(CodeEnum.SUCCESS,pageInfo);
|
return Result.success(CodeEnum.SUCCESS,pageInfo);
|
||||||
@@ -73,7 +75,11 @@ public class TbPrintPCMachineService {
|
|||||||
public Result insert(PrintMachineDto resources) {
|
public Result insert(PrintMachineDto resources) {
|
||||||
TbPrintPCMachine tbPrintMachine = new TbPrintPCMachine();
|
TbPrintPCMachine tbPrintMachine = new TbPrintPCMachine();
|
||||||
tbPrintMachine.setCreatedAt(Instant.now().toEpochMilli());
|
tbPrintMachine.setCreatedAt(Instant.now().toEpochMilli());
|
||||||
|
tbPrintMachine.setContentType("local");
|
||||||
if (resources.getConfig() != null){
|
if (resources.getConfig() != null){
|
||||||
|
if(CollectionUtils.isEmpty(resources.getConfig().getCategoryList())){
|
||||||
|
resources.getConfig().setCategoryList(null);
|
||||||
|
}
|
||||||
tbPrintMachine.setConfig(JSONUtil.toJSONString(resources.getConfig(),true));
|
tbPrintMachine.setConfig(JSONUtil.toJSONString(resources.getConfig(),true));
|
||||||
}
|
}
|
||||||
BeanUtils.copyProperties(resources,tbPrintMachine);
|
BeanUtils.copyProperties(resources,tbPrintMachine);
|
||||||
|
|||||||
Reference in New Issue
Block a user