Commit 693a7558 authored by cjl's avatar cjl
Browse files

从jsh远程仓库更新

(cherry picked from commit 36139e26)
parent 1e1e5f6e
......@@ -343,8 +343,7 @@
//报表打印
function print() {
$("#printBtn").off("click").on("click", function () {
var path = "<%=path %>";
CreateFormPage('打印报表', $('#tableData'), path);
CreateFormPage('打印报表', $('#tableData'));
});
}
</script>
......
......@@ -42,7 +42,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.7</java.version>
<java.version>1.8</java.version>
</properties>
<dependencies>
......@@ -96,6 +96,11 @@
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.3</version>
</dependency>
</dependencies>
<repositories>
......@@ -174,9 +179,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
......
nohup ./jshERPStart.sh &
\ No newline at end of file
......@@ -5,13 +5,18 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.datasource.entities.App;
import com.jsh.erp.service.app.AppService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.util.List;
import java.util.Properties;
/**
* @author ji_sheng_hua 752*718*920
......@@ -26,14 +31,7 @@ public class AppController {
@Resource
private UserBusinessService userBusinessService;
/**
* create by: cjl
* description:
* 桌面菜单按钮初始化
* create time: 2019/1/11 17:01
* @Param: request
* @return com.alibaba.fastjson.JSONObject
*/
@GetMapping(value = "/findDesk")
public JSONObject findDesk(HttpServletRequest request) {
JSONObject obj = new JSONObject();
......@@ -123,4 +121,38 @@ public class AppController {
}
return arr;
}
/**
* 上传图片
* @param fileInfo
* @param request
*/
@PostMapping(value = "/uploadImg")
public BaseResponseInfo uploadImg(MultipartFile fileInfo, @RequestParam("fileInfoName") String fileName,
HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
try {
if (fileInfo != null) {
String basePath = request.getSession().getServletContext().getRealPath("/"); //默认windows文件路径,linux环境下生成的目录与项目同级,而不是下级
String path = basePath + "upload/images/deskIcon/"; //windows环境下的路径
Properties pro = System.getProperties();
String osName = pro.getProperty("os.name");//获得当前操作系统的名称
if("Linux".equals(osName) || "linux".equals(osName) || "LINUX".equals(osName)){
path = basePath + "/upload/images/deskIcon/"; //linux环境下的路径
}
FileUtils.SaveFileFromInputStream(fileInfo.getInputStream(), path, fileName);
res.code = 200;
res.data = "上传图片成功";
}
} catch (FileNotFoundException e) {
e.printStackTrace();
res.code = 500;
res.data = "获取图片失败";
} catch (IOException e) {
e.printStackTrace();
res.code = 500;
res.data = "上传图片失败";
}
return res;
}
}
......@@ -84,14 +84,18 @@ public class DepotHeadService {
}
depotHead.setCreatetime(new Timestamp(System.currentTimeMillis()));
depotHead.setStatus(false);
return depotHeadMapper.insertSelective(depotHead);
return depotHeadMapper.insert(depotHead);
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateDepotHead(String beanJson, Long id) {
DepotHead dh = depotHeadMapper.selectByPrimaryKey(id);
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
depotHead.setId(id);
return depotHeadMapper.updateByPrimaryKeySelective(depotHead);
depotHead.setStatus(dh.getStatus());
depotHead.setCreatetime(dh.getCreatetime());
depotHead.setOperpersonname(dh.getOperpersonname());
return depotHeadMapper.updateByPrimaryKey(depotHead);
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment