|
|
@@ -31,6 +31,9 @@ import com.startup.minpay.frame.session.MINSession;
|
|
|
import com.startup.minpay.frame.target.MINAction;
|
|
|
import com.startup.minpay.frame.target.MINComponent;
|
|
|
import com.startup.minpay.frame.target.MINParam;
|
|
|
+import org.apache.commons.fileupload.FileItem;
|
|
|
+import org.apache.commons.fileupload.FileItemFactory;
|
|
|
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
|
|
|
|
|
import java.io.*;
|
|
|
import java.util.HashMap;
|
|
|
@@ -290,8 +293,19 @@ public class MachineManageAction implements IMINAction {
|
|
|
outputStream.close();
|
|
|
// 上传图片到服务器
|
|
|
InputStream inputSteam = new FileInputStream(file);
|
|
|
- String url = UpLoadFile.uploadImg(inputSteam,"jpg",channel,"00");
|
|
|
|
|
|
+ String ambient = Service.lookup(IPublicService.class)
|
|
|
+ .getSysParValue("AMBIENT");//当前环境
|
|
|
+ FileItem fileItem = createFileItem(file ,"itemFileName");
|
|
|
+ Map<String, Object> map = null;
|
|
|
+ if("00".equals(ambient)){//测试
|
|
|
+ map =Service.lookup(IPublicService.class).uploadFile(fileItem, "00", 0, true,"V01");
|
|
|
+ }
|
|
|
+ if("01".equals(ambient)){//生产
|
|
|
+ map =Service.lookup(IPublicService.class).uploadFileBD(fileItem, "00", 0, true,"V01");
|
|
|
+ }
|
|
|
+ //String url = UpLoadFile.uploadImg(inputSteam,"jpg",channel,"00");
|
|
|
+ String url = String.valueOf(map.get("url"));
|
|
|
inputSteam.close();
|
|
|
// 删除本地图片
|
|
|
file.delete();
|
|
|
@@ -324,9 +338,19 @@ public class MachineManageAction implements IMINAction {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
outputStreams.close();
|
|
|
- // 上传图片到服务器
|
|
|
InputStream inputSteams = new FileInputStream(file);
|
|
|
- url = UpLoadFile.uploadImg(inputSteams,"jpg",channel,"00");
|
|
|
+ FileItem fileItemb = createFileItem(file ,"itemFileName");
|
|
|
+ Map<String, Object> mapb = null;
|
|
|
+ if("00".equals(ambient)){//测试
|
|
|
+ mapb =Service.lookup(IPublicService.class).uploadFile(fileItemb, "00", 0, true,"V01");
|
|
|
+ }
|
|
|
+ if("01".equals(ambient)){//生产
|
|
|
+ mapb =Service.lookup(IPublicService.class).uploadFileBD(fileItemb, "00", 0, true,"V01");
|
|
|
+ }
|
|
|
+ //String url = UpLoadFile.uploadImg(inputSteam,"jpg",channel,"00");
|
|
|
+ url = String.valueOf(mapb.get("url"));
|
|
|
+
|
|
|
+ //url = UpLoadFile.uploadImg(inputSteams,"jpg",channel,"00");
|
|
|
|
|
|
inputSteams.close();
|
|
|
// 删除本地图片
|
|
|
@@ -1335,7 +1359,7 @@ public class MachineManageAction implements IMINAction {
|
|
|
* @param flash 是否刷新
|
|
|
*/
|
|
|
@MINAction(value = CREATE_QRCODE, transaction = IMINTransactionEnum.CMT)
|
|
|
- public static MINActionResult createQrCode(
|
|
|
+ public MINActionResult createQrCode(
|
|
|
@MINParam(key = "flash") String flash,
|
|
|
@MINParam(key = "equId") String equId,
|
|
|
@MINParam(key = "equType") String equType,
|
|
|
@@ -1383,7 +1407,20 @@ public class MachineManageAction implements IMINAction {
|
|
|
outputStream.close();
|
|
|
// 上传图片到服务器
|
|
|
InputStream inputSteam = new FileInputStream(file);
|
|
|
- String url = UpLoadFile.uploadImg(inputSteam,"jpg",channel,"00");
|
|
|
+ //String url = UpLoadFile.uploadImg(inputSteam,"jpg",channel,"00");
|
|
|
+ String ambient = Service.lookup(IPublicService.class)
|
|
|
+ .getSysParValue("AMBIENT");//当前环境
|
|
|
+ InputStream inputSteams = new FileInputStream(file);
|
|
|
+ FileItem fileItemb = createFileItem(file ,"itemFileName");
|
|
|
+ Map<String, Object> map = null;
|
|
|
+ if("00".equals(ambient)){//测试
|
|
|
+ map =Service.lookup(IPublicService.class).uploadFile(fileItemb, "00", 0, true,"V01");
|
|
|
+ }
|
|
|
+ if("01".equals(ambient)){//生产
|
|
|
+ map =Service.lookup(IPublicService.class).uploadFileBD(fileItemb, "00", 0, true,"V01");
|
|
|
+ }
|
|
|
+ //String url = UpLoadFile.uploadImg(inputSteam,"jpg",channel,"00");
|
|
|
+ String url = String.valueOf(map.get("url"));
|
|
|
|
|
|
inputSteam.close();
|
|
|
// 删除本地图片
|
|
|
@@ -1647,12 +1684,12 @@ public class MachineManageAction implements IMINAction {
|
|
|
*/
|
|
|
@MINAction(value = TENCENTMANAGE_QUERY)
|
|
|
public MINActionResult businessNumManageQuery(MINSession session,
|
|
|
- @MINParam(key = "branchId") String branchId,
|
|
|
- @MINParam(key = "accountName") String accountName,
|
|
|
- @MINParam(key = "accountId") String accountId,
|
|
|
- @MINParam(key = "type") String type,
|
|
|
- @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
- @MINParam(key = "limit", defaultValue = "10") int limit) throws MINBusinessException {
|
|
|
+ @MINParam(key = "branchId") String branchId,
|
|
|
+ @MINParam(key = "accountName") String accountName,
|
|
|
+ @MINParam(key = "accountId") String accountId,
|
|
|
+ @MINParam(key = "type") String type,
|
|
|
+ @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
+ @MINParam(key = "limit", defaultValue = "10") int limit) throws MINBusinessException {
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
// 查询当前角色编号
|
|
|
User u = session.getUser();
|
|
|
@@ -1664,15 +1701,17 @@ public class MachineManageAction implements IMINAction {
|
|
|
if(!StringUtils.isNullOrEmpty(accountName)){
|
|
|
createCriteria.andNameLike("%"+accountName+"%");
|
|
|
}
|
|
|
- if(!StringUtils.isNullOrEmpty(accountId)){
|
|
|
- createCriteria.andUsridEqualTo(accountId);
|
|
|
- }
|
|
|
if(!StringUtils.isNullOrEmpty(type)){
|
|
|
createCriteria.andTypeEqualTo(type);
|
|
|
}
|
|
|
- if(!branchId.equals(Constant.DEFAULT_INSTITUTIONS)){
|
|
|
- createCriteria.andUsridEqualTo(branchId);
|
|
|
+ if(Constant.ADMINISTRATION_SYSTEM_NUMBER.equals(u.getBranchId())){
|
|
|
+ if(!StringUtils.isNullOrEmpty(accountId)){
|
|
|
+ createCriteria.andUsridEqualTo(accountId);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ createCriteria.andUsridEqualTo(u.getBranchId());
|
|
|
}
|
|
|
+ createCriteria.andStateEqualTo("00");
|
|
|
List<VmHlAccount> businessNumList = Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmHlAccountMapper.class).selectByExample(vmHlAccountExample,rows);
|
|
|
|
|
|
@@ -1697,11 +1736,11 @@ public class MachineManageAction implements IMINAction {
|
|
|
*/
|
|
|
@MINAction(value = QUERY_BRANCH)
|
|
|
public MINActionResult queryBranch(MINSession session,
|
|
|
- @MINParam(key = "accountName") String accountName,
|
|
|
- @MINParam(key = "accountId") String accountId,
|
|
|
- @MINParam(key = "type") String type,
|
|
|
- @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
- @MINParam(key = "limit", defaultValue = "10") int limit) throws MINBusinessException {
|
|
|
+ @MINParam(key = "accountName") String accountName,
|
|
|
+ @MINParam(key = "accountId") String accountId,
|
|
|
+ @MINParam(key = "type") String type,
|
|
|
+ @MINParam(key = "page", defaultValue = "1") int page,
|
|
|
+ @MINParam(key = "limit", defaultValue = "10") int limit) throws MINBusinessException {
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
// 查询当前角色编号
|
|
|
User u = session.getUser();
|
|
|
@@ -1758,4 +1797,25 @@ public class MachineManageAction implements IMINAction {
|
|
|
Service.lookup(ILogService.class).logging(session, logInfo);*/
|
|
|
return res;
|
|
|
}
|
|
|
+ /*
|
|
|
+ 创建FileItem
|
|
|
+ */
|
|
|
+ private FileItem createFileItem(File file, String fieldName) {
|
|
|
+ FileItemFactory factory = new DiskFileItemFactory(16, null);
|
|
|
+ FileItem item = factory.createItem(fieldName, "text/plain", true, file.getName());
|
|
|
+ int bytesRead = 0;
|
|
|
+ byte[] buffer = new byte[8192];
|
|
|
+ try {
|
|
|
+ FileInputStream fis = new FileInputStream(file);
|
|
|
+ OutputStream os = item.getOutputStream();
|
|
|
+ while ((bytesRead = fis.read(buffer, 0, 8192)) != -1) {
|
|
|
+ os.write(buffer, 0, bytesRead);
|
|
|
+ }
|
|
|
+ os.close();
|
|
|
+ fis.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ }
|
|
|
}
|