新增页面

This commit is contained in:
2025-08-29 10:16:48 +08:00
parent 05b89aba22
commit 17f6c8bdaa
10 changed files with 989 additions and 4 deletions
@@ -0,0 +1,28 @@
package lingtao.net.bean;
import lombok.Data;
import java.util.Date;
@Data
public class TipContent {
private Integer id;
private int type;
private String content;
private String createBy;
private Date createDate;
private String updateBy;
private Date updateDate;
private String title;
/**
* 附件
*/
private String attachment;
}
@@ -0,0 +1,64 @@
package lingtao.net.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lingtao.net.bean.Msg;
import lingtao.net.bean.StandardMemo;
import lingtao.net.bean.TipContent;
import lingtao.net.service.StandardMemoService;
import lingtao.net.service.TipContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpSession;
import java.util.List;
@RestController
public class TipContentController {
@Autowired
private TipContentService tipContentService;
/**
* 产品知识列表
*
* @return
*/
@RequestMapping("/getTipContent")
public Msg getStandard(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "10") Integer limit, TipContent tipContent) {
PageHelper.startPage(page, limit);
List<TipContent> tipContentList = tipContentService.getTipContents(tipContent);
PageInfo<TipContent> pageInfo = new PageInfo<>(tipContentList);
return Msg.success().add("list", pageInfo);
}
/**
* 添加产品知识
*/
@RequestMapping("/addTipContent")
public Msg addStandard(TipContent tipContent, HttpSession session) {
tipContentService.addTipContent(tipContent, session);
return Msg.success();
}
/**
* 修改产品知识
*/
@RequestMapping("/updateTipContent")
public Msg updateStandard(TipContent tipContent, HttpSession session) {
tipContentService.updateTipContentById(tipContent, session);
return Msg.success();
}
/**
* 删除
*/
@RequestMapping("/deleteTipContent")
public Msg deleteStandard(@RequestParam("id") Integer id) {
tipContentService.deleteTipContentById(id);
return Msg.success();
}
}
@@ -0,0 +1,18 @@
package lingtao.net.dao;
import lingtao.net.bean.StandardMemo;
import lingtao.net.bean.TipContent;
import java.util.List;
public interface TipContentMapper {
List<TipContent> getTipContents(TipContent standardMemo);
void addTipContent(TipContent standardMemo);
void updateTipContentById(TipContent standardMemo);
void deleteTipContentById(Integer id);
}
@@ -688,16 +688,16 @@ public class ProductService {
for (Product product : priceList) {
double carft_price = 0;
if (craftList.contains("压痕")) {
carft_price += Math.max(0.02 * product.getCount(), 10);
carft_price += Math.max(0.02 * product.getCount(), 10) * number;
}
if (craftList.contains("压点线")) {
carft_price += Math.max(0.02 * product.getCount(), 10);
carft_price += Math.max(0.02 * product.getCount(), 10) * number;
}
if (craftList.contains("圆角")) {
carft_price += Math.max(0.02 * product.getCount(), 10);
carft_price += Math.max(0.02 * product.getCount(), 10) * number;
}
//腰封的模切费单独计算
product.setPrice(Math.ceil((product.getPrice() + carft_price) * number));
product.setPrice(Math.ceil((product.getPrice() + carft_price)));
product.setWeight(df.format(number * length / 100 * width / 100 * product.getCount() * 0.3 * 0.86));
}
if (isMq) {
@@ -0,0 +1,58 @@
package lingtao.net.service;
import lingtao.net.bean.Msg;
import lingtao.net.bean.StandardMemo;
import lingtao.net.bean.SysUser;
import lingtao.net.bean.TipContent;
import lingtao.net.dao.StandardMemoMapper;
import lingtao.net.dao.TipContentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpSession;
import java.util.List;
@Service
public class TipContentService {
@Autowired
private TipContentMapper tipContentMapper;
public List<TipContent> getTipContents(TipContent tipContent) {
return tipContentMapper.getTipContents(tipContent);
}
public Msg addTipContent(TipContent tipContent, HttpSession session) {
SysUser user = (SysUser) session.getAttribute("USER_SESSION");
tipContent.setCreateBy(user.getRealname());
try {
tipContentMapper.addTipContent(tipContent);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
public Msg updateTipContentById(TipContent tipContent, HttpSession session) {
SysUser user = (SysUser) session.getAttribute("USER_SESSION");
tipContent.setUpdateBy(user.getRealname());
try {
tipContentMapper.updateTipContentById(tipContent);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
public Msg deleteTipContentById(Integer id) {
try {
tipContentMapper.deleteTipContentById(id);
return Msg.success();
} catch (Exception e) {
return Msg.fail();
}
}
}